diff --git a/e2e/davinci-app/components/boolean.ts b/e2e/davinci-app/components/boolean.ts index 8630a7128d..1560dd062e 100644 --- a/e2e/davinci-app/components/boolean.ts +++ b/e2e/davinci-app/components/boolean.ts @@ -4,13 +4,14 @@ * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ +import { dotToCamelCase, richContentInterpolation } from '../helper.js'; + import type { BooleanCollector, - ValidatedBooleanCollector, Updater, + ValidatedBooleanCollector, Validator, } from '@forgerock/davinci-client/types'; -import { dotToCamelCase, richContentInterpolation } from '../helper.js'; /** * Creates a single checkbox and attaches it to the form diff --git a/e2e/davinci-app/components/fido.ts b/e2e/davinci-app/components/fido.ts index 6c68e1bafc..9ced9c14e3 100644 --- a/e2e/davinci-app/components/fido.ts +++ b/e2e/davinci-app/components/fido.ts @@ -1,15 +1,16 @@ /* - * 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 '@forgerock/davinci-client'; + import type { - FidoRegistrationCollector, FidoAuthenticationCollector, - Updater, FidoClient, + FidoRegistrationCollector, + Updater, } from '@forgerock/davinci-client/types'; export default function fidoComponent( diff --git a/e2e/davinci-app/components/password.ts b/e2e/davinci-app/components/password.ts index 869e4d6b1b..18b9ffc696 100644 --- a/e2e/davinci-app/components/password.ts +++ b/e2e/davinci-app/components/password.ts @@ -1,16 +1,17 @@ /* - * 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 { dotToCamelCase } from '../helper.js'; + import type { PasswordCollector, - ValidatedPasswordCollector, Updater, + ValidatedPasswordCollector, Validator, } from '@forgerock/davinci-client/types'; -import { dotToCamelCase } from '../helper.js'; const UPPERCASE_RE = /^[A-Z]+$/; const LOWERCASE_RE = /^[a-z]+$/; diff --git a/e2e/davinci-app/components/polling.ts b/e2e/davinci-app/components/polling.ts index bb33f247af..25f60ce991 100644 --- a/e2e/davinci-app/components/polling.ts +++ b/e2e/davinci-app/components/polling.ts @@ -4,7 +4,7 @@ * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ -import type { PollingCollector, Poller, Updater } from '@forgerock/davinci-client/types'; +import type { Poller, PollingCollector, Updater } from '@forgerock/davinci-client/types'; export default function pollingComponent( formEl: HTMLFormElement, diff --git a/e2e/davinci-app/components/protect.ts b/e2e/davinci-app/components/protect.ts index ac2434b6f6..37f738ce9d 100644 --- a/e2e/davinci-app/components/protect.ts +++ b/e2e/davinci-app/components/protect.ts @@ -1,13 +1,13 @@ /* - * 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 type { TextCollector, - ValidatedTextCollector, Updater, + ValidatedTextCollector, } from '@forgerock/davinci-client/types'; export default function protectComponent( diff --git a/e2e/davinci-app/components/read-only.ts b/e2e/davinci-app/components/read-only.ts index c2eb1650f9..3b3414c522 100644 --- a/e2e/davinci-app/components/read-only.ts +++ b/e2e/davinci-app/components/read-only.ts @@ -4,9 +4,10 @@ * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ -import type { ReadOnlyCollector, RichTextCollector } from '@forgerock/davinci-client/types'; import { richContentInterpolation } from '../helper.js'; +import type { ReadOnlyCollector, RichTextCollector } from '@forgerock/davinci-client/types'; + export default function ( formEl: HTMLFormElement, collector: ReadOnlyCollector | RichTextCollector, diff --git a/e2e/davinci-app/components/social-login-button.ts b/e2e/davinci-app/components/social-login-button.ts index a4f314495e..d7d0d19f6e 100644 --- a/e2e/davinci-app/components/social-login-button.ts +++ b/e2e/davinci-app/components/social-login-button.ts @@ -1,10 +1,10 @@ /* - * 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 type { InternalErrorResponse, IdpCollector } from '@forgerock/davinci-client/types'; +import type { IdpCollector, InternalErrorResponse } from '@forgerock/davinci-client/types'; export default function submitButtonComponent( formEl: HTMLFormElement, diff --git a/e2e/davinci-app/components/text.ts b/e2e/davinci-app/components/text.ts index 19e80022cb..3f2dfe24c6 100644 --- a/e2e/davinci-app/components/text.ts +++ b/e2e/davinci-app/components/text.ts @@ -4,13 +4,14 @@ * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ +import { dotToCamelCase } from '../helper.js'; + import type { TextCollector, - ValidatedTextCollector, Updater, + ValidatedTextCollector, Validator, } from '@forgerock/davinci-client/types'; -import { dotToCamelCase } from '../helper.js'; export default function textComponent( formEl: HTMLFormElement, diff --git a/e2e/davinci-app/main.ts b/e2e/davinci-app/main.ts index f4fa57970e..4b381725ea 100644 --- a/e2e/davinci-app/main.ts +++ b/e2e/davinci-app/main.ts @@ -4,39 +4,39 @@ * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ -import './style.css'; - import { davinci } from '@forgerock/davinci-client'; import { oidc } from '@forgerock/oidc-client'; -import type { OidcConfig } from '@forgerock/oidc-client/types'; +import { protect } from '@forgerock/protect'; + +import './style.css'; +import booleanComponent from './components/boolean.js'; +import fidoComponent from './components/fido.js'; +import flowLinkComponent from './components/flow-link.js'; +import multiValueComponent from './components/multi-value.js'; +import objectValueComponent from './components/object-value.js'; +import passwordComponent from './components/password.js'; +import pollingComponent from './components/polling.js'; +import protectComponent from './components/protect.js'; +import qrCodeComponent from './components/qr-code.js'; +import readOnlyComponent from './components/read-only.js'; +import singleValueComponent from './components/single-value.js'; +import socialLoginButtonComponent from './components/social-login-button.js'; +import submitButtonComponent from './components/submit-button.js'; +import textComponent from './components/text.js'; +import { serverConfigs } from './server-configs.js'; + import type { Collectors, CustomLogger, - DaVinciConfig, DavinciClient, + DaVinciConfig, GetClient, InternalErrorResponse, NodeStates, ProtectCollector, RequestMiddleware, } from '@forgerock/davinci-client/types'; -import { protect } from '@forgerock/protect'; - -import textComponent from './components/text.js'; -import passwordComponent from './components/password.js'; -import submitButtonComponent from './components/submit-button.js'; -import protectComponent from './components/protect.js'; -import flowLinkComponent from './components/flow-link.js'; -import socialLoginButtonComponent from './components/social-login-button.js'; -import { serverConfigs } from './server-configs.js'; -import singleValueComponent from './components/single-value.js'; -import multiValueComponent from './components/multi-value.js'; -import readOnlyComponent from './components/read-only.js'; -import objectValueComponent from './components/object-value.js'; -import fidoComponent from './components/fido.js'; -import qrCodeComponent from './components/qr-code.js'; -import pollingComponent from './components/polling.js'; -import booleanComponent from './components/boolean.js'; +import type { OidcConfig } from '@forgerock/oidc-client/types'; const loggerFn = { error: () => { diff --git a/e2e/davinci-suites/playwright.config.ts b/e2e/davinci-suites/playwright.config.ts index 5527bee305..ee488b75cb 100644 --- a/e2e/davinci-suites/playwright.config.ts +++ b/e2e/davinci-suites/playwright.config.ts @@ -4,9 +4,10 @@ * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ -import { PlaywrightTestConfig } from '@playwright/test'; import { workspaceRoot } from '@nx/devkit'; +import type { PlaywrightTestConfig } from '@playwright/test'; + // For CI, you may want to set BASE_URL to the deployed application. const baseURL = process.env['BASE_URL'] || 'http://localhost:5829'; diff --git a/e2e/davinci-suites/src/basic.test.ts b/e2e/davinci-suites/src/basic.test.ts index 43002ae465..b2289380f0 100644 --- a/e2e/davinci-suites/src/basic.test.ts +++ b/e2e/davinci-suites/src/basic.test.ts @@ -1,10 +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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; import { password, username } from './utils/demo-user.js'; diff --git a/e2e/davinci-suites/src/fido.test.ts b/e2e/davinci-suites/src/fido.test.ts index e1a38cb486..f82dff3cb1 100644 --- a/e2e/davinci-suites/src/fido.test.ts +++ b/e2e/davinci-suites/src/fido.test.ts @@ -1,6 +1,15 @@ -import { test, expect, CDPSession } from '@playwright/test'; +/* + * 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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; +import type { CDPSession } from '@playwright/test'; + const username = 'JSFidoUser@user.com'; const password = 'FakePassword#123'; let cdp: CDPSession | undefined; diff --git a/e2e/davinci-suites/src/logging.test.ts b/e2e/davinci-suites/src/logging.test.ts index 1121aba0e7..5d0996592f 100644 --- a/e2e/davinci-suites/src/logging.test.ts +++ b/e2e/davinci-suites/src/logging.test.ts @@ -1,10 +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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; import { password, username } from './utils/demo-user.js'; diff --git a/e2e/davinci-suites/src/mfa.test.ts b/e2e/davinci-suites/src/mfa.test.ts index fb84521a3d..ac1b290152 100644 --- a/e2e/davinci-suites/src/mfa.test.ts +++ b/e2e/davinci-suites/src/mfa.test.ts @@ -1,10 +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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; import { password } from './utils/demo-user.js'; diff --git a/e2e/davinci-suites/src/middleware.test.ts b/e2e/davinci-suites/src/middleware.test.ts index eeb8709551..c23311c3df 100644 --- a/e2e/davinci-suites/src/middleware.test.ts +++ b/e2e/davinci-suites/src/middleware.test.ts @@ -1,10 +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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; import { password, username } from './utils/demo-user.js'; diff --git a/e2e/davinci-suites/src/password-policy.test.ts b/e2e/davinci-suites/src/password-policy.test.ts index 0204d6add9..57706b9608 100644 --- a/e2e/davinci-suites/src/password-policy.test.ts +++ b/e2e/davinci-suites/src/password-policy.test.ts @@ -5,6 +5,7 @@ * of the MIT license. See the LICENSE file for details. */ import { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; import { password } from './utils/demo-user.js'; diff --git a/e2e/davinci-suites/src/phone-number-field.test.ts b/e2e/davinci-suites/src/phone-number-field.test.ts index fc1017adb3..3dfaa78044 100644 --- a/e2e/davinci-suites/src/phone-number-field.test.ts +++ b/e2e/davinci-suites/src/phone-number-field.test.ts @@ -1,10 +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 { expect, test } from '@playwright/test'; + import { password } from './utils/demo-user.js'; test.describe('Device registration tests', () => { diff --git a/e2e/davinci-suites/src/polling.test.ts b/e2e/davinci-suites/src/polling.test.ts index 5a691bec06..393e2e1283 100644 --- a/e2e/davinci-suites/src/polling.test.ts +++ b/e2e/davinci-suites/src/polling.test.ts @@ -5,6 +5,7 @@ * of the MIT license. See the LICENSE file for details. */ import { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; test.describe('Challenge Polling', () => { diff --git a/e2e/davinci-suites/src/protect.test.ts b/e2e/davinci-suites/src/protect.test.ts index 4830bb6b22..3104b03441 100644 --- a/e2e/davinci-suites/src/protect.test.ts +++ b/e2e/davinci-suites/src/protect.test.ts @@ -1,12 +1,13 @@ /* - * 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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; -import { username, password } from './utils/demo-user.js'; +import { password, username } from './utils/demo-user.js'; test('Test Protect collector with Custom HTML component', async ({ page }) => { const davinciFlow = 'ea02bcbfb2112e051c94ee9b08083d2d'; diff --git a/e2e/davinci-suites/src/qr-code.test.ts b/e2e/davinci-suites/src/qr-code.test.ts index b68d157f6d..133c0f38b4 100644 --- a/e2e/davinci-suites/src/qr-code.test.ts +++ b/e2e/davinci-suites/src/qr-code.test.ts @@ -1,10 +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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; import { password, username } from './utils/demo-user.js'; diff --git a/e2e/davinci-suites/src/register.test.ts b/e2e/davinci-suites/src/register.test.ts index 8dfba86576..faf8c4eb73 100644 --- a/e2e/davinci-suites/src/register.test.ts +++ b/e2e/davinci-suites/src/register.test.ts @@ -1,10 +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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; import { password } from './utils/demo-user.js'; diff --git a/e2e/device-client-app/src/device-binding/main.ts b/e2e/device-client-app/src/device-binding/main.ts index 9dd9f5f70c..49d30b9cda 100644 --- a/e2e/device-client-app/src/device-binding/main.ts +++ b/e2e/device-client-app/src/device-binding/main.ts @@ -1,6 +1,6 @@ /* * - * Copyright © 2025 Ping Identity Corporation. All right reserved. + * Copyright (c) 2025 - 2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. @@ -8,7 +8,8 @@ */ import { Console, Effect } from 'effect'; -import { getUser, LoginAndGetClient, handleError, handleSuccess } from '../utils/index.js'; + +import { getUser, handleError, handleSuccess, LoginAndGetClient } from '../utils/index.js'; const deviceBinding = Effect.gen(function* () { const client = yield* LoginAndGetClient; diff --git a/e2e/device-client-app/src/device-profile/main.ts b/e2e/device-client-app/src/device-profile/main.ts index e455442b88..0068848b16 100644 --- a/e2e/device-client-app/src/device-profile/main.ts +++ b/e2e/device-client-app/src/device-profile/main.ts @@ -1,6 +1,6 @@ /* * - * Copyright © 2025 Ping Identity Corporation. All right reserved. + * Copyright (c) 2025 - 2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. @@ -8,7 +8,8 @@ */ import { Console, Effect } from 'effect'; -import { getUser, LoginAndGetClient, handleError, handleSuccess } from '../utils/index.js'; + +import { getUser, handleError, handleSuccess, LoginAndGetClient } from '../utils/index.js'; const deviceProfiling = Effect.gen(function* () { const client = yield* LoginAndGetClient; diff --git a/e2e/device-client-app/src/oath/main.ts b/e2e/device-client-app/src/oath/main.ts index 04e3758e8b..2c4784097f 100644 --- a/e2e/device-client-app/src/oath/main.ts +++ b/e2e/device-client-app/src/oath/main.ts @@ -1,6 +1,6 @@ /* * - * Copyright © 2025 Ping Identity Corporation. All right reserved. + * Copyright (c) 2025 - 2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. @@ -8,7 +8,8 @@ */ import { Console, Effect } from 'effect'; -import { getUser, LoginAndGetClient, handleError, handleSuccess } from '../utils/index.js'; + +import { getUser, handleError, handleSuccess, LoginAndGetClient } from '../utils/index.js'; const oath = Effect.gen(function* () { const client = yield* LoginAndGetClient; diff --git a/e2e/device-client-app/src/push/main.ts b/e2e/device-client-app/src/push/main.ts index 97f47f0331..ec0f7e0810 100644 --- a/e2e/device-client-app/src/push/main.ts +++ b/e2e/device-client-app/src/push/main.ts @@ -1,6 +1,6 @@ /* * - * Copyright © 2025 Ping Identity Corporation. All right reserved. + * Copyright (c) 2025 - 2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. @@ -8,7 +8,8 @@ */ import { Console, Effect } from 'effect'; -import { getUser, LoginAndGetClient, handleError, handleSuccess } from '../utils/index.js'; + +import { getUser, handleError, handleSuccess, LoginAndGetClient } from '../utils/index.js'; const push = Effect.gen(function* () { const client = yield* LoginAndGetClient; diff --git a/e2e/device-client-app/src/types.ts b/e2e/device-client-app/src/types.ts index 94692f2581..3198cb406a 100644 --- a/e2e/device-client-app/src/types.ts +++ b/e2e/device-client-app/src/types.ts @@ -1,3 +1,8 @@ -import { deviceClient } from '@forgerock/device-client'; +/* + * 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. + */ export type DeviceClient = ReturnType; diff --git a/e2e/device-client-app/src/utils/index.ts b/e2e/device-client-app/src/utils/index.ts index d7b246ec9b..f040fedc0f 100644 --- a/e2e/device-client-app/src/utils/index.ts +++ b/e2e/device-client-app/src/utils/index.ts @@ -1,19 +1,27 @@ -import { deviceClient } from '@forgerock/device-client'; -import type { ConfigOptions, DeviceClient } from '@forgerock/device-client/types'; +/* + * 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 { CallbackType, Config, FRAuth, + SessionManager, + TokenManager, + UserManager, +} from '@forgerock/javascript-sdk'; +import { Console, Effect } from 'effect'; + +import type { ConfigOptions, DeviceClient } from '@forgerock/device-client/types'; +import type { FRLoginFailure, FRLoginSuccess, FRStep, NameCallback, PasswordCallback, - SessionManager, - TokenManager, - UserManager, } from '@forgerock/javascript-sdk'; -import { Console, Effect } from 'effect'; const logout = Effect.ignore( Effect.tryPromise({ diff --git a/e2e/device-client-app/src/webauthn/main.ts b/e2e/device-client-app/src/webauthn/main.ts index 89bdb4c941..2cbc75dcaa 100644 --- a/e2e/device-client-app/src/webauthn/main.ts +++ b/e2e/device-client-app/src/webauthn/main.ts @@ -1,6 +1,6 @@ /* * - * Copyright © 2025 Ping Identity Corporation. All right reserved. + * Copyright (c) 2025 - 2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. @@ -8,7 +8,8 @@ */ import { Console, Effect } from 'effect'; -import { getUser, LoginAndGetClient, handleError, handleSuccess } from '../utils/index.js'; + +import { getUser, handleError, handleSuccess, LoginAndGetClient } from '../utils/index.js'; const webauthn = Effect.gen(function* () { const client = yield* LoginAndGetClient; diff --git a/e2e/device-client-app/vite.config.ts b/e2e/device-client-app/vite.config.ts index f54af97750..15a91ee57c 100644 --- a/e2e/device-client-app/vite.config.ts +++ b/e2e/device-client-app/vite.config.ts @@ -1,6 +1,6 @@ /// -import { defineConfig } from 'vite'; import * as path from 'path'; +import { defineConfig } from 'vite'; const pages = ['oath', 'push', 'webauthn', 'device-binding', 'device-profile']; diff --git a/e2e/journey-app/callback-map.ts b/e2e/journey-app/callback-map.ts index a9b6e94831..c43c47bd7a 100644 --- a/e2e/journey-app/callback-map.ts +++ b/e2e/journey-app/callback-map.ts @@ -1,10 +1,34 @@ /* - * 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 { + attributeInputComponent, + choiceComponent, + confirmationComponent, + deviceProfileComponent, + hiddenValueComponent, + kbaCreateComponent, + metadataComponent, + passwordComponent, + pingProtectEvaluationComponent, + pingProtectInitializeComponent, + pollingWaitComponent, + recaptchaComponent, + recaptchaEnterpriseComponent, + redirectComponent, + selectIdpComponent, + suspendedTextOutputComponent, + termsAndConditionsComponent, + textInputComponent, + textOutputComponent, + validatedPasswordComponent, + validatedUsernameComponent, +} from './components/index.js'; + import type { AttributeInputCallback, BaseCallback, @@ -31,30 +55,6 @@ import type { ValidatedCreateUsernameCallback, } from '@forgerock/journey-client/types'; -import { - attributeInputComponent, - choiceComponent, - confirmationComponent, - deviceProfileComponent, - hiddenValueComponent, - kbaCreateComponent, - metadataComponent, - passwordComponent, - pingProtectEvaluationComponent, - pingProtectInitializeComponent, - pollingWaitComponent, - recaptchaComponent, - recaptchaEnterpriseComponent, - redirectComponent, - selectIdpComponent, - suspendedTextOutputComponent, - termsAndConditionsComponent, - textInputComponent, - textOutputComponent, - validatedPasswordComponent, - validatedUsernameComponent, -} from './components/index.js'; - /** * Renders a callback component based on its type * @param journeyEl - The container element to append the component to diff --git a/e2e/journey-app/components/device-profile.ts b/e2e/journey-app/components/device-profile.ts index d452970ccc..7506853b9a 100644 --- a/e2e/journey-app/components/device-profile.ts +++ b/e2e/journey-app/components/device-profile.ts @@ -1,10 +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 { Device } from '@forgerock/journey-client/device'; + import type { DeviceProfileCallback } from '@forgerock/journey-client/types'; /** diff --git a/e2e/journey-app/components/ping-protect-evaluation.ts b/e2e/journey-app/components/ping-protect-evaluation.ts index 403e284f25..ff038ae339 100644 --- a/e2e/journey-app/components/ping-protect-evaluation.ts +++ b/e2e/journey-app/components/ping-protect-evaluation.ts @@ -1,12 +1,13 @@ /* - * 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 type { PingOneProtectEvaluationCallback } from '@forgerock/journey-client/types'; import { getProtectInstance } from './ping-protect-initialize.js'; +import type { PingOneProtectEvaluationCallback } from '@forgerock/journey-client/types'; + /** * PingOne Protect Evaluation Component * Automatically collects device and behavioral signals using the Protect SDK diff --git a/e2e/journey-app/components/ping-protect-initialize.ts b/e2e/journey-app/components/ping-protect-initialize.ts index 6cbe21db28..0b8bcf6711 100644 --- a/e2e/journey-app/components/ping-protect-initialize.ts +++ b/e2e/journey-app/components/ping-protect-initialize.ts @@ -1,10 +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 { protect } from '@forgerock/protect'; + import type { PingOneProtectInitializeCallback } from '@forgerock/journey-client/types'; // Global storage for protect instance to be used by evaluation component diff --git a/e2e/journey-app/components/qr-code.ts b/e2e/journey-app/components/qr-code.ts index 1c1d5ff746..b5bfc94a20 100644 --- a/e2e/journey-app/components/qr-code.ts +++ b/e2e/journey-app/components/qr-code.ts @@ -1,11 +1,12 @@ /* - * 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 { QRCode } from '@forgerock/journey-client/qr-code'; -import type { JourneyStep, ConfirmationCallback } from '@forgerock/journey-client/types'; + +import type { ConfirmationCallback, JourneyStep } from '@forgerock/journey-client/types'; export function renderQRCodeStep(journeyEl: HTMLDivElement, step: JourneyStep): boolean { if (!QRCode.isQRCodeStep(step)) { diff --git a/e2e/journey-app/components/recovery-codes.ts b/e2e/journey-app/components/recovery-codes.ts index c74ab3ee18..9c3847197f 100644 --- a/e2e/journey-app/components/recovery-codes.ts +++ b/e2e/journey-app/components/recovery-codes.ts @@ -1,11 +1,12 @@ /* - * 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 { RecoveryCodes } from '@forgerock/journey-client/recovery-codes'; -import type { JourneyStep, ConfirmationCallback } from '@forgerock/journey-client/types'; + +import type { ConfirmationCallback, JourneyStep } from '@forgerock/journey-client/types'; export function renderRecoveryCodesStep(journeyEl: HTMLDivElement, step: JourneyStep): boolean { if (!RecoveryCodes.isDisplayStep(step)) { diff --git a/e2e/journey-app/components/webauthn-step.ts b/e2e/journey-app/components/webauthn-step.ts index fe136b202b..c8d32a14cf 100644 --- a/e2e/journey-app/components/webauthn-step.ts +++ b/e2e/journey-app/components/webauthn-step.ts @@ -5,11 +5,12 @@ * of the MIT license. See the LICENSE file for details. */ -import type { BaseCallback, JourneyStep } from '@forgerock/journey-client/types'; import { WebAuthn, WebAuthnStepType } from '@forgerock/journey-client/webauthn'; import { renderCallbacks } from '../callback-map.js'; +import type { BaseCallback, JourneyStep } from '@forgerock/journey-client/types'; + type WebAuthnStepHandlerResult = { callbacksRendered: boolean; didSubmit: boolean; diff --git a/e2e/journey-app/main.ts b/e2e/journey-app/main.ts index 18adaa6600..e5c0d735db 100644 --- a/e2e/journey-app/main.ts +++ b/e2e/journey-app/main.ts @@ -1,22 +1,21 @@ /* - * Copyright (c) 2025-2026 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 './style.css'; - import { journey } from '@forgerock/journey-client'; -import type { JourneyClient, RequestMiddleware } from '@forgerock/journey-client/types'; - +import './style.css'; import { renderCallbacks } from './callback-map.js'; import { renderDeleteDevicesSection } from './components/delete-device.js'; import { renderQRCodeStep } from './components/qr-code.js'; import { renderRecoveryCodesStep } from './components/recovery-codes.js'; -import { deleteWebAuthnDevice } from './services/delete-webauthn-device.js'; import { handleWebAuthnStep } from './components/webauthn-step.js'; import { serverConfigs } from './server-configs.js'; +import { deleteWebAuthnDevice } from './services/delete-webauthn-device.js'; + +import type { JourneyClient, RequestMiddleware } from '@forgerock/journey-client/types'; const qs = window.location.search; const searchParams = new URLSearchParams(qs); diff --git a/e2e/journey-app/services/delete-webauthn-device.ts b/e2e/journey-app/services/delete-webauthn-device.ts index e8c5e0827b..c9c3825643 100644 --- a/e2e/journey-app/services/delete-webauthn-device.ts +++ b/e2e/journey-app/services/delete-webauthn-device.ts @@ -6,8 +6,9 @@ */ import { deviceClient as createDeviceClient } from '@forgerock/device-client'; + import type { WebAuthnDevice } from '@forgerock/device-client/types'; -import { JourneyClientConfig } from '@forgerock/journey-client/types'; +import type { JourneyClientConfig } from '@forgerock/journey-client/types'; /** * Derives the AM base URL from an OIDC well-known URL. diff --git a/e2e/journey-suites/playwright.config.ts b/e2e/journey-suites/playwright.config.ts index 85229ca845..f1dd37fb18 100644 --- a/e2e/journey-suites/playwright.config.ts +++ b/e2e/journey-suites/playwright.config.ts @@ -4,9 +4,10 @@ * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ -import { PlaywrightTestConfig } from '@playwright/test'; import { workspaceRoot } from '@nx/devkit'; +import type { PlaywrightTestConfig } from '@playwright/test'; + // For CI, you may want to set BASE_URL to the deployed application. const baseURL = process.env['BASE_URL'] || 'http://localhost:5829'; diff --git a/e2e/journey-suites/src/choice-confirm-poll.test.ts b/e2e/journey-suites/src/choice-confirm-poll.test.ts index 4c800011f9..fe21d8abfb 100644 --- a/e2e/journey-suites/src/choice-confirm-poll.test.ts +++ b/e2e/journey-suites/src/choice-confirm-poll.test.ts @@ -1,13 +1,14 @@ /* - * 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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; -import { username, password } from './utils/demo-user.js'; +import { password, username } from './utils/demo-user.js'; test('Test happy paths on test page', async ({ page }) => { const { clickButton, navigate } = asyncEvents(page); diff --git a/e2e/journey-suites/src/custom-paths.test.ts b/e2e/journey-suites/src/custom-paths.test.ts index 8cd43b7863..e3ccc76006 100644 --- a/e2e/journey-suites/src/custom-paths.test.ts +++ b/e2e/journey-suites/src/custom-paths.test.ts @@ -1,13 +1,14 @@ /* - * 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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; -import { username, password } from './utils/demo-user.js'; +import { password, username } from './utils/demo-user.js'; // Skipping test until AM Mock API is available that supports custom paths test.skip('Test happy paths on test page', async ({ page }) => { diff --git a/e2e/journey-suites/src/device-profile.test.ts b/e2e/journey-suites/src/device-profile.test.ts index e5770b3262..b737045e92 100644 --- a/e2e/journey-suites/src/device-profile.test.ts +++ b/e2e/journey-suites/src/device-profile.test.ts @@ -1,13 +1,14 @@ /* - * 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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; -import { username, password } from './utils/demo-user.js'; +import { password, username } from './utils/demo-user.js'; test('Test device profile collection journey flow', async ({ page }) => { const { clickButton, navigate } = asyncEvents(page); diff --git a/e2e/journey-suites/src/email-suspend.test.ts b/e2e/journey-suites/src/email-suspend.test.ts index 4e4d180d87..5bef82424e 100644 --- a/e2e/journey-suites/src/email-suspend.test.ts +++ b/e2e/journey-suites/src/email-suspend.test.ts @@ -1,13 +1,14 @@ /* - * 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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; -import { username, password } from './utils/demo-user.js'; +import { password, username } from './utils/demo-user.js'; test('Test happy paths on test page', async ({ page }) => { const { clickButton, navigate } = asyncEvents(page); diff --git a/e2e/journey-suites/src/login.test.ts b/e2e/journey-suites/src/login.test.ts index 63f83d988f..250c609242 100644 --- a/e2e/journey-suites/src/login.test.ts +++ b/e2e/journey-suites/src/login.test.ts @@ -1,11 +1,12 @@ /* - * 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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; import { password, username } from './utils/demo-user.js'; diff --git a/e2e/journey-suites/src/no-session.test.ts b/e2e/journey-suites/src/no-session.test.ts index 679e6e9cba..9ea7818a07 100644 --- a/e2e/journey-suites/src/no-session.test.ts +++ b/e2e/journey-suites/src/no-session.test.ts @@ -1,13 +1,14 @@ /* - * 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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; -import { username, password } from './utils/demo-user.js'; +import { password, username } from './utils/demo-user.js'; test('Test happy paths on test page', async ({ page }) => { const { clickButton, navigate } = asyncEvents(page); diff --git a/e2e/journey-suites/src/otp-register.test.ts b/e2e/journey-suites/src/otp-register.test.ts index 27f33ca373..b9e95717fb 100644 --- a/e2e/journey-suites/src/otp-register.test.ts +++ b/e2e/journey-suites/src/otp-register.test.ts @@ -1,13 +1,14 @@ /* - * 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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; -import { username, password } from './utils/demo-user.js'; +import { password, username } from './utils/demo-user.js'; test('Test happy paths on test page', async ({ page }) => { const { clickButton, navigate } = asyncEvents(page); diff --git a/e2e/journey-suites/src/protect.test.ts b/e2e/journey-suites/src/protect.test.ts index 09e37c4920..bb82400c71 100644 --- a/e2e/journey-suites/src/protect.test.ts +++ b/e2e/journey-suites/src/protect.test.ts @@ -1,13 +1,14 @@ /* - * 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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; -import { username, password } from './utils/demo-user.js'; +import { password, username } from './utils/demo-user.js'; test('Test PingOne Protect journey flow', async ({ page }) => { const { clickButton } = asyncEvents(page); diff --git a/e2e/journey-suites/src/qr-code.test.ts b/e2e/journey-suites/src/qr-code.test.ts index b18ebd2d4d..b39c0107a2 100644 --- a/e2e/journey-suites/src/qr-code.test.ts +++ b/e2e/journey-suites/src/qr-code.test.ts @@ -1,13 +1,14 @@ /* - * 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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; -import { username, password } from './utils/demo-user.js'; +import { password, username } from './utils/demo-user.js'; test('Test QR Code journey flow using QRCode module', async ({ page }) => { const { clickButton, navigate } = asyncEvents(page); diff --git a/e2e/journey-suites/src/recovery-codes.test.ts b/e2e/journey-suites/src/recovery-codes.test.ts index ce90a62607..47ef67d6df 100644 --- a/e2e/journey-suites/src/recovery-codes.test.ts +++ b/e2e/journey-suites/src/recovery-codes.test.ts @@ -1,11 +1,12 @@ /* - * 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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; test.describe('Recovery Codes Journey', () => { diff --git a/e2e/journey-suites/src/registration.test.ts b/e2e/journey-suites/src/registration.test.ts index 6bf6725ad0..b1c6cac76f 100644 --- a/e2e/journey-suites/src/registration.test.ts +++ b/e2e/journey-suites/src/registration.test.ts @@ -1,11 +1,12 @@ /* - * 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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; import { password } from './utils/demo-user.js'; diff --git a/e2e/journey-suites/src/request-middleware.test.ts b/e2e/journey-suites/src/request-middleware.test.ts index 0e33d0b989..726e82a881 100644 --- a/e2e/journey-suites/src/request-middleware.test.ts +++ b/e2e/journey-suites/src/request-middleware.test.ts @@ -1,13 +1,14 @@ /* - * 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 { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; -import { username, password } from './utils/demo-user.js'; +import { password, username } from './utils/demo-user.js'; test('Test middleware on test page', async ({ page }) => { const { clickButton, navigate } = asyncEvents(page); diff --git a/e2e/journey-suites/src/webauthn-device.test.ts b/e2e/journey-suites/src/webauthn-device.test.ts index b79c2518b0..c6f8e334fa 100644 --- a/e2e/journey-suites/src/webauthn-device.test.ts +++ b/e2e/journey-suites/src/webauthn-device.test.ts @@ -6,9 +6,11 @@ */ import { expect, test } from '@playwright/test'; -import type { CDPSession } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; -import { username, password } from './utils/demo-user.js'; +import { password, username } from './utils/demo-user.js'; + +import type { CDPSession } from '@playwright/test'; const WEBAUTHN_CREDENTIAL_ID_QUERY_PARAM = 'webauthnCredentialId'; diff --git a/e2e/mock-api-v2/src/handlers/authorize.handler.ts b/e2e/mock-api-v2/src/handlers/authorize.handler.ts index c636c9e762..bc225fb7fc 100644 --- a/e2e/mock-api-v2/src/handlers/authorize.handler.ts +++ b/e2e/mock-api-v2/src/handlers/authorize.handler.ts @@ -1,13 +1,14 @@ /* - * 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 { Effect, pipe } from 'effect'; -import { MockApi } from '../spec.js'; import { HttpApiBuilder, HttpApiError, HttpServerResponse } from '@effect/platform'; +import { Effect, pipe } from 'effect'; + import { getFirstElementAndRespond } from '../services/mock-env-helpers/index.js'; +import { MockApi } from '../spec.js'; const AuthorizeHandlerMock = HttpApiBuilder.group(MockApi, 'Authorization', (handlers) => handlers.handle('authorize', ({ urlParams }) => diff --git a/e2e/mock-api-v2/src/handlers/capabilities.handler.ts b/e2e/mock-api-v2/src/handlers/capabilities.handler.ts index d82c62f3a5..4a0d66265b 100644 --- a/e2e/mock-api-v2/src/handlers/capabilities.handler.ts +++ b/e2e/mock-api-v2/src/handlers/capabilities.handler.ts @@ -1,20 +1,21 @@ /** - * 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 { Effect, pipe } from 'effect'; -import { MockApi } from '../spec.js'; import { HttpApiBuilder, HttpApiError, HttpServerRequest, HttpServerResponse, } from '@effect/platform'; -import { responseMap } from '../responses/index.js'; +import { Effect, pipe } from 'effect'; + import { validator } from '../helpers/match.js'; +import { responseMap } from '../responses/index.js'; import { returnSuccessResponseRedirect } from '../responses/return-success-redirect.js'; +import { MockApi } from '../spec.js'; const CapabilitiesHandlerMock = HttpApiBuilder.group(MockApi, 'Capabilities', (handlers) => handlers.handle('capabilities', ({ payload }) => diff --git a/e2e/mock-api-v2/src/handlers/end-session.handler.ts b/e2e/mock-api-v2/src/handlers/end-session.handler.ts index c25219e38b..680c6a9c5c 100644 --- a/e2e/mock-api-v2/src/handlers/end-session.handler.ts +++ b/e2e/mock-api-v2/src/handlers/end-session.handler.ts @@ -1,13 +1,14 @@ /* - * 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 { Effect, Console } from 'effect'; import { HttpApiBuilder, HttpServerRequest } from '@effect/platform'; -import { MockApi } from '../spec.js'; +import { Console, Effect } from 'effect'; + import { SessionStorage } from '../services/session.service.js'; +import { MockApi } from '../spec.js'; export const EndSessionHandlerMock = HttpApiBuilder.group( MockApi, diff --git a/e2e/mock-api-v2/src/handlers/healthcheck.handler.ts b/e2e/mock-api-v2/src/handlers/healthcheck.handler.ts index fd9a27ce26..e65d46081b 100644 --- a/e2e/mock-api-v2/src/handlers/healthcheck.handler.ts +++ b/e2e/mock-api-v2/src/handlers/healthcheck.handler.ts @@ -1,7 +1,13 @@ -import { HttpApiBuilder } from '@effect/platform'; -import { MockApi } from '../spec.js'; +/* + * 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 { Effect } from 'effect'; +import { MockApi } from '../spec.js'; + const HealthCheckLive = HttpApiBuilder.group(MockApi, 'Healthcheck', (handlers) => handlers.handle('HealthCheck', () => Effect.succeed('Healthy').pipe(Effect.withSpan('HealthCheck')), diff --git a/e2e/mock-api-v2/src/handlers/open-id-configuration.handler.ts b/e2e/mock-api-v2/src/handlers/open-id-configuration.handler.ts index f6b4d2a76e..3c71a5eb0d 100644 --- a/e2e/mock-api-v2/src/handlers/open-id-configuration.handler.ts +++ b/e2e/mock-api-v2/src/handlers/open-id-configuration.handler.ts @@ -1,13 +1,14 @@ /* - * 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 { Effect } from 'effect'; -import { MockApi } from '../spec.js'; import { HttpApiBuilder } from '@effect/platform'; import { HttpServerRequest } from '@effect/platform/HttpServerRequest'; +import { Effect } from 'effect'; + +import { MockApi } from '../spec.js'; const OpenidConfigMock = HttpApiBuilder.group(MockApi, 'OpenIDConfig', (handlers) => handlers.handle('openid', ({ path: { envid } }) => diff --git a/e2e/mock-api-v2/src/handlers/revoke.handler.ts b/e2e/mock-api-v2/src/handlers/revoke.handler.ts index b25c8da876..f58384dd6a 100644 --- a/e2e/mock-api-v2/src/handlers/revoke.handler.ts +++ b/e2e/mock-api-v2/src/handlers/revoke.handler.ts @@ -1,14 +1,15 @@ /* - * 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 { MockApi } from '../spec.js'; -import { Tokens } from '../services/tokens.service.js'; import { HttpApiBuilder } from '@effect/platform'; import { Effect } from 'effect'; +import { Tokens } from '../services/tokens.service.js'; +import { MockApi } from '../spec.js'; + const RevokeTokenHandler = HttpApiBuilder.group(MockApi, 'Revoke', (handlers) => handlers.handle('RevokeToken', () => Effect.gen(function* () { diff --git a/e2e/mock-api-v2/src/handlers/token.handler.ts b/e2e/mock-api-v2/src/handlers/token.handler.ts index 5eefdd073d..0f3805b510 100644 --- a/e2e/mock-api-v2/src/handlers/token.handler.ts +++ b/e2e/mock-api-v2/src/handlers/token.handler.ts @@ -1,14 +1,15 @@ /* - * 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 { MockApi } from '../spec.js'; -import { Tokens } from '../services/tokens.service.js'; import { HttpApiBuilder } from '@effect/platform'; import { Effect } from 'effect'; +import { Tokens } from '../services/tokens.service.js'; +import { MockApi } from '../spec.js'; + const TokensHandler = HttpApiBuilder.group(MockApi, 'Tokens', (handlers) => handlers.handle('Tokens', () => Effect.gen(function* () { diff --git a/e2e/mock-api-v2/src/handlers/userinfo.handler.ts b/e2e/mock-api-v2/src/handlers/userinfo.handler.ts index bea15715eb..9c94bcb4b0 100644 --- a/e2e/mock-api-v2/src/handlers/userinfo.handler.ts +++ b/e2e/mock-api-v2/src/handlers/userinfo.handler.ts @@ -1,14 +1,15 @@ /* - * 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 { Effect } from 'effect'; -import { MockApi } from '../spec.js'; -import { UserInfo } from '../services/userinfo.service.js'; import { HttpApiBuilder, HttpApiError } from '@effect/platform'; +import { Effect } from 'effect'; + import { BearerToken } from '../middleware/Authorization.js'; +import { UserInfo } from '../services/userinfo.service.js'; +import { MockApi } from '../spec.js'; const UserInfoMockHandler = HttpApiBuilder.group(MockApi, 'ProtectedRequests', (handlers) => handlers.handle('UserInfo', () => diff --git a/e2e/mock-api-v2/src/helpers/match.ts b/e2e/mock-api-v2/src/helpers/match.ts index 511f2ffda2..bdbbd22798 100644 --- a/e2e/mock-api-v2/src/helpers/match.ts +++ b/e2e/mock-api-v2/src/helpers/match.ts @@ -1,13 +1,15 @@ /* - * 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 { Effect, Match, Schema } from 'effect'; - import { HttpApiError } from '@effect/platform'; -import { CapabilitiesRequestBody } from '../schemas/capabilities/capabilities.request.schema.js'; +import { Effect, Match } from 'effect'; + +import type { Schema } from 'effect'; + +import type { CapabilitiesRequestBody } from '../schemas/capabilities/capabilities.request.schema.js'; type PingRequestData = Schema.Schema.Type; /** diff --git a/e2e/mock-api-v2/src/main.ts b/e2e/mock-api-v2/src/main.ts index 92e2acf3ee..12e9ff05bd 100644 --- a/e2e/mock-api-v2/src/main.ts +++ b/e2e/mock-api-v2/src/main.ts @@ -1,30 +1,31 @@ /* - * 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 { Layer } from 'effect'; -import { NodeHttpServer, NodeRuntime } from '@effect/platform-node'; -import { MockApi } from './spec.js'; +import { NodeSdk } from '@effect/opentelemetry'; import { HttpApiBuilder, HttpApiSwagger, HttpMiddleware, HttpServer } from '@effect/platform'; +import { NodeHttpServer, NodeRuntime } from '@effect/platform-node'; +import { BatchSpanProcessor, ConsoleSpanExporter } from '@opentelemetry/sdk-trace-base'; +import { Layer } from 'effect'; import { createServer } from 'node:http'; -import { HealthCheckLive } from './handlers/healthcheck.handler.js'; -import { OpenidConfigMock } from './handlers/open-id-configuration.handler.js'; -import { IncrementStepIndexMock } from './middleware/CookieMiddleware.js'; + import { AuthorizeHandlerMock } from './handlers/authorize.handler.js'; import { CapabilitiesHandlerMock } from './handlers/capabilities.handler.js'; -import { TokensMock } from './services/tokens.service.js'; +import { EndSessionHandlerMock } from './handlers/end-session.handler.js'; +import { HealthCheckLive } from './handlers/healthcheck.handler.js'; +import { OpenidConfigMock } from './handlers/open-id-configuration.handler.js'; +import { RevokeTokenHandler } from './handlers/revoke.handler.js'; import { TokensHandler } from './handlers/token.handler.js'; import { UserInfoMockHandler } from './handlers/userinfo.handler.js'; -import { UserInfoMockService } from './services/userinfo.service.js'; import { AuthorizationMock } from './middleware/Authorization.js'; +import { IncrementStepIndexMock } from './middleware/CookieMiddleware.js'; import { SessionMiddlewareMock } from './middleware/Session.js'; import { SessionStorage } from './services/session.service.js'; -import { NodeSdk } from '@effect/opentelemetry'; -import { BatchSpanProcessor, ConsoleSpanExporter } from '@opentelemetry/sdk-trace-base'; -import { EndSessionHandlerMock } from './handlers/end-session.handler.js'; -import { RevokeTokenHandler } from './handlers/revoke.handler.js'; +import { TokensMock } from './services/tokens.service.js'; +import { UserInfoMockService } from './services/userinfo.service.js'; +import { MockApi } from './spec.js'; const Services = [ Layer.provide(TokensMock), diff --git a/e2e/mock-api-v2/src/middleware/Authorization.ts b/e2e/mock-api-v2/src/middleware/Authorization.ts index 1cfe3d8bee..e01935a3db 100644 --- a/e2e/mock-api-v2/src/middleware/Authorization.ts +++ b/e2e/mock-api-v2/src/middleware/Authorization.ts @@ -1,5 +1,10 @@ +/* + * 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 { Unauthorized } from '@effect/platform/HttpApiError'; -import { HttpApiMiddleware, HttpApiSecurity, OpenApi } from '@effect/platform'; import { Brand, Context, Effect, Layer, Redacted } from 'effect'; type BearerTokenValue = string & Brand.Brand<'BearerToken'>; diff --git a/e2e/mock-api-v2/src/middleware/Session.ts b/e2e/mock-api-v2/src/middleware/Session.ts index c04cbec6ee..33c35b09be 100644 --- a/e2e/mock-api-v2/src/middleware/Session.ts +++ b/e2e/mock-api-v2/src/middleware/Session.ts @@ -1,7 +1,15 @@ -import { HttpApiError, HttpApiMiddleware, HttpServerRequest } from '@effect/platform'; -import { SessionData, SessionStorage } from '../services/session.service.js'; +/* + * 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 { Context, Effect, Layer } from 'effect'; +import { SessionStorage } from '../services/session.service.js'; + +import type { SessionData } from '../services/session.service.js'; + class Session extends Context.Tag('Session')() {} export class SessionMiddleware extends HttpApiMiddleware.Tag()('Session', { diff --git a/e2e/mock-api-v2/src/responses/index.ts b/e2e/mock-api-v2/src/responses/index.ts index 0fe59a0a7c..1448c10228 100644 --- a/e2e/mock-api-v2/src/responses/index.ts +++ b/e2e/mock-api-v2/src/responses/index.ts @@ -1,14 +1,14 @@ /* - * 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 { Array } from 'effect'; -import { UsernamePassword } from './username-password.js'; -import { returnSuccessResponseRedirect } from './return-success-redirect.js'; import { InvalidUsernamePassword } from './invalid-username-password.js'; +import { returnSuccessResponseRedirect } from './return-success-redirect.js'; +import { UsernamePassword } from './username-password.js'; type ResponseMapKeys = keyof typeof responseMap; const responseMap = { diff --git a/e2e/mock-api-v2/src/services/mock-env-helpers/index.ts b/e2e/mock-api-v2/src/services/mock-env-helpers/index.ts index cb93a0616d..b435ad59f3 100644 --- a/e2e/mock-api-v2/src/services/mock-env-helpers/index.ts +++ b/e2e/mock-api-v2/src/services/mock-env-helpers/index.ts @@ -1,18 +1,21 @@ /* - * 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 { Array, Effect, Option, pipe, Schema } from 'effect'; +import { HttpApiError } from '@effect/platform'; +import { Array, Effect, Option, pipe } from 'effect'; import { UnableToFindNextStep } from '../../errors/index.js'; -import { ResponseMapKeys, responseMap } from '../../responses/index.js'; -import { CapabilitiesResponse } from '../../schemas/capabilities/capabilities.response.schema.js'; - -import { QueryTypes } from '../../types/index.js'; import { validator } from '../../helpers/match.js'; -import { HttpApiError } from '@effect/platform'; +import { responseMap } from '../../responses/index.js'; + +import type { Schema } from 'effect'; + +import type { ResponseMapKeys } from '../../responses/index.js'; +import type { CapabilitiesResponse } from '../../schemas/capabilities/capabilities.response.schema.js'; +import type { QueryTypes } from '../../types/index.js'; /** * Given data in the shape of Ping's Request formData.value diff --git a/e2e/mock-api-v2/src/services/tokens.service.ts b/e2e/mock-api-v2/src/services/tokens.service.ts index 5c2df0c5b5..acd15c4c2d 100644 --- a/e2e/mock-api-v2/src/services/tokens.service.ts +++ b/e2e/mock-api-v2/src/services/tokens.service.ts @@ -1,17 +1,20 @@ /* - * 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 { Context, Effect, Layer, Schema } from 'effect'; import { HttpApiError } from '@effect/platform'; -import { tokenResponseBody } from '../responses/token/token.js'; -import { TokenResponseBody } from '../schemas/token/token.schema.js'; +import { Context, Effect, Layer } from 'effect'; + import { revokeResponseBody } from '../responses/revoke/revoke.js'; -import { RevokeResponseBody } from '../schemas/revoke/revoke.schema.js'; +import { tokenResponseBody } from '../responses/token/token.js'; + +import type { Schema } from 'effect'; -import { HeaderTypes } from '../types/index.js'; +import type { RevokeResponseBody } from '../schemas/revoke/revoke.schema.js'; +import type { TokenResponseBody } from '../schemas/token/token.schema.js'; +import type { HeaderTypes } from '../types/index.js'; type TokensResponseBody = Schema.Schema.Type; type RevokeTokenResponseBody = Schema.Schema.Type; diff --git a/e2e/mock-api-v2/src/services/userinfo.service.ts b/e2e/mock-api-v2/src/services/userinfo.service.ts index b9e3dabc45..015619e3a2 100644 --- a/e2e/mock-api-v2/src/services/userinfo.service.ts +++ b/e2e/mock-api-v2/src/services/userinfo.service.ts @@ -1,15 +1,18 @@ /* - * 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 { Layer, Schema } from 'effect'; -import { Effect, Context } from 'effect'; +import { HttpApiError } from '@effect/platform'; +import { Layer } from 'effect'; +import { Context, Effect } from 'effect'; import { userInfoResponse } from '../responses/userinfo/userinfo.js'; -import { UserInfoSchema } from '../schemas/userinfo/userinfo.schema.js'; -import { HttpApiError } from '@effect/platform'; + +import type { Schema } from 'effect'; + +import type { UserInfoSchema } from '../schemas/userinfo/userinfo.schema.js'; /*** * This file should be converted to a Layer that uses Request diff --git a/e2e/mock-api-v2/src/spec.ts b/e2e/mock-api-v2/src/spec.ts index 3981a26464..d8fc3e14ba 100644 --- a/e2e/mock-api-v2/src/spec.ts +++ b/e2e/mock-api-v2/src/spec.ts @@ -1,34 +1,34 @@ /* - * 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 { Schema } from 'effect'; import { HttpApi, HttpApiEndpoint, HttpApiError, HttpApiGroup, OpenApi } from '@effect/platform'; -import { openIdConfigurationResponseSchema } from './schemas/open-id-configuration/open-id-configuration-response.schema.js'; -import { TokenResponseBody } from './schemas/token/token.schema.js'; -import { UserInfoSchema } from './schemas/userinfo/userinfo.schema.js'; +import { Schema } from 'effect'; + +import { addStepCookie } from './addStepCookie.openapi.js'; import { Authorization } from './middleware/Authorization.js'; +import { IncrementStepIndex } from './middleware/CookieMiddleware.js'; import { SessionMiddleware } from './middleware/Session.js'; +import { DavinciAuthorizeHeaders, DavinciAuthorizeQuery } from './schemas/authorize.schema.js'; +import { CapabilitiesHeaders } from './schemas/capabilities/capabilities.headers.schema.js'; +import { CapabilitiesPathParams } from './schemas/capabilities/capabilities.path.schema.js'; +import { CapabilitiesRequestBody } from './schemas/capabilities/capabilities.request.schema.js'; +import { CapabilitiesResponse } from './schemas/capabilities/capabilities.response.schema.js'; import { - EndSessionQuery, EndSessionHeaders, EndSessionPath, + EndSessionQuery, } from './schemas/end-session.schema.js'; +import { openIdConfigurationResponseSchema } from './schemas/open-id-configuration/open-id-configuration-response.schema.js'; import { RevokePath, RevokeRequestBody, RevokeResponseBody, } from './schemas/revoke/revoke.schema.js'; - -import { CapabilitiesHeaders } from './schemas/capabilities/capabilities.headers.schema.js'; -import { CapabilitiesResponse } from './schemas/capabilities/capabilities.response.schema.js'; -import { DavinciAuthorizeHeaders, DavinciAuthorizeQuery } from './schemas/authorize.schema.js'; -import { CapabilitiesPathParams } from './schemas/capabilities/capabilities.path.schema.js'; -import { CapabilitiesRequestBody } from './schemas/capabilities/capabilities.request.schema.js'; -import { addStepCookie } from './addStepCookie.openapi.js'; -import { IncrementStepIndex } from './middleware/CookieMiddleware.js'; +import { TokenResponseBody } from './schemas/token/token.schema.js'; +import { UserInfoSchema } from './schemas/userinfo/userinfo.schema.js'; const MockApi = HttpApi.make('MyApi') .annotate(OpenApi.Title, 'PingOne OIDC and OAuth2 Mock API') diff --git a/e2e/mock-api-v2/src/types/index.ts b/e2e/mock-api-v2/src/types/index.ts index 0c44c3741b..7d0974462d 100644 --- a/e2e/mock-api-v2/src/types/index.ts +++ b/e2e/mock-api-v2/src/types/index.ts @@ -1,12 +1,16 @@ /* - * 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 { Schema } from 'effect'; -import { DavinciAuthorizeHeaders, DavinciAuthorizeQuery } from '../schemas/authorize.schema.js'; -import { SuccessResponseRedirect } from '../schemas/return-success-response-redirect.schema.js'; +import type { Schema } from 'effect'; + +import type { + DavinciAuthorizeHeaders, + DavinciAuthorizeQuery, +} from '../schemas/authorize.schema.js'; +import type { SuccessResponseRedirect } from '../schemas/return-success-response-redirect.schema.js'; type QueryTypes = Schema.Schema.Type | null; diff --git a/e2e/oidc-app/src/utils/oidc-app.ts b/e2e/oidc-app/src/utils/oidc-app.ts index fabada73f3..4114eaa072 100644 --- a/e2e/oidc-app/src/utils/oidc-app.ts +++ b/e2e/oidc-app/src/utils/oidc-app.ts @@ -1,12 +1,13 @@ /* * - * Copyright © 2025 Ping Identity Corporation. All right reserved. + * Copyright (c) 2025 - 2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. * */ import { oidc } from '@forgerock/oidc-client'; + import type { AuthorizationError, GenericError, diff --git a/e2e/oidc-app/vite.config.ts b/e2e/oidc-app/vite.config.ts index c40a554f9f..3d4d99d4c6 100644 --- a/e2e/oidc-app/vite.config.ts +++ b/e2e/oidc-app/vite.config.ts @@ -1,7 +1,7 @@ /// -import { defineConfig } from 'vite'; import { dirname, resolve } from 'path'; import { fileURLToPath } from 'url'; +import { defineConfig } from 'vite'; const __dirname = dirname(fileURLToPath(import.meta.url)); const pages = ['ping-am', 'ping-one', 'par']; diff --git a/e2e/oidc-suites/playwright.config.ts b/e2e/oidc-suites/playwright.config.ts index 0a722e28de..e150300be2 100644 --- a/e2e/oidc-suites/playwright.config.ts +++ b/e2e/oidc-suites/playwright.config.ts @@ -1,5 +1,5 @@ -import { defineConfig } from '@playwright/test'; import { workspaceRoot } from '@nx/devkit'; +import { defineConfig } from '@playwright/test'; // For CI, you may want to set BASE_URL to the deployed application. const baseURL = process.env['BASE_URL'] || 'http://localhost:8443'; diff --git a/e2e/oidc-suites/src/login.spec.ts b/e2e/oidc-suites/src/login.spec.ts index 5934f94cb5..1f993b83cb 100644 --- a/e2e/oidc-suites/src/login.spec.ts +++ b/e2e/oidc-suites/src/login.spec.ts @@ -1,19 +1,20 @@ /* * - * Copyright © 2025 Ping Identity Corporation. All right reserved. + * Copyright (c) 2025 - 2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. * */ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; + +import { asyncEvents } from './utils/async-events.js'; import { - pingAmUsername, pingAmPassword, - pingOneUsername, + pingAmUsername, pingOnePassword, + pingOneUsername, } from './utils/demo-users.js'; -import { asyncEvents } from './utils/async-events.js'; test.describe('PingAM login and get token tests', () => { test('background login with valid credentials', async ({ page }) => { diff --git a/e2e/oidc-suites/src/logout.spec.ts b/e2e/oidc-suites/src/logout.spec.ts index ae4065301e..1b2d8de6eb 100644 --- a/e2e/oidc-suites/src/logout.spec.ts +++ b/e2e/oidc-suites/src/logout.spec.ts @@ -1,19 +1,20 @@ /* * - * Copyright © 2025 Ping Identity Corporation. All right reserved. + * Copyright (c) 2025 - 2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. * */ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; + +import { asyncEvents } from './utils/async-events.js'; import { - pingAmUsername, pingAmPassword, - pingOneUsername, + pingAmUsername, pingOnePassword, + pingOneUsername, } from './utils/demo-users.js'; -import { asyncEvents } from './utils/async-events.js'; test.describe('Logout tests', () => { test('PingAM login then logout', async ({ page }) => { diff --git a/e2e/oidc-suites/src/par.spec.ts b/e2e/oidc-suites/src/par.spec.ts index ff10c1a974..7e9e80bbcf 100644 --- a/e2e/oidc-suites/src/par.spec.ts +++ b/e2e/oidc-suites/src/par.spec.ts @@ -1,14 +1,15 @@ /* * - * Copyright © 2025 Ping Identity Corporation. All right reserved. + * Copyright (c) 2025 - 2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. * */ -import { test, expect } from '@playwright/test'; -import { pingAmUsername, pingAmPassword } from './utils/demo-users.js'; +import { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; +import { pingAmPassword, pingAmUsername } from './utils/demo-users.js'; async function loginJourney(page, username: string, password: string) { await page.getByLabel('User Name').fill(username); diff --git a/e2e/oidc-suites/src/session.spec.ts b/e2e/oidc-suites/src/session.spec.ts index 60d509457f..2c7be6e0ba 100644 --- a/e2e/oidc-suites/src/session.spec.ts +++ b/e2e/oidc-suites/src/session.spec.ts @@ -1,12 +1,13 @@ /* - * Copyright © 2026 Ping Identity Corporation. All rights reserved. + * 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. */ -import { test, expect } from '@playwright/test'; -import { pingAmUsername, pingAmPassword } from './utils/demo-users.js'; +import { expect, test } from '@playwright/test'; + import { asyncEvents } from './utils/async-events.js'; +import { pingAmPassword, pingAmUsername } from './utils/demo-users.js'; import { loginPingAm } from './utils/login.js'; // The redirect URI the SDK is configured with for the PingAM app diff --git a/e2e/oidc-suites/src/token.spec.ts b/e2e/oidc-suites/src/token.spec.ts index 083d14be1d..9bb8c63ae4 100644 --- a/e2e/oidc-suites/src/token.spec.ts +++ b/e2e/oidc-suites/src/token.spec.ts @@ -1,19 +1,20 @@ /* * - * Copyright © 2025 Ping Identity Corporation. All right reserved. + * Copyright (c) 2025 - 2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. * */ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; + +import { asyncEvents } from './utils/async-events.js'; import { - pingAmUsername, pingAmPassword, - pingOneUsername, + pingAmUsername, pingOnePassword, + pingOneUsername, } from './utils/demo-users.js'; -import { asyncEvents } from './utils/async-events.js'; test.describe('PingAM tokens', () => { test('login and get tokens', async ({ page }) => { diff --git a/e2e/oidc-suites/src/user.spec.ts b/e2e/oidc-suites/src/user.spec.ts index 1fbb847840..af883d9f1f 100644 --- a/e2e/oidc-suites/src/user.spec.ts +++ b/e2e/oidc-suites/src/user.spec.ts @@ -1,19 +1,20 @@ /* * - * Copyright © 2025 Ping Identity Corporation. All right reserved. + * Copyright (c) 2025 - 2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. * */ -import { test, expect } from '@playwright/test'; +import { expect, test } from '@playwright/test'; + +import { asyncEvents } from './utils/async-events.js'; import { - pingAmUsername, pingAmPassword, - pingOneUsername, + pingAmUsername, pingOnePassword, + pingOneUsername, } from './utils/demo-users.js'; -import { asyncEvents } from './utils/async-events.js'; test.describe('User tests', () => { test('get user info from PingAM', async ({ page }) => { diff --git a/e2e/oidc-suites/src/utils/login.ts b/e2e/oidc-suites/src/utils/login.ts index 669913980f..d3e40ad148 100644 --- a/e2e/oidc-suites/src/utils/login.ts +++ b/e2e/oidc-suites/src/utils/login.ts @@ -1,10 +1,11 @@ /* - * Copyright © 2026 Ping Identity Corporation. All rights reserved. + * 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. */ import { expect, type Page } from '@playwright/test'; + import { asyncEvents } from './async-events.js'; export async function loginPingAm(page: Page, username: string, password: string) { diff --git a/e2e/protect-app/src/protect-native.ts b/e2e/protect-app/src/protect-native.ts index 9e76487f03..514e4a71b7 100644 --- a/e2e/protect-app/src/protect-native.ts +++ b/e2e/protect-app/src/protect-native.ts @@ -1,28 +1,32 @@ /* * - * Copyright © 2025 Ping Identity Corporation. All right reserved. + * Copyright (c) 2025 - 2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. * */ -import './style.css'; -import { protect } from '@forgerock/protect'; -import type { Protect } from '@forgerock/protect/types'; import { CallbackType, Config, FRAuth, - FRStep, FRUser, + TokenManager, + UserManager, +} from '@forgerock/javascript-sdk'; +import { protect } from '@forgerock/protect'; + +import './style.css'; + +import type { + FRStep, NameCallback, PasswordCallback, PingOneProtectEvaluationCallback, PingOneProtectInitializeCallback, - TokenManager, - UserManager, } from '@forgerock/javascript-sdk'; +import type { Protect } from '@forgerock/protect/types'; const protectAPI: Protect = protect({ envId: '02fb4743-189a-4bc7-9d6c-a919edfe6447' }); const FATAL = 'Fatal'; diff --git a/e2e/protect-suites/playwright.config.ts b/e2e/protect-suites/playwright.config.ts index 01d088798c..38ccd60e98 100644 --- a/e2e/protect-suites/playwright.config.ts +++ b/e2e/protect-suites/playwright.config.ts @@ -1,6 +1,7 @@ -import { PlaywrightTestConfig } from '@playwright/test'; import { workspaceRoot } from '@nx/devkit'; +import type { PlaywrightTestConfig } from '@playwright/test'; + // For CI, you may want to set BASE_URL to the deployed application. const baseURL = process.env['BASE_URL'] || 'http://localhost:8443'; diff --git a/e2e/protect-suites/src/protect-native.test.ts b/e2e/protect-suites/src/protect-native.test.ts index 077117092b..663f376753 100644 --- a/e2e/protect-suites/src/protect-native.test.ts +++ b/e2e/protect-suites/src/protect-native.test.ts @@ -1,6 +1,6 @@ /* * - * Copyright © 2025 Ping Identity Corporation. All right reserved. + * Copyright (c) 2025 - 2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. @@ -8,6 +8,7 @@ */ import { expect, test } from '@playwright/test'; + import { password, username } from './utils/demo-user.js'; test.describe('Test basic login flow with Ping Protect', () => { diff --git a/eslint.config.mjs b/eslint.config.mjs index b38bd77ab9..cb35cc07ad 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -5,14 +5,15 @@ * of the MIT license. See the LICENSE file for details. */ import { FlatCompat } from '@eslint/eslintrc'; -import { dirname } from 'path'; -import { fileURLToPath } from 'url'; import js from '@eslint/js'; -import packageJson from 'eslint-plugin-package-json'; -import typescriptEslintEslintPlugin from '@typescript-eslint/eslint-plugin'; import nxEslintPlugin from '@nx/eslint-plugin'; -import eslintPluginImport from 'eslint-plugin-import'; +import typescriptEslintEslintPlugin from '@typescript-eslint/eslint-plugin'; import typescriptEslintParser from '@typescript-eslint/parser'; +import eslintPluginImport from 'eslint-plugin-import'; +import packageJson from 'eslint-plugin-package-json'; +import simpleImportSort from 'eslint-plugin-simple-import-sort'; +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; const compat = new FlatCompat({ baseDirectory: dirname(fileURLToPath(import.meta.url)), @@ -39,6 +40,39 @@ export default [ '@typescript-eslint': typescriptEslintEslintPlugin, '@nx': nxEslintPlugin, import: eslintPluginImport, + 'simple-import-sort': simpleImportSort, + }, + }, + { + rules: { + 'simple-import-sort/imports': [ + 'error', + { + groups: [ + // value imports from packages + ['^\\u0000[^.$]', '^[^.$]'], + // value imports from relative paths + ['^\\u0000\\.', '^\\.'], + // type-only imports from packages + ['^[^.$].*\\u0000$'], + // type-only imports from relative paths + ['^(\\.).*\\u0000$'], + ], + }, + ], + }, + }, + { + files: ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts'], + rules: { + '@typescript-eslint/consistent-type-imports': [ + 'error', + { + prefer: 'type-imports', + fixStyle: 'separate-type-imports', + }, + ], + 'import/consistent-type-specifier-style': ['error', 'prefer-top-level'], }, }, { diff --git a/package.json b/package.json index 276cd4db39..b5d8ceeac5 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,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", @@ -93,6 +93,7 @@ "eslint-plugin-package-json": "0.91.1", "eslint-plugin-playwright": "^2.0.0", "eslint-plugin-prettier": "^5.2.3", + "eslint-plugin-simple-import-sort": "^13.0.0", "fast-check": "^4.0.0", "jiti": "2.6.1", "jsdom": "27.4.0", diff --git a/packages/davinci-client/api-report/davinci-client.api.md b/packages/davinci-client/api-report/davinci-client.api.md index 5ba455b2a5..49c130e898 100644 --- a/packages/davinci-client/api-report/davinci-client.api.md +++ b/packages/davinci-client/api-report/davinci-client.api.md @@ -10,7 +10,7 @@ import type { AsyncLegacyConfigOptions } from '@forgerock/sdk-types'; import { CustomLogger } from '@forgerock/sdk-logger'; import { FetchBaseQueryError } from '@reduxjs/toolkit/query'; import type { FetchBaseQueryMeta } from '@reduxjs/toolkit/query'; -import { GenericError } from '@forgerock/sdk-types'; +import type { GenericError } from '@forgerock/sdk-types'; import { LogLevel } from '@forgerock/sdk-logger'; import type { MutationResultSelectorResult } from '@reduxjs/toolkit/query'; import { QueryStatus } from '@reduxjs/toolkit/query'; @@ -283,7 +283,7 @@ export function davinci(input: { resume: (input: { continueToken: string; }) => Promise; - start: (options?: StartOptions | undefined) => Promise; + start: (options?: StartOptions | undefined) => Promise; update: (collector: T) => Updater; validate: (collector: SingleValueCollectors | ObjectValueCollectors | MultiValueCollectors | AutoCollectors) => Validator; pollStatus: (collector: PollingCollector) => Poller; @@ -313,7 +313,7 @@ export function davinci(input: { getCollectors: () => Collectors[]; getError: () => DaVinciError | null; getErrorCollectors: () => CollectorErrors[]; - getNode: () => ContinueNode | ErrorNode | StartNode | SuccessNode | FailureNode; + getNode: () => ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode; getServer: () => { _links?: Links; id?: string; diff --git a/packages/davinci-client/api-report/davinci-client.types.api.md b/packages/davinci-client/api-report/davinci-client.types.api.md index 2cfcbab708..7e13070609 100644 --- a/packages/davinci-client/api-report/davinci-client.types.api.md +++ b/packages/davinci-client/api-report/davinci-client.types.api.md @@ -10,7 +10,7 @@ import type { AsyncLegacyConfigOptions } from '@forgerock/sdk-types'; import { CustomLogger } from '@forgerock/sdk-logger'; import { FetchBaseQueryError } from '@reduxjs/toolkit/query'; import type { FetchBaseQueryMeta } from '@reduxjs/toolkit/query'; -import { GenericError } from '@forgerock/sdk-types'; +import type { GenericError } from '@forgerock/sdk-types'; import { LogLevel } from '@forgerock/sdk-logger'; import type { MutationResultSelectorResult } from '@reduxjs/toolkit/query'; import { QueryStatus } from '@reduxjs/toolkit/query'; @@ -283,7 +283,7 @@ export function davinci(input: { resume: (input: { continueToken: string; }) => Promise; - start: (options?: StartOptions | undefined) => Promise; + start: (options?: StartOptions | undefined) => Promise; update: (collector: T) => Updater; validate: (collector: SingleValueCollectors | ObjectValueCollectors | MultiValueCollectors | AutoCollectors) => Validator; pollStatus: (collector: PollingCollector) => Poller; @@ -313,7 +313,7 @@ export function davinci(input: { getCollectors: () => Collectors[]; getError: () => DaVinciError | null; getErrorCollectors: () => CollectorErrors[]; - getNode: () => ContinueNode | ErrorNode | StartNode | SuccessNode | FailureNode; + getNode: () => ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode; getServer: () => { _links?: Links; id?: string; diff --git a/packages/davinci-client/src/lib/client.store.effects.test.ts b/packages/davinci-client/src/lib/client.store.effects.test.ts index 365118aac0..0714104d23 100644 --- a/packages/davinci-client/src/lib/client.store.effects.test.ts +++ b/packages/davinci-client/src/lib/client.store.effects.test.ts @@ -5,16 +5,17 @@ * of the MIT license. See the LICENSE file for details. */ +import { it } from '@effect/vitest'; import { Micro } from 'effect'; import { describe, expect, vi } from 'vitest'; -import { it } from '@effect/vitest'; import { buildChallengeEndpoint, - isChallengeStillPending, - interpretChallengeResponse, getPollingModeµ, + interpretChallengeResponse, + isChallengeStillPending, } from './client.store.effects.js'; + import type { PollDispatchResult } from './client.store.effects.js'; import type { PollingCollector } from './collector.types.js'; diff --git a/packages/davinci-client/src/lib/client.store.effects.ts b/packages/davinci-client/src/lib/client.store.effects.ts index 9923ea4b67..5828de19d7 100644 --- a/packages/davinci-client/src/lib/client.store.effects.ts +++ b/packages/davinci-client/src/lib/client.store.effects.ts @@ -6,19 +6,19 @@ */ import { Micro } from 'effect'; -import { SerializedError } from '@reduxjs/toolkit/react'; -import { FetchBaseQueryError } from '@reduxjs/toolkit/query/react'; + +import { createInternalError, isInternalError } from './client.store.utils.js'; +import { davinciApi } from './davinci.api.js'; +import { nodeSlice } from './node.slice.js'; import type { logger as loggerFn } from '@forgerock/sdk-logger'; +import type { FetchBaseQueryError } from '@reduxjs/toolkit/query/react'; +import type { SerializedError } from '@reduxjs/toolkit/react'; import type { ClientStore, RootState } from './client.store.utils.js'; -import type { PollingStatus, InternalErrorResponse } from './client.types.js'; +import type { InternalErrorResponse, PollingStatus } from './client.types.js'; import type { PollingCollector } from './collector.types.js'; -import { createInternalError, isInternalError } from './client.store.utils.js'; -import { davinciApi } from './davinci.api.js'; -import { nodeSlice } from './node.slice.js'; - /** * Shape returned by RTK Query's dispatch for the poll endpoint. */ diff --git a/packages/davinci-client/src/lib/client.store.test.ts b/packages/davinci-client/src/lib/client.store.test.ts index 8d4e647b1f..3021f7eb92 100644 --- a/packages/davinci-client/src/lib/client.store.test.ts +++ b/packages/davinci-client/src/lib/client.store.test.ts @@ -8,6 +8,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { davinci } from './client.store.js'; + import type { DaVinciConfig } from './config.types.js'; // --------------------------------------------------------------------------- diff --git a/packages/davinci-client/src/lib/client.store.ts b/packages/davinci-client/src/lib/client.store.ts index dc78d00ae0..5e0b9a8469 100644 --- a/packages/davinci-client/src/lib/client.store.ts +++ b/packages/davinci-client/src/lib/client.store.ts @@ -1,15 +1,16 @@ /* - * 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 { logger as loggerFn } from '@forgerock/sdk-logger'; +import { createWellknownError, isGenericError } from '@forgerock/sdk-utilities'; +import { createStorage } from '@forgerock/storage'; import { Micro } from 'effect'; import { exitIsFail, exitIsSuccess } from 'effect/Micro'; -import { type CustomLogger, logger as loggerFn, type LogLevel } from '@forgerock/sdk-logger'; -import { createStorage } from '@forgerock/storage'; -import { isGenericError, createWellknownError } from '@forgerock/sdk-utilities'; +import { getPollingModeµ, pollingµ } from './client.store.effects.js'; /** * Import RTK slices and api */ @@ -17,15 +18,35 @@ import { createClientStore, createInternalError, handleUpdateValidateError, - type RootState, } from './client.store.utils.js'; -import { pollingµ, getPollingModeµ } from './client.store.effects.js'; -import { nodeSlice } from './node.slice.js'; -import { davinciApi } from './davinci.api.js'; +import { returnValidator } from './collector.utils.js'; import { configSlice } from './config.slice.js'; +import { davinciApi } from './davinci.api.js'; +import { nodeSlice } from './node.slice.js'; +import { returnPasswordPolicyValidator } from './password-policy.rules.js'; import { wellknownApi } from './wellknown.api.js'; +import type { CustomLogger, LogLevel } from '@forgerock/sdk-logger'; import type { ActionTypes, RequestMiddleware } from '@forgerock/sdk-request-middleware'; + +import type { RootState } from './client.store.utils.js'; +import type { + CollectorValueTypes, + InitFlow, + InternalErrorResponse, + NodeStates, + Poller, + Updater, + Validator, +} from './client.types.js'; +import type { + AutoCollectors, + MultiSelectCollector, + MultiValueCollectors, + ObjectValueCollectors, + PollingCollector, + SingleValueCollectors, +} from './collector.types.js'; /** * Import the DaVinciRequest types */ @@ -36,25 +57,6 @@ import type { OutgoingQueryParams, StartOptions, } from './davinci.types.js'; -import type { - SingleValueCollectors, - MultiSelectCollector, - ObjectValueCollectors, - AutoCollectors, - PollingCollector, - MultiValueCollectors, -} from './collector.types.js'; -import type { - InitFlow, - InternalErrorResponse, - NodeStates, - Updater, - Validator, - Poller, - CollectorValueTypes, -} from './client.types.js'; -import { returnValidator } from './collector.utils.js'; -import { returnPasswordPolicyValidator } from './password-policy.rules.js'; import type { ContinueNode, StartNode } from './node.types.js'; /** diff --git a/packages/davinci-client/src/lib/client.store.utils.ts b/packages/davinci-client/src/lib/client.store.utils.ts index 32f265c45a..3b4c3ff2bb 100644 --- a/packages/davinci-client/src/lib/client.store.utils.ts +++ b/packages/davinci-client/src/lib/client.store.utils.ts @@ -1,23 +1,23 @@ /* - * 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 { configureStore } from '@reduxjs/toolkit'; -import type { ActionTypes, RequestMiddleware } from '@forgerock/sdk-request-middleware'; +import { configSlice } from './config.slice.js'; +import { davinciApi } from './davinci.api.js'; +import { nodeSlice } from './node.slice.js'; +import { wellknownApi } from './wellknown.api.js'; + import type { logger as loggerFn } from '@forgerock/sdk-logger'; +import type { ActionTypes, RequestMiddleware } from '@forgerock/sdk-request-middleware'; import type { GenericError } from '@forgerock/sdk-types'; -import type { ErrorNode, ContinueNode, StartNode, SuccessNode } from '../types.js'; +import type { ContinueNode, ErrorNode, StartNode, SuccessNode } from '../types.js'; import type { InternalErrorResponse } from './client.types.js'; -import { configSlice } from './config.slice.js'; -import { nodeSlice } from './node.slice.js'; -import { davinciApi } from './davinci.api.js'; -import { wellknownApi } from './wellknown.api.js'; - export function createClientStore({ requestMiddleware, logger, diff --git a/packages/davinci-client/src/lib/client.types.test-d.ts b/packages/davinci-client/src/lib/client.types.test-d.ts index aaafff1381..760ea029dd 100644 --- a/packages/davinci-client/src/lib/client.types.test-d.ts +++ b/packages/davinci-client/src/lib/client.types.test-d.ts @@ -1,5 +1,5 @@ /* - * 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. @@ -15,7 +15,7 @@ import type { InternalErrorResponse, Updater, } from './client.types.js'; -import type { ErrorNode, FailureNode, ContinueNode, StartNode, SuccessNode } from './node.types.js'; +import type { ContinueNode, ErrorNode, FailureNode, StartNode, SuccessNode } from './node.types.js'; describe('Client Types', () => { it('should allow function returning error', async () => { diff --git a/packages/davinci-client/src/lib/client.types.ts b/packages/davinci-client/src/lib/client.types.ts index 50125904a9..adb15de8df 100644 --- a/packages/davinci-client/src/lib/client.types.ts +++ b/packages/davinci-client/src/lib/client.types.ts @@ -1,5 +1,5 @@ /* - * 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. @@ -7,18 +7,18 @@ import type { GenericError } from '@forgerock/sdk-types'; import type { - FidoRegistrationInputValue, - FidoAuthenticationInputValue, - PhoneNumberInputValue, - PhoneNumberExtensionInputValue, AutoCollectors, + FidoAuthenticationInputValue, + FidoRegistrationInputValue, MultiValueCollectors, ObjectValueCollectors, - ValidatedTextCollector, + PhoneNumberExtensionInputValue, + PhoneNumberInputValue, ValidatedBooleanCollector, ValidatedPasswordCollector, + ValidatedTextCollector, } from './collector.types.js'; -import type { ErrorNode, FailureNode, ContinueNode, StartNode, SuccessNode } from './node.types.js'; +import type { ContinueNode, ErrorNode, FailureNode, StartNode, SuccessNode } from './node.types.js'; export type FlowNode = ContinueNode | ErrorNode | StartNode | SuccessNode | FailureNode; diff --git a/packages/davinci-client/src/lib/collector.types.test-d.ts b/packages/davinci-client/src/lib/collector.types.test-d.ts index 6c39def2b3..d7112aedc1 100644 --- a/packages/davinci-client/src/lib/collector.types.test-d.ts +++ b/packages/davinci-client/src/lib/collector.types.test-d.ts @@ -5,42 +5,43 @@ * of the MIT license. See the LICENSE file for details. */ import { describe, expectTypeOf, it } from 'vitest'; + import type { - SingleValueCollectorTypes, - SingleValueCollectorWithValue, - SingleValueCollectorNoValue, + ActionCollectorNoUrl, ActionCollectorTypes, ActionCollectorWithUrl, - ActionCollectorNoUrl, - TextCollector, - PasswordCollector, - ValidatedPasswordCollector, + CollectorRichContent, FlowCollector, IdpCollector, - SubmitCollector, - SingleSelectCollector, - MultiValueCollectorWithValue, - MultiSelectCollector, - InferSingleValueCollectorType, - InferMultiValueCollectorType, InferActionCollectorType, + InferMultiValueCollectorType, InferNoValueCollectorType, - ReadOnlyCollector, - RichTextCollector, - QrCodeCollector, + InferSingleValueCollectorType, + InferValueObjectCollectorType, + MultiSelectCollector, + MultiValueCollectorWithValue, + NoValueCollector, + ObjectValueCollectorWithObjectValue, + PasswordCollector, PhoneNumberCollector, PhoneNumberExtensionCollector, - ObjectValueCollectorWithObjectValue, - InferValueObjectCollectorType, - PhoneNumberInputValue, - PhoneNumberOutputValue, PhoneNumberExtensionInputValue, PhoneNumberExtensionOutputValue, + PhoneNumberInputValue, + PhoneNumberOutputValue, + QrCodeCollector, + ReadOnlyCollector, RichContentLink, - CollectorRichContent, - NoValueCollector, + RichTextCollector, + SingleSelectCollector, SingleSelectCollectorWithValue, + SingleValueCollectorNoValue, + SingleValueCollectorTypes, + SingleValueCollectorWithValue, + SubmitCollector, + TextCollector, ValidatedBooleanCollector, + ValidatedPasswordCollector, ValidatedTextCollector, } from './collector.types.js'; import type { PasswordPolicy } from './davinci.types.js'; diff --git a/packages/davinci-client/src/lib/collector.utils.test.ts b/packages/davinci-client/src/lib/collector.utils.test.ts index 7cb924e9cd..11fa159339 100644 --- a/packages/davinci-client/src/lib/collector.utils.test.ts +++ b/packages/davinci-client/src/lib/collector.utils.test.ts @@ -4,61 +4,63 @@ * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ -import { describe, it, expect } from 'vitest'; +import { describe, expect, it } from 'vitest'; + import { + normalizeReplacements, returnActionCollector, + returnBooleanCollector, returnFlowCollector, returnIdpCollector, - returnSubmitCollector, - returnSingleValueCollector, - returnPasswordCollector, - returnValidatedPasswordCollector, - returnTextCollector, - returnSingleSelectCollector, returnMultiSelectCollector, - returnValidator, - returnReadOnlyCollector, returnNoValueCollector, returnObjectSelectCollector, - returnObjectValueCollector, - returnSingleValueAutoCollector, returnObjectValueAutoCollector, + returnObjectValueCollector, + returnPasswordCollector, returnQrCodeCollector, - normalizeReplacements, - returnBooleanCollector, + returnReadOnlyCollector, + returnSingleSelectCollector, + returnSingleValueAutoCollector, + returnSingleValueCollector, + returnSubmitCollector, + returnTextCollector, returnValidatedBooleanCollector, + returnValidatedPasswordCollector, + returnValidator, } from './collector.utils.js'; import { returnPasswordPolicyValidator } from './password-policy.rules.js'; + +import type { + BooleanCollector, + MultiSelectCollector, + PhoneNumberCollector, + PhoneNumberExtensionCollector, + PhoneNumberExtensionOutputValue, + PhoneNumberOutputValue, + RichTextCollector, + ValidatedBooleanCollector, + ValidatedTextCollector, +} from './collector.types.js'; import type { + AgreementField, DaVinciField, DeviceAuthenticationField, DeviceRegistrationField, - PasswordField, FidoAuthenticationField, FidoRegistrationField, + PasswordField, PhoneNumberExtensionField, PhoneNumberField, + PollingField, ProtectField, QrCodeField, - PollingField, ReadOnlyField, RedirectField, RichContentReplacement, SingleCheckboxField, StandardField, - AgreementField, } from './davinci.types.js'; -import type { - BooleanCollector, - MultiSelectCollector, - PhoneNumberCollector, - PhoneNumberExtensionCollector, - PhoneNumberOutputValue, - PhoneNumberExtensionOutputValue, - RichTextCollector, - ValidatedBooleanCollector, - ValidatedTextCollector, -} from './collector.types.js'; describe('Action Collectors', () => { describe('returnFlowCollector', () => { diff --git a/packages/davinci-client/src/lib/collector.utils.ts b/packages/davinci-client/src/lib/collector.utils.ts index da8a4aa4a0..e185f2daa6 100644 --- a/packages/davinci-client/src/lib/collector.utils.ts +++ b/packages/davinci-client/src/lib/collector.utils.ts @@ -7,60 +7,60 @@ /** * Import the required types */ -import { CollectorValueType, Validator } from './client.types.js'; +import type { CollectorValueType, Validator } from './client.types.js'; import type { ActionCollectors, ActionCollectorTypes, - InferSingleValueCollectorType, - InferMultiValueCollectorType, - SingleValueCollectorTypes, - MultiValueCollectorTypes, + AutoCollectors, + BooleanCollector, InferActionCollectorType, - NoValueCollectorTypes, + InferAutoCollectorType, + InferMultiValueCollectorType, InferNoValueCollectorType, - ValidatedBooleanCollector, - ValidatedSingleValueCollectorWithValue, - ValidatedTextCollector, + InferSingleValueCollectorType, InferValueObjectCollectorType, - ObjectValueCollectorTypes, - UnknownCollector, - InferAutoCollectorType, - PhoneNumberOutputValue, MultiValueCollectors, - ObjectValueCollectors, - AutoCollectors, - SingleValueAutoCollectorTypes, + MultiValueCollectorTypes, + NoValueCollectorTypes, ObjectValueAutoCollectorTypes, + ObjectValueCollectors, + ObjectValueCollectorTypes, + PasswordCollector, + PhoneNumberExtensionOutputValue, + PhoneNumberOutputValue, QrCodeCollector, ReadOnlyCollector, - RichTextCollector, RichContentLink, - PhoneNumberExtensionOutputValue, - PasswordCollector, + RichTextCollector, + SingleValueAutoCollectorTypes, + SingleValueCollectorTypes, + UnknownCollector, + ValidatedBooleanCollector, ValidatedPasswordCollector, - BooleanCollector, + ValidatedSingleValueCollectorWithValue, + ValidatedTextCollector, } from './collector.types.js'; import type { + AgreementField, DeviceAuthenticationField, DeviceRegistrationField, FidoAuthenticationField, FidoRegistrationField, MultiSelectField, PasswordField, + PhoneNumberExtensionField, PhoneNumberField, + PollingField, ProtectField, QrCodeField, - PollingField, ReadOnlyField, + ReadOnlyFields, RedirectField, RichContentReplacement, SingleCheckboxField, SingleSelectField, StandardField, ValidatedField, - AgreementField, - ReadOnlyFields, - PhoneNumberExtensionField, } from './davinci.types.js'; /** diff --git a/packages/davinci-client/src/lib/config.slice.test.ts b/packages/davinci-client/src/lib/config.slice.test.ts index e3149453b9..5dda0d8588 100644 --- a/packages/davinci-client/src/lib/config.slice.test.ts +++ b/packages/davinci-client/src/lib/config.slice.test.ts @@ -1,10 +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 { describe, it, expect } from 'vitest'; +import { describe, expect, it } from 'vitest'; + import { configSlice } from './config.slice.js'; describe('The config slice reducers', () => { diff --git a/packages/davinci-client/src/lib/config.slice.ts b/packages/davinci-client/src/lib/config.slice.ts index 4f0c89c6f5..a7d9fba047 100644 --- a/packages/davinci-client/src/lib/config.slice.ts +++ b/packages/davinci-client/src/lib/config.slice.ts @@ -1,5 +1,5 @@ /* - * 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. @@ -8,13 +8,15 @@ * Import the createSlice and PayloadAction utilities from Redux Toolkit * @see https://redux-toolkit.js.org/api/createslice */ -import { createSlice, type PayloadAction } from '@reduxjs/toolkit'; +import { createSlice } from '@reduxjs/toolkit'; + +import type { PayloadAction } from '@reduxjs/toolkit'; /** * Import the types */ import type { InternalDaVinciConfig } from './config.types.js'; -import { Endpoints } from './wellknown.types.js'; +import type { Endpoints } from './wellknown.types.js'; /** * @const initialState - The initial state of the configuration slice diff --git a/packages/davinci-client/src/lib/config.types.test-d.ts b/packages/davinci-client/src/lib/config.types.test-d.ts index 6b5c1ba7d5..37e03af8ec 100644 --- a/packages/davinci-client/src/lib/config.types.test-d.ts +++ b/packages/davinci-client/src/lib/config.types.test-d.ts @@ -1,13 +1,15 @@ /* - * 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 { describe, expectTypeOf, it } from 'vitest'; -import type { DaVinciConfig, InternalDaVinciConfig } from './config.types.js'; + import type { AsyncLegacyConfigOptions, WellknownResponse } from '@forgerock/sdk-types'; +import type { DaVinciConfig, InternalDaVinciConfig } from './config.types.js'; + describe('Config Types', () => { describe('DaVinciConfig', () => { it('should extend AsyncLegacyConfigOptions', () => { diff --git a/packages/davinci-client/src/lib/davinci.api.ts b/packages/davinci-client/src/lib/davinci.api.ts index c8a1915dc4..72c12860d6 100644 --- a/packages/davinci-client/src/lib/davinci.api.ts +++ b/packages/davinci-client/src/lib/davinci.api.ts @@ -1,5 +1,5 @@ /* - * 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. @@ -8,26 +8,25 @@ * Import the RTK Query library from Redux Toolkit * @see https://redux-toolkit.js.org/rtk-query/overview */ -import { - createApi, - FetchArgs, - fetchBaseQuery, - FetchBaseQueryError, - FetchBaseQueryMeta, - QueryReturnValue, -} from '@reduxjs/toolkit/query'; - +import { createAuthorizeUrl } from '@forgerock/sdk-oidc'; /** * Import internal modules */ import { initQuery } from '@forgerock/sdk-request-middleware'; -import { createAuthorizeUrl } from '@forgerock/sdk-oidc'; +import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'; import { handleResponse, transformActionRequest, transformSubmitRequest } from './davinci.utils.js'; import type { logger as loggerFn } from '@forgerock/sdk-logger'; import type { ActionTypes, RequestMiddleware } from '@forgerock/sdk-request-middleware'; +import type { + FetchArgs, + FetchBaseQueryError, + FetchBaseQueryMeta, + QueryReturnValue, +} from '@reduxjs/toolkit/query'; +import type { StartNode } from '../types.js'; /** * Import the DaVinci types */ @@ -39,7 +38,6 @@ import type { ThrownQueryError, } from './davinci.types.js'; import type { ContinueNode } from './node.types.js'; -import type { StartNode } from '../types.js'; type BaseQueryResponse = Promise< QueryReturnValue diff --git a/packages/davinci-client/src/lib/davinci.utils.test.ts b/packages/davinci-client/src/lib/davinci.utils.test.ts index 094d4d945c..ee257250d8 100644 --- a/packages/davinci-client/src/lib/davinci.utils.test.ts +++ b/packages/davinci-client/src/lib/davinci.utils.test.ts @@ -1,21 +1,20 @@ /* - * 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 { describe, it, expect, vi } from 'vitest'; - import { logger } from '@forgerock/sdk-logger'; +import { describe, expect, it, vi } from 'vitest'; -import { handleResponse, transformSubmitRequest, transformActionRequest } from './davinci.utils.js'; - -import type { ContinueNode } from './node.types.d.ts'; -import { next0 } from './mock-data/davinci.next.mock.js'; -import { DaVinciCacheEntry } from './davinci.types.js'; +import { handleResponse, transformActionRequest, transformSubmitRequest } from './davinci.utils.js'; import { error0a, error3 } from './mock-data/davinci.error.mock.js'; +import { next0 } from './mock-data/davinci.next.mock.js'; import { success0 } from './mock-data/davinci.success.mock.js'; +import type { DaVinciCacheEntry } from './davinci.types.js'; +import type { ContinueNode } from './node.types.d.ts'; + describe('transformSubmitRequest', () => { it('should transform node state to DaVinciRequest for next request', () => { const node: ContinueNode = { diff --git a/packages/davinci-client/src/lib/davinci.utils.ts b/packages/davinci-client/src/lib/davinci.utils.ts index f3271d1017..3c9c037d30 100644 --- a/packages/davinci-client/src/lib/davinci.utils.ts +++ b/packages/davinci-client/src/lib/davinci.utils.ts @@ -1,5 +1,5 @@ /* - * 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. @@ -7,12 +7,17 @@ /** * Import the used types */ -import type { Dispatch } from '@reduxjs/toolkit'; - -import { logger as loggerFn } from '@forgerock/sdk-logger'; - import { nodeSlice } from './node.slice.js'; +import type { logger as loggerFn } from '@forgerock/sdk-logger'; +import type { Dispatch } from '@reduxjs/toolkit'; + +import type { + DeviceValue, + FidoAuthenticationInputValue, + FidoRegistrationInputValue, + PhoneNumberInputValue, +} from './collector.types.js'; import type { DaVinciCacheEntry, DavinciErrorResponse, @@ -22,12 +27,6 @@ import type { DaVinciSuccessResponse, } from './davinci.types.js'; import type { ContinueNode } from './node.types.js'; -import { - DeviceValue, - FidoAuthenticationInputValue, - FidoRegistrationInputValue, - PhoneNumberInputValue, -} from './collector.types.js'; /** * @function transformSubmitRequest - Transforms a NextNode into a DaVinciRequest for form submissions * @param {ContinueNode} node - The node to transform into a DaVinciRequest diff --git a/packages/davinci-client/src/lib/fido/fido.ts b/packages/davinci-client/src/lib/fido/fido.ts index a48a9f63f9..0b6ea07e1d 100644 --- a/packages/davinci-client/src/lib/fido/fido.ts +++ b/packages/davinci-client/src/lib/fido/fido.ts @@ -1,11 +1,12 @@ /* - * 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 { Micro } from 'effect'; import { exitIsFail, exitIsSuccess } from 'effect/Micro'; + import { transformAssertion, transformAuthenticationOptions, @@ -14,6 +15,7 @@ import { } from './fido.utils.js'; import type { GenericError } from '@forgerock/sdk-types'; + import type { FidoAuthenticationInputValue, FidoRegistrationInputValue, diff --git a/packages/davinci-client/src/lib/fido/fido.utils.test.ts b/packages/davinci-client/src/lib/fido/fido.utils.test.ts index 5470cfeff1..6255816c4a 100644 --- a/packages/davinci-client/src/lib/fido/fido.utils.test.ts +++ b/packages/davinci-client/src/lib/fido/fido.utils.test.ts @@ -1,10 +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 { describe, it, expect } from 'vitest'; +import { describe, expect, it } from 'vitest'; + import { transformAssertion, transformAuthenticationOptions, @@ -12,8 +13,8 @@ import { transformRegistrationOptions, } from './fido.utils'; -import type { FidoAuthenticationOptions, FidoRegistrationOptions } from '../davinci.types'; import type { FidoAuthenticationInputValue, FidoRegistrationInputValue } from '../collector.types'; +import type { FidoAuthenticationOptions, FidoRegistrationOptions } from '../davinci.types'; function base64ToArrayBuffer(base64: string): ArrayBuffer { const binaryString = atob(base64); diff --git a/packages/davinci-client/src/lib/node.reducer.test.ts b/packages/davinci-client/src/lib/node.reducer.test.ts index df9a71377c..0d08c102f4 100644 --- a/packages/davinci-client/src/lib/node.reducer.test.ts +++ b/packages/davinci-client/src/lib/node.reducer.test.ts @@ -4,17 +4,18 @@ * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ -import { describe, it, expect } from 'vitest'; +import { describe, expect, it } from 'vitest'; import { nodeCollectorReducer } from './node.reducer.js'; + import type { + BooleanCollector, DeviceAuthenticationCollector, DeviceRegistrationCollector, FidoAuthenticationCollector, FidoRegistrationCollector, MultiSelectCollector, PasswordCollector, - ValidatedPasswordCollector, PhoneNumberCollector, PhoneNumberExtensionCollector, PollingCollector, @@ -23,8 +24,8 @@ import type { ReadOnlyCollector, SubmitCollector, TextCollector, - BooleanCollector, ValidatedBooleanCollector, + ValidatedPasswordCollector, } from './collector.types.js'; import type { FidoAuthenticationOptions, FidoRegistrationOptions } from './davinci.types.js'; diff --git a/packages/davinci-client/src/lib/node.reducer.ts b/packages/davinci-client/src/lib/node.reducer.ts index 0348445eda..0b3fe4ead6 100644 --- a/packages/davinci-client/src/lib/node.reducer.ts +++ b/packages/davinci-client/src/lib/node.reducer.ts @@ -1,5 +1,5 @@ /* - * 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. @@ -14,29 +14,30 @@ import { createAction, createReducer } from '@reduxjs/toolkit'; */ import { returnActionCollector, + returnBooleanCollector, + returnFidoAuthenticationCollector, + returnFidoRegistrationCollector, returnFlowCollector, - returnPasswordCollector, - returnValidatedPasswordCollector, returnIdpCollector, - returnSubmitCollector, - returnTextCollector, - returnBooleanCollector, - returnValidatedBooleanCollector, - returnSingleSelectCollector, returnMultiSelectCollector, - returnReadOnlyCollector, returnObjectSelectCollector, returnObjectValueCollector, - returnProtectCollector, + returnPasswordCollector, returnPollingCollector, - returnUnknownCollector, - returnFidoRegistrationCollector, - returnFidoAuthenticationCollector, + returnProtectCollector, returnQrCodeCollector, + returnReadOnlyCollector, + returnSingleSelectCollector, + returnSubmitCollector, + returnTextCollector, + returnUnknownCollector, + returnValidatedBooleanCollector, + returnValidatedPasswordCollector, } from './collector.utils.js'; -import type { DaVinciField, UnknownField } from './davinci.types.js'; -import type { PhoneNumberOutputValue, PhoneNumberExtensionOutputValue } from './collector.types.js'; + import type { CollectorValueTypes } from './client.types.js'; +import type { PhoneNumberExtensionOutputValue, PhoneNumberOutputValue } from './collector.types.js'; +import type { DaVinciField, UnknownField } from './davinci.types.js'; import type { Collectors } from './node.types.js'; /** diff --git a/packages/davinci-client/src/lib/node.slice.test.ts b/packages/davinci-client/src/lib/node.slice.test.ts index 6156dd8aca..948034d52f 100644 --- a/packages/davinci-client/src/lib/node.slice.test.ts +++ b/packages/davinci-client/src/lib/node.slice.test.ts @@ -1,18 +1,19 @@ /* - * 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 { describe, it, expect } from 'vitest'; +import { describe, expect, it } from 'vitest'; -import { nodeSlice } from './node.slice.js'; +import { error0a, error2b, error3 } from './mock-data/davinci.error.mock.js'; import { next0 } from './mock-data/davinci.next.mock.js'; -import { nodeNext0 } from './mock-data/node.next.mock.js'; import { success0, success1 } from './mock-data/davinci.success.mock.js'; -import { nodeSuccess0, nodeSuccess1 } from './mock-data/node.success.mock.js'; -import { error0a, error2b, error3 } from './mock-data/davinci.error.mock.js'; +import { nodeNext0 } from './mock-data/node.next.mock.js'; import { continuePolling } from './mock-data/node.poll.mock.js'; +import { nodeSuccess0, nodeSuccess1 } from './mock-data/node.success.mock.js'; +import { nodeSlice } from './node.slice.js'; + import type { ContinueNode } from './node.types.js'; describe('The node slice reducers', () => { diff --git a/packages/davinci-client/src/lib/node.slice.ts b/packages/davinci-client/src/lib/node.slice.ts index 29d91342bd..2c599fc503 100644 --- a/packages/davinci-client/src/lib/node.slice.ts +++ b/packages/davinci-client/src/lib/node.slice.ts @@ -1,5 +1,5 @@ /* - * 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. @@ -12,7 +12,7 @@ import { createSlice } from '@reduxjs/toolkit'; /** * Import the needed reducers */ -import { nodeCollectorReducer, updateCollectorValues } from './node.reducer.js'; +import { nodeCollectorReducer } from './node.reducer.js'; import { getCollectorErrors } from './node.utils.js'; /** @@ -27,7 +27,8 @@ import type { DaVinciNextResponse, DaVinciSuccessResponse, } from './davinci.types.js'; -import type { ContinueNode, SuccessNode, ErrorNode, StartNode, FailureNode } from './node.types.js'; +import type { updateCollectorValues } from './node.reducer.js'; +import type { ContinueNode, ErrorNode, FailureNode, StartNode, SuccessNode } from './node.types.js'; /** * The possible statuses for the four types of nodes diff --git a/packages/davinci-client/src/lib/node.types.test-d.ts b/packages/davinci-client/src/lib/node.types.test-d.ts index 78e3b2e006..23600ae6c1 100644 --- a/packages/davinci-client/src/lib/node.types.test-d.ts +++ b/packages/davinci-client/src/lib/node.types.test-d.ts @@ -1,48 +1,49 @@ /* - * 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. */ /* eslint-disable @typescript-eslint/no-unused-vars */ import { describe, expectTypeOf, it } from 'vitest'; -import type { - DaVinciError, - Collectors, - ContinueNode, - ErrorNode, - FailureNode, - StartNode, - SuccessNode, -} from './node.types.js'; -import type { ErrorDetail, Links } from './davinci.types.js'; + import type { ActionCollector, + BooleanCollector, + DeviceAuthenticationCollector, + DeviceRegistrationCollector, + FidoAuthenticationCollector, + FidoRegistrationCollector, FlowCollector, + IdpCollector, MultiSelectCollector, PasswordCollector, - ValidatedPasswordCollector, + PhoneNumberCollector, + PhoneNumberExtensionCollector, + PollingCollector, + ProtectCollector, + QrCodeCollector, ReadOnlyCollector, RichTextCollector, - BooleanCollector, - ValidatedBooleanCollector, SingleSelectCollector, SingleValueCollector, - IdpCollector, SubmitCollector, TextCollector, - ValidatedTextCollector, - DeviceRegistrationCollector, - DeviceAuthenticationCollector, - PhoneNumberCollector, - PhoneNumberExtensionCollector, UnknownCollector, - ProtectCollector, - PollingCollector, - FidoRegistrationCollector, - FidoAuthenticationCollector, - QrCodeCollector, + ValidatedBooleanCollector, + ValidatedPasswordCollector, + ValidatedTextCollector, } from './collector.types.js'; +import type { ErrorDetail, Links } from './davinci.types.js'; +import type { + Collectors, + ContinueNode, + DaVinciError, + ErrorNode, + FailureNode, + StartNode, + SuccessNode, +} from './node.types.js'; // ErrorDetail and Links are used as part of the DaVinciError and server._links types respectively describe('Node Types', () => { diff --git a/packages/davinci-client/src/lib/node.types.ts b/packages/davinci-client/src/lib/node.types.ts index 61adfefbe0..a45451b088 100644 --- a/packages/davinci-client/src/lib/node.types.ts +++ b/packages/davinci-client/src/lib/node.types.ts @@ -1,37 +1,37 @@ /* - * 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 { GenericError } from '@forgerock/sdk-types'; +import type { GenericError } from '@forgerock/sdk-types'; import type { - FlowCollector, - PasswordCollector, - ValidatedPasswordCollector, - TextCollector, - IdpCollector, - SubmitCollector, ActionCollector, BooleanCollector, - ValidatedBooleanCollector, - SingleValueCollector, - SingleSelectCollector, - MultiSelectCollector, DeviceAuthenticationCollector, DeviceRegistrationCollector, - ReadOnlyCollector, - RichTextCollector, - ValidatedTextCollector, + FidoAuthenticationCollector, + FidoRegistrationCollector, + FlowCollector, + IdpCollector, + MultiSelectCollector, + PasswordCollector, PhoneNumberCollector, - ProtectCollector, + PhoneNumberExtensionCollector, PollingCollector, - UnknownCollector, - FidoRegistrationCollector, - FidoAuthenticationCollector, + ProtectCollector, QrCodeCollector, - PhoneNumberExtensionCollector, + ReadOnlyCollector, + RichTextCollector, + SingleSelectCollector, + SingleValueCollector, + SubmitCollector, + TextCollector, + UnknownCollector, + ValidatedBooleanCollector, + ValidatedPasswordCollector, + ValidatedTextCollector, } from './collector.types.js'; import type { Links } from './davinci.types.js'; diff --git a/packages/davinci-client/src/lib/node.utils.test.ts b/packages/davinci-client/src/lib/node.utils.test.ts index 7dd403f593..44a569cdae 100644 --- a/packages/davinci-client/src/lib/node.utils.test.ts +++ b/packages/davinci-client/src/lib/node.utils.test.ts @@ -1,10 +1,10 @@ /* - * 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 { describe, it, expect } from 'vitest'; +import { describe, expect, it } from 'vitest'; import { error0a, error1a, error1b, error1c, error1f } from './mock-data/davinci.error.mock.js'; import { getCollectorErrors } from './node.utils.js'; diff --git a/packages/davinci-client/src/lib/node.utils.ts b/packages/davinci-client/src/lib/node.utils.ts index 4eee644f1a..a597e02e9b 100644 --- a/packages/davinci-client/src/lib/node.utils.ts +++ b/packages/davinci-client/src/lib/node.utils.ts @@ -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 { DavinciErrorResponse } from './davinci.types.js'; -import { CollectorErrors } from './node.types.js'; +import type { DavinciErrorResponse } from './davinci.types.js'; +import type { CollectorErrors } from './node.types.js'; export function getCollectorErrors(error: DavinciErrorResponse) { const details = error.details; diff --git a/packages/davinci-client/src/lib/password-policy.rules.ts b/packages/davinci-client/src/lib/password-policy.rules.ts index 2d6f517fe5..07dfd6f348 100644 --- a/packages/davinci-client/src/lib/password-policy.rules.ts +++ b/packages/davinci-client/src/lib/password-policy.rules.ts @@ -1,14 +1,14 @@ /* - * 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 { Array as Arr, Option, pipe } from 'effect'; +import type { Validator } from './client.types.js'; import type { ValidatedPasswordCollector } from './collector.types.js'; import type { PasswordPolicy } from './davinci.types.js'; -import { Validator } from './client.types.js'; /** * A single policy check: given the policy and a candidate value, produce zero or more diff --git a/packages/davinci-client/src/lib/wellknown.api.ts b/packages/davinci-client/src/lib/wellknown.api.ts index 251d24a04d..882a66bcc3 100644 --- a/packages/davinci-client/src/lib/wellknown.api.ts +++ b/packages/davinci-client/src/lib/wellknown.api.ts @@ -1,13 +1,13 @@ /* - * 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 { initWellknownQuery } from '@forgerock/sdk-oidc'; import { createSelector } from '@reduxjs/toolkit'; import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'; -import { initWellknownQuery } from '@forgerock/sdk-oidc'; import type { WellknownResponse } from '@forgerock/sdk-types'; import type { diff --git a/packages/davinci-client/src/types.test-d.ts b/packages/davinci-client/src/types.test-d.ts index 8cf841a0ea..bd408e56f1 100644 --- a/packages/davinci-client/src/types.test-d.ts +++ b/packages/davinci-client/src/types.test-d.ts @@ -1,28 +1,29 @@ /* - * 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. */ /* eslint-disable @typescript-eslint/no-unused-vars */ import { describe, expectTypeOf, it } from 'vitest'; + +import type { NodeStates } from './lib/client.types.js'; +import type { DaVinciError } from './lib/node.types.js'; +import type * as Types from './types.js'; import type { - StartNode, + ActionCollector, ContinueNode, ErrorNode, - SuccessNode, FailureNode, - ActionCollector, - SingleValueCollector, FlowCollector, - PasswordCollector, - TextCollector, IdpCollector, + PasswordCollector, + SingleValueCollector, + StartNode, SubmitCollector, + SuccessNode, + TextCollector, } from './types.js'; -import type * as Types from './types.js'; -import { DaVinciError } from './lib/node.types.js'; -import { NodeStates } from './lib/client.types.js'; describe('Type exports', () => { it('should validate all types are exported', () => { diff --git a/packages/davinci-client/src/types.ts b/packages/davinci-client/src/types.ts index eef29fda63..0fb46dac72 100644 --- a/packages/davinci-client/src/types.ts +++ b/packages/davinci-client/src/types.ts @@ -1,4 +1,4 @@ -/* 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. @@ -36,17 +36,25 @@ export { // Re-export the davinci function so DavinciClient type alias can be resolved export { davinci } from './lib/client.store.js'; -import { davinci } from './lib/client.store.js'; +import type { davinci } from './lib/client.store.js'; export type DavinciClient = Awaited>; +import type { + ContinueNode, + ErrorNode, + FailureNode, + StartNode, + SuccessNode, +} from './lib/node.types.js'; + /** * The client property of any node state. * Represents the parsed client-facing state from a DaVinci flow node. */ export type GetClient = - | import('./lib/node.types.js').StartNode['client'] - | import('./lib/node.types.js').ContinueNode['client'] - | import('./lib/node.types.js').ErrorNode['client'] - | import('./lib/node.types.js').SuccessNode['client'] - | import('./lib/node.types.js').FailureNode['client']; + | StartNode['client'] + | ContinueNode['client'] + | ErrorNode['client'] + | SuccessNode['client'] + | FailureNode['client']; diff --git a/packages/device-client/src/lib/device.store.test.ts b/packages/device-client/src/lib/device.store.test.ts index 4e006874d1..d3b756bafd 100644 --- a/packages/device-client/src/lib/device.store.test.ts +++ b/packages/device-client/src/lib/device.store.test.ts @@ -1,21 +1,21 @@ // @vitest-environment node /* - * 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 { afterEach, afterAll, beforeAll, describe, expect, it } from 'vitest'; import { setupServer } from 'msw/node'; +import { afterAll, afterEach, beforeAll, describe, expect, it } from 'vitest'; + import { deviceClient } from './device.store.js'; import { handlers } from './device.store.test.utils.js'; - import { - MOCK_PUSH_DEVICES, MOCK_BINDING_DEVICES, + MOCK_DEVICE_PROFILE_SUCCESS, MOCK_OATH_DEVICES, + MOCK_PUSH_DEVICES, MOCK_WEBAUTHN_DEVICES, - MOCK_DEVICE_PROFILE_SUCCESS, } from './mock-data/device.store.mock.js'; export const server = setupServer(...handlers); diff --git a/packages/device-client/src/lib/device.store.test.utils.ts b/packages/device-client/src/lib/device.store.test.utils.ts index 32e9c3a08a..aeb20522c6 100644 --- a/packages/device-client/src/lib/device.store.test.utils.ts +++ b/packages/device-client/src/lib/device.store.test.utils.ts @@ -1,5 +1,5 @@ /* - * 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. @@ -8,12 +8,12 @@ import { http, HttpResponse } from 'msw'; import { - MOCK_PUSH_DEVICES, MOCK_BINDING_DEVICES, - MOCK_OATH_DEVICES, MOCK_DELETED_OATH_DEVICE, - MOCK_WEBAUTHN_DEVICES, MOCK_DEVICE_PROFILE_SUCCESS, + MOCK_OATH_DEVICES, + MOCK_PUSH_DEVICES, + MOCK_WEBAUTHN_DEVICES, } from './mock-data/device.store.mock.js'; // Create mock service worker handlers diff --git a/packages/device-client/src/lib/device.store.ts b/packages/device-client/src/lib/device.store.ts index 8b18f5ac6f..11b2c284e6 100644 --- a/packages/device-client/src/lib/device.store.ts +++ b/packages/device-client/src/lib/device.store.ts @@ -1,26 +1,29 @@ /* - * 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 { type ConfigOptions } from '@forgerock/javascript-sdk'; import { configureStore } from '@reduxjs/toolkit'; + +import { handleError } from './device.store.utils.js'; import { deviceService } from './services/index.js'; + +import type { ConfigOptions } from '@forgerock/javascript-sdk'; + +import type { BoundDeviceQuery, Device, GetBoundDevicesQuery } from './types/bound-device.types.js'; import type { OathDevice, RetrieveOathQuery } from './types/oath.types.js'; +import type { + GetProfileDevices, + ProfileDevice, + ProfileDevicesQuery, +} from './types/profile-device.types.js'; import type { DeleteDeviceQuery, PushDevice, PushDeviceQuery } from './types/push-device.types.js'; import type { UpdatedWebAuthnDevice, WebAuthnDevice, WebAuthnQuery, } from './types/webauthn.types.js'; -import type { BoundDeviceQuery, Device, GetBoundDevicesQuery } from './types/bound-device.types.js'; -import type { - GetProfileDevices, - ProfileDevice, - ProfileDevicesQuery, -} from './types/profile-device.types.js'; -import { handleError } from './device.store.utils.js'; /** * @function deviceClient diff --git a/packages/device-client/src/lib/device.store.utils.ts b/packages/device-client/src/lib/device.store.utils.ts index 7e62f5e0c2..402a503da2 100644 --- a/packages/device-client/src/lib/device.store.utils.ts +++ b/packages/device-client/src/lib/device.store.utils.ts @@ -1,5 +1,10 @@ -import { SerializedError } from '@reduxjs/toolkit'; -import { FetchBaseQueryError } from '@reduxjs/toolkit/query'; +/* + * 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 type { FetchBaseQueryError } from '@reduxjs/toolkit/query'; export function handleError(error: FetchBaseQueryError | SerializedError, message?: string) { /** diff --git a/packages/device-client/src/lib/mock-data/device.store.mock.ts b/packages/device-client/src/lib/mock-data/device.store.mock.ts index 3c53c7bfd8..fee186559a 100644 --- a/packages/device-client/src/lib/mock-data/device.store.mock.ts +++ b/packages/device-client/src/lib/mock-data/device.store.mock.ts @@ -1,14 +1,14 @@ /* - * 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 { GeneralResponse } from '../services/index.js'; +import type { GeneralResponse } from '../services/index.js'; import type { - OathResponse, DeletedOathDevice, DeviceResponse, + OathResponse, ProfileDevice, PushDevice, WebAuthnDevice, diff --git a/packages/device-client/src/lib/services/index.ts b/packages/device-client/src/lib/services/index.ts index fd7be4981d..1907f3e6ea 100644 --- a/packages/device-client/src/lib/services/index.ts +++ b/packages/device-client/src/lib/services/index.ts @@ -1,30 +1,38 @@ /* - * 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 { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'; -import { + +import type { + BoundDeviceQuery, + Device, + GetBoundDevicesQuery, +} from '../types/bound-device.types.js'; +import type { DeletedOathDevice, OathDevice, OathResponse, RetrieveOathQuery, } from '../types/oath.types.js'; -import { +import type { + GetProfileDevices, + ProfileDevice, + ProfileDevicesQuery, +} from '../types/profile-device.types.js'; +import type { DeleteDeviceQuery, DeletedPushDevice, PushDevice, PushDeviceQuery, } from '../types/push-device.types.js'; -import { BoundDeviceQuery, Device, GetBoundDevicesQuery } from '../types/bound-device.types.js'; - -import { UpdatedWebAuthnDevice, WebAuthnDevice, WebAuthnQuery } from '../types/webauthn.types.js'; -import { - ProfileDevice, - GetProfileDevices, - ProfileDevicesQuery, -} from '../types/profile-device.types.js'; +import type { + UpdatedWebAuthnDevice, + WebAuthnDevice, + WebAuthnQuery, +} from '../types/webauthn.types.js'; export interface GeneralResponse { pagedResultsCookie: string | null; diff --git a/packages/device-client/src/lib/types/index.ts b/packages/device-client/src/lib/types/index.ts index 884c2a1d05..5cfa940144 100644 --- a/packages/device-client/src/lib/types/index.ts +++ b/packages/device-client/src/lib/types/index.ts @@ -1,10 +1,10 @@ /* - * 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 { deviceClient } from '../device.store.js'; +import type { deviceClient } from '../device.store.js'; export type DeviceClient = ReturnType; diff --git a/packages/journey-client/eslint.config.mjs b/packages/journey-client/eslint.config.mjs index 68e527a4f2..2ec9a19efb 100644 --- a/packages/journey-client/eslint.config.mjs +++ b/packages/journey-client/eslint.config.mjs @@ -9,6 +9,7 @@ export default [ 'warn', { ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs,ts,cts,mts}'], + ignoredDependencies: ['vitest', 'vitest-canvas-mock'], }, ], }, diff --git a/packages/journey-client/src/__tests__/types-reexport.typecheck.ts b/packages/journey-client/src/__tests__/types-reexport.typecheck.ts index 136becfe45..1bcc8b36a0 100644 --- a/packages/journey-client/src/__tests__/types-reexport.typecheck.ts +++ b/packages/journey-client/src/__tests__/types-reexport.typecheck.ts @@ -1,30 +1,36 @@ +/* + * 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. + */ /** * Verifies consumer-facing types are re-exported from @forgerock/journey-client/types. * Checked by tsc --noEmit, not executed at runtime. */ +// PolicyKey is a value (enum), verify it is available from main index +import { PolicyKey } from '../index.js'; + import type { - // Already re-exported (regression guard) - Step, + ActionTypes, + AuthResponse, Callback, CallbackType, - StepType, - GenericError, - PolicyRequirement, + CustomLogger, FailedPolicyRequirement, + FailureDetail, + GenericError, LogLevel, - CustomLogger, - RequestMiddleware, - ActionTypes, // These should be re-exported but are not yet NameValue, + PolicyRequirement, + RequestMiddleware, + // Already re-exported (regression guard) + Step, StepDetail, - AuthResponse, - FailureDetail, + StepType, } from '../types.js'; -// PolicyKey is a value (enum), verify it is available from main index -import { PolicyKey } from '../index.js'; - // eslint-disable-next-line @typescript-eslint/no-unused-vars type _TypeAssert = [ Step, diff --git a/packages/journey-client/src/lib/callbacks/attribute-input-callback.test.ts b/packages/journey-client/src/lib/callbacks/attribute-input-callback.test.ts index d39f203cb5..d9d2794be7 100644 --- a/packages/journey-client/src/lib/callbacks/attribute-input-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/attribute-input-callback.test.ts @@ -3,17 +3,17 @@ * * attribute-input-callback.test.ts * - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 { callbackType } from '@forgerock/sdk-types'; -import type { Callback } from '@forgerock/sdk-types'; - import { AttributeInputCallback } from './attribute-input-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('AttributeInputCallback', () => { const payload: Callback = { _id: 0, diff --git a/packages/journey-client/src/lib/callbacks/attribute-input-callback.ts b/packages/journey-client/src/lib/callbacks/attribute-input-callback.ts index 9977b1d9f8..0692e874eb 100644 --- a/packages/journey-client/src/lib/callbacks/attribute-input-callback.ts +++ b/packages/journey-client/src/lib/callbacks/attribute-input-callback.ts @@ -1,14 +1,14 @@ /* - * 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 type { Callback, PolicyRequirement } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback, PolicyRequirement } from '@forgerock/sdk-types'; + /** * Represents a callback used to collect attributes. * diff --git a/packages/journey-client/src/lib/callbacks/base-callback.test.ts b/packages/journey-client/src/lib/callbacks/base-callback.test.ts index 35a0da5cb3..95dbd691c5 100644 --- a/packages/journey-client/src/lib/callbacks/base-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/base-callback.test.ts @@ -3,17 +3,17 @@ * * fr-auth-callback.test.ts * - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 { callbackType } from '@forgerock/sdk-types'; -import type { Callback } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('BaseCallback', () => { it('reads/writes basic properties', () => { const payload: Callback = { diff --git a/packages/journey-client/src/lib/callbacks/base-callback.ts b/packages/journey-client/src/lib/callbacks/base-callback.ts index 16eb5fc168..f0f4fdf3e0 100644 --- a/packages/journey-client/src/lib/callbacks/base-callback.ts +++ b/packages/journey-client/src/lib/callbacks/base-callback.ts @@ -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 type { CallbackType, Callback, NameValue } from '@forgerock/sdk-types'; +import type { Callback, CallbackType, NameValue } from '@forgerock/sdk-types'; /** * Base class for authentication tree callback wrappers. diff --git a/packages/journey-client/src/lib/callbacks/choice-callback.test.ts b/packages/journey-client/src/lib/callbacks/choice-callback.test.ts index 89397b0171..b39500086d 100644 --- a/packages/journey-client/src/lib/callbacks/choice-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/choice-callback.test.ts @@ -1,17 +1,17 @@ /* - * 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 { callbackType } from '@forgerock/sdk-types'; -import { describe, it, expect } from 'vitest'; - -import type { Callback } from '@forgerock/sdk-types'; +import { describe, expect, it } from 'vitest'; import { ChoiceCallback } from './choice-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('ChoiceCallback', () => { const payload: Callback = { type: callbackType.ChoiceCallback, diff --git a/packages/journey-client/src/lib/callbacks/choice-callback.ts b/packages/journey-client/src/lib/callbacks/choice-callback.ts index 2769f6fcec..80c4796ce7 100644 --- a/packages/journey-client/src/lib/callbacks/choice-callback.ts +++ b/packages/journey-client/src/lib/callbacks/choice-callback.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 type { Callback } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + /** * Represents a callback used to collect an answer to a choice. */ diff --git a/packages/journey-client/src/lib/callbacks/confirmation-callback.test.ts b/packages/journey-client/src/lib/callbacks/confirmation-callback.test.ts index b93df5ac8f..81676a8a59 100644 --- a/packages/journey-client/src/lib/callbacks/confirmation-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/confirmation-callback.test.ts @@ -1,17 +1,17 @@ /* - * 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 { callbackType } from '@forgerock/sdk-types'; -import { describe, it, expect } from 'vitest'; - -import type { Callback } from '@forgerock/sdk-types'; +import { describe, expect, it } from 'vitest'; import { ConfirmationCallback } from './confirmation-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('ConfirmationCallback', () => { const payload: Callback = { type: callbackType.ConfirmationCallback, diff --git a/packages/journey-client/src/lib/callbacks/confirmation-callback.ts b/packages/journey-client/src/lib/callbacks/confirmation-callback.ts index baeadfb078..e10d0bc8f1 100644 --- a/packages/journey-client/src/lib/callbacks/confirmation-callback.ts +++ b/packages/journey-client/src/lib/callbacks/confirmation-callback.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 type { Callback } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + /** * Represents a callback used to collect a confirmation to a message. */ diff --git a/packages/journey-client/src/lib/callbacks/device-profile-callback.test.ts b/packages/journey-client/src/lib/callbacks/device-profile-callback.test.ts index 3792447ec8..0acebe7052 100644 --- a/packages/journey-client/src/lib/callbacks/device-profile-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/device-profile-callback.test.ts @@ -1,17 +1,17 @@ /* - * 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 { callbackType } from '@forgerock/sdk-types'; -import { describe, it, expect } from 'vitest'; - -import type { Callback } from '@forgerock/sdk-types'; +import { describe, expect, it } from 'vitest'; import { DeviceProfileCallback } from './device-profile-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('DeviceProfileCallback', () => { const payload: Callback = { type: callbackType.DeviceProfileCallback, diff --git a/packages/journey-client/src/lib/callbacks/device-profile-callback.ts b/packages/journey-client/src/lib/callbacks/device-profile-callback.ts index 78beeb1a19..ffc7ecd11c 100644 --- a/packages/journey-client/src/lib/callbacks/device-profile-callback.ts +++ b/packages/journey-client/src/lib/callbacks/device-profile-callback.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 type { Callback } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + import type { DeviceProfileData } from '../device/interfaces.js'; /** diff --git a/packages/journey-client/src/lib/callbacks/factory.test.ts b/packages/journey-client/src/lib/callbacks/factory.test.ts index ee178e5264..0b5c72c37b 100644 --- a/packages/journey-client/src/lib/callbacks/factory.test.ts +++ b/packages/journey-client/src/lib/callbacks/factory.test.ts @@ -1,23 +1,20 @@ /* - * 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 { callbackType } from '@forgerock/sdk-types'; -import { describe, it, expect } from 'vitest'; - -import type { Callback } from '@forgerock/sdk-types'; - -import { createCallback } from './factory.js'; -import { BaseCallback } from './base-callback.js'; +import { describe, expect, it } from 'vitest'; // Import all callback classes to check against import { AttributeInputCallback } from './attribute-input-callback.js'; +import { BaseCallback } from './base-callback.js'; import { ChoiceCallback } from './choice-callback.js'; import { ConfirmationCallback } from './confirmation-callback.js'; import { DeviceProfileCallback } from './device-profile-callback.js'; +import { createCallback } from './factory.js'; import { HiddenValueCallback } from './hidden-value-callback.js'; import { KbaCreateCallback } from './kba-create-callback.js'; import { MetadataCallback } from './metadata-callback.js'; @@ -37,6 +34,8 @@ import { TextOutputCallback } from './text-output-callback.js'; import { ValidatedCreatePasswordCallback } from './validated-create-password-callback.js'; import { ValidatedCreateUsernameCallback } from './validated-create-username-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('Callback Factory', () => { const testCases = [ { type: callbackType.BooleanAttributeInputCallback, class: AttributeInputCallback }, diff --git a/packages/journey-client/src/lib/callbacks/factory.ts b/packages/journey-client/src/lib/callbacks/factory.ts index 9eaae7d039..f0ebdeec78 100644 --- a/packages/journey-client/src/lib/callbacks/factory.ts +++ b/packages/journey-client/src/lib/callbacks/factory.ts @@ -1,5 +1,5 @@ /* - * 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. @@ -7,11 +7,8 @@ import { callbackType } from '@forgerock/sdk-types'; -import type { Callback } from '@forgerock/sdk-types'; - -import { BaseCallback } from './base-callback.js'; - import { AttributeInputCallback } from './attribute-input-callback.js'; +import { BaseCallback } from './base-callback.js'; import { ChoiceCallback } from './choice-callback.js'; import { ConfirmationCallback } from './confirmation-callback.js'; import { DeviceProfileCallback } from './device-profile-callback.js'; @@ -34,6 +31,8 @@ import { TextOutputCallback } from './text-output-callback.js'; import { ValidatedCreatePasswordCallback } from './validated-create-password-callback.js'; import { ValidatedCreateUsernameCallback } from './validated-create-username-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + export type CallbackFactory = (callback: Callback) => BaseCallback; /** diff --git a/packages/journey-client/src/lib/callbacks/hidden-value-callback.test.ts b/packages/journey-client/src/lib/callbacks/hidden-value-callback.test.ts index 199a55d4e4..6c6e1159e4 100644 --- a/packages/journey-client/src/lib/callbacks/hidden-value-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/hidden-value-callback.test.ts @@ -1,17 +1,17 @@ /* - * 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 { callbackType } from '@forgerock/sdk-types'; -import { describe, it, expect } from 'vitest'; - -import type { Callback } from '@forgerock/sdk-types'; +import { describe, expect, it } from 'vitest'; import { HiddenValueCallback } from './hidden-value-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('HiddenValueCallback', () => { it('should instantiate correctly', () => { const payload: Callback = { diff --git a/packages/journey-client/src/lib/callbacks/hidden-value-callback.ts b/packages/journey-client/src/lib/callbacks/hidden-value-callback.ts index deaa2fb7f8..9650a71f35 100644 --- a/packages/journey-client/src/lib/callbacks/hidden-value-callback.ts +++ b/packages/journey-client/src/lib/callbacks/hidden-value-callback.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 type { Callback } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + /** * Represents a callback used to collect information indirectly from the user. */ diff --git a/packages/journey-client/src/lib/callbacks/kba-create-callback.test.ts b/packages/journey-client/src/lib/callbacks/kba-create-callback.test.ts index 3ac9b45e1c..88a44d3ee2 100644 --- a/packages/journey-client/src/lib/callbacks/kba-create-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/kba-create-callback.test.ts @@ -1,17 +1,17 @@ /* - * 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 { callbackType } from '@forgerock/sdk-types'; -import { describe, it, expect } from 'vitest'; - -import type { Callback } from '@forgerock/sdk-types'; +import { describe, expect, it } from 'vitest'; import { KbaCreateCallback } from './kba-create-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('KbaCreateCallback', () => { const payload: Callback = { type: callbackType.KbaCreateCallback, diff --git a/packages/journey-client/src/lib/callbacks/kba-create-callback.ts b/packages/journey-client/src/lib/callbacks/kba-create-callback.ts index d98d34302f..980bbcb6d8 100644 --- a/packages/journey-client/src/lib/callbacks/kba-create-callback.ts +++ b/packages/journey-client/src/lib/callbacks/kba-create-callback.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 type { Callback } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + /** * Represents a callback used to collect KBA-style security questions and answers. */ diff --git a/packages/journey-client/src/lib/callbacks/metadata-callback.test.ts b/packages/journey-client/src/lib/callbacks/metadata-callback.test.ts index 18932508a5..533de8c012 100644 --- a/packages/journey-client/src/lib/callbacks/metadata-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/metadata-callback.test.ts @@ -1,17 +1,17 @@ /* - * 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 { callbackType } from '@forgerock/sdk-types'; -import { describe, it, expect } from 'vitest'; - -import type { Callback } from '@forgerock/sdk-types'; +import { describe, expect, it } from 'vitest'; import { MetadataCallback } from './metadata-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('MetadataCallback', () => { it('should allow getting the data', () => { const mockData = { foo: 'bar', baz: 123 }; diff --git a/packages/journey-client/src/lib/callbacks/metadata-callback.ts b/packages/journey-client/src/lib/callbacks/metadata-callback.ts index 55abdc7360..d7c65765b5 100644 --- a/packages/journey-client/src/lib/callbacks/metadata-callback.ts +++ b/packages/journey-client/src/lib/callbacks/metadata-callback.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 type { Callback } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + /** * Represents a callback used to deliver and collect miscellaneous data. */ diff --git a/packages/journey-client/src/lib/callbacks/name-callback.test.ts b/packages/journey-client/src/lib/callbacks/name-callback.test.ts index 5c9dbe2e12..15f10631f3 100644 --- a/packages/journey-client/src/lib/callbacks/name-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/name-callback.test.ts @@ -1,17 +1,17 @@ /* - * 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 { callbackType } from '@forgerock/sdk-types'; -import { describe, it, expect } from 'vitest'; - -import type { Callback } from '@forgerock/sdk-types'; +import { describe, expect, it } from 'vitest'; import { NameCallback } from './name-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('NameCallback', () => { const payload: Callback = { type: callbackType.NameCallback, diff --git a/packages/journey-client/src/lib/callbacks/name-callback.ts b/packages/journey-client/src/lib/callbacks/name-callback.ts index dd8e5a36ad..4eecf0d1a5 100644 --- a/packages/journey-client/src/lib/callbacks/name-callback.ts +++ b/packages/journey-client/src/lib/callbacks/name-callback.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 type { Callback } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + /** * Represents a callback used to collect a username. */ diff --git a/packages/journey-client/src/lib/callbacks/password-callback.test.ts b/packages/journey-client/src/lib/callbacks/password-callback.test.ts index 2cba416a41..7a97776bb0 100644 --- a/packages/journey-client/src/lib/callbacks/password-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/password-callback.test.ts @@ -1,17 +1,17 @@ /* - * 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 { callbackType } from '@forgerock/sdk-types'; -import { describe, it, expect } from 'vitest'; - -import type { Callback } from '@forgerock/sdk-types'; +import { describe, expect, it } from 'vitest'; import { PasswordCallback } from './password-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('PasswordCallback', () => { const payload: Callback = { type: callbackType.PasswordCallback, diff --git a/packages/journey-client/src/lib/callbacks/password-callback.ts b/packages/journey-client/src/lib/callbacks/password-callback.ts index dc264ec90d..028cee7345 100644 --- a/packages/journey-client/src/lib/callbacks/password-callback.ts +++ b/packages/journey-client/src/lib/callbacks/password-callback.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 type { Callback, PolicyRequirement } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback, PolicyRequirement } from '@forgerock/sdk-types'; + /** * Represents a callback used to collect a password. */ diff --git a/packages/journey-client/src/lib/callbacks/ping-protect-evaluation-callback.test.ts b/packages/journey-client/src/lib/callbacks/ping-protect-evaluation-callback.test.ts index 564032de62..65c0133e2a 100644 --- a/packages/journey-client/src/lib/callbacks/ping-protect-evaluation-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/ping-protect-evaluation-callback.test.ts @@ -3,13 +3,13 @@ * * ping-protect-evaluation-callback.test.ts * - * Copyright (c) 2024 - 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 { callbackType } from '@forgerock/sdk-types'; -import { vi, describe, it, expect } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { PingOneProtectEvaluationCallback } from './ping-protect-evaluation-callback.js'; diff --git a/packages/journey-client/src/lib/callbacks/ping-protect-evaluation-callback.ts b/packages/journey-client/src/lib/callbacks/ping-protect-evaluation-callback.ts index a3ea0cf79b..4ae80764d5 100644 --- a/packages/journey-client/src/lib/callbacks/ping-protect-evaluation-callback.ts +++ b/packages/journey-client/src/lib/callbacks/ping-protect-evaluation-callback.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2024 - 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 type { Callback } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + /** * @class - Represents a callback used to complete and package up device and behavioral data. */ diff --git a/packages/journey-client/src/lib/callbacks/ping-protect-initialize-callback.test.ts b/packages/journey-client/src/lib/callbacks/ping-protect-initialize-callback.test.ts index 58d774e798..a36b79a766 100644 --- a/packages/journey-client/src/lib/callbacks/ping-protect-initialize-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/ping-protect-initialize-callback.test.ts @@ -9,7 +9,7 @@ */ import { callbackType } from '@forgerock/sdk-types'; -import { vi, describe, expect, it } from 'vitest'; +import { describe, expect, it, vi } from 'vitest'; import { PingOneProtectInitializeCallback } from './ping-protect-initialize-callback.js'; diff --git a/packages/journey-client/src/lib/callbacks/ping-protect-initialize-callback.ts b/packages/journey-client/src/lib/callbacks/ping-protect-initialize-callback.ts index 4e5d99018f..1c497c1610 100644 --- a/packages/journey-client/src/lib/callbacks/ping-protect-initialize-callback.ts +++ b/packages/journey-client/src/lib/callbacks/ping-protect-initialize-callback.ts @@ -4,10 +4,10 @@ * of the MIT license. See the LICENSE file for details. */ -import type { Callback } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + /** * @class - Represents a callback used to initialize and start device and behavioral data collection. */ diff --git a/packages/journey-client/src/lib/callbacks/polling-wait-callback.test.ts b/packages/journey-client/src/lib/callbacks/polling-wait-callback.test.ts index 03c1ee1fba..c919a7ce87 100644 --- a/packages/journey-client/src/lib/callbacks/polling-wait-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/polling-wait-callback.test.ts @@ -1,17 +1,17 @@ /* - * 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 { callbackType } from '@forgerock/sdk-types'; -import { describe, it, expect } from 'vitest'; - -import type { Callback } from '@forgerock/sdk-types'; +import { describe, expect, it } from 'vitest'; import { PollingWaitCallback } from './polling-wait-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('PollingWaitCallback', () => { const payload: Callback = { type: callbackType.PollingWaitCallback, diff --git a/packages/journey-client/src/lib/callbacks/polling-wait-callback.ts b/packages/journey-client/src/lib/callbacks/polling-wait-callback.ts index 50ceb030a3..f607e202ee 100644 --- a/packages/journey-client/src/lib/callbacks/polling-wait-callback.ts +++ b/packages/journey-client/src/lib/callbacks/polling-wait-callback.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 type { Callback } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + /** * Represents a callback used to instruct the system to poll while a backend process completes. */ diff --git a/packages/journey-client/src/lib/callbacks/recaptcha-callback.test.ts b/packages/journey-client/src/lib/callbacks/recaptcha-callback.test.ts index f5ec9fdaa3..db46cc3b53 100644 --- a/packages/journey-client/src/lib/callbacks/recaptcha-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/recaptcha-callback.test.ts @@ -1,17 +1,17 @@ /* - * 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 { callbackType } from '@forgerock/sdk-types'; -import { describe, it, expect } from 'vitest'; - -import type { Callback } from '@forgerock/sdk-types'; +import { describe, expect, it } from 'vitest'; import { ReCaptchaCallback } from './recaptcha-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('ReCaptchaCallback', () => { const payload: Callback = { type: callbackType.ReCaptchaCallback, diff --git a/packages/journey-client/src/lib/callbacks/recaptcha-callback.ts b/packages/journey-client/src/lib/callbacks/recaptcha-callback.ts index f2d2fbe8c6..f5846abfc6 100644 --- a/packages/journey-client/src/lib/callbacks/recaptcha-callback.ts +++ b/packages/journey-client/src/lib/callbacks/recaptcha-callback.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 type { Callback } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + /** * Represents a callback used to integrate reCAPTCHA. */ diff --git a/packages/journey-client/src/lib/callbacks/recaptcha-enterprise-callback.test.ts b/packages/journey-client/src/lib/callbacks/recaptcha-enterprise-callback.test.ts index 950dd1a688..5ae3672b49 100644 --- a/packages/journey-client/src/lib/callbacks/recaptcha-enterprise-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/recaptcha-enterprise-callback.test.ts @@ -3,18 +3,18 @@ * * recaptcha-enterprise-callback.test.ts * - * 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 { callbackType } from '@forgerock/sdk-types'; -import { describe, expect, it, beforeAll } from 'vitest'; - -import type { Callback } from '@forgerock/sdk-types'; +import { beforeAll, describe, expect, it } from 'vitest'; import { ReCaptchaEnterpriseCallback } from './recaptcha-enterprise-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + const recaptchaCallback: Callback = { type: callbackType.ReCaptchaEnterpriseCallback, output: [ diff --git a/packages/journey-client/src/lib/callbacks/recaptcha-enterprise-callback.ts b/packages/journey-client/src/lib/callbacks/recaptcha-enterprise-callback.ts index 07eb1ab539..287da26e7c 100644 --- a/packages/journey-client/src/lib/callbacks/recaptcha-enterprise-callback.ts +++ b/packages/journey-client/src/lib/callbacks/recaptcha-enterprise-callback.ts @@ -3,15 +3,15 @@ * * recaptcha-callback.ts * - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 type { Callback } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + /** * Represents a callback used to integrate reCAPTCHA. */ diff --git a/packages/journey-client/src/lib/callbacks/redirect-callback.test.ts b/packages/journey-client/src/lib/callbacks/redirect-callback.test.ts index 31f7ec3d1e..89f61a01a6 100644 --- a/packages/journey-client/src/lib/callbacks/redirect-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/redirect-callback.test.ts @@ -1,17 +1,17 @@ /* - * 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 { callbackType } from '@forgerock/sdk-types'; -import { describe, it, expect } from 'vitest'; - -import type { Callback } from '@forgerock/sdk-types'; +import { describe, expect, it } from 'vitest'; import { RedirectCallback } from './redirect-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('RedirectCallback', () => { const payload: Callback = { type: callbackType.RedirectCallback, diff --git a/packages/journey-client/src/lib/callbacks/redirect-callback.ts b/packages/journey-client/src/lib/callbacks/redirect-callback.ts index 37c48dd2e6..71e836faff 100644 --- a/packages/journey-client/src/lib/callbacks/redirect-callback.ts +++ b/packages/journey-client/src/lib/callbacks/redirect-callback.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 type { Callback } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + /** * Represents a callback used to collect an answer to a choice. */ diff --git a/packages/journey-client/src/lib/callbacks/select-idp-callback.test.ts b/packages/journey-client/src/lib/callbacks/select-idp-callback.test.ts index eeea3569a0..ad9b868b9b 100644 --- a/packages/journey-client/src/lib/callbacks/select-idp-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/select-idp-callback.test.ts @@ -1,17 +1,17 @@ /* - * 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 { callbackType } from '@forgerock/sdk-types'; -import { describe, it, expect } from 'vitest'; - -import type { Callback } from '@forgerock/sdk-types'; +import { describe, expect, it } from 'vitest'; import { SelectIdPCallback } from './select-idp-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('SelectIdPCallback', () => { const payload: Callback = { type: callbackType.SelectIdPCallback, diff --git a/packages/journey-client/src/lib/callbacks/select-idp-callback.ts b/packages/journey-client/src/lib/callbacks/select-idp-callback.ts index 47cf23f2a5..02b92a644f 100644 --- a/packages/journey-client/src/lib/callbacks/select-idp-callback.ts +++ b/packages/journey-client/src/lib/callbacks/select-idp-callback.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 type { Callback } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + interface IdPValue { provider: string; uiConfig: { diff --git a/packages/journey-client/src/lib/callbacks/suspended-text-output-callback.test.ts b/packages/journey-client/src/lib/callbacks/suspended-text-output-callback.test.ts index 80abcc6033..8f31a45db6 100644 --- a/packages/journey-client/src/lib/callbacks/suspended-text-output-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/suspended-text-output-callback.test.ts @@ -1,17 +1,17 @@ /* - * 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 { callbackType } from '@forgerock/sdk-types'; -import { describe, it, expect } from 'vitest'; - -import type { Callback } from '@forgerock/sdk-types'; +import { describe, expect, it } from 'vitest'; import { SuspendedTextOutputCallback } from './suspended-text-output-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('SuspendedTextOutputCallback', () => { it('should instantiate correctly and inherit from TextOutputCallback', () => { const payload: Callback = { diff --git a/packages/journey-client/src/lib/callbacks/suspended-text-output-callback.ts b/packages/journey-client/src/lib/callbacks/suspended-text-output-callback.ts index 79654dff51..4e918b9723 100644 --- a/packages/journey-client/src/lib/callbacks/suspended-text-output-callback.ts +++ b/packages/journey-client/src/lib/callbacks/suspended-text-output-callback.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 type { Callback } from '@forgerock/sdk-types'; - import { TextOutputCallback } from './text-output-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + /** * Represents a callback used to display a message. */ diff --git a/packages/journey-client/src/lib/callbacks/terms-and-conditions-callback.test.ts b/packages/journey-client/src/lib/callbacks/terms-and-conditions-callback.test.ts index c6f9f6de87..c04942f786 100644 --- a/packages/journey-client/src/lib/callbacks/terms-and-conditions-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/terms-and-conditions-callback.test.ts @@ -1,17 +1,17 @@ /* - * 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 { callbackType } from '@forgerock/sdk-types'; -import { describe, it, expect } from 'vitest'; - -import type { Callback } from '@forgerock/sdk-types'; +import { describe, expect, it } from 'vitest'; import { TermsAndConditionsCallback } from './terms-and-conditions-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('TermsAndConditionsCallback', () => { const date = new Date().toString(); const payload: Callback = { diff --git a/packages/journey-client/src/lib/callbacks/terms-and-conditions-callback.ts b/packages/journey-client/src/lib/callbacks/terms-and-conditions-callback.ts index 66e8d5e15e..dc6cf4dfbd 100644 --- a/packages/journey-client/src/lib/callbacks/terms-and-conditions-callback.ts +++ b/packages/journey-client/src/lib/callbacks/terms-and-conditions-callback.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 type { Callback } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + /** * Represents a callback used to collect acceptance of terms and conditions. */ diff --git a/packages/journey-client/src/lib/callbacks/text-input-callback.test.ts b/packages/journey-client/src/lib/callbacks/text-input-callback.test.ts index 947ac6ab76..85a960993a 100644 --- a/packages/journey-client/src/lib/callbacks/text-input-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/text-input-callback.test.ts @@ -3,17 +3,17 @@ * * attribute-input-callback.test.ts * - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 { callbackType } from '@forgerock/sdk-types'; -import type { Callback } from '@forgerock/sdk-types'; - import { TextInputCallback } from './text-input-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('TextInputCallback', () => { const payload: Callback = { type: callbackType.TextInputCallback, diff --git a/packages/journey-client/src/lib/callbacks/text-input-callback.ts b/packages/journey-client/src/lib/callbacks/text-input-callback.ts index d60233b718..3d64c21afb 100644 --- a/packages/journey-client/src/lib/callbacks/text-input-callback.ts +++ b/packages/journey-client/src/lib/callbacks/text-input-callback.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2022 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2022 - 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 type { Callback } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + /** * Represents a callback used to retrieve input from the user. */ diff --git a/packages/journey-client/src/lib/callbacks/text-output-callback.test.ts b/packages/journey-client/src/lib/callbacks/text-output-callback.test.ts index 29bacb7984..7d4c8a8263 100644 --- a/packages/journey-client/src/lib/callbacks/text-output-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/text-output-callback.test.ts @@ -1,17 +1,17 @@ /* - * 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 { callbackType } from '@forgerock/sdk-types'; -import { describe, it, expect } from 'vitest'; - -import type { Callback } from '@forgerock/sdk-types'; +import { describe, expect, it } from 'vitest'; import { TextOutputCallback } from './text-output-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('TextOutputCallback', () => { const payload: Callback = { type: callbackType.TextOutputCallback, diff --git a/packages/journey-client/src/lib/callbacks/text-output-callback.ts b/packages/journey-client/src/lib/callbacks/text-output-callback.ts index d1647af101..98e67debb7 100644 --- a/packages/journey-client/src/lib/callbacks/text-output-callback.ts +++ b/packages/journey-client/src/lib/callbacks/text-output-callback.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 type { Callback } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + /** * Represents a callback used to display a message. */ diff --git a/packages/journey-client/src/lib/callbacks/validated-create-password-callback.test.ts b/packages/journey-client/src/lib/callbacks/validated-create-password-callback.test.ts index ec370ab701..62a1e4537d 100644 --- a/packages/journey-client/src/lib/callbacks/validated-create-password-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/validated-create-password-callback.test.ts @@ -3,17 +3,17 @@ * * validated-create-password-callback.test.ts * - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 { callbackType } from '@forgerock/sdk-types'; -import type { Callback } from '@forgerock/sdk-types'; - import { ValidatedCreatePasswordCallback } from './validated-create-password-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('ValidatedCreatePasswordCallback', () => { const payload: Callback = { type: callbackType.ValidatedCreatePasswordCallback, diff --git a/packages/journey-client/src/lib/callbacks/validated-create-password-callback.ts b/packages/journey-client/src/lib/callbacks/validated-create-password-callback.ts index 31532363cf..37cff4c976 100644 --- a/packages/journey-client/src/lib/callbacks/validated-create-password-callback.ts +++ b/packages/journey-client/src/lib/callbacks/validated-create-password-callback.ts @@ -1,13 +1,13 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 type { Callback, PolicyRequirement } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback, PolicyRequirement } from '@forgerock/sdk-types'; + /** * Represents a callback used to collect a valid platform password. */ diff --git a/packages/journey-client/src/lib/callbacks/validated-create-username-callback.test.ts b/packages/journey-client/src/lib/callbacks/validated-create-username-callback.test.ts index 8c7674deaf..654156584f 100644 --- a/packages/journey-client/src/lib/callbacks/validated-create-username-callback.test.ts +++ b/packages/journey-client/src/lib/callbacks/validated-create-username-callback.test.ts @@ -3,17 +3,17 @@ * * validated-create-username-callback.test.ts * - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 { callbackType } from '@forgerock/sdk-types'; -import type { Callback } from '@forgerock/sdk-types'; - import { ValidatedCreateUsernameCallback } from './validated-create-username-callback.js'; +import type { Callback } from '@forgerock/sdk-types'; + describe('ValidatedCreateUsernameCallback', () => { const payload: Callback = { type: callbackType.ValidatedCreateUsernameCallback, diff --git a/packages/journey-client/src/lib/callbacks/validated-create-username-callback.ts b/packages/journey-client/src/lib/callbacks/validated-create-username-callback.ts index ec41bed146..e3c9636a8c 100644 --- a/packages/journey-client/src/lib/callbacks/validated-create-username-callback.ts +++ b/packages/journey-client/src/lib/callbacks/validated-create-username-callback.ts @@ -1,14 +1,14 @@ /* - * 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 type { Callback, PolicyRequirement } from '@forgerock/sdk-types'; - import { BaseCallback } from './base-callback.js'; +import type { Callback, PolicyRequirement } from '@forgerock/sdk-types'; + /** * Represents a callback used to collect a valid platform username. */ diff --git a/packages/journey-client/src/lib/client.store.test.ts b/packages/journey-client/src/lib/client.store.test.ts index 3d150328bf..42ca47933c 100644 --- a/packages/journey-client/src/lib/client.store.test.ts +++ b/packages/journey-client/src/lib/client.store.test.ts @@ -1,6 +1,6 @@ // @vitest-environment node /* - * Copyright (c) 2025-2026 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. @@ -8,12 +8,12 @@ import { afterEach, describe, expect, test, vi } from 'vitest'; +import { callbackType } from '../index.js'; import { journey } from './client.store.js'; import { createJourneyStep } from './step.utils.js'; -import { callbackType, type GenericError, type Step, type WellknownResponse } from '../index.js'; - -import { JourneyClientConfig } from './config.types.js'; +import type { GenericError, Step, WellknownResponse } from '../index.js'; +import type { JourneyClientConfig } from './config.types.js'; /** * Type guard to check if a result is a GenericError diff --git a/packages/journey-client/src/lib/client.store.ts b/packages/journey-client/src/lib/client.store.ts index 19d1fabe70..01e61dd562 100644 --- a/packages/journey-client/src/lib/client.store.ts +++ b/packages/journey-client/src/lib/client.store.ts @@ -1,35 +1,36 @@ /* - * Copyright (c) 2025-2026 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 { logger as loggerFn, LogLevel, CustomLogger } from '@forgerock/sdk-logger'; +import { logger as loggerFn } from '@forgerock/sdk-logger'; import { callbackType } from '@forgerock/sdk-types'; import { + createWellknownError, isGenericError, isValidWellknownUrl, - createWellknownError, } from '@forgerock/sdk-utilities'; - -import type { GenericError } from '@forgerock/sdk-types'; -import type { ActionTypes, RequestMiddleware } from '@forgerock/sdk-request-middleware'; -import type { Step } from '@forgerock/sdk-types'; +import { createStorage } from '@forgerock/storage'; +import * as Either from 'effect/Either'; import { createJourneyStore } from './client.store.utils.js'; import { configSlice } from './config.slice.js'; import { journeyApi } from './journey.api.js'; -import { createStorage } from '@forgerock/storage'; -import * as Either from 'effect/Either'; import { createJourneyObject, parseJourneyResponse } from './journey.utils.js'; -import type { JourneyResult } from './journey.utils.js'; import { wellknownApi } from './wellknown.api.js'; -import type { JourneyStep } from './step.utils.js'; -import type { JourneyClientConfig } from './config.types.js'; +import type { CustomLogger, LogLevel } from '@forgerock/sdk-logger'; +import type { ActionTypes, RequestMiddleware } from '@forgerock/sdk-request-middleware'; +import type { GenericError } from '@forgerock/sdk-types'; +import type { Step } from '@forgerock/sdk-types'; + import type { RedirectCallback } from './callbacks/redirect-callback.js'; -import type { NextOptions, StartParam, ResumeOptions } from './interfaces.js'; +import type { JourneyClientConfig } from './config.types.js'; +import type { NextOptions, ResumeOptions, StartParam } from './interfaces.js'; +import type { JourneyResult } from './journey.utils.js'; +import type { JourneyStep } from './step.utils.js'; /** The journey client instance returned by the `journey()` function. */ export interface JourneyClient { diff --git a/packages/journey-client/src/lib/client.store.utils.ts b/packages/journey-client/src/lib/client.store.utils.ts index 0e0b05c794..6439d9a4a5 100644 --- a/packages/journey-client/src/lib/client.store.utils.ts +++ b/packages/journey-client/src/lib/client.store.utils.ts @@ -1,18 +1,19 @@ /* - * 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 { logger as loggerFn } from '@forgerock/sdk-logger'; -import { ActionTypes, RequestMiddleware } from '@forgerock/sdk-request-middleware'; import { combineReducers, configureStore } from '@reduxjs/toolkit'; import { configSlice } from './config.slice.js'; import { journeyApi } from './journey.api.js'; import { wellknownApi } from './wellknown.api.js'; +import type { logger as loggerFn } from '@forgerock/sdk-logger'; +import type { ActionTypes, RequestMiddleware } from '@forgerock/sdk-request-middleware'; + const rootReducer = combineReducers({ [journeyApi.reducerPath]: journeyApi.reducer, [configSlice.name]: configSlice.reducer, diff --git a/packages/journey-client/src/lib/client.types.test-d.ts b/packages/journey-client/src/lib/client.types.test-d.ts index 92c265713f..5d3adc730e 100644 --- a/packages/journey-client/src/lib/client.types.test-d.ts +++ b/packages/journey-client/src/lib/client.types.test-d.ts @@ -1,5 +1,5 @@ /* - * 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. @@ -10,9 +10,9 @@ import { describe, it } from 'vitest'; import type { GenericError } from '@forgerock/sdk-types'; import type { JourneyClient } from './client.types.js'; -import type { JourneyStep } from './step.utils.js'; -import type { JourneyLoginSuccess } from './login-success.utils.js'; import type { JourneyLoginFailure } from './login-failure.utils.js'; +import type { JourneyLoginSuccess } from './login-success.utils.js'; +import type { JourneyStep } from './step.utils.js'; /** * Resolves to `true` if `U` is a member of union `T`, `false` otherwise. diff --git a/packages/journey-client/src/lib/config.slice.test.ts b/packages/journey-client/src/lib/config.slice.test.ts index 0affaf7cce..31323ad4e0 100644 --- a/packages/journey-client/src/lib/config.slice.test.ts +++ b/packages/journey-client/src/lib/config.slice.test.ts @@ -1,14 +1,16 @@ /* - * 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 { describe, it, expect } from 'vitest'; +import { describe, expect, it } from 'vitest'; + import { configSlice } from './config.slice.js'; import type { WellknownResponse } from '@forgerock/sdk-types'; + import type { ResolvedConfig } from './config.slice.js'; function createMockWellknown(overrides: Partial = {}): WellknownResponse { diff --git a/packages/journey-client/src/lib/config.slice.ts b/packages/journey-client/src/lib/config.slice.ts index 02cac72102..e1924f2512 100644 --- a/packages/journey-client/src/lib/config.slice.ts +++ b/packages/journey-client/src/lib/config.slice.ts @@ -1,14 +1,18 @@ /* - * 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 { createSlice, PayloadAction } from '@reduxjs/toolkit'; +import { createSlice } from '@reduxjs/toolkit'; + +import { convertWellknown } from './wellknown.utils.js'; + import type { WellknownResponse } from '@forgerock/sdk-types'; +import type { PayloadAction } from '@reduxjs/toolkit'; + import type { InternalJourneyClientConfig } from './config.types.js'; -import { convertWellknown } from './wellknown.utils.js'; /** * Payload dispatched to the config slice after well-known resolution. diff --git a/packages/journey-client/src/lib/config.types.test-d.ts b/packages/journey-client/src/lib/config.types.test-d.ts index d314f040fe..eda4cdc400 100644 --- a/packages/journey-client/src/lib/config.types.test-d.ts +++ b/packages/journey-client/src/lib/config.types.test-d.ts @@ -1,16 +1,18 @@ /* - * 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 { describe, expectTypeOf, it } from 'vitest'; + +import type { AsyncLegacyConfigOptions } from '@forgerock/sdk-types'; + import type { + InternalJourneyClientConfig, JourneyClientConfig, JourneyServerConfig, - InternalJourneyClientConfig, } from './config.types.js'; -import type { AsyncLegacyConfigOptions } from '@forgerock/sdk-types'; import type { ResolvedServerConfig } from './wellknown.utils.js'; describe('Config Types', () => { diff --git a/packages/journey-client/src/lib/config.types.ts b/packages/journey-client/src/lib/config.types.ts index 25eaeaa888..ceeac9be78 100644 --- a/packages/journey-client/src/lib/config.types.ts +++ b/packages/journey-client/src/lib/config.types.ts @@ -1,11 +1,12 @@ /* - * 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 type { AsyncLegacyConfigOptions, GenericError } from '@forgerock/sdk-types'; + import type { ResolvedServerConfig } from './wellknown.utils.js'; /** diff --git a/packages/journey-client/src/lib/device/device-profile.test.ts b/packages/journey-client/src/lib/device/device-profile.test.ts index 0fd2d9a677..88367684ce 100644 --- a/packages/journey-client/src/lib/device/device-profile.test.ts +++ b/packages/journey-client/src/lib/device/device-profile.test.ts @@ -3,14 +3,16 @@ * * device-profile.test.ts * - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 { vi, expect, describe, it, afterEach, beforeEach, type MockInstance } from 'vitest'; +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { Device } from './device-profile.js'; +import type { MockInstance } from 'vitest'; + // Patch window.crypto.getRandomValues to return Uint32Array for compatibility Object.defineProperty(window, 'crypto', { writable: true, diff --git a/packages/journey-client/src/lib/device/device-profile.ts b/packages/journey-client/src/lib/device/device-profile.ts index 6c3e5f6b3c..29d365ba2d 100644 --- a/packages/journey-client/src/lib/device/device-profile.ts +++ b/packages/journey-client/src/lib/device/device-profile.ts @@ -3,15 +3,13 @@ * * index.ts * - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 { reduceToObject, reduceToString } from '@forgerock/sdk-utilities'; import { logger as loggerFn } from '@forgerock/sdk-logger'; - -import type { LogLevel } from '@forgerock/sdk-logger'; +import { reduceToObject, reduceToString } from '@forgerock/sdk-utilities'; import { browserProps, @@ -24,6 +22,8 @@ import { platformProps, } from './defaults.js'; +import type { LogLevel } from '@forgerock/sdk-logger'; + import type { BaseProfileConfig, Category, diff --git a/packages/journey-client/src/lib/interfaces.ts b/packages/journey-client/src/lib/interfaces.ts index 0dc93ca842..6fa405f1d1 100644 --- a/packages/journey-client/src/lib/interfaces.ts +++ b/packages/journey-client/src/lib/interfaces.ts @@ -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 { JourneyStep } from './step.types.js'; +import type { JourneyStep } from './step.types.js'; export interface StartParam { journey: string; diff --git a/packages/journey-client/src/lib/journey.api.ts b/packages/journey-client/src/lib/journey.api.ts index 66c4da9a29..5ce1ce09c0 100644 --- a/packages/journey-client/src/lib/journey.api.ts +++ b/packages/journey-client/src/lib/journey.api.ts @@ -1,16 +1,17 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 { initQuery, RequestMiddleware } from '@forgerock/sdk-request-middleware'; -import { REQUESTED_WITH, getEndpointPath, stringify, resolve } from '@forgerock/sdk-utilities'; +import { initQuery } from '@forgerock/sdk-request-middleware'; +import { getEndpointPath, REQUESTED_WITH, resolve, stringify } from '@forgerock/sdk-utilities'; import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'; -import type { Step } from '@forgerock/sdk-types'; import type { logger as loggerFn } from '@forgerock/sdk-logger'; +import type { RequestMiddleware } from '@forgerock/sdk-request-middleware'; +import type { Step } from '@forgerock/sdk-types'; import type { BaseQueryApi, BaseQueryFn, @@ -20,10 +21,9 @@ import type { QueryReturnValue, } from '@reduxjs/toolkit/query'; -import { JourneyStep } from './step.types.js'; - import type { InternalJourneyClientConfig } from './config.types.js'; -import { NextOptions, StartParam } from './interfaces.js'; +import type { NextOptions, StartParam } from './interfaces.js'; +import type { JourneyStep } from './step.types.js'; /** * Minimal state type for accessing journey config from RTK Query endpoints. diff --git a/packages/journey-client/src/lib/journey.utils.test.ts b/packages/journey-client/src/lib/journey.utils.test.ts index 30718d8159..88d5a4c5d8 100644 --- a/packages/journey-client/src/lib/journey.utils.test.ts +++ b/packages/journey-client/src/lib/journey.utils.test.ts @@ -8,9 +8,9 @@ import { describe, expect, it } from 'vitest'; import { StepType } from '../types.js'; -import { type Step } from '../index.js'; - import { createJourneyObject, parseJourneyResponse } from './journey.utils.js'; + +import type { Step } from '../index.js'; import type { JourneyLoginFailure } from './login-failure.utils.js'; describe('createJourneyObject', () => { diff --git a/packages/journey-client/src/lib/journey.utils.ts b/packages/journey-client/src/lib/journey.utils.ts index 198721e43e..1ea88f8897 100644 --- a/packages/journey-client/src/lib/journey.utils.ts +++ b/packages/journey-client/src/lib/journey.utils.ts @@ -1,25 +1,24 @@ /* - * 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 { StepType } from '@forgerock/sdk-types'; import * as Either from 'effect/Either'; -import { StepType } from '@forgerock/sdk-types'; +import { createJourneyLoginFailure } from './login-failure.utils.js'; +import { createJourneyLoginSuccess } from './login-success.utils.js'; +import { createJourneyStep } from './step.utils.js'; import type { GenericError, Step } from '@forgerock/sdk-types'; -import type { FetchBaseQueryError } from '@reduxjs/toolkit/query'; import type { SerializedError } from '@reduxjs/toolkit'; +import type { FetchBaseQueryError } from '@reduxjs/toolkit/query'; -import { createJourneyLoginSuccess } from './login-success.utils.js'; -import { createJourneyLoginFailure } from './login-failure.utils.js'; -import { createJourneyStep } from './step.utils.js'; - -import type { JourneyStep } from './step.utils.js'; import type { JourneyLoginFailure } from './login-failure.utils.js'; import type { JourneyLoginSuccess } from './login-success.utils.js'; +import type { JourneyStep } from './step.utils.js'; export type JourneyResult = JourneyStep | JourneyLoginSuccess | JourneyLoginFailure | GenericError; diff --git a/packages/journey-client/src/lib/login-failure.utils.ts b/packages/journey-client/src/lib/login-failure.utils.ts index 88fa4cfcc8..ac0874ace2 100644 --- a/packages/journey-client/src/lib/login-failure.utils.ts +++ b/packages/journey-client/src/lib/login-failure.utils.ts @@ -1,14 +1,14 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 { StepType } from '@forgerock/sdk-types'; -import type { Step, AuthResponse, FailureDetail } from '@forgerock/sdk-types'; - import { Policy } from './policy/policy.js'; +import type { AuthResponse, FailureDetail, Step } from '@forgerock/sdk-types'; + import type { MessageCreator, ProcessedPropertyError } from './policy/interfaces.js'; type JourneyLoginFailure = AuthResponse & { diff --git a/packages/journey-client/src/lib/login-success.utils.ts b/packages/journey-client/src/lib/login-success.utils.ts index 1be9840c79..e3e283d19c 100644 --- a/packages/journey-client/src/lib/login-success.utils.ts +++ b/packages/journey-client/src/lib/login-success.utils.ts @@ -1,12 +1,12 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 { StepType } from '@forgerock/sdk-types'; -import type { Step, AuthResponse } from '@forgerock/sdk-types'; +import type { AuthResponse, Step } from '@forgerock/sdk-types'; type JourneyLoginSuccess = AuthResponse & { type: StepType.LoginSuccess; diff --git a/packages/journey-client/src/lib/policy/policy.test.ts b/packages/journey-client/src/lib/policy/policy.test.ts index 3a5c65cac1..b884d57fc9 100644 --- a/packages/journey-client/src/lib/policy/policy.test.ts +++ b/packages/journey-client/src/lib/policy/policy.test.ts @@ -3,14 +3,16 @@ * * fr-policy.test.ts * - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 { PolicyKey } from '@forgerock/sdk-types'; -import { Policy, MessageCreator } from './policy.js'; +import { Policy } from './policy.js'; + +import type { MessageCreator } from './policy.js'; describe('The IDM error handling', () => { const property = 'userName'; diff --git a/packages/journey-client/src/lib/policy/policy.ts b/packages/journey-client/src/lib/policy/policy.ts index ac562864d6..d78f769f34 100644 --- a/packages/journey-client/src/lib/policy/policy.ts +++ b/packages/journey-client/src/lib/policy/policy.ts @@ -1,15 +1,15 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 { PolicyKey } from '@forgerock/sdk-types'; -import type { FailedPolicyRequirement, PolicyRequirement, Step } from '@forgerock/sdk-types'; - import { defaultMessageCreator } from './message-creator.js'; +import type { FailedPolicyRequirement, PolicyRequirement, Step } from '@forgerock/sdk-types'; + import type { MessageCreator, ProcessedPropertyError } from './interfaces.js'; /** diff --git a/packages/journey-client/src/lib/qr-code/qr-code.test.ts b/packages/journey-client/src/lib/qr-code/qr-code.test.ts index 5067955907..d8d01a2332 100644 --- a/packages/journey-client/src/lib/qr-code/qr-code.test.ts +++ b/packages/journey-client/src/lib/qr-code/qr-code.test.ts @@ -3,16 +3,16 @@ * * index.test.ts * - * Copyright (c) 2024 - 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 { QRCode } from './qr-code.js'; -import { otpQRCodeStep, pushQRCodeStep } from './qr-code.mock.data.js'; import { createJourneyStep } from '../step.utils.js'; // import WebAuthn step as it's similar in structure for testing non-QR Code steps import { webAuthnRegJSCallback70 } from '../webauthn/webauthn.mock.data.js'; +import { QRCode } from './qr-code.js'; +import { otpQRCodeStep, pushQRCodeStep } from './qr-code.mock.data.js'; describe('Class for managing QR Codes', () => { it('should return true for step containing OTP QR Code callbacks', () => { diff --git a/packages/journey-client/src/lib/qr-code/qr-code.ts b/packages/journey-client/src/lib/qr-code/qr-code.ts index 8c64d7fbf0..67443ea2da 100644 --- a/packages/journey-client/src/lib/qr-code/qr-code.ts +++ b/packages/journey-client/src/lib/qr-code/qr-code.ts @@ -3,16 +3,15 @@ * * index.ts * - * Copyright (c) 2024 - 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 { callbackType } from '@forgerock/sdk-types'; -import { TextOutputCallback } from '../callbacks/text-output-callback.js'; -import { HiddenValueCallback } from '../callbacks/hidden-value-callback.js'; - +import type { HiddenValueCallback } from '../callbacks/hidden-value-callback.js'; +import type { TextOutputCallback } from '../callbacks/text-output-callback.js'; import type { JourneyStep } from '../step.utils.js'; export type QRCodeData = { diff --git a/packages/journey-client/src/lib/recovery-codes/recovery-codes.test.ts b/packages/journey-client/src/lib/recovery-codes/recovery-codes.test.ts index f9f09c6fd8..8d659e4aff 100644 --- a/packages/journey-client/src/lib/recovery-codes/recovery-codes.test.ts +++ b/packages/journey-client/src/lib/recovery-codes/recovery-codes.test.ts @@ -3,13 +3,13 @@ * * recovery-codes.test.ts * - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 { RecoveryCodes } from './recovery-codes.js'; import { createJourneyStep } from '../step.utils.js'; +import { RecoveryCodes } from './recovery-codes.js'; import { displayRecoveryCodesResponse, expectedDeviceName, diff --git a/packages/journey-client/src/lib/step.test.ts b/packages/journey-client/src/lib/step.test.ts index 1406dd3497..7d3a52241c 100644 --- a/packages/journey-client/src/lib/step.test.ts +++ b/packages/journey-client/src/lib/step.test.ts @@ -1,17 +1,17 @@ /* - * 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 { callbackType } from '@forgerock/sdk-types'; -import { describe, it, expect } from 'vitest'; +import { describe, expect, it } from 'vitest'; -import type { Step } from '@forgerock/sdk-types'; - -import { createJourneyStep } from './step.utils.js'; import { NameCallback } from './callbacks/name-callback.js'; +import { createJourneyStep } from './step.utils.js'; + +import type { Step } from '@forgerock/sdk-types'; describe('fr-step.ts', () => { const stepPayload: Step = { diff --git a/packages/journey-client/src/lib/step.utils.ts b/packages/journey-client/src/lib/step.utils.ts index 7218364b31..69f06564a9 100644 --- a/packages/journey-client/src/lib/step.utils.ts +++ b/packages/journey-client/src/lib/step.utils.ts @@ -1,19 +1,19 @@ /* - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 { type CallbackType, type Callback, type Step } from '@forgerock/sdk-types'; - import { StepType } from '@forgerock/sdk-types'; import { createCallback } from './callbacks/factory.js'; +import type { Callback, CallbackType, Step } from '@forgerock/sdk-types'; + import type { BaseCallback } from './callbacks/base-callback.js'; -import type { JourneyStep } from './step.types.js'; import type { CallbackFactory } from './callbacks/factory.js'; +import type { JourneyStep } from './step.types.js'; function getCallbacksOfType( callbacks: BaseCallback[], diff --git a/packages/journey-client/src/lib/webauthn/helpers.test.ts b/packages/journey-client/src/lib/webauthn/helpers.test.ts index b81ed2a7c3..afc691eca7 100644 --- a/packages/journey-client/src/lib/webauthn/helpers.test.ts +++ b/packages/journey-client/src/lib/webauthn/helpers.test.ts @@ -3,17 +3,17 @@ * * helpers.test.ts * - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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 { parseCredentials, parsePubKeyArray } from './helpers.js'; import { - allowCredentials70, - allowMultipleCredentials70, acceptableCredentials653, acceptableMultipleCredentials653, + allowCredentials70, + allowMultipleCredentials70, pubKeyCredParamsStr, } from './helpers.mock.data.js'; diff --git a/packages/journey-client/src/lib/webauthn/helpers.ts b/packages/journey-client/src/lib/webauthn/helpers.ts index de5109b980..23f3a56afd 100644 --- a/packages/journey-client/src/lib/webauthn/helpers.ts +++ b/packages/journey-client/src/lib/webauthn/helpers.ts @@ -3,7 +3,7 @@ * * helpers.ts * - * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * Copyright (c) 2020 - 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. */ @@ -14,6 +14,7 @@ * These are private utility functions for HttpClient */ import { WebAuthnOutcomeType } from './enums.js'; + import type { ParsedCredential } from './interfaces.js'; function ensureArray(arr: RegExpMatchArray | null): string[] { diff --git a/packages/journey-client/src/lib/webauthn/webauthn.test.ts b/packages/journey-client/src/lib/webauthn/webauthn.test.ts index 60714f1434..6db4031d9c 100644 --- a/packages/journey-client/src/lib/webauthn/webauthn.test.ts +++ b/packages/journey-client/src/lib/webauthn/webauthn.test.ts @@ -8,21 +8,21 @@ * of the MIT license. See the LICENSE file for details. */ +import { createJourneyStep } from '../step.utils.js'; import { WebAuthnStepType } from './enums.js'; import { WebAuthn } from './webauthn.js'; import { - webAuthnRegJSCallback653, - webAuthnAuthJSCallback653, - webAuthnRegJSCallback70, webAuthnAuthJSCallback70, - webAuthnRegMetaCallback70, + webAuthnAuthJSCallback70StoredUsername, + webAuthnAuthJSCallback653, webAuthnAuthMetaCallback70, + webAuthnAuthMetaCallback70StoredUsername, + webAuthnRegJSCallback70, webAuthnRegJSCallback70StoredUsername, - webAuthnAuthJSCallback70StoredUsername, + webAuthnRegJSCallback653, + webAuthnRegMetaCallback70, webAuthnRegMetaCallback70StoredUsername, - webAuthnAuthMetaCallback70StoredUsername, } from './webauthn.mock.data.js'; -import { createJourneyStep } from '../step.utils.js'; describe('Test FRWebAuthn class with 6.5.3 "Passwordless"', () => { it('should return Registration type with register text-output callbacks', () => { diff --git a/packages/journey-client/src/lib/webauthn/webauthn.ts b/packages/journey-client/src/lib/webauthn/webauthn.ts index 0c2da99b7f..8b2c8e111f 100644 --- a/packages/journey-client/src/lib/webauthn/webauthn.ts +++ b/packages/journey-client/src/lib/webauthn/webauthn.ts @@ -20,6 +20,8 @@ import { } from './helpers.js'; import type { HiddenValueCallback } from '../callbacks/hidden-value-callback.js'; +import type { MetadataCallback } from '../callbacks/metadata-callback.js'; +import type { TextOutputCallback } from '../callbacks/text-output-callback.js'; import type { JourneyStep } from '../step.utils.js'; import type { AttestationType, @@ -29,8 +31,6 @@ import type { WebAuthnRegistrationMetadata, WebAuthnTextOutputRegistration, } from './interfaces.js'; -import type { MetadataCallback } from '../callbacks/metadata-callback.js'; -import type { TextOutputCallback } from '../callbacks/text-output-callback.js'; // :::::: export type OutcomeWithName< diff --git a/packages/journey-client/src/lib/wellknown.api.ts b/packages/journey-client/src/lib/wellknown.api.ts index 2c1c41e5a2..ad89ff6cd6 100644 --- a/packages/journey-client/src/lib/wellknown.api.ts +++ b/packages/journey-client/src/lib/wellknown.api.ts @@ -1,12 +1,12 @@ /* - * 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 { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'; import { initWellknownQuery } from '@forgerock/sdk-oidc'; +import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'; import type { WellknownResponse } from '@forgerock/sdk-types'; import type { diff --git a/packages/journey-client/src/lib/wellknown.utils.test.ts b/packages/journey-client/src/lib/wellknown.utils.test.ts index 9160ec48a3..85007e8d5a 100644 --- a/packages/journey-client/src/lib/wellknown.utils.test.ts +++ b/packages/journey-client/src/lib/wellknown.utils.test.ts @@ -1,14 +1,16 @@ /* - * 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 { describe, it, expect } from 'vitest'; +import { describe, expect, it } from 'vitest'; + import { convertWellknown } from './wellknown.utils.js'; import type { WellknownResponse } from '@forgerock/sdk-types'; + import type { ResolvedServerConfig } from './wellknown.utils.js'; function assertResolvedConfig( diff --git a/packages/oidc-client/api-report/oidc-client.api.md b/packages/oidc-client/api-report/oidc-client.api.md index 8ee68af5a5..560c13568b 100644 --- a/packages/oidc-client/api-report/oidc-client.api.md +++ b/packages/oidc-client/api-report/oidc-client.api.md @@ -16,7 +16,7 @@ import { FetchBaseQueryMeta } from '@reduxjs/toolkit/query'; import { GenericError } from '@forgerock/sdk-types'; import { GetAuthorizationUrlOptions } from '@forgerock/sdk-types'; import type { JWTPayload } from 'jose'; -import { logger } from '@forgerock/sdk-logger'; +import type { logger } from '@forgerock/sdk-logger'; import { LogLevel } from '@forgerock/sdk-logger'; import { LogMessage } from '@forgerock/sdk-logger'; import { MutationDefinition } from '@reduxjs/toolkit/query'; diff --git a/packages/oidc-client/api-report/oidc-client.types.api.md b/packages/oidc-client/api-report/oidc-client.types.api.md index 8ee68af5a5..560c13568b 100644 --- a/packages/oidc-client/api-report/oidc-client.types.api.md +++ b/packages/oidc-client/api-report/oidc-client.types.api.md @@ -16,7 +16,7 @@ import { FetchBaseQueryMeta } from '@reduxjs/toolkit/query'; import { GenericError } from '@forgerock/sdk-types'; import { GetAuthorizationUrlOptions } from '@forgerock/sdk-types'; import type { JWTPayload } from 'jose'; -import { logger } from '@forgerock/sdk-logger'; +import type { logger } from '@forgerock/sdk-logger'; import { LogLevel } from '@forgerock/sdk-logger'; import { LogMessage } from '@forgerock/sdk-logger'; import { MutationDefinition } from '@reduxjs/toolkit/query'; diff --git a/packages/oidc-client/src/__tests__/types-reexport.typecheck.ts b/packages/oidc-client/src/__tests__/types-reexport.typecheck.ts index 7d1d6bdb3d..ec1003f32d 100644 --- a/packages/oidc-client/src/__tests__/types-reexport.typecheck.ts +++ b/packages/oidc-client/src/__tests__/types-reexport.typecheck.ts @@ -1,19 +1,25 @@ +/* + * 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. + */ /** * Verifies consumer-facing types are re-exported from @forgerock/oidc-client/types. * Checked by tsc --noEmit, not executed at runtime. */ import type { + ActionTypes, + CustomLogger, // Already re-exported (regression guard) GenericError, GetAuthorizationUrlOptions, - WellknownResponse, - StorageConfig, - ActionTypes, - RequestMiddleware, - CustomLogger, LogLevel, + RequestMiddleware, // Should be re-exported but is not yet ResponseType, + StorageConfig, + WellknownResponse, } from '../types.js'; // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/packages/oidc-client/src/lib/authorize.request.micros.test.ts b/packages/oidc-client/src/lib/authorize.request.micros.test.ts index 289617eae9..079ab93df0 100644 --- a/packages/oidc-client/src/lib/authorize.request.micros.test.ts +++ b/packages/oidc-client/src/lib/authorize.request.micros.test.ts @@ -1,14 +1,14 @@ /* - * 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 { it, expect } from '@effect/vitest'; -import { Micro } from 'effect'; -import { vi, afterEach } from 'vitest'; +import { expect, it } from '@effect/vitest'; import * as sdkOidc from '@forgerock/sdk-oidc'; import * as sdkUtilities from '@forgerock/sdk-utilities'; +import { Micro } from 'effect'; +import { afterEach, vi } from 'vitest'; import { buildParBodyµ, @@ -23,11 +23,12 @@ import { validateParResponseµ, } from './authorize.request.micros.js'; -import type { OidcConfig } from './config.types.js'; -import type { WellknownResponse } from '@forgerock/sdk-types'; -import type { ClientStore } from './client.types.js'; +import type { GetAuthorizationUrlOptions, WellknownResponse } from '@forgerock/sdk-types'; import type { FetchBaseQueryError } from '@reduxjs/toolkit/query'; +import type { ClientStore } from './client.types.js'; +import type { OidcConfig } from './config.types.js'; + // ─── Fixtures ──────────────────────────────────────────────────────────────── const clientId = 'test-client-id'; @@ -413,7 +414,7 @@ it.effect('dispatchAuthorizeIframeµ fails with unknown_error when data has no c mockStore, 'https://example.com/authorize?foo=bar', wellknown, - {} as import('@forgerock/sdk-types').GetAuthorizationUrlOptions, + {} as GetAuthorizationUrlOptions, ), ); expect(Micro.exitIsFailure(exit)).toBe(true); diff --git a/packages/oidc-client/src/lib/authorize.request.micros.ts b/packages/oidc-client/src/lib/authorize.request.micros.ts index 8c31bd2cc9..67589cc0f8 100644 --- a/packages/oidc-client/src/lib/authorize.request.micros.ts +++ b/packages/oidc-client/src/lib/authorize.request.micros.ts @@ -1,5 +1,5 @@ /* - * 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. @@ -17,19 +17,19 @@ import { hasPushRequestUri, isFetchBaseQueryError, toDispatchError, - type PromptValue, } from './authorize.request.utils.js'; - import { oidcApi } from './oidc.api.js'; +import type { GetAuthorizationUrlOptions, WellknownResponse } from '@forgerock/sdk-types'; import type { SerializedError } from '@reduxjs/toolkit'; import type { FetchBaseQueryError } from '@reduxjs/toolkit/query'; -import type { GetAuthorizationUrlOptions, WellknownResponse } from '@forgerock/sdk-types'; + import type { AuthorizationError, AuthorizationSuccess, OptionalAuthorizeOptions, } from './authorize.request.types.js'; +import type { PromptValue } from './authorize.request.utils.js'; import type { ClientStore } from './client.types.js'; import type { OidcConfig } from './config.types.js'; diff --git a/packages/oidc-client/src/lib/authorize.request.ts b/packages/oidc-client/src/lib/authorize.request.ts index 826ce8ec51..0b3d34dfc7 100644 --- a/packages/oidc-client/src/lib/authorize.request.ts +++ b/packages/oidc-client/src/lib/authorize.request.ts @@ -1,13 +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 { CustomLogger } from '@forgerock/sdk-logger'; import { Micro } from 'effect'; -import { buildAuthorizeOptions } from './authorize.request.utils.js'; import { buildParBodyµ, buildParSlimUrlµ, @@ -20,8 +18,11 @@ import { storeAuthOptionsµ, validateParResponseµ, } from './authorize.request.micros.js'; +import { buildAuthorizeOptions } from './authorize.request.utils.js'; +import type { CustomLogger } from '@forgerock/sdk-logger'; import type { GetAuthorizationUrlOptions, WellknownResponse } from '@forgerock/sdk-types'; + import type { AuthorizationError, AuthorizationSuccess, diff --git a/packages/oidc-client/src/lib/authorize.request.utils.test.ts b/packages/oidc-client/src/lib/authorize.request.utils.test.ts index f850406461..eb58fbbc93 100644 --- a/packages/oidc-client/src/lib/authorize.request.utils.test.ts +++ b/packages/oidc-client/src/lib/authorize.request.utils.test.ts @@ -1,26 +1,30 @@ /* - * 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 { it, expect } from '@effect/vitest'; -import { Micro } from 'effect'; -import { vi, afterEach } from 'vitest'; +import { expect, it } from '@effect/vitest'; import * as sdkOidc from '@forgerock/sdk-oidc'; -import { createParAuthorizeUrlµ, authorizeµ } from './authorize.request.js'; +import { Micro } from 'effect'; +import { afterEach, vi } from 'vitest'; + +import { authorizeµ, createParAuthorizeUrlµ } from './authorize.request.js'; import { - toAuthorizationError, - isFetchBaseQueryError, - toDispatchError, - isStringRecord, - hasPushRequestUri, buildAuthorizeOptions, buildParAuthorizeUrl, + hasPushRequestUri, + isFetchBaseQueryError, + isStringRecord, + toAuthorizationError, + toDispatchError, } from './authorize.request.utils.js'; -import type { OidcConfig } from './config.types.js'; + +import type { CustomLogger } from '@forgerock/sdk-logger'; import type { WellknownResponse } from '@forgerock/sdk-types'; + import type { ClientStore } from './client.types.js'; +import type { OidcConfig } from './config.types.js'; const clientId = '123456789'; const redirectUri = 'https://example.com/callback.html'; @@ -60,7 +64,7 @@ const mockLog = { error: vi.fn(), info: vi.fn(), warn: vi.fn(), -} as unknown as import('@forgerock/sdk-logger').CustomLogger; +} as unknown as CustomLogger; const sessionStorageStub = { getItem: vi.fn(), setItem: vi.fn(), removeItem: vi.fn() }; diff --git a/packages/oidc-client/src/lib/authorize.request.utils.ts b/packages/oidc-client/src/lib/authorize.request.utils.ts index ae70d9874f..307520f441 100644 --- a/packages/oidc-client/src/lib/authorize.request.utils.ts +++ b/packages/oidc-client/src/lib/authorize.request.utils.ts @@ -1,12 +1,13 @@ /* - * 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 type { GetAuthorizationUrlOptions, WellknownResponse } from '@forgerock/sdk-types'; import type { SerializedError } from '@reduxjs/toolkit'; import type { FetchBaseQueryError } from '@reduxjs/toolkit/query'; -import type { WellknownResponse, GetAuthorizationUrlOptions } from '@forgerock/sdk-types'; + import type { AuthorizationError, OptionalAuthorizeOptions } from './authorize.request.types.js'; import type { OidcConfig } from './config.types.js'; diff --git a/packages/oidc-client/src/lib/client.store.test.ts b/packages/oidc-client/src/lib/client.store.test.ts index d6d543ac15..0725955fac 100644 --- a/packages/oidc-client/src/lib/client.store.test.ts +++ b/packages/oidc-client/src/lib/client.store.test.ts @@ -1,5 +1,5 @@ /* - * Copyright © 2025 - 2026 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. @@ -7,7 +7,7 @@ import { http, HttpResponse } from 'msw'; import { setupServer } from 'msw/node'; -import { it, expect, describe, vi, beforeEach, afterEach, afterAll, beforeAll } from 'vitest'; +import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'; import { oidc } from './client.store.js'; diff --git a/packages/oidc-client/src/lib/client.store.ts b/packages/oidc-client/src/lib/client.store.ts index d96d181805..f2354945b2 100644 --- a/packages/oidc-client/src/lib/client.store.ts +++ b/packages/oidc-client/src/lib/client.store.ts @@ -1,30 +1,31 @@ /* - * Copyright © 2025 - 2026 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 { logger as loggerFn } from '@forgerock/sdk-logger'; import { createAuthorizeUrl } from '@forgerock/sdk-oidc'; +import { handleMicroExit } from '@forgerock/sdk-utilities'; import { createStorage } from '@forgerock/storage'; import { Micro } from 'effect'; import { causeIsDie, exitIsFail, exitIsSuccess } from 'effect/Micro'; import { authorizeµ, createParAuthorizeUrlµ } from './authorize.request.js'; -import { buildTokenExchangeµ } from './exchange.request.js'; import { createClientStore, createTokenError } from './client.store.utils.js'; -import { handleMicroExit } from '@forgerock/sdk-utilities'; -import { isExpiryWithinThreshold } from './token.utils.js'; +import { buildTokenExchangeµ } from './exchange.request.js'; import { logoutµ } from './logout.request.js'; import { oidcApi } from './oidc.api.js'; -import { sessionCheckNoneµ, sessionCheckIdTokenµ } from './session.micros.js'; +import { sessionCheckIdTokenµ, sessionCheckNoneµ } from './session.micros.js'; +import { isExpiryWithinThreshold } from './token.utils.js'; import { wellknownApi, wellknownSelector } from './wellknown.api.js'; +import type { CustomLogger, LogLevel } from '@forgerock/sdk-logger'; import type { ActionTypes, RequestMiddleware } from '@forgerock/sdk-request-middleware'; import type { GenericError, GetAuthorizationUrlOptions } from '@forgerock/sdk-types'; -import type { CustomLogger, LogLevel } from '@forgerock/sdk-logger'; import type { StorageConfig } from '@forgerock/storage'; +import type { AuthorizationError, AuthorizationSuccess } from './authorize.request.types.js'; import type { GetTokensOptions, LogoutErrorResult, @@ -34,7 +35,6 @@ import type { UserInfoResponse, } from './client.types.js'; import type { OauthTokens, OidcConfig } from './config.types.js'; -import type { AuthorizationError, AuthorizationSuccess } from './authorize.request.types.js'; import type { TokenExchangeErrorResponse } from './exchange.types.js'; import type { SessionCheckOptions, SessionCheckSuccess } from './session.types.js'; diff --git a/packages/oidc-client/src/lib/client.store.utils.ts b/packages/oidc-client/src/lib/client.store.utils.ts index f7c5f30792..be2f53eb7c 100644 --- a/packages/oidc-client/src/lib/client.store.utils.ts +++ b/packages/oidc-client/src/lib/client.store.utils.ts @@ -1,17 +1,18 @@ /* - * 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 type { ActionTypes, RequestMiddleware } from '@forgerock/sdk-request-middleware'; -import { logger as loggerFn } from '@forgerock/sdk-logger'; +import { configureStore } from '@reduxjs/toolkit'; -import { configureStore, type SerializedError } from '@reduxjs/toolkit'; import { oidcApi } from './oidc.api.js'; import { wellknownApi } from './wellknown.api.js'; +import type { logger as loggerFn } from '@forgerock/sdk-logger'; +import type { ActionTypes, RequestMiddleware } from '@forgerock/sdk-request-middleware'; import type { GenericError } from '@forgerock/sdk-types'; +import type { SerializedError } from '@reduxjs/toolkit'; import type { FetchBaseQueryError } from '@reduxjs/toolkit/query'; /** diff --git a/packages/oidc-client/src/lib/client.types.ts b/packages/oidc-client/src/lib/client.types.ts index 6a04c919b3..7e091b84fc 100644 --- a/packages/oidc-client/src/lib/client.types.ts +++ b/packages/oidc-client/src/lib/client.types.ts @@ -1,13 +1,14 @@ /* - * 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 type { GenericError, GetAuthorizationUrlOptions } from '@forgerock/sdk-types'; import type { StorageConfig } from '@forgerock/storage'; -import { createClientStore } from './client.store.utils.js'; -import { oidc } from './client.store.js'; + +import type { oidc } from './client.store.js'; +import type { createClientStore } from './client.store.utils.js'; export type OidcClient = Awaited>; diff --git a/packages/oidc-client/src/lib/exchange.request.ts b/packages/oidc-client/src/lib/exchange.request.ts index 4fb4e57110..4edded807c 100644 --- a/packages/oidc-client/src/lib/exchange.request.ts +++ b/packages/oidc-client/src/lib/exchange.request.ts @@ -1,19 +1,19 @@ /* - * 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 { Micro } from 'effect'; -import { logger } from '@forgerock/sdk-logger'; - import { createValuesµ, handleTokenResponseµ, validateValuesµ } from './exchange.utils.js'; import { oidcApi } from './oidc.api.js'; +import type { logger } from '@forgerock/sdk-logger'; +import type { StorageConfig } from '@forgerock/storage'; + import type { ClientStore } from './client.types.js'; import type { OauthTokens, OidcConfig } from './config.types.js'; -import type { StorageConfig } from '@forgerock/storage'; import type { TokenExchangeErrorResponse } from './exchange.types.js'; interface BuildTokenExchangeµParams { diff --git a/packages/oidc-client/src/lib/exchange.utils.test.ts b/packages/oidc-client/src/lib/exchange.utils.test.ts index d64cccabc8..903b70829c 100644 --- a/packages/oidc-client/src/lib/exchange.utils.test.ts +++ b/packages/oidc-client/src/lib/exchange.utils.test.ts @@ -1,15 +1,18 @@ /* - * 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 { it, expect } from '@effect/vitest'; +import { expect, it } from '@effect/vitest'; import { Micro } from 'effect'; + import { handleTokenResponseµ, validateValuesµ } from './exchange.utils.js'; -import type { OidcConfig } from './config.types.js'; + import type { GetAuthorizationUrlOptions } from '@forgerock/sdk-types'; +import type { OidcConfig } from './config.types.js'; + const clientId = '123456789'; const redirectUri = 'https://example.com/callback.html'; const scope = 'openid profile'; diff --git a/packages/oidc-client/src/lib/exchange.utils.ts b/packages/oidc-client/src/lib/exchange.utils.ts index b3314a6ab4..6cb6423476 100644 --- a/packages/oidc-client/src/lib/exchange.utils.ts +++ b/packages/oidc-client/src/lib/exchange.utils.ts @@ -1,20 +1,20 @@ /* - * 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 type { SerializedError } from '@reduxjs/toolkit'; -import type { FetchBaseQueryError } from '@reduxjs/toolkit/query'; +import { getStoredAuthUrlValues } from '@forgerock/sdk-oidc'; import { Micro } from 'effect'; -import { getStoredAuthUrlValues } from '@forgerock/sdk-oidc'; import type { GetAuthorizationUrlOptions } from '@forgerock/sdk-types'; import type { StorageConfig } from '@forgerock/storage'; +import type { SerializedError } from '@reduxjs/toolkit'; +import type { FetchBaseQueryError } from '@reduxjs/toolkit/query'; +import type { OidcConfig } from './config.types.js'; import type { TokenExchangeResponse, TokenRequestOptions } from './exchange.types.js'; import type { TokenExchangeErrorResponse } from './exchange.types.js'; -import type { OidcConfig } from './config.types.js'; export function createValuesµ( code: string, diff --git a/packages/oidc-client/src/lib/logout.request.test.ts b/packages/oidc-client/src/lib/logout.request.test.ts index 09bc0af911..3acea95060 100644 --- a/packages/oidc-client/src/lib/logout.request.test.ts +++ b/packages/oidc-client/src/lib/logout.request.test.ts @@ -1,18 +1,20 @@ /* - * 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 { it, expect, describe } from '@effect/vitest'; +import { describe, expect, it } from '@effect/vitest'; +import { logger as loggerFn } from '@forgerock/sdk-logger'; +import { createStorage } from '@forgerock/storage'; import { Micro } from 'effect'; -import { deepStrictEqual } from 'node:assert'; -import { setupServer } from 'msw/node'; import { http, HttpResponse } from 'msw'; -import { logoutµ } from './logout.request.js'; -import { createStorage } from '@forgerock/storage'; +import { setupServer } from 'msw/node'; +import { deepStrictEqual } from 'node:assert'; + import { createClientStore } from './client.store.utils.js'; -import { logger as loggerFn } from '@forgerock/sdk-logger'; +import { logoutµ } from './logout.request.js'; + import type { OauthTokens, OidcConfig } from './config.types.js'; const server = setupServer( diff --git a/packages/oidc-client/src/lib/logout.request.ts b/packages/oidc-client/src/lib/logout.request.ts index 92ee6869d6..99084ae7d4 100644 --- a/packages/oidc-client/src/lib/logout.request.ts +++ b/packages/oidc-client/src/lib/logout.request.ts @@ -1,17 +1,19 @@ /* - * 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 { Micro } from 'effect'; -import { oidcApi } from './oidc.api.js'; + import { createLogoutError } from './client.store.utils.js'; +import { oidcApi } from './oidc.api.js'; -import type { OauthTokens, OidcConfig } from './config.types.js'; import type { WellknownResponse } from '@forgerock/sdk-types'; import type { StorageClient } from '@forgerock/storage'; + import type { ClientStore, LogoutErrorResult, LogoutSuccessResult } from './client.types.js'; +import type { OauthTokens, OidcConfig } from './config.types.js'; export function logoutµ({ tokens, diff --git a/packages/oidc-client/src/lib/oidc.api.ts b/packages/oidc-client/src/lib/oidc.api.ts index 54f9d10eba..44c3accc39 100644 --- a/packages/oidc-client/src/lib/oidc.api.ts +++ b/packages/oidc-client/src/lib/oidc.api.ts @@ -1,32 +1,30 @@ /* - * Copyright © 2025 - 2026 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 { - createApi, - fetchBaseQuery, - type FetchArgs, - type FetchBaseQueryError, - type FetchBaseQueryMeta, - type QueryReturnValue, -} from '@reduxjs/toolkit/query'; -import type { OidcConfig } from './config.types.js'; -import { transformError } from './oidc.api.utils.js'; import { iFrameManager } from '@forgerock/iframe-manager'; -import { - initQuery, - type ActionTypes, - type RequestMiddleware, -} from '@forgerock/sdk-request-middleware'; +import { initQuery } from '@forgerock/sdk-request-middleware'; +import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'; + +import { transformError } from './oidc.api.utils.js'; import type { logger as loggerFn } from '@forgerock/sdk-logger'; -import type { TokenExchangeResponse } from './exchange.types.js'; +import type { ActionTypes, RequestMiddleware } from '@forgerock/sdk-request-middleware'; +import type { GenericError } from '@forgerock/sdk-types'; +import type { + FetchArgs, + FetchBaseQueryError, + FetchBaseQueryMeta, + QueryReturnValue, +} from '@reduxjs/toolkit/query'; + import type { AuthorizationSuccess, AuthorizeSuccessResponse } from './authorize.request.types.js'; import type { UserInfoResponse } from './client.types.js'; +import type { OidcConfig } from './config.types.js'; +import type { TokenExchangeResponse } from './exchange.types.js'; import type { PushAuthorizationResponse } from './par.types.js'; -import type { GenericError } from '@forgerock/sdk-types'; import type { SessionCheckResponseType } from './session.types.js'; const IFRAME_TIMEOUT_MS = 3000; diff --git a/packages/oidc-client/src/lib/oidc.api.utils.ts b/packages/oidc-client/src/lib/oidc.api.utils.ts index 5f8283f401..9e85a69b3b 100644 --- a/packages/oidc-client/src/lib/oidc.api.utils.ts +++ b/packages/oidc-client/src/lib/oidc.api.utils.ts @@ -1,10 +1,10 @@ /* - * 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 { GenericError } from '@forgerock/sdk-types'; +import type { GenericError } from '@forgerock/sdk-types'; export function transformError( error: string, diff --git a/packages/oidc-client/src/lib/session.micros.test.ts b/packages/oidc-client/src/lib/session.micros.test.ts index 581d84d366..12817cb8c1 100644 --- a/packages/oidc-client/src/lib/session.micros.test.ts +++ b/packages/oidc-client/src/lib/session.micros.test.ts @@ -1,35 +1,36 @@ /* - * Copyright © 2026 Ping Identity Corporation. All rights reserved. + * 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. */ -import { it, expect } from '@effect/vitest'; -import { Micro } from 'effect'; -import { vi, afterEach, describe } from 'vitest'; +import { expect, it } from '@effect/vitest'; +import { logger as loggerFn } from '@forgerock/sdk-logger'; import * as sdkUtilities from '@forgerock/sdk-utilities'; +import { Micro } from 'effect'; +import { afterEach, describe, vi } from 'vitest'; +import { oidcApi } from './oidc.api.js'; import { - buildNoneUrl, buildIdTokenUrl, - dispatchSessionCheckIframeµ, + buildNoneUrl, dispatchSessionCheckFetchµ, + dispatchSessionCheckIframeµ, readStoredIdTokenµ, sessionCheckIdTokenµ, sessionCheckNoneµ, validateSessionCheckResponseµ, } from './session.micros.js'; -import { oidcApi } from './oidc.api.js'; -import { logger as loggerFn } from '@forgerock/sdk-logger'; -import type { OidcConfig } from './config.types.js'; import type { WellknownResponse } from '@forgerock/sdk-types'; -import type { ClientStore } from './client.types.js'; -import type { StorageClient } from '@forgerock/storage'; -import type { OauthTokens } from './config.types.js'; import type { GenericError } from '@forgerock/sdk-types'; +import type { StorageClient } from '@forgerock/storage'; import type { JWTPayload } from 'jose'; +import type { ClientStore } from './client.types.js'; +import type { OidcConfig } from './config.types.js'; +import type { OauthTokens } from './config.types.js'; + // ─── Fixtures ──────────────────────────────────────────────────────────────── const clientId = 'test-client-id'; diff --git a/packages/oidc-client/src/lib/session.micros.ts b/packages/oidc-client/src/lib/session.micros.ts index 561291dce0..7c61f25ffa 100644 --- a/packages/oidc-client/src/lib/session.micros.ts +++ b/packages/oidc-client/src/lib/session.micros.ts @@ -1,23 +1,22 @@ /* - * Copyright © 2026 Ping Identity Corporation. All rights reserved. + * 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. */ -import { Micro } from 'effect'; - import { createRandomString, createState } from '@forgerock/sdk-utilities'; +import { Micro } from 'effect'; +import { decodeJwt } from 'jose/jwt/decode'; import { oidcApi } from './oidc.api.js'; -import { decodeJwt } from 'jose/jwt/decode'; -import type { JWTPayload } from 'jose'; - import type { CustomLogger } from '@forgerock/sdk-logger'; import type { GenericError, WellknownResponse } from '@forgerock/sdk-types'; import type { StorageClient } from '@forgerock/storage'; -import type { OauthTokens, OidcConfig } from './config.types.js'; +import type { JWTPayload } from 'jose'; + import type { ClientStore } from './client.types.js'; +import type { OauthTokens, OidcConfig } from './config.types.js'; import type { SessionCheckOptions, SessionCheckSuccess } from './session.types.js'; // ─── Storage read ───────────────────────────────────────────────────────────── diff --git a/packages/oidc-client/src/lib/wellknown.api.ts b/packages/oidc-client/src/lib/wellknown.api.ts index b4da332e53..44a5ba10f8 100644 --- a/packages/oidc-client/src/lib/wellknown.api.ts +++ b/packages/oidc-client/src/lib/wellknown.api.ts @@ -1,13 +1,13 @@ /* - * 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 { initWellknownQuery } from '@forgerock/sdk-oidc'; import { createSelector } from '@reduxjs/toolkit'; import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'; -import { initWellknownQuery } from '@forgerock/sdk-oidc'; import type { WellknownResponse } from '@forgerock/sdk-types'; import type { @@ -15,6 +15,7 @@ import type { FetchBaseQueryMeta, QueryReturnValue, } from '@reduxjs/toolkit/query'; + import type { RootState } from './client.types.js'; /** diff --git a/packages/protect/src/lib/protect.test.ts b/packages/protect/src/lib/protect.test.ts index ed3a0d96a3..d72b7f1e49 100644 --- a/packages/protect/src/lib/protect.test.ts +++ b/packages/protect/src/lib/protect.test.ts @@ -1,6 +1,6 @@ /* * - * Copyright © 2025 - 2026 Ping Identity Corporation. All right reserved. + * Copyright (c) 2025 - 2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. @@ -8,7 +8,8 @@ */ import { protect } from './protect.js'; -import { ProtectConfig, Protect } from './protect.types.js'; + +import type { Protect, ProtectConfig } from './protect.types.js'; const config: ProtectConfig = { envId: '12345', diff --git a/packages/protect/src/lib/protect.ts b/packages/protect/src/lib/protect.ts index c25a9fe75c..7d9e37bb3d 100644 --- a/packages/protect/src/lib/protect.ts +++ b/packages/protect/src/lib/protect.ts @@ -1,13 +1,13 @@ /* * - * Copyright © 2025 - 2026 Ping Identity Corporation. All right reserved. + * Copyright (c) 2025 - 2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. * */ -import { Protect, ProtectConfig, SignalsInitializationOptions } from './protect.types.js'; +import type { Protect, ProtectConfig, SignalsInitializationOptions } from './protect.types.js'; // Add Signals SDK namespace to the window object declare global { diff --git a/packages/sdk-effects/iframe-manager/src/lib/iframe-manager.effects.test.ts b/packages/sdk-effects/iframe-manager/src/lib/iframe-manager.effects.test.ts index d2ebdefeca..1edebc3d3f 100644 --- a/packages/sdk-effects/iframe-manager/src/lib/iframe-manager.effects.test.ts +++ b/packages/sdk-effects/iframe-manager/src/lib/iframe-manager.effects.test.ts @@ -1,11 +1,12 @@ /* - * Copyright © 2025 - 2026 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 { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; + import { iFrameManager } from './iframe-manager.effects.js'; /** diff --git a/packages/sdk-effects/logger/src/lib/logger.effects.ts b/packages/sdk-effects/logger/src/lib/logger.effects.ts index be365c4221..3f04247cb2 100644 --- a/packages/sdk-effects/logger/src/lib/logger.effects.ts +++ b/packages/sdk-effects/logger/src/lib/logger.effects.ts @@ -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 { CustomLogger, LogLevel, LogMessage } from './logger.types.js'; +import type { CustomLogger, LogLevel, LogMessage } from './logger.types.js'; export function logger(config: { level: LogLevel; custom?: CustomLogger }) { let logLevel: LogLevel = config.level || 'info'; diff --git a/packages/sdk-effects/logger/src/lib/logger.test.ts b/packages/sdk-effects/logger/src/lib/logger.test.ts index cd36e2c107..69d01c3063 100644 --- a/packages/sdk-effects/logger/src/lib/logger.test.ts +++ b/packages/sdk-effects/logger/src/lib/logger.test.ts @@ -1,11 +1,12 @@ /* - * 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 { describe, it, expect, vi, beforeEach } from 'vitest'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; + import { logger } from './logger.effects.js'; describe('logger', () => { diff --git a/packages/sdk-effects/oidc/src/lib/authorize.effects.ts b/packages/sdk-effects/oidc/src/lib/authorize.effects.ts index f196238674..e6ec8cb450 100644 --- a/packages/sdk-effects/oidc/src/lib/authorize.effects.ts +++ b/packages/sdk-effects/oidc/src/lib/authorize.effects.ts @@ -1,5 +1,5 @@ /* - * 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. @@ -10,8 +10,8 @@ */ import { createChallenge } from '@forgerock/sdk-utilities'; -import { generateAndStoreAuthUrlValues } from './state-pkce.effects.js'; import { buildAuthorizeParams } from './authorize.utils.js'; +import { generateAndStoreAuthUrlValues } from './state-pkce.effects.js'; import type { GetAuthorizationUrlOptions } from '@forgerock/sdk-types'; diff --git a/packages/sdk-effects/oidc/src/lib/authorize.test.ts b/packages/sdk-effects/oidc/src/lib/authorize.test.ts index 484e8bed25..d8f4d9abb3 100644 --- a/packages/sdk-effects/oidc/src/lib/authorize.test.ts +++ b/packages/sdk-effects/oidc/src/lib/authorize.test.ts @@ -1,16 +1,18 @@ /* - * 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 type { GenerateAndStoreAuthUrlValues } from '@forgerock/sdk-types'; -import { describe, expect, it, beforeEach } from 'vitest'; +import { beforeEach, describe, expect, it } from 'vitest'; + import { createAuthorizeUrl } from './authorize.effects.js'; import { buildAuthorizeParams } from './authorize.utils.js'; import { getStorageKey } from './state-pkce.effects.js'; +import type { GenerateAndStoreAuthUrlValues } from '@forgerock/sdk-types'; + const mockSessionStorage = (() => { let store: { [key: string]: string } = {}; return { diff --git a/packages/sdk-effects/oidc/src/lib/state-pkce.effects.ts b/packages/sdk-effects/oidc/src/lib/state-pkce.effects.ts index f24df9fdfb..eba5d80745 100644 --- a/packages/sdk-effects/oidc/src/lib/state-pkce.effects.ts +++ b/packages/sdk-effects/oidc/src/lib/state-pkce.effects.ts @@ -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 { createVerifier, createState } from '@forgerock/sdk-utilities'; +import { createState, createVerifier } from '@forgerock/sdk-utilities'; import type { GenerateAndStoreAuthUrlValues, diff --git a/packages/sdk-effects/oidc/src/lib/state-pkce.test.ts b/packages/sdk-effects/oidc/src/lib/state-pkce.test.ts index 8c2e67b834..428531d0b1 100644 --- a/packages/sdk-effects/oidc/src/lib/state-pkce.test.ts +++ b/packages/sdk-effects/oidc/src/lib/state-pkce.test.ts @@ -1,16 +1,18 @@ /* - * 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 { describe, expect, it, beforeEach } from 'vitest'; +import { beforeEach, describe, expect, it } from 'vitest'; + import { generateAndStoreAuthUrlValues, getStorageKey, getStoredAuthUrlValues, } from './state-pkce.effects.js'; + import type { GenerateAndStoreAuthUrlValues } from '@forgerock/sdk-types'; const mockSessionStorage = (() => { diff --git a/packages/sdk-effects/oidc/src/lib/wellknown.effects.test.ts b/packages/sdk-effects/oidc/src/lib/wellknown.effects.test.ts index cbf7033e30..3c9d6ebf61 100644 --- a/packages/sdk-effects/oidc/src/lib/wellknown.effects.test.ts +++ b/packages/sdk-effects/oidc/src/lib/wellknown.effects.test.ts @@ -1,12 +1,13 @@ /* - * 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 { describe, it, expect } from 'vitest'; -import { isValidWellknownResponse, initWellknownQuery } from './wellknown.effects.js'; +import { describe, expect, it } from 'vitest'; + +import { initWellknownQuery, isValidWellknownResponse } from './wellknown.effects.js'; import type { WellknownResponse } from '@forgerock/sdk-types'; diff --git a/packages/sdk-effects/oidc/src/lib/wellknown.effects.ts b/packages/sdk-effects/oidc/src/lib/wellknown.effects.ts index 3836173422..aa1fe837ed 100644 --- a/packages/sdk-effects/oidc/src/lib/wellknown.effects.ts +++ b/packages/sdk-effects/oidc/src/lib/wellknown.effects.ts @@ -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 type { WellknownResponse, GenericError } from '@forgerock/sdk-types'; +import type { GenericError, WellknownResponse } from '@forgerock/sdk-types'; /** * Structural types compatible with RTK Query's shapes. diff --git a/packages/sdk-effects/sdk-request-middleware/src/lib/request-mware.effects.ts b/packages/sdk-effects/sdk-request-middleware/src/lib/request-mware.effects.ts index bd27a87d57..a1564568aa 100644 --- a/packages/sdk-effects/sdk-request-middleware/src/lib/request-mware.effects.ts +++ b/packages/sdk-effects/sdk-request-middleware/src/lib/request-mware.effects.ts @@ -1,19 +1,19 @@ /* - * 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 { +import { actionTypes } from './request-mware.derived.js'; + +import type { FetchArgs, FetchBaseQueryError, FetchBaseQueryMeta, QueryReturnValue, } from '@reduxjs/toolkit/query'; -import { actionTypes } from './request-mware.derived.js'; - import type { ActionTypes, EndpointTypes } from './request-mware.derived.js'; import type { ModifiedFetchArgs, RequestMiddleware } from './request-mware.types.js'; diff --git a/packages/sdk-effects/sdk-request-middleware/src/lib/request-mware.test.ts b/packages/sdk-effects/sdk-request-middleware/src/lib/request-mware.test.ts index acecbdc391..dd86f6ba64 100644 --- a/packages/sdk-effects/sdk-request-middleware/src/lib/request-mware.test.ts +++ b/packages/sdk-effects/sdk-request-middleware/src/lib/request-mware.test.ts @@ -1,11 +1,14 @@ /* - * 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 { +import { initQuery, middlewareWrapper } from './request-mware.effects.js'; +import middleware from './request-mware.mock.js'; + +import type { FetchArgs, FetchBaseQueryError, FetchBaseQueryMeta, @@ -15,9 +18,6 @@ import { import type { ActionTypes } from './request-mware.derived.js'; import type { Action, ModifiedFetchArgs } from './request-mware.types.js'; -import { initQuery, middlewareWrapper } from './request-mware.effects.js'; -import middleware from './request-mware.mock.js'; - type BaseQueryResponse = Promise< QueryReturnValue >; diff --git a/packages/sdk-effects/sdk-request-middleware/src/lib/request-mware.types.ts b/packages/sdk-effects/sdk-request-middleware/src/lib/request-mware.types.ts index 55973eecde..0db97d7179 100644 --- a/packages/sdk-effects/sdk-request-middleware/src/lib/request-mware.types.ts +++ b/packages/sdk-effects/sdk-request-middleware/src/lib/request-mware.types.ts @@ -1,18 +1,18 @@ /* - * 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 { +import type { FetchArgs, FetchBaseQueryError, FetchBaseQueryMeta, QueryReturnValue, } from '@reduxjs/toolkit/query'; -import { ActionTypes } from './request-mware.derived.js'; +import type { ActionTypes } from './request-mware.derived.js'; export type RequestMiddleware = ( req: ModifiedFetchArgs, diff --git a/packages/sdk-effects/storage/src/lib/storage.effects.test.ts b/packages/sdk-effects/storage/src/lib/storage.effects.test.ts index 2d4357a83e..7b1b22744c 100644 --- a/packages/sdk-effects/storage/src/lib/storage.effects.test.ts +++ b/packages/sdk-effects/storage/src/lib/storage.effects.test.ts @@ -1,13 +1,17 @@ /* - * 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 { describe, it, expect, vi, beforeEach } from 'vitest'; -import { createStorage, type StorageConfig } from './storage.effects.js'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; + +import { createStorage } from './storage.effects.js'; + import type { CustomStorageObject, GenericError } from '@forgerock/sdk-types'; +import type { StorageConfig } from './storage.effects.js'; + const localStorageMock = (() => { let store: Record = {}; return { diff --git a/packages/sdk-effects/storage/src/lib/storage.effects.ts b/packages/sdk-effects/storage/src/lib/storage.effects.ts index 64706f07f4..fbe66144df 100644 --- a/packages/sdk-effects/storage/src/lib/storage.effects.ts +++ b/packages/sdk-effects/storage/src/lib/storage.effects.ts @@ -1,10 +1,10 @@ /* - * 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 { CustomStorageObject, GenericError } from '@forgerock/sdk-types'; +import type { CustomStorageObject, GenericError } from '@forgerock/sdk-types'; export interface StorageClient { get: () => Promise; diff --git a/packages/sdk-types/src/lib/config.types.ts b/packages/sdk-types/src/lib/config.types.ts index 4a4a3f63cf..1bdfdf8321 100644 --- a/packages/sdk-types/src/lib/config.types.ts +++ b/packages/sdk-types/src/lib/config.types.ts @@ -1,10 +1,10 @@ /* - * 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 { CustomStorageObject } from './tokens.types.js'; +import type { CustomStorageObject } from './tokens.types.js'; /** * Union of possible OAuth Configs diff --git a/packages/sdk-types/src/lib/legacy-config.types.ts b/packages/sdk-types/src/lib/legacy-config.types.ts index a66da83553..2130296045 100644 --- a/packages/sdk-types/src/lib/legacy-config.types.ts +++ b/packages/sdk-types/src/lib/legacy-config.types.ts @@ -1,5 +1,5 @@ /* - * 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. @@ -11,7 +11,7 @@ import type { Callback, CustomPathConfig } from './am-callback.types.js'; import type { LegacyRequestMiddleware } from './legacy-mware.types.js'; -import { CustomStorageObject } from './tokens.types.js'; +import type { CustomStorageObject } from './tokens.types.js'; /** * Configuration settings for connecting to a server. diff --git a/packages/sdk-utilities/src/lib/error/error.utils.test.ts b/packages/sdk-utilities/src/lib/error/error.utils.test.ts index d71b707167..47ee41bcd8 100644 --- a/packages/sdk-utilities/src/lib/error/error.utils.test.ts +++ b/packages/sdk-utilities/src/lib/error/error.utils.test.ts @@ -1,12 +1,14 @@ /* - * 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 { describe, it, expect } from 'vitest'; +import { describe, expect, it } from 'vitest'; + import { isGenericError } from './error.utils.js'; + import type { GenericError } from '@forgerock/sdk-types'; describe('isGenericError', () => { diff --git a/packages/sdk-utilities/src/lib/micro.utils.ts b/packages/sdk-utilities/src/lib/micro.utils.ts index f5febe126d..cf58145f3b 100644 --- a/packages/sdk-utilities/src/lib/micro.utils.ts +++ b/packages/sdk-utilities/src/lib/micro.utils.ts @@ -1,12 +1,13 @@ /* - * 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 { causeIsDie, exitIsFail, exitIsSuccess } from 'effect/Micro'; -import type { MicroExit } from 'effect/Micro'; + import type { GenericError } from '@forgerock/sdk-types'; +import type { MicroExit } from 'effect/Micro'; export function handleMicroExit( result: MicroExit, diff --git a/packages/sdk-utilities/src/lib/oidc/pkce.test.ts b/packages/sdk-utilities/src/lib/oidc/pkce.test.ts index 6747f0cd83..7cb39136b8 100644 --- a/packages/sdk-utilities/src/lib/oidc/pkce.test.ts +++ b/packages/sdk-utilities/src/lib/oidc/pkce.test.ts @@ -1,6 +1,6 @@ /* * - * Copyright © 2025 Ping Identity Corporation. All right reserved. + * Copyright (c) 2025 - 2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. @@ -10,9 +10,10 @@ /** * @jest-environment jsdom */ -import { expect, describe, it } from 'vitest'; import * as crypto from 'crypto'; import { TextEncoder } from 'util'; +import { describe, expect, it } from 'vitest'; + import { createChallenge, createVerifier } from './pkce.utils.js'; declare let window: unknown; diff --git a/packages/sdk-utilities/src/lib/url/am-url.test.ts b/packages/sdk-utilities/src/lib/url/am-url.test.ts index 7c447d6e0f..20eef7e124 100644 --- a/packages/sdk-utilities/src/lib/url/am-url.test.ts +++ b/packages/sdk-utilities/src/lib/url/am-url.test.ts @@ -1,6 +1,6 @@ /* * - * Copyright © 2025 Ping Identity Corporation. All right reserved. + * Copyright (c) 2025 - 2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. @@ -8,7 +8,8 @@ */ import { getEndpointPath, getRealmUrlPath } from './am-url.utils.js'; -import { GetEndpointPathParams } from './am-url.types.js'; + +import type { GetEndpointPathParams } from './am-url.types.js'; describe('The URL utility functions', () => { it('getRealmUrlPath creates the correct paths', () => { diff --git a/packages/sdk-utilities/src/lib/wellknown/wellknown.utils.test.ts b/packages/sdk-utilities/src/lib/wellknown/wellknown.utils.test.ts index e325c6dac5..8213ee7f6c 100644 --- a/packages/sdk-utilities/src/lib/wellknown/wellknown.utils.test.ts +++ b/packages/sdk-utilities/src/lib/wellknown/wellknown.utils.test.ts @@ -1,12 +1,13 @@ /* - * 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 { describe, it, expect } from 'vitest'; -import { isValidWellknownUrl, createWellknownError } from './wellknown.utils.js'; +import { describe, expect, it } from 'vitest'; + +import { createWellknownError, isValidWellknownUrl } from './wellknown.utils.js'; describe('wellknown.utils', () => { describe('isValidWellknownUrl', () => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9412fb80ad..9e1650007e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -212,6 +212,9 @@ importers: eslint-plugin-prettier: specifier: ^5.2.3 version: 5.5.4(@types/eslint@9.6.1)(eslint-config-prettier@10.1.8(eslint@9.39.4(jiti@2.6.1)))(eslint@9.39.4(jiti@2.6.1))(prettier@3.8.3) + eslint-plugin-simple-import-sort: + specifier: ^13.0.0 + version: 13.0.0(eslint@9.39.4(jiti@2.6.1)) fast-check: specifier: ^4.0.0 version: 4.7.0 @@ -4870,6 +4873,11 @@ packages: eslint-config-prettier: optional: true + eslint-plugin-simple-import-sort@13.0.0: + resolution: {integrity: sha512-McAc+/Nlvcg4byY/CABGH8kqnefWBj8s3JA2okEtz8ixbECQgU46p0HkTUKa4YS7wvgGceimlc34p1nXqbWqtA==} + peerDependencies: + eslint: '>=5.0.0' + eslint-scope@5.1.1: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} @@ -11745,7 +11753,7 @@ snapshots: std-env: 3.10.0 test-exclude: 7.0.1 tinyrainbow: 2.0.0 - vitest: 3.2.4(@types/node@24.9.2)(@vitest/ui@3.2.4)(jiti@2.6.1)(jsdom@27.4.0(@noble/hashes@1.8.0))(msw@2.12.1(@types/node@24.9.2)(typescript@5.9.3))(terser@5.46.2)(tsx@4.21.0)(yaml@2.8.1) + vitest: 3.2.4(@types/node@24.9.2)(@vitest/ui@3.2.4)(jiti@2.6.1)(jsdom@27.4.0(@noble/hashes@1.8.0))(msw@2.12.1(@types/node@24.9.2)(typescript@5.8.3))(terser@5.46.2)(tsx@4.21.0)(yaml@2.8.1) transitivePeerDependencies: - supports-color @@ -11804,7 +11812,7 @@ snapshots: sirv: 3.0.2 tinyglobby: 0.2.15 tinyrainbow: 2.0.0 - vitest: 3.2.4(@types/node@24.9.2)(@vitest/ui@3.2.4)(jiti@2.6.1)(jsdom@27.4.0(@noble/hashes@1.8.0))(msw@2.12.1(@types/node@24.9.2)(typescript@5.9.3))(terser@5.46.2)(tsx@4.21.0)(yaml@2.8.1) + vitest: 3.2.4(@types/node@24.9.2)(@vitest/ui@3.2.4)(jiti@2.6.1)(jsdom@27.4.0(@noble/hashes@1.8.0))(msw@2.12.1(@types/node@24.9.2)(typescript@5.8.3))(terser@5.46.2)(tsx@4.21.0)(yaml@2.8.1) '@vitest/utils@3.2.4': dependencies: @@ -13385,6 +13393,10 @@ snapshots: '@types/eslint': 9.6.1 eslint-config-prettier: 10.1.8(eslint@9.39.4(jiti@2.6.1)) + eslint-plugin-simple-import-sort@13.0.0(eslint@9.39.4(jiti@2.6.1)): + dependencies: + eslint: 9.39.4(jiti@2.6.1) + eslint-scope@5.1.1: dependencies: esrecurse: 4.3.0 @@ -17241,7 +17253,7 @@ snapshots: dependencies: cssfontparser: 1.2.1 moo-color: 1.0.3 - vitest: 3.2.4(@types/node@24.9.2)(@vitest/ui@3.2.4)(jiti@2.6.1)(jsdom@27.4.0(@noble/hashes@1.8.0))(msw@2.12.1(@types/node@24.9.2)(typescript@5.9.3))(terser@5.46.2)(tsx@4.21.0)(yaml@2.8.1) + vitest: 3.2.4(@types/node@24.9.2)(@vitest/ui@3.2.4)(jiti@2.6.1)(jsdom@27.4.0(@noble/hashes@1.8.0))(msw@2.12.1(@types/node@24.9.2)(typescript@5.8.3))(terser@5.46.2)(tsx@4.21.0)(yaml@2.8.1) vitest@3.2.4(@types/node@24.9.2)(@vitest/ui@3.2.4)(jiti@2.6.1)(jsdom@27.4.0(@noble/hashes@1.8.0))(msw@2.12.1(@types/node@24.9.2)(typescript@5.8.3))(terser@5.46.2)(tsx@4.21.0)(yaml@2.8.1): dependencies: diff --git a/tools/api-report/src/config.spec.ts b/tools/api-report/src/config.spec.ts index 8fe5452711..edbdbfca2a 100644 --- a/tools/api-report/src/config.spec.ts +++ b/tools/api-report/src/config.spec.ts @@ -1,4 +1,5 @@ -import { describe, it, expect } from 'vitest'; +import { describe, expect, it } from 'vitest'; + import { buildReportFileName } from './config.js'; describe('buildReportFileName', () => { diff --git a/tools/api-report/src/config.ts b/tools/api-report/src/config.ts index 1f6224e9be..b952aab13a 100644 --- a/tools/api-report/src/config.ts +++ b/tools/api-report/src/config.ts @@ -1,5 +1,6 @@ import { ExtractorConfig, ExtractorLogLevel } from '@microsoft/api-extractor'; import { resolve } from 'node:path'; + import type { EntryPoint } from './resolve-entries.js'; const WORKSPACE_ROOT = resolve(import.meta.dirname, '../../..'); diff --git a/tools/api-report/src/fixer.spec.ts b/tools/api-report/src/fixer.spec.ts index b54fbe96d6..5b26040279 100644 --- a/tools/api-report/src/fixer.spec.ts +++ b/tools/api-report/src/fixer.spec.ts @@ -1,12 +1,13 @@ import { resolve } from 'node:path'; -import { describe, it, expect } from 'vitest'; +import { describe, expect, it } from 'vitest'; + import { - parseForgottenExportMessage, - resolveSourcePackage, + buildReExportStatement, determineExportKind, findImportModuleForSymbol, - buildReExportStatement, insertReExport, + parseForgottenExportMessage, + resolveSourcePackage, } from './fixer.js'; describe('parseForgottenExportMessage', () => { diff --git a/tools/api-report/src/fixer.ts b/tools/api-report/src/fixer.ts index e00a06a0b4..6461182fd9 100644 --- a/tools/api-report/src/fixer.ts +++ b/tools/api-report/src/fixer.ts @@ -1,5 +1,5 @@ -import { readFileSync, writeFileSync, existsSync } from 'node:fs'; -import { resolve, relative } from 'node:path'; +import { existsSync, readFileSync, writeFileSync } from 'node:fs'; +import { relative, resolve } from 'node:path'; /** * Extracts the symbol name from an ae-forgotten-export message. diff --git a/tools/api-report/src/integration.spec.ts b/tools/api-report/src/integration.spec.ts index 6d7e30c31e..178a0b322a 100644 --- a/tools/api-report/src/integration.spec.ts +++ b/tools/api-report/src/integration.spec.ts @@ -1,9 +1,12 @@ -import { describe, it, expect, beforeEach, afterEach } from 'vitest'; -import { mkdirSync, writeFileSync, readFileSync, rmSync, mkdtempSync } from 'node:fs'; -import { resolve, join } from 'node:path'; +import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; import { tmpdir } from 'node:os'; -import { analyzePackage, type PackageInfo } from './main.js'; +import { join, resolve } from 'node:path'; +import { afterEach, beforeEach, describe, expect, it } from 'vitest'; + import { applyFixes } from './fixer.js'; +import { analyzePackage } from './main.js'; + +import type { PackageInfo } from './main.js'; let FIXTURE_ROOT: string; let CLIENT_DIR: string; diff --git a/tools/api-report/src/main.spec.ts b/tools/api-report/src/main.spec.ts index 9cdd3ff924..6cd163e7cf 100644 --- a/tools/api-report/src/main.spec.ts +++ b/tools/api-report/src/main.spec.ts @@ -1,4 +1,5 @@ -import { describe, it, expect } from 'vitest'; +import { describe, expect, it } from 'vitest'; + import { resolvePackageInfo } from './main.js'; describe('resolvePackageInfo', () => { diff --git a/tools/api-report/src/main.ts b/tools/api-report/src/main.ts index 46b72efbca..20226c9733 100644 --- a/tools/api-report/src/main.ts +++ b/tools/api-report/src/main.ts @@ -1,9 +1,15 @@ -import { Extractor, type ExtractorMessage } from '@microsoft/api-extractor'; -import { readFileSync, existsSync, mkdirSync } from 'node:fs'; +import { Extractor } from '@microsoft/api-extractor'; +import { existsSync, mkdirSync, readFileSync } from 'node:fs'; import { resolve } from 'node:path'; -import { resolveEntryPoints, type EntryPoint } from './resolve-entries.js'; + import { buildExtractorConfig } from './config.js'; -import { parseForgottenExportMessage, applyFixes, type ForgottenExport } from './fixer.js'; +import { applyFixes, parseForgottenExportMessage } from './fixer.js'; +import { resolveEntryPoints } from './resolve-entries.js'; + +import type { ExtractorMessage } from '@microsoft/api-extractor'; + +import type { ForgottenExport } from './fixer.js'; +import type { EntryPoint } from './resolve-entries.js'; const WORKSPACE_ROOT = resolve(import.meta.dirname, '../../..'); diff --git a/tools/api-report/src/resolve-entries.spec.ts b/tools/api-report/src/resolve-entries.spec.ts index 6010f71658..6fdd51ea43 100644 --- a/tools/api-report/src/resolve-entries.spec.ts +++ b/tools/api-report/src/resolve-entries.spec.ts @@ -1,4 +1,5 @@ -import { describe, it, expect } from 'vitest'; +import { describe, expect, it } from 'vitest'; + import { resolveEntryPoints } from './resolve-entries.js'; describe('resolveEntryPoints', () => { diff --git a/tools/interface-mapping-validator/src/differ.test.ts b/tools/interface-mapping-validator/src/differ.test.ts index 0b38f12759..55dfbc79b7 100644 --- a/tools/interface-mapping-validator/src/differ.test.ts +++ b/tools/interface-mapping-validator/src/differ.test.ts @@ -1,7 +1,9 @@ -import { describe, it, expect } from 'vitest'; -import { diff } from './differ.js'; -import type { LegacyExport, NewSdkExport, MarkdownExtractionResult } from './types.js'; +import { describe, expect, it } from 'vitest'; + import { SECTIONS } from './config.js'; +import { diff } from './differ.js'; + +import type { LegacyExport, MarkdownExtractionResult, NewSdkExport } from './types.js'; // --------------------------------------------------------------------------- // Test data helpers diff --git a/tools/interface-mapping-validator/src/differ.ts b/tools/interface-mapping-validator/src/differ.ts index b2b9d599a0..6f83bbbc8b 100644 --- a/tools/interface-mapping-validator/src/differ.ts +++ b/tools/interface-mapping-validator/src/differ.ts @@ -1,3 +1,5 @@ +import { PROTECTED_PREFIXES, SECTIONS } from './config.js'; + import type { Finding, FindingAction, @@ -7,7 +9,6 @@ import type { MarkdownExtractionResult, NewSdkExport, } from './types.js'; -import { PROTECTED_PREFIXES, SECTIONS } from './config.js'; // --------------------------------------------------------------------------- // Helpers diff --git a/tools/interface-mapping-validator/src/extractors/legacy.test.ts b/tools/interface-mapping-validator/src/extractors/legacy.test.ts index fb6f95db0a..7bba8fa90d 100644 --- a/tools/interface-mapping-validator/src/extractors/legacy.test.ts +++ b/tools/interface-mapping-validator/src/extractors/legacy.test.ts @@ -1,5 +1,6 @@ -import { describe, it, expect } from 'vitest'; import { resolve } from 'node:path'; +import { describe, expect, it } from 'vitest'; + import { extractLegacyExports } from './legacy.js'; const FIXTURE_PATH = resolve(__dirname, '../fixtures/legacy-sample.d.ts'); diff --git a/tools/interface-mapping-validator/src/extractors/legacy.ts b/tools/interface-mapping-validator/src/extractors/legacy.ts index 586ab868ef..d61a60c1e7 100644 --- a/tools/interface-mapping-validator/src/extractors/legacy.ts +++ b/tools/interface-mapping-validator/src/extractors/legacy.ts @@ -1,5 +1,6 @@ import { Project } from 'ts-morph'; -import type { LegacyExport, ExportKind } from '../types.js'; + +import type { ExportKind, LegacyExport } from '../types.js'; /** * Extracts all named exports from the legacy SDK's index file using static analysis. diff --git a/tools/interface-mapping-validator/src/extractors/markdown.test.ts b/tools/interface-mapping-validator/src/extractors/markdown.test.ts index f0ae36d236..235c1a94ff 100644 --- a/tools/interface-mapping-validator/src/extractors/markdown.test.ts +++ b/tools/interface-mapping-validator/src/extractors/markdown.test.ts @@ -1,5 +1,6 @@ -import { describe, it, expect } from 'vitest'; import { resolve } from 'node:path'; +import { describe, expect, it } from 'vitest'; + import { extractDocumentedMappings } from './markdown.js'; const FIXTURE_PATH = resolve(__dirname, '../fixtures/sample-mapping.md'); diff --git a/tools/interface-mapping-validator/src/extractors/markdown.ts b/tools/interface-mapping-validator/src/extractors/markdown.ts index 74a66a6290..150b4944ae 100644 --- a/tools/interface-mapping-validator/src/extractors/markdown.ts +++ b/tools/interface-mapping-validator/src/extractors/markdown.ts @@ -1,5 +1,7 @@ import { readFileSync } from 'node:fs'; + import { SECTIONS } from '../config.js'; + import type { DocumentedMapping, MarkdownExtractionResult } from '../types.js'; const IMPORT_SYMBOL_RE = /import\s+(?:type\s+)?{\s*(\w+)\s*}\s+from\s+['"]([^'"]+)['"]/; diff --git a/tools/interface-mapping-validator/src/extractors/new-sdk.test.ts b/tools/interface-mapping-validator/src/extractors/new-sdk.test.ts index b7d900fafc..e34a62d8a5 100644 --- a/tools/interface-mapping-validator/src/extractors/new-sdk.test.ts +++ b/tools/interface-mapping-validator/src/extractors/new-sdk.test.ts @@ -1,5 +1,6 @@ -import { describe, it, expect } from 'vitest'; import { resolve } from 'node:path'; +import { describe, expect, it } from 'vitest'; + import { extractNewSdkExports } from './new-sdk.js'; const FIXTURE_DIR = resolve(__dirname, '../fixtures/mock-package'); diff --git a/tools/interface-mapping-validator/src/extractors/new-sdk.ts b/tools/interface-mapping-validator/src/extractors/new-sdk.ts index 3d8986f780..9c6f21f775 100644 --- a/tools/interface-mapping-validator/src/extractors/new-sdk.ts +++ b/tools/interface-mapping-validator/src/extractors/new-sdk.ts @@ -1,7 +1,8 @@ -import { Project, Node } from 'ts-morph'; -import { readFileSync, existsSync } from 'node:fs'; -import { resolve, join } from 'node:path'; -import type { NewSdkExport, ExportKind } from '../types.js'; +import { existsSync, readFileSync } from 'node:fs'; +import { join, resolve } from 'node:path'; +import { Node, Project } from 'ts-morph'; + +import type { ExportKind, NewSdkExport } from '../types.js'; type PackageExports = Record>; diff --git a/tools/interface-mapping-validator/src/fixer.test.ts b/tools/interface-mapping-validator/src/fixer.test.ts index 1ebe0a1089..873b11c3a8 100644 --- a/tools/interface-mapping-validator/src/fixer.test.ts +++ b/tools/interface-mapping-validator/src/fixer.test.ts @@ -1,7 +1,9 @@ -import { describe, it, expect } from 'vitest'; +import { describe, expect, it } from 'vitest'; + +import { SECTIONS } from './config.js'; import { applyFixes } from './fixer.js'; + import type { Finding } from './types.js'; -import { SECTIONS } from './config.js'; const SAMPLE_DOC = `# Interface Mapping diff --git a/tools/interface-mapping-validator/src/fixer.ts b/tools/interface-mapping-validator/src/fixer.ts index 397c10ba1e..260e1069ab 100644 --- a/tools/interface-mapping-validator/src/fixer.ts +++ b/tools/interface-mapping-validator/src/fixer.ts @@ -1,6 +1,7 @@ -import type { Finding } from './types.js'; import { PROTECTED_PREFIXES } from './config.js'; +import type { Finding } from './types.js'; + /** * Find the section heading marker in the lines array for a given section name. * diff --git a/tools/interface-mapping-validator/src/fixtures/legacy-sample.d.ts b/tools/interface-mapping-validator/src/fixtures/legacy-sample.d.ts index 2529ddce32..137da86f44 100644 --- a/tools/interface-mapping-validator/src/fixtures/legacy-sample.d.ts +++ b/tools/interface-mapping-validator/src/fixtures/legacy-sample.d.ts @@ -1,8 +1,10 @@ -import { default as FRAuth } from './fake/fr-auth'; +import {default as Config } from './fake/config'; import { CallbackType } from './fake/enums'; +import { default as FRAuth } from './fake/fr-auth'; import { default as NameCallback } from './fake/name-callback'; -import { Step, FailureDetail } from './fake/interfaces'; -import { default as Config, ConfigOptions } from './fake/config'; + +import type { ConfigOptions} from './fake/config'; +import type { FailureDetail,Step } from './fake/interfaces'; export type { ConfigOptions, FailureDetail, Step }; export { CallbackType, Config, FRAuth, NameCallback }; diff --git a/tools/interface-mapping-validator/src/generator.test.ts b/tools/interface-mapping-validator/src/generator.test.ts index 92190c189c..02e097f6aa 100644 --- a/tools/interface-mapping-validator/src/generator.test.ts +++ b/tools/interface-mapping-validator/src/generator.test.ts @@ -1,5 +1,7 @@ -import { describe, it, expect } from 'vitest'; +import { describe, expect, it } from 'vitest'; + import { generateSections } from './generator.js'; + import type { LegacyExport, NewSdkExport, SymbolMapping } from './types.js'; // --------------------------------------------------------------------------- diff --git a/tools/interface-mapping-validator/src/generator.ts b/tools/interface-mapping-validator/src/generator.ts index 900fa497fe..d39a7e4be7 100644 --- a/tools/interface-mapping-validator/src/generator.ts +++ b/tools/interface-mapping-validator/src/generator.ts @@ -1,9 +1,9 @@ import type { + GeneratedSections, LegacyExport, NewSdkExport, - SymbolMapping, RenamedMapping, - GeneratedSections, + SymbolMapping, } from './types.js'; // --------------------------------------------------------------------------- diff --git a/tools/interface-mapping-validator/src/integration.test.ts b/tools/interface-mapping-validator/src/integration.test.ts index 7619856251..c6e8ac4c70 100644 --- a/tools/interface-mapping-validator/src/integration.test.ts +++ b/tools/interface-mapping-validator/src/integration.test.ts @@ -1,22 +1,24 @@ -import { describe, it, expect, beforeAll } from 'vitest'; import { readFileSync } from 'node:fs'; -import { fileURLToPath } from 'node:url'; import { dirname, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { beforeAll, describe, expect, it } from 'vitest'; + +import { INTERFACE_MAPPING_PATH, LEGACY_SDK_INDEX_PATH, NEW_SDK_PACKAGES } from './config.js'; +import { diff } from './differ.js'; import { extractLegacyExports } from './extractors/legacy.js'; -import { extractNewSdkExports } from './extractors/new-sdk.js'; import { extractDocumentedMappings } from './extractors/markdown.js'; -import { diff } from './differ.js'; -import { formatReport } from './reporter.js'; +import { extractNewSdkExports } from './extractors/new-sdk.js'; import { generateSections } from './generator.js'; +import { PACKAGE_MAP, SYMBOL_MAP } from './mapping-config.js'; +import { formatReport } from './reporter.js'; import { replaceSections } from './writer.js'; -import { SYMBOL_MAP, PACKAGE_MAP } from './mapping-config.js'; + import type { + GeneratedSections, LegacyExport, - NewSdkExport, MarkdownExtractionResult, - GeneratedSections, + NewSdkExport, } from './types.js'; -import { LEGACY_SDK_INDEX_PATH, INTERFACE_MAPPING_PATH, NEW_SDK_PACKAGES } from './config.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/tools/interface-mapping-validator/src/main.ts b/tools/interface-mapping-validator/src/main.ts index 0fcb863378..b615fd3a4a 100644 --- a/tools/interface-mapping-validator/src/main.ts +++ b/tools/interface-mapping-validator/src/main.ts @@ -1,23 +1,24 @@ -import { fileURLToPath } from 'node:url'; -import { dirname, resolve } from 'node:path'; -import { readFileSync, writeFileSync } from 'node:fs'; import { execFileSync } from 'node:child_process'; -import { extractLegacyExports } from './extractors/legacy.js'; -import { extractNewSdkExports } from './extractors/new-sdk.js'; -import { extractDocumentedMappings } from './extractors/markdown.js'; -import { diff } from './differ.js'; -import { applyFixes } from './fixer.js'; -import { formatReport } from './reporter.js'; -import { generateSections } from './generator.js'; -import { replaceSections, replaceMigrationDependencies } from './writer.js'; -import { SYMBOL_MAP, PACKAGE_MAP } from './mapping-config.js'; +import { readFileSync, writeFileSync } from 'node:fs'; +import { dirname, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; + import { - LEGACY_SDK_INDEX_PATH, + CLIENT_PACKAGES, INTERFACE_MAPPING_PATH, + LEGACY_SDK_INDEX_PATH, NEW_SDK_PACKAGES, - CLIENT_PACKAGES, } from './config.js'; +import { diff } from './differ.js'; +import { extractLegacyExports } from './extractors/legacy.js'; +import { extractDocumentedMappings } from './extractors/markdown.js'; +import { extractNewSdkExports } from './extractors/new-sdk.js'; +import { applyFixes } from './fixer.js'; +import { generateSections } from './generator.js'; +import { PACKAGE_MAP, SYMBOL_MAP } from './mapping-config.js'; +import { formatReport } from './reporter.js'; import { validateClientImportsOnly } from './validate-client-imports.js'; +import { replaceMigrationDependencies, replaceSections } from './writer.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); diff --git a/tools/interface-mapping-validator/src/reporter.test.ts b/tools/interface-mapping-validator/src/reporter.test.ts index 5db2f91fd6..a3910b697c 100644 --- a/tools/interface-mapping-validator/src/reporter.test.ts +++ b/tools/interface-mapping-validator/src/reporter.test.ts @@ -1,7 +1,9 @@ -import { describe, it, expect } from 'vitest'; -import type { Finding } from './types.js'; +import { describe, expect, it } from 'vitest'; + import { formatReport } from './reporter.js'; +import type { Finding } from './types.js'; + const makeFinding = (overrides: Partial = {}): Finding => ({ category: 'undocumented-legacy-symbol', severity: 'error', diff --git a/tools/interface-mapping-validator/src/validate-client-imports.spec.ts b/tools/interface-mapping-validator/src/validate-client-imports.spec.ts index 013137644c..179e494e69 100644 --- a/tools/interface-mapping-validator/src/validate-client-imports.spec.ts +++ b/tools/interface-mapping-validator/src/validate-client-imports.spec.ts @@ -1,4 +1,5 @@ -import { describe, it, expect } from 'vitest'; +import { describe, expect, it } from 'vitest'; + import { validateClientImportsOnly } from './validate-client-imports.js'; const ALLOWED_PACKAGES = [ diff --git a/tools/interface-mapping-validator/src/writer.test.ts b/tools/interface-mapping-validator/src/writer.test.ts index 7106637e89..ca37706133 100644 --- a/tools/interface-mapping-validator/src/writer.test.ts +++ b/tools/interface-mapping-validator/src/writer.test.ts @@ -1,5 +1,6 @@ -import { describe, it, expect } from 'vitest'; -import { replaceSections, replaceMigrationDependencies } from './writer.js'; +import { describe, expect, it } from 'vitest'; + +import { replaceMigrationDependencies, replaceSections } from './writer.js'; // --------------------------------------------------------------------------- // Test fixture diff --git a/tools/release/commands/commands.ts b/tools/release/commands/commands.ts index 7b59867562..d75401c1e6 100644 --- a/tools/release/commands/commands.ts +++ b/tools/release/commands/commands.ts @@ -1,12 +1,13 @@ -import { Effect } from 'effect'; import { Command } from '@effect/platform'; import { FileSystem, Path } from '@effect/platform'; +import { Effect } from 'effect'; + import { - CommandExitError, - GitStatusError, - ChangesetError, ChangesetConfigError, + ChangesetError, + CommandExitError, GitRestoreError, + GitStatusError, } from '../errors'; const SNAPSHOT_TAG = 'beta'; diff --git a/tools/release/release.ts b/tools/release/release.ts index b5f0ba2007..1892f3c163 100644 --- a/tools/release/release.ts +++ b/tools/release/release.ts @@ -1,14 +1,15 @@ /* eslint-disable import/extensions */ -import { Duration, Effect, Schedule } from 'effect'; import { NodeContext, NodeRuntime } from '@effect/platform-node'; +import { Duration, Effect, Schedule } from 'effect'; + import { - assertCleanGitStatus, assertChangesetsExist, - versionSnapshotPackages, + assertCleanGitStatus, buildPackages, - startLocalRegistry, publishToLocalRegistry, restoreGitFiles, + startLocalRegistry, + versionSnapshotPackages, } from './commands/commands'; import { RegistryNotReadyError } from './errors'; diff --git a/tools/user-scripts/src/index.ts b/tools/user-scripts/src/index.ts index e5a0907fe9..5d23a09398 100644 --- a/tools/user-scripts/src/index.ts +++ b/tools/user-scripts/src/index.ts @@ -1,4 +1,5 @@ import { Console, Effect } from 'effect'; + import { UserRuntime, UserService } from './lib/user-scripts.js'; export const deleteUser = (userId: string) => diff --git a/tools/user-scripts/src/lib/user-scripts.ts b/tools/user-scripts/src/lib/user-scripts.ts index 18e657634f..504218cb7e 100644 --- a/tools/user-scripts/src/lib/user-scripts.ts +++ b/tools/user-scripts/src/lib/user-scripts.ts @@ -1,6 +1,7 @@ import { HttpClient, HttpClientRequest, HttpClientResponse } from '@effect/platform'; -import { Config, Data, Effect, ManagedRuntime } from 'effect'; import { NodeHttpClient } from '@effect/platform-node'; +import { Config, Data, Effect, ManagedRuntime } from 'effect'; + import { getUsersResponse, TokenResponse } from './schemas.js'; export class UnexpectedStatus extends Data.TaggedError('UnExpectedStatus')<{