diff --git a/e2e/davinci-app/components/boolean.ts b/e2e/davinci-app/components/boolean.ts index 8630a7128d4..1560dd062ee 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 d21f6ae7a85..49609d905d0 100644 --- a/e2e/davinci-app/components/fido.ts +++ b/e2e/davinci-app/components/fido.ts @@ -5,11 +5,12 @@ * 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/metadata.ts b/e2e/davinci-app/components/metadata.ts index ae18a05c51a..d21d9c754ed 100644 --- a/e2e/davinci-app/components/metadata.ts +++ b/e2e/davinci-app/components/metadata.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 { MetadataCollector, Updater, MetadataError } from '@forgerock/davinci-client/types'; +import type { MetadataCollector, MetadataError, Updater } from '@forgerock/davinci-client/types'; export default function metadataComponent( formEl: HTMLFormElement, diff --git a/e2e/davinci-app/components/password.ts b/e2e/davinci-app/components/password.ts index 869e4d6b1b0..18b9ffc6961 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 bb33f247afa..25f60ce9914 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 ac2434b6f6b..37f738ce9d7 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 c2eb1650f9e..3b3414c522c 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 a4f314495e0..d7d0d19f6e7 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 19e80022cb3..3f2dfe24c65 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 088a7a5807a..e42ee2030a6 100644 --- a/e2e/davinci-app/main.ts +++ b/e2e/davinci-app/main.ts @@ -4,41 +4,41 @@ * 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 formImageComponent from './components/form-image.js'; +import metadataComponent from './components/metadata.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 formImageComponent from './components/form-image.js'; -import pollingComponent from './components/polling.js'; -import booleanComponent from './components/boolean.js'; -import metadataComponent from './components/metadata.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 5527bee3053..383a9a36701 100644 --- a/e2e/davinci-suites/playwright.config.ts +++ b/e2e/davinci-suites/playwright.config.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 { 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 9d4654c3c92..b8f11ee03fb 100644 --- a/e2e/davinci-suites/src/basic.test.ts +++ b/e2e/davinci-suites/src/basic.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, 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 00474980799..c13e7ddcf22 100644 --- a/e2e/davinci-suites/src/fido.test.ts +++ b/e2e/davinci-suites/src/fido.test.ts @@ -4,9 +4,12 @@ * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ -import { test, expect, CDPSession } from '@playwright/test'; +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'; diff --git a/e2e/davinci-suites/src/logging.test.ts b/e2e/davinci-suites/src/logging.test.ts index 1121aba0e7a..5d0996592f9 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/metadata.test.ts b/e2e/davinci-suites/src/metadata.test.ts index e765b30fcb3..6813f2d9a18 100644 --- a/e2e/davinci-suites/src/metadata.test.ts +++ b/e2e/davinci-suites/src/metadata.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('Metadata Collector', () => { diff --git a/e2e/davinci-suites/src/mfa.test.ts b/e2e/davinci-suites/src/mfa.test.ts index fb84521a3d4..ac1b2901524 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 712e098ae45..12f8428a88a 100644 --- a/e2e/davinci-suites/src/middleware.test.ts +++ b/e2e/davinci-suites/src/middleware.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, 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 555a53ef0c2..e2189ee1220 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 97a5265a8e6..aa2cf22441b 100644 --- a/e2e/davinci-suites/src/phone-number-field.test.ts +++ b/e2e/davinci-suites/src/phone-number-field.test.ts @@ -5,6 +5,7 @@ * 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 5a691bec061..393e2e12839 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 6345809a6f5..8516589a51a 100644 --- a/e2e/davinci-suites/src/protect.test.ts +++ b/e2e/davinci-suites/src/protect.test.ts @@ -5,8 +5,9 @@ * 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'; const clientId = '31a587ce-9aa4-4f36-a09f-78cd8a0a74a0'; diff --git a/e2e/davinci-suites/src/qr-code.test.ts b/e2e/davinci-suites/src/qr-code.test.ts index 63d37b5ce40..56f5e68b1a7 100644 --- a/e2e/davinci-suites/src/qr-code.test.ts +++ b/e2e/davinci-suites/src/qr-code.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'; const clientId = 'e4ef2896-8d90-4abd-bf0f-7b8034995927'; diff --git a/e2e/davinci-suites/src/register.test.ts b/e2e/davinci-suites/src/register.test.ts index 8dfba865769..faf8c4eb734 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 9dd9f5f70c0..49d30b9cda1 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 e455442b889..0068848b169 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/index.ts b/e2e/device-client-app/src/index.ts index df64de15b1e..310a1a5e582 100644 --- a/e2e/device-client-app/src/index.ts +++ b/e2e/device-client-app/src/index.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. diff --git a/e2e/device-client-app/src/oath/main.ts b/e2e/device-client-app/src/oath/main.ts index 04e3758e8be..2c4784097f6 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 97f47f03317..ec0f7e0810b 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 94692f25812..90aa798a084 100644 --- a/e2e/device-client-app/src/types.ts +++ b/e2e/device-client-app/src/types.ts @@ -1,3 +1,10 @@ -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. + */ + +import type { deviceClient } from '@forgerock/device-client'; 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 d7b246ec9bd..83851ac0fa2 100644 --- a/e2e/device-client-app/src/utils/index.ts +++ b/e2e/device-client-app/src/utils/index.ts @@ -1,19 +1,29 @@ +/* + * 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 '@forgerock/device-client'; -import type { ConfigOptions, DeviceClient } from '@forgerock/device-client/types'; 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 89bdb4c9419..2cbc75dcaa9 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 f54af977507..15a91ee57c3 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 a9b6e94831a..c43c47bd7ab 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 d452970cccc..7506853b9a6 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 403e284f250..ff038ae3398 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 6cbe21db28d..0b8bcf67119 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 1c1d5ff746c..b5bfc94a203 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 c74ab3ee182..9c3847197f6 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 fe136b202b8..c8d32a14cf9 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 18adaa66009..e5c0d735dbb 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 e8c5e0827b3..c9c38256431 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 85229ca8455..db6ff01a960 100644 --- a/e2e/journey-suites/playwright.config.ts +++ b/e2e/journey-suites/playwright.config.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 { 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 4c800011f9b..fe21d8abfb3 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 8cd43b78639..e3ccc76006f 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 e5770b32620..b737045e92d 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 4e4d180d874..5bef82424e7 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 63f83d988ff..250c609242b 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 679e6e9cba3..9ea7818a07e 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 27f33ca3734..b9e95717fb0 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 5879dc4c135..eec66301d72 100644 --- a/e2e/journey-suites/src/protect.test.ts +++ b/e2e/journey-suites/src/protect.test.ts @@ -6,8 +6,10 @@ */ 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'; + import type { Callback, NameValue } from '@forgerock/journey-client'; test('Test PingOne Protect journey flow', async ({ page }) => { diff --git a/e2e/journey-suites/src/qr-code.test.ts b/e2e/journey-suites/src/qr-code.test.ts index b18ebd2d4d1..b39c0107a28 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 ce90a62607a..47ef67d6df9 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 6bf6725ad0e..b1c6cac76fe 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 0e33d0b989c..726e82a8819 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 b79c2518b04..c6f8e334faf 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 c636c9e762f..bc225fb7fc9 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 d82c62f3a5c..4a0d66265be 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 c25219e38be..680c6a9c5ce 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 fd9a27ce26a..bea605181e0 100644 --- a/e2e/mock-api-v2/src/handlers/healthcheck.handler.ts +++ b/e2e/mock-api-v2/src/handlers/healthcheck.handler.ts @@ -1,7 +1,15 @@ +/* + * 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 { HttpApiBuilder } from '@effect/platform'; -import { MockApi } from '../spec.js'; 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 f6b4d2a76e5..3c71a5eb0d1 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 b25c8da8767..f58384dd6ae 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 5eefdd073d1..0f3805b5102 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 bea15715eb4..9c94bcb4b0b 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 511f2ffda2c..bdbbd22798b 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 92e2acf3ee6..12e9ff05bd3 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 1cfe3d8bee6..59cc8be7d43 100644 --- a/e2e/mock-api-v2/src/middleware/Authorization.ts +++ b/e2e/mock-api-v2/src/middleware/Authorization.ts @@ -1,5 +1,12 @@ -import { Unauthorized } from '@effect/platform/HttpApiError'; +/* + * 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 { HttpApiMiddleware, HttpApiSecurity, OpenApi } from '@effect/platform'; +import { Unauthorized } from '@effect/platform/HttpApiError'; 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 c04cbec6eea..8b8710528b2 100644 --- a/e2e/mock-api-v2/src/middleware/Session.ts +++ b/e2e/mock-api-v2/src/middleware/Session.ts @@ -1,7 +1,17 @@ +/* + * 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 { HttpApiError, HttpApiMiddleware, HttpServerRequest } from '@effect/platform'; -import { SessionData, SessionStorage } from '../services/session.service.js'; 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 0fe59a0a7c6..1448c102285 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 cb93a0616dd..b435ad59f39 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 5c2df0c5b56..acd15c4c2d2 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 b9e3dabc45c..015619e3a2a 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 3981a264643..d8fc3e14ba8 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 0c44c3741b3..7d0974462d6 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/index.ts b/e2e/oidc-app/src/index.ts index 0f3a6351221..1c66e48fa70 100644 --- a/e2e/oidc-app/src/index.ts +++ b/e2e/oidc-app/src/index.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. diff --git a/e2e/oidc-app/src/par/main.ts b/e2e/oidc-app/src/par/main.ts index a94da7faddf..46ec6b3e367 100644 --- a/e2e/oidc-app/src/par/main.ts +++ b/e2e/oidc-app/src/par/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. diff --git a/e2e/oidc-app/src/ping-am/main.ts b/e2e/oidc-app/src/ping-am/main.ts index ed4dcf7f91b..2966e86e457 100644 --- a/e2e/oidc-app/src/ping-am/main.ts +++ b/e2e/oidc-app/src/ping-am/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. diff --git a/e2e/oidc-app/src/utils/oidc-app.ts b/e2e/oidc-app/src/utils/oidc-app.ts index fabada73f3a..4114eaa072c 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 c40a554f9f1..3d4d99d4c66 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 0a722e28def..89cca3ecf19 100644 --- a/e2e/oidc-suites/playwright.config.ts +++ b/e2e/oidc-suites/playwright.config.ts @@ -1,5 +1,11 @@ -import { defineConfig } 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 { 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 5934f94cb5c..1f993b83cb5 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 ae4065301ea..1b2d8de6eb9 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 eed5ee74248..8d618d449da 100644 --- a/e2e/oidc-suites/src/par.spec.ts +++ b/e2e/oidc-suites/src/par.spec.ts @@ -6,9 +6,10 @@ * 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 60d509457f0..2c7be6e0ba2 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 083d14be1d6..9bb8c63ae4a 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 1fbb8478400..af883d9f1f8 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/demo-users.ts b/e2e/oidc-suites/src/utils/demo-users.ts index aa7a0f61dda..df0a387d8b8 100644 --- a/e2e/oidc-suites/src/utils/demo-users.ts +++ b/e2e/oidc-suites/src/utils/demo-users.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. diff --git a/e2e/oidc-suites/src/utils/login.ts b/e2e/oidc-suites/src/utils/login.ts index 669913980fd..616518b9226 100644 --- a/e2e/oidc-suites/src/utils/login.ts +++ b/e2e/oidc-suites/src/utils/login.ts @@ -1,12 +1,15 @@ /* - * 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 { expect } from '@playwright/test'; + import { asyncEvents } from './async-events.js'; +import type { Page } from '@playwright/test'; + export async function loginPingAm(page: Page, username: string, password: string) { const { clickWithRedirect } = asyncEvents(page); await clickWithRedirect('Login (Background)', '**/am/XUI/**'); diff --git a/e2e/recognize-app/src/index.ts b/e2e/recognize-app/src/index.ts index c5d7a920f07..91015df536d 100644 --- a/e2e/recognize-app/src/index.ts +++ b/e2e/recognize-app/src/index.ts @@ -1,4 +1,12 @@ +/* + * 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 { recognize } from '@forgerock/recognize'; + import './styles.css'; const client = recognize({ diff --git a/e2e/recognize-app/vite.config.ts b/e2e/recognize-app/vite.config.ts index 23d9c03af65..f337c952976 100644 --- a/e2e/recognize-app/vite.config.ts +++ b/e2e/recognize-app/vite.config.ts @@ -1,6 +1,6 @@ -import { defineConfig } from 'vite'; import { dirname, resolve } from 'path'; import { fileURLToPath } from 'url'; +import { defineConfig } from 'vite'; const __dirname = dirname(fileURLToPath(import.meta.url)); diff --git a/eslint.config.mjs b/eslint.config.mjs index a2c14760ae6..44ba6903bfb 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)), @@ -74,6 +75,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 6293c49a8df..943be31ce59 100644 --- a/package.json +++ b/package.json @@ -96,6 +96,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", @@ -135,7 +136,7 @@ "rollup": "^4.59.0", "picomatch@>=4": "^4.0.4", "picomatch@<3": "^2.3.2", - "fast-uri": "^3.1.6", + "fast-uri": "^3.1.7", "qs": "^6.16.0", "@opentelemetry/core": "^2.8.0", "brace-expansion@<2": "~1.1.15", @@ -143,7 +144,7 @@ "brace-expansion@>=3 <4": "~3.0.2", "brace-expansion@>=4": "~5.0.8", "ws": "^8.21.1", - "undici": "^7.29.0", + "undici": "^7.29.1", "nanoid": "^5.1.16", "postcss": "^8.5.23" }, diff --git a/packages/davinci-client/api-report/davinci-client.api.md b/packages/davinci-client/api-report/davinci-client.api.md index a8e738c5514..0d0966fa211 100644 --- a/packages/davinci-client/api-report/davinci-client.api.md +++ b/packages/davinci-client/api-report/davinci-client.api.md @@ -1,2019 +1,2443 @@ -## API Report File for "@forgerock/davinci-client" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import { ActionCreatorWithPayload } from '@reduxjs/toolkit'; -import { ActionTypes } from '@forgerock/sdk-request-middleware'; -import { CustomLogger } from '@forgerock/sdk-logger'; -import type { DaVinciConfig } from '@forgerock/sdk-types'; -import { FetchBaseQueryError } from '@reduxjs/toolkit/query'; -import type { FetchBaseQueryMeta } from '@reduxjs/toolkit/query'; -import { GenericError } from '@forgerock/sdk-types'; -import { LogLevel } from '@forgerock/sdk-logger'; -import { makeDavinciConfig } from '@forgerock/sdk-utilities'; -import type { MutationResultSelectorResult } from '@reduxjs/toolkit/query'; -import { QueryStatus } from '@reduxjs/toolkit/query'; -import { Reducer } from '@reduxjs/toolkit'; -import { RequestMiddleware } from '@forgerock/sdk-request-middleware'; -import { SerializedError } from '@reduxjs/toolkit'; -import { Unsubscribe } from '@reduxjs/toolkit'; - -// @public (undocumented) -export type ActionCollector = ActionCollectorNoUrl | ActionCollectorWithUrl; - -// @public (undocumented) -export interface ActionCollectorNoUrl { - // (undocumented) - category: 'ActionCollector'; - // (undocumented) - error: string | null; - // (undocumented) - id: string; - // (undocumented) - name: string; - // (undocumented) - output: { - key: string; - label: string; - type: string; - }; - // (undocumented) - type: T; -} - -// @public (undocumented) -export type ActionCollectors = ActionCollectorWithUrl<'IdpCollector'> | ActionCollectorNoUrl<'ActionCollector'> | ActionCollectorNoUrl<'FlowCollector'> | ActionCollectorNoUrl<'SubmitCollector'>; - -// @public -export type ActionCollectorTypes = 'FlowCollector' | 'SubmitCollector' | 'IdpCollector' | 'ActionCollector'; - -// @public (undocumented) -export interface ActionCollectorWithUrl { - // (undocumented) - category: 'ActionCollector'; - // (undocumented) - error: string | null; - // (undocumented) - id: string; - // (undocumented) - name: string; - // (undocumented) - output: { - key: string; - label: string; - type: string; - url?: string | null; - }; - // (undocumented) - type: T; -} - -export { ActionTypes } - -// @public (undocumented) -export type AgreementField = { - type: 'AGREEMENT'; - key: string; - content: string; - titleEnabled: boolean; - title?: string; - agreement: { - id: string; - useDynamicAgreement: boolean; - }; - enabled: boolean; -}; - -// @public (undocumented) -export interface AssertionValue extends Omit { - // (undocumented) - rawId: string; - // (undocumented) - response: { - clientDataJSON: string; - authenticatorData: string; - signature: string; - userHandle: string | null; - }; -} - -// @public (undocumented) -export interface AttestationValue extends Omit { - // (undocumented) - rawId: string; - // (undocumented) - response: { - clientDataJSON: string; - attestationObject: string; - }; -} - -// @public (undocumented) -export interface AutoCollector> { - // (undocumented) - category: C; - // (undocumented) - error: string | null; - // (undocumented) - id: string; - // (undocumented) - input: { - key: string; - value: IV; - type: string; - validation?: ValidationRequired[] | null; - }; - // (undocumented) - name: string; - // (undocumented) - output: { - key: string; - type: string; - config: OV; - }; - // (undocumented) - type: T; -} - -// @public (undocumented) -export type AutoCollectorCategories = 'SingleValueAutoCollector' | 'ObjectValueAutoCollector'; - -// @public (undocumented) -export type AutoCollectors = ProtectCollector | FidoRegistrationCollector | FidoAuthenticationCollector | MetadataCollector | PollingCollector | SingleValueAutoCollector | ObjectValueAutoCollector; - -// @public (undocumented) -export type AutoCollectorTypes = SingleValueAutoCollectorTypes | ObjectValueAutoCollectorTypes; - -// @public (undocumented) -export interface BooleanCollector extends SingleValueCollectorWithValue<'BooleanCollector', boolean> { - // (undocumented) - output: SingleValueCollectorWithValue<'BooleanCollector', boolean>['output'] & { - appearance: string; - richContent?: CollectorRichContent; - }; -} - -// @public (undocumented) -export type CollectorCategory = Collectors['category']; - -// @public (undocumented) -export interface CollectorErrors { - // (undocumented) - code: string; - // (undocumented) - message: string; - // (undocumented) - target: string; -} - -// @public -export interface CollectorRichContent { - // (undocumented) - content: string; - // (undocumented) - replacements: RichContentLink[]; -} - -// @public (undocumented) -export type Collectors = FlowCollector | MetadataCollector | PasswordCollector | ValidatedPasswordCollector | TextCollector | BooleanCollector | ValidatedBooleanCollector | SingleSelectCollector | IdpCollector | SubmitCollector | ActionCollector<'ActionCollector'> | SingleValueCollector<'SingleValueCollector'> | MultiSelectCollector | DeviceAuthenticationCollector | DeviceRegistrationCollector | PhoneNumberCollector | PhoneNumberExtensionCollector | ReadOnlyCollector | RichTextCollector | ValidatedTextCollector | ProtectCollector | PollingCollector | FidoRegistrationCollector | FidoAuthenticationCollector | QrCodeCollector | ImageCollector | UnknownCollector; - -// @public -export type CollectorValueType = T extends { - type: 'PasswordCollector'; -} | { - type: 'ValidatedPasswordCollector'; -} | { - type: 'SingleSelectCollector'; -} | { - type: 'DeviceRegistrationCollector'; -} | { - type: 'DeviceAuthenticationCollector'; -} | { - type: 'ProtectCollector'; -} | { - type: 'PollingCollector'; -} ? string : T extends { - type: 'TextCollector'; - category: 'SingleValueCollector'; -} ? string : T extends { - type: 'TextCollector'; - category: 'ValidatedSingleValueCollector'; -} ? string : T extends { - type: 'BooleanCollector'; -} | { - type: 'ValidatedBooleanCollector'; -} ? boolean : T extends { - type: 'MultiSelectCollector'; -} ? string | string[] : T extends { - type: 'PhoneNumberCollector'; -} ? PhoneNumberInputValue : T extends { - type: 'PhoneNumberExtensionCollector'; -} ? PhoneNumberExtensionInputValue : T extends { - type: 'FidoRegistrationCollector'; -} ? FidoRegistrationInputValue | GenericError : T extends { - type: 'FidoAuthenticationCollector'; -} ? FidoAuthenticationInputValue | GenericError : T extends { - type: 'MetadataCollector'; -} ? Record | MetadataError : T extends { - category: 'SingleValueCollector'; -} ? string : T extends { - category: 'ValidatedSingleValueCollector'; -} ? string : T extends { - category: 'SingleValueAutoCollector'; -} ? string : T extends { - category: 'MultiValueCollector'; -} ? string | string[] : T extends { - category: 'ActionCollector'; -} ? never : T extends { - category: 'NoValueCollector'; -} ? never : CollectorValueTypes; - -// @public -export type CollectorValueTypes = string | string[] | boolean | PhoneNumberInputValue | PhoneNumberExtensionInputValue | FidoRegistrationInputValue | FidoAuthenticationInputValue | MetadataError | GenericError; - -// @public (undocumented) -export type ComplexValueFields = DeviceAuthenticationField | DeviceRegistrationField | PhoneNumberField | PhoneNumberExtensionField | FidoRegistrationField | FidoAuthenticationField | PollingField | MetadataField; - -// @public (undocumented) -export interface ContinueNode { - // (undocumented) - cache: { - key: string; - }; - // (undocumented) - client: { - action: string; - collectors: Collectors[]; - description?: string; - name?: string; - status: 'continue'; - }; - // (undocumented) - error: null; - // (undocumented) - httpStatus: number; - // (undocumented) - server: { - _links?: Links; - id?: string; - interactionId?: string; - interactionToken?: string; - href?: string; - eventName?: string; - status: 'continue'; - }; - // (undocumented) - status: 'continue'; -} - -export { CustomLogger } - -// @public -export type CustomPollingStatus = string & {}; - -// @public -export function davinci(input: { - config: DaVinciConfig; - requestMiddleware?: RequestMiddleware[]; - logger?: { - level: LogLevel; - custom?: CustomLogger; - }; -}): Promise<{ - subscribe: (listener: () => void) => Unsubscribe; - externalIdp: () => (() => Promise); - flow: (action: DaVinciAction) => InitFlow; - next: (args?: DaVinciRequest) => Promise; - resume: (input: { - continueToken: string; - }) => Promise; - start: (options?: StartOptions | undefined) => Promise; - update: (collector: T) => Updater; - validate: (collector: SingleValueCollectors | ObjectValueCollectors | MultiValueCollectors | AutoCollectors) => Validator; - pollStatus: (collector: PollingCollector) => Poller; - getClient: () => { - action: string; - collectors: Collectors[]; - description?: string; - name?: string; - status: "continue"; - } | { - action: string; - collectors: Collectors[]; - description?: string; - name?: string; - status: "error"; - } | { - status: "failure"; - } | { - status: "start"; - } | { - authorization?: { - code?: string; - state?: string; - }; - status: "success"; - } | null; - getCollectors: () => Collectors[]; - getError: () => DaVinciError | null; - getErrorCollectors: () => CollectorErrors[]; - getNode: () => ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode; - getServer: () => { - _links?: Links; - id?: string; - interactionId?: string; - interactionToken?: string; - href?: string; - eventName?: string; - status: "continue"; - } | { - _links?: Links; - eventName?: string; - id?: string; - interactionId?: string; - interactionToken?: string; - status: "error"; - } | { - _links?: Links; - eventName?: string; - href?: string; - id?: string; - interactionId?: string; - interactionToken?: string; - status: "failure"; - } | { - status: "start"; - } | { - _links?: Links; - eventName?: string; - id?: string; - interactionId?: string; - interactionToken?: string; - href?: string; - session?: string; - status: "success"; - } | null; - cache: { - getLatestResponse: () => ({ - status: QueryStatus.fulfilled; - } & Omit<{ - requestId: string; - data?: unknown; - error?: FetchBaseQueryError | SerializedError | undefined; - endpointName: string; - startedTimeStamp: number; - fulfilledTimeStamp?: number; - }, "data" | "fulfilledTimeStamp"> & Required> & { - error: undefined; - } & { - status: QueryStatus.fulfilled; - isUninitialized: false; - isLoading: false; - isSuccess: true; - isError: false; - }) | ({ - status: QueryStatus.rejected; - } & Omit<{ - requestId: string; - data?: unknown; - error?: FetchBaseQueryError | SerializedError | undefined; - endpointName: string; - startedTimeStamp: number; - fulfilledTimeStamp?: number; - }, "error"> & Required> & { - status: QueryStatus.rejected; - isUninitialized: false; - isLoading: false; - isSuccess: false; - isError: true; - }) | { - error: { - message: string; - type: string; - }; - }; - getResponseWithId: (requestId: string) => ({ - status: QueryStatus.fulfilled; - } & Omit<{ - requestId: string; - data?: unknown; - error?: FetchBaseQueryError | SerializedError | undefined; - endpointName: string; - startedTimeStamp: number; - fulfilledTimeStamp?: number; - }, "data" | "fulfilledTimeStamp"> & Required> & { - error: undefined; - } & { - status: QueryStatus.fulfilled; - isUninitialized: false; - isLoading: false; - isSuccess: true; - isError: false; - }) | ({ - status: QueryStatus.rejected; - } & Omit<{ - requestId: string; - data?: unknown; - error?: FetchBaseQueryError | SerializedError | undefined; - endpointName: string; - startedTimeStamp: number; - fulfilledTimeStamp?: number; - }, "error"> & Required> & { - status: QueryStatus.rejected; - isUninitialized: false; - isLoading: false; - isSuccess: false; - isError: true; - }) | { - error: { - message: string; - type: string; - }; - }; - }; -}>; - -// @public -export interface DaVinciAction { - // (undocumented) - action: string; -} - -// @public -export interface DaVinciBaseResponse { - // (undocumented) - capabilityName?: string; - // (undocumented) - companyId?: string; - // (undocumented) - connectionId?: string; - // (undocumented) - connectorId?: string; - // (undocumented) - id?: string; - // (undocumented) - interactionId?: string; - // (undocumented) - interactionToken?: string; - // (undocumented) - isResponseCompatibleWithMobileAndWebSdks?: boolean; - // (undocumented) - status?: string; -} - -// @public -export type DaVinciCacheEntry = { - data?: DaVinciBaseResponse; - error?: { - data: DaVinciBaseResponse; - status: number; - }; -} & { - data?: any; - error?: any; -} & MutationResultSelectorResult; - -// @public (undocumented) -export type DavinciClient = Awaited>; - -export { DaVinciConfig } - -// @public (undocumented) -export interface DaVinciError extends Omit { - // (undocumented) - collectors?: CollectorErrors[]; - // (undocumented) - internalHttpStatus?: number; - // (undocumented) - message: string; - // (undocumented) - status: 'error' | 'failure' | 'unknown'; -} - -// @public (undocumented) -export interface DaVinciErrorCacheEntry { - // (undocumented) - endpointName: 'next' | 'flow' | 'start'; - // (undocumented) - error: { - data: T; - }; - // (undocumented) - fulfilledTimeStamp: number; - // (undocumented) - isError: boolean; - // (undocumented) - isLoading: boolean; - // (undocumented) - isSuccess: boolean; - // (undocumented) - isUninitialized: boolean; - // (undocumented) - requestId: string; - // (undocumented) - startedTimeStamp: number; - // (undocumented) - status: 'fulfilled' | 'pending' | 'rejected'; -} - -// @public (undocumented) -export interface DavinciErrorResponse extends DaVinciBaseResponse { - // (undocumented) - cause?: string | null; - // (undocumented) - code: string | number; - // (undocumented) - details?: ErrorDetail[]; - // (undocumented) - doNotSendToOE?: boolean; - // (undocumented) - error?: { - code?: string; - message?: string; - }; - // (undocumented) - errorCategory?: string; - // (undocumented) - errorMessage?: string; - // (undocumented) - expected?: boolean; - // (undocumented) - httpResponseCode: number; - // (undocumented) - isErrorCustomized?: boolean; - // (undocumented) - message: string; - // (undocumented) - metricAttributes?: { - [key: string]: unknown; - }; -} - -// @public (undocumented) -export interface DaVinciFailureResponse extends DaVinciBaseResponse { - // (undocumented) - error?: { - code?: string; - message?: string; - [key: string]: unknown; - }; -} - -// @public (undocumented) -export type DaVinciField = ComplexValueFields | MultiValueFields | ReadOnlyFields | RedirectFields | SingleValueFields; - -// @public -export interface DaVinciNextResponse extends DaVinciBaseResponse { - // (undocumented) - eventName?: string; - // (undocumented) - form?: { - name?: string; - description?: string; - components?: { - fields?: DaVinciField[]; - }; - }; - // (undocumented) - formData?: { - value?: { - [key: string]: string; - }; - }; - // (undocumented) - _links?: Links; -} - -// @public -export interface DaVinciPollResponse extends DaVinciBaseResponse { - // (undocumented) - eventName?: string; - // (undocumented) - _links?: Links; - // (undocumented) - success?: boolean; -} - -// @public (undocumented) -export interface DaVinciRequest { - // (undocumented) - eventName: string; - // (undocumented) - id: string; - // (undocumented) - interactionId: string; - // (undocumented) - parameters: { - eventType: 'submit' | 'action' | 'polling'; - data: { - actionKey: string; - formData?: Record; - }; - }; -} - -// @public -export type DaVinciRequestValueTypes = string | number | boolean | (string | number | boolean)[] | DeviceValue | PhoneNumberInputValue | FidoRegistrationInputValue | FidoAuthenticationInputValue | MetadataError | GenericError; - -// @public (undocumented) -export interface DaVinciSuccessResponse extends DaVinciBaseResponse { - // (undocumented) - authorizeResponse?: OAuthDetails; - // (undocumented) - environment: { - id: string; - [key: string]: unknown; - }; - // (undocumented) - _links?: Links; - // (undocumented) - resetCookie?: boolean; - // (undocumented) - session?: { - id?: string; - [key: string]: unknown; - }; - // (undocumented) - sessionToken?: string; - // (undocumented) - sessionTokenMaxAge?: number; - // (undocumented) - status: string; - // (undocumented) - subFlowSettings?: { - cssLinks?: unknown[]; - cssUrl?: unknown; - jsLinks?: unknown[]; - loadingScreenSettings?: unknown; - reactSkUrl?: unknown; - }; - // (undocumented) - success: true; -} - -// @public (undocumented) -export type DeviceAuthenticationCollector = ObjectOptionsCollectorWithObjectValue<'DeviceAuthenticationCollector', DeviceValue>; - -// @public (undocumented) -export type DeviceAuthenticationField = { - type: 'DEVICE_AUTHENTICATION'; - key: string; - label: string; - options: { - type: string; - iconSrc: string; - title: string; - id: string; - default: boolean; - description: string; - }[]; - required: boolean; -}; - -// @public (undocumented) -export interface DeviceOptionNoDefault { - // (undocumented) - content: string; - // (undocumented) - key: string; - // (undocumented) - label: string; - // (undocumented) - type: string; - // (undocumented) - value: string; -} - -// @public (undocumented) -export interface DeviceOptionWithDefault { - // (undocumented) - content: string; - // (undocumented) - default: boolean; - // (undocumented) - key: string; - // (undocumented) - label: string; - // (undocumented) - type: string; - // (undocumented) - value: string; -} - -// @public (undocumented) -export type DeviceRegistrationCollector = ObjectOptionsCollectorWithStringValue<'DeviceRegistrationCollector', string>; - -// @public (undocumented) -export type DeviceRegistrationField = { - type: 'DEVICE_REGISTRATION'; - key: string; - label: string; - options: { - type: string; - iconSrc: string; - title: string; - description: string; - }[]; - required: boolean; -}; - -// @public (undocumented) -export interface DeviceValue { - // (undocumented) - id: string; - // (undocumented) - type: string; - // (undocumented) - value: string; -} - -// @public (undocumented) -export interface ErrorDetail { - // (undocumented) - message?: string; - // (undocumented) - rawResponse?: { - _embedded?: { - users?: Array; - }; - code?: string; - count?: number; - details?: NestedErrorDetails[]; - id?: string; - message?: string; - size?: number; - userFilter?: string; - [key: string]: unknown; - }; - // (undocumented) - statusCode?: number; -} - -// @public (undocumented) -export interface ErrorNode { - // (undocumented) - cache: { - key: string; - }; - // (undocumented) - client: { - action: string; - collectors: Collectors[]; - description?: string; - name?: string; - status: 'error'; - }; - // (undocumented) - error: DaVinciError; - // (undocumented) - httpStatus: number; - // (undocumented) - server: { - _links?: Links; - eventName?: string; - id?: string; - interactionId?: string; - interactionToken?: string; - status: 'error'; - } | null; - // (undocumented) - status: 'error'; -} - -// @public (undocumented) -export interface FailureNode { - // (undocumented) - cache: { - key: string; - }; - // (undocumented) - client: { - status: 'failure'; - }; - // (undocumented) - error: DaVinciError; - // (undocumented) - httpStatus: number; - // (undocumented) - server: { - _links?: Links; - eventName?: string; - href?: string; - id?: string; - interactionId?: string; - interactionToken?: string; - status: 'failure'; - } | null; - // (undocumented) - status: 'failure'; -} - -// @public -export function fido(): FidoClient; - -// @public (undocumented) -export type FidoAuthenticationCollector = AutoCollector<'ObjectValueAutoCollector', 'FidoAuthenticationCollector', FidoAuthenticationInputValue | GenericError, FidoAuthenticationOutputValue>; - -// @public (undocumented) -export type FidoAuthenticationField = { - type: 'FIDO2'; - key: string; - label: string; - publicKeyCredentialRequestOptions: FidoAuthenticationOptions; - action: 'AUTHENTICATE'; - trigger: string; - required: boolean; -}; - -// @public (undocumented) -export interface FidoAuthenticationInputValue { - // (undocumented) - assertionValue?: AssertionValue; -} - -// @public (undocumented) -export interface FidoAuthenticationOptions extends Omit { - // (undocumented) - allowCredentials?: { - id: number[]; - transports?: AuthenticatorTransport[]; - type: PublicKeyCredentialType; - }[]; - // (undocumented) - challenge: number[]; -} - -// @public (undocumented) -export interface FidoAuthenticationOutputValue { - // (undocumented) - action: 'AUTHENTICATE'; - // (undocumented) - publicKeyCredentialRequestOptions: FidoAuthenticationOptions; - // (undocumented) - trigger: string; -} - -// @public (undocumented) -export interface FidoClient { - authenticate: (options: FidoAuthenticationOptions) => Promise; - register: (options: FidoRegistrationOptions) => Promise; -} - -// @public -export type FidoErrorCode = 'NotAllowedError' | 'AbortError' | 'InvalidStateError' | 'NotSupportedError' | 'SecurityError' | 'TimeoutError' | 'UnknownError'; - -// @public (undocumented) -export type FidoRegistrationCollector = AutoCollector<'ObjectValueAutoCollector', 'FidoRegistrationCollector', FidoRegistrationInputValue | GenericError, FidoRegistrationOutputValue>; - -// @public (undocumented) -export type FidoRegistrationField = { - type: 'FIDO2'; - key: string; - label: string; - publicKeyCredentialCreationOptions: FidoRegistrationOptions; - action: 'REGISTER'; - trigger: string; - required: boolean; -}; - -// @public (undocumented) -export interface FidoRegistrationInputValue { - // (undocumented) - attestationValue?: AttestationValue; -} - -// @public (undocumented) -export interface FidoRegistrationOptions extends Omit { - // (undocumented) - challenge: number[]; - // (undocumented) - excludeCredentials?: { - id: number[]; - transports?: AuthenticatorTransport[]; - type: PublicKeyCredentialType; - }[]; - // (undocumented) - pubKeyCredParams: { - alg: string | number; - type: PublicKeyCredentialType; - }[]; - // (undocumented) - user: { - id: number[]; - name: string; - displayName: string; - }; -} - -// @public (undocumented) -export interface FidoRegistrationOutputValue { - // (undocumented) - action: 'REGISTER'; - // (undocumented) - publicKeyCredentialCreationOptions: FidoRegistrationOptions; - // (undocumented) - trigger: string; -} - -// @public (undocumented) -export type FlowCollector = ActionCollectorNoUrl<'FlowCollector'>; - -// @public (undocumented) -export type FlowNode = ContinueNode | ErrorNode | StartNode | SuccessNode | FailureNode; - -// @public -export type GetClient = StartNode['client'] | ContinueNode['client'] | ErrorNode['client'] | SuccessNode['client'] | FailureNode['client']; - -// @public (undocumented) -export type IdpCollector = ActionCollectorWithUrl<'IdpCollector'>; - -// @public -export interface ImageCollector extends NoValueCollectorBase<'ImageCollector'> { - // (undocumented) - output: NoValueCollectorBase<'ImageCollector'>['output'] & { - src: string; - alt: string; - href?: string; - }; -} - -// @public (undocumented) -export type ImageField = { - type: 'IMAGE'; - key: string; - description: string; - imageUrl: string; - hyperlinkUrl?: string; -}; - -// @public (undocumented) -export type InferActionCollectorType = T extends 'IdpCollector' ? IdpCollector : T extends 'SubmitCollector' ? SubmitCollector : T extends 'FlowCollector' ? FlowCollector : ActionCollectorWithUrl<'ActionCollector'> | ActionCollectorNoUrl<'ActionCollector'>; - -// @public -export type InferAutoCollectorType = T extends 'ProtectCollector' ? ProtectCollector : T extends 'PollingCollector' ? PollingCollector : T extends 'FidoRegistrationCollector' ? FidoRegistrationCollector : T extends 'FidoAuthenticationCollector' ? FidoAuthenticationCollector : T extends 'MetadataCollector' ? MetadataCollector : T extends 'ObjectValueAutoCollector' ? ObjectValueAutoCollector : SingleValueAutoCollector; - -// @public -export type InferMultiValueCollectorType = T extends 'MultiSelectCollector' ? MultiValueCollectorWithValue<'MultiSelectCollector'> : MultiValueCollectorWithValue<'MultiValueCollector'> | MultiValueCollectorNoValue<'MultiValueCollector'>; - -// @public -export type InferNoValueCollectorType = T extends 'ReadOnlyCollector' ? ReadOnlyCollector : T extends 'RichTextCollector' ? RichTextCollector : T extends 'QrCodeCollector' ? QrCodeCollector : T extends 'ImageCollector' ? ImageCollector : NoValueCollectorBase<'NoValueCollector'>; - -// @public -export type InferSingleValueCollectorType = T extends 'TextCollector' ? TextCollector : T extends 'SingleSelectCollector' ? SingleSelectCollector : T extends 'ValidatedTextCollector' ? ValidatedTextCollector : T extends 'PasswordCollector' ? PasswordCollector : T extends 'ValidatedPasswordCollector' ? ValidatedPasswordCollector : T extends 'BooleanCollector' ? BooleanCollector : T extends 'ValidatedBooleanCollector' ? ValidatedBooleanCollector : SingleValueCollectorWithValue<'SingleValueCollector'> | SingleValueCollectorNoValue<'SingleValueCollector'>; - -// @public (undocumented) -export type InferValueObjectCollectorType = T extends 'DeviceAuthenticationCollector' ? DeviceAuthenticationCollector : T extends 'DeviceRegistrationCollector' ? DeviceRegistrationCollector : T extends 'PhoneNumberCollector' ? PhoneNumberCollector : T extends 'PhoneNumberExtensionCollector' ? PhoneNumberExtensionCollector : ObjectOptionsCollectorWithObjectValue<'ObjectValueCollector'> | ObjectOptionsCollectorWithStringValue<'ObjectValueCollector'>; - -// @public (undocumented) -export type InitFlow = () => Promise; - -// @public (undocumented) -export interface InternalErrorResponse { - // (undocumented) - error: Omit & { - message: string; - }; - // (undocumented) - type: 'internal_error'; -} - -// @public (undocumented) -export interface Links { - // (undocumented) - [key: string]: { - href?: string; - }; -} - -export { LogLevel } - -export { makeDavinciConfig } - -// @public (undocumented) -export type MetadataCollector = AutoCollector<'ObjectValueAutoCollector', 'MetadataCollector', MetadataCollectorInputValue, Record>; - -// @public (undocumented) -export type MetadataCollectorInputValue = Record | MetadataError; - -// @public -export interface MetadataError { - // (undocumented) - code: string; - // (undocumented) - message: string; -} - -// @public (undocumented) -export type MetadataField = { - type: 'METADATA'; - key: string; - payload: Record; -}; - -// @public (undocumented) -export type MultiSelectCollector = MultiValueCollectorWithValue<'MultiSelectCollector'>; - -// @public (undocumented) -export type MultiSelectField = { - inputType: 'MULTI_SELECT'; - key: string; - label: string; - options: { - label: string; - value: string; - }[]; - required?: boolean; - type: 'CHECKBOX' | 'COMBOBOX'; -}; - -// @public (undocumented) -export type MultiValueCollector = MultiValueCollectorWithValue | MultiValueCollectorNoValue; - -// @public (undocumented) -export interface MultiValueCollectorNoValue { - // (undocumented) - category: 'MultiValueCollector'; - // (undocumented) - error: string | null; - // (undocumented) - id: string; - // (undocumented) - input: { - key: string; - value: string[]; - type: string; - validation: ValidationRequired[] | null; - }; - // (undocumented) - name: string; - // (undocumented) - output: { - key: string; - label: string; - type: string; - options: SelectorOption[]; - }; - // (undocumented) - type: T; -} - -// @public (undocumented) -export type MultiValueCollectors = MultiValueCollectorWithValue<'MultiValueCollector'> | MultiValueCollectorWithValue<'MultiSelectCollector'>; - -// @public -export type MultiValueCollectorTypes = 'MultiSelectCollector' | 'MultiValueCollector'; - -// @public (undocumented) -export interface MultiValueCollectorWithValue { - // (undocumented) - category: 'MultiValueCollector'; - // (undocumented) - error: string | null; - // (undocumented) - id: string; - // (undocumented) - input: { - key: string; - value: string[]; - type: string; - validation: ValidationRequired[] | null; - }; - // (undocumented) - name: string; - // (undocumented) - output: { - key: string; - label: string; - type: string; - value: string[]; - options: SelectorOption[]; - }; - // (undocumented) - type: T; -} - -// @public (undocumented) -export type MultiValueFields = MultiSelectField; - -// @public -export interface NestedErrorDetails { - // (undocumented) - code?: string; - // (undocumented) - innerError?: { - history?: string; - unsatisfiedRequirements?: string[]; - failuresRemaining?: number; - }; - // (undocumented) - message?: string; - // (undocumented) - target?: string; -} - -// @public -export const nextCollectorValues: ActionCreatorWithPayload< { -fields: DaVinciField[]; -formData: { -value: Record; -}; -}, string>; - -// @public -export const nodeCollectorReducer: Reducer & { - getInitialState: () => Collectors[]; -}; - -// @public (undocumented) -export type NodeStates = StartNode | ContinueNode | ErrorNode | SuccessNode | FailureNode; - -// @public (undocumented) -export type NoValueCollector = InferNoValueCollectorType; - -// @public (undocumented) -export interface NoValueCollectorBase { - // (undocumented) - category: 'NoValueCollector'; - // (undocumented) - error: string | null; - // (undocumented) - id: string; - // (undocumented) - name: string; - // (undocumented) - output: { - key: string; - label: string; - type: string; - }; - // (undocumented) - type: T; -} - -// @public (undocumented) -export type NoValueCollectors = NoValueCollectorBase<'NoValueCollector'> | ReadOnlyCollector | RichTextCollector | QrCodeCollector | ImageCollector; - -// @public -export type NoValueCollectorTypes = 'ReadOnlyCollector' | 'RichTextCollector' | 'NoValueCollector' | 'QrCodeCollector' | 'ImageCollector'; - -// @public -export interface OAuthDetails { - // (undocumented) - [key: string]: unknown; - // (undocumented) - code?: string; - // (undocumented) - state?: string; -} - -// @public (undocumented) -export interface ObjectOptionsCollectorWithObjectValue, D = Record> { - // (undocumented) - category: 'ObjectValueCollector'; - // (undocumented) - error: string | null; - // (undocumented) - id: string; - // (undocumented) - input: { - key: string; - value: V; - type: string; - validation: ValidationRequired[] | null; - }; - // (undocumented) - name: string; - // (undocumented) - output: { - key: string; - label: string; - type: string; - options: DeviceOptionWithDefault[]; - value?: D | null; - }; - // (undocumented) - type: T; -} - -// @public (undocumented) -export interface ObjectOptionsCollectorWithStringValue { - // (undocumented) - category: 'ObjectValueCollector'; - // (undocumented) - error: string | null; - // (undocumented) - id: string; - // (undocumented) - input: { - key: string; - value: V; - type: string; - validation: ValidationRequired[] | null; - }; - // (undocumented) - name: string; - // (undocumented) - output: { - key: string; - label: string; - type: string; - options: DeviceOptionNoDefault[]; - }; - // (undocumented) - type: T; -} - -// @public (undocumented) -export type ObjectValueAutoCollector = AutoCollector<'ObjectValueAutoCollector', 'ObjectValueAutoCollector', Record>; - -// @public (undocumented) -export type ObjectValueAutoCollectorTypes = 'ObjectValueAutoCollector' | 'FidoRegistrationCollector' | 'FidoAuthenticationCollector' | 'MetadataCollector'; - -// @public (undocumented) -export type ObjectValueCollector = ObjectOptionsCollectorWithObjectValue | ObjectOptionsCollectorWithStringValue | ObjectValueCollectorWithObjectValue; - -// @public (undocumented) -export type ObjectValueCollectors = DeviceAuthenticationCollector | DeviceRegistrationCollector | PhoneNumberCollector | PhoneNumberExtensionCollector | ObjectOptionsCollectorWithObjectValue<'ObjectSelectCollector'> | ObjectOptionsCollectorWithStringValue<'ObjectSelectCollector'>; - -// @public -export type ObjectValueCollectorTypes = 'DeviceAuthenticationCollector' | 'DeviceRegistrationCollector' | 'PhoneNumberCollector' | 'PhoneNumberExtensionCollector' | 'ObjectOptionsCollector' | 'ObjectValueCollector' | 'ObjectSelectCollector'; - -// @public (undocumented) -export interface ObjectValueCollectorWithObjectValue, OV = Record> { - // (undocumented) - category: 'ObjectValueCollector'; - // (undocumented) - error: string | null; - // (undocumented) - id: string; - // (undocumented) - input: { - key: string; - value: IV; - type: string; - validation: (ValidationRequired | ValidationPhoneNumber)[] | null; - }; - // (undocumented) - name: string; - // (undocumented) - output: { - key: string; - label: string; - type: string; - value?: OV | null; - }; - // (undocumented) - type: T; -} - -// @public (undocumented) -export interface OutgoingQueryParams { - // (undocumented) - [key: string]: string | string[]; -} - -// @public (undocumented) -export interface PasswordCollector { - // (undocumented) - category: 'SingleValueCollector'; - // (undocumented) - error: string | null; - // (undocumented) - id: string; - // (undocumented) - input: { - key: string; - value: string | number | boolean; - type: string; - }; - // (undocumented) - name: string; - // (undocumented) - output: { - key: string; - label: string; - type: string; - verify: boolean; - }; - // (undocumented) - type: 'PasswordCollector'; -} - -// @public -export type PasswordField = { - type: 'PASSWORD' | 'PASSWORD_VERIFY'; - key: string; - label: string; - required?: boolean; - verify?: boolean; - passwordPolicy?: PasswordPolicy; -}; - -// @public -export interface PasswordPolicy { - // (undocumented) - createdAt?: string; - // (undocumented) - default?: boolean; - // (undocumented) - description?: string; - // (undocumented) - excludesCommonlyUsed?: boolean; - // (undocumented) - excludesProfileData?: boolean; - // (undocumented) - history?: { - count?: number; - retentionDays?: number; - }; - // (undocumented) - id?: string; - // (undocumented) - length?: { - min?: number; - max?: number; - }; - // (undocumented) - lockout?: { - failureCount?: number; - durationSeconds?: number; - }; - // (undocumented) - maxAgeDays?: number; - // (undocumented) - maxRepeatedCharacters?: number; - // (undocumented) - minAgeDays?: number; - // (undocumented) - minCharacters?: Record; - // (undocumented) - minUniqueCharacters?: number; - // (undocumented) - name?: string; - // (undocumented) - notSimilarToCurrent?: boolean; - // (undocumented) - populationCount?: number; - // (undocumented) - updatedAt?: string; -} - -// @public (undocumented) -export type PhoneNumberCollector = ObjectValueCollectorWithObjectValue<'PhoneNumberCollector', PhoneNumberInputValue, PhoneNumberOutputValue>; - -// @public (undocumented) -export interface PhoneNumberExtensionCollector { - // (undocumented) - category: 'ObjectValueCollector'; - // (undocumented) - error: string | null; - // (undocumented) - id: string; - // (undocumented) - input: { - key: string; - value: PhoneNumberExtensionInputValue; - type: string; - validation: (ValidationRequired | ValidationPhoneNumber)[] | null; - }; - // (undocumented) - name: string; - // (undocumented) - output: { - key: string; - label: string; - type: string; - extensionLabel: string; - value: PhoneNumberExtensionOutputValue; - }; - // (undocumented) - type: 'PhoneNumberExtensionCollector'; -} - -// @public (undocumented) -export type PhoneNumberExtensionField = PhoneNumberField & { - showExtension: boolean; - extensionLabel: string; -}; - -// @public (undocumented) -export interface PhoneNumberExtensionInputValue { - // (undocumented) - countryCode: string; - // (undocumented) - extension: string; - // (undocumented) - phoneNumber: string; -} - -// @public (undocumented) -export interface PhoneNumberExtensionOutputValue { - // (undocumented) - countryCode?: string; - // (undocumented) - extension?: string; - // (undocumented) - phoneNumber?: string; -} - -// @public (undocumented) -export type PhoneNumberField = { - type: 'PHONE_NUMBER'; - key: string; - label: string; - required: boolean; - defaultCountryCode: string | null; - validatePhoneNumber: boolean; -}; - -// @public (undocumented) -export interface PhoneNumberInputValue { - // (undocumented) - countryCode: string; - // (undocumented) - phoneNumber: string; -} - -// @public (undocumented) -export interface PhoneNumberOutputValue { - // (undocumented) - countryCode?: string; - // (undocumented) - phoneNumber?: string; -} - -// @public -export type Poller = () => Promise; - -// @public (undocumented) -export type PollingCollector = AutoCollector<'SingleValueAutoCollector', 'PollingCollector', string, PollingOutputValue>; - -// @public (undocumented) -export type PollingField = { - type: 'POLLING'; - key: string; - pollInterval: number; - pollRetries: number; - pollChallengeStatus?: boolean; - challenge?: string; -}; - -// @public (undocumented) -export interface PollingOutputValue { - // (undocumented) - challenge?: string; - // (undocumented) - pollChallengeStatus?: boolean; - // (undocumented) - pollInterval: number; - // (undocumented) - pollRetries: number; - // (undocumented) - retriesRemaining?: number; -} - -// @public (undocumented) -export type PollingStatus = PollingStatusContinue | PollingStatusChallenge; - -// @public (undocumented) -export type PollingStatusChallenge = PollingStatusChallengeComplete | 'expired' | 'timedOut' | 'error'; - -// @public (undocumented) -export type PollingStatusChallengeComplete = 'approved' | 'denied' | 'continue' | CustomPollingStatus; - -// @public (undocumented) -export type PollingStatusContinue = 'continue' | 'timedOut'; - -// @public (undocumented) -export type ProtectCollector = AutoCollector<'SingleValueAutoCollector', 'ProtectCollector', string, ProtectOutputValue>; - -// @public (undocumented) -export type ProtectField = { - type: 'PROTECT'; - key: string; - behavioralDataCollection: boolean; - universalDeviceIdentification: boolean; -}; - -// @public -export interface ProtectOutputValue { - // (undocumented) - behavioralDataCollection: boolean; - // (undocumented) - universalDeviceIdentification: boolean; -} - -// @public -export interface QrCodeCollector extends NoValueCollectorBase<'QrCodeCollector'> { - // (undocumented) - output: NoValueCollectorBase<'QrCodeCollector'>['output'] & { - src: string; - }; -} - -// @public (undocumented) -export type QrCodeField = { - type: 'QR_CODE'; - key: string; - content: string; - fallbackText?: string; -}; - -// @public -export interface ReadOnlyCollector extends NoValueCollectorBase<'ReadOnlyCollector'> { - // (undocumented) - output: NoValueCollectorBase<'ReadOnlyCollector'>['output'] & { - content: string; - title?: string; - }; -} - -// @public (undocumented) -export type ReadOnlyField = { - type: 'LABEL'; - content: string; - richContent?: RichContent; - key?: string; -}; - -// @public (undocumented) -export type ReadOnlyFields = ReadOnlyField | QrCodeField | AgreementField | ImageField; - -// @public (undocumented) -export type RedirectField = { - type: 'SOCIAL_LOGIN_BUTTON'; - key: string; - label: string; - links: Links; -}; - -// @public (undocumented) -export type RedirectFields = RedirectField; - -export { RequestMiddleware } - -// @public -export type RichContent = { - content: string; - replacements?: Record; -}; - -// @public -export interface RichContentLink { - // (undocumented) - href: string; - // (undocumented) - key: string; - // (undocumented) - target?: '_self' | '_blank'; - // (undocumented) - type: 'link'; - // (undocumented) - value: string; -} - -// @public -export type RichContentReplacement = { - type: 'link'; - value: string; - href: string; - target?: '_self' | '_blank'; -}; - -// @public -export interface RichTextCollector extends NoValueCollectorBase<'RichTextCollector'> { - // (undocumented) - output: NoValueCollectorBase<'RichTextCollector'>['output'] & { - content: string; - richContent: CollectorRichContent; - }; -} - -// @public (undocumented) -export interface SelectorOption { - // (undocumented) - label: string; - // (undocumented) - value: string; -} - -// @public (undocumented) -export type SingleCheckboxField = { - type: 'SINGLE_CHECKBOX'; - inputType: 'BOOLEAN'; - key: string; - label: string; - required?: boolean; - errorMessage?: string; - appearance: string; - richContent?: RichContent; -}; - -// @public (undocumented) -export type SingleSelectCollector = SingleSelectCollectorWithValue<'SingleSelectCollector'>; - -// @public (undocumented) -export interface SingleSelectCollectorNoValue { - // (undocumented) - category: 'SingleValueCollector'; - // (undocumented) - error: string | null; - // (undocumented) - id: string; - // (undocumented) - input: { - key: string; - value: string | number | boolean; - type: string; - }; - // (undocumented) - name: string; - // (undocumented) - output: { - key: string; - label: string; - type: string; - options: SelectorOption[]; - }; - // (undocumented) - type: T; -} - -// @public (undocumented) -export interface SingleSelectCollectorWithValue { - // (undocumented) - category: 'SingleValueCollector'; - // (undocumented) - error: string | null; - // (undocumented) - id: string; - // (undocumented) - input: { - key: string; - value: string | number | boolean; - type: string; - }; - // (undocumented) - name: string; - // (undocumented) - output: { - key: string; - label: string; - type: string; - value: string | number | boolean; - options: SelectorOption[]; - }; - // (undocumented) - type: T; -} - -// @public (undocumented) -export type SingleSelectField = { - inputType: 'SINGLE_SELECT'; - key: string; - label: string; - options: { - label: string; - value: string; - }[]; - required?: boolean; - type: 'RADIO' | 'DROPDOWN'; -}; - -// @public (undocumented) -export type SingleValueAutoCollector = AutoCollector<'SingleValueAutoCollector', 'SingleValueAutoCollector', string>; - -// @public (undocumented) -export type SingleValueAutoCollectorTypes = 'SingleValueAutoCollector' | 'ProtectCollector' | 'PollingCollector'; - -// @public -export type SingleValueCollector = SingleValueCollectorWithValue | SingleValueCollectorNoValue; - -// @public (undocumented) -export interface SingleValueCollectorNoValue { - // (undocumented) - category: 'SingleValueCollector'; - // (undocumented) - error: string | null; - // (undocumented) - id: string; - // (undocumented) - input: { - key: string; - value: string | number | boolean; - type: string; - }; - // (undocumented) - name: string; - // (undocumented) - output: { - key: string; - label: string; - type: string; - }; - // (undocumented) - type: T; -} - -// @public (undocumented) -export type SingleValueCollectors = PasswordCollector | ValidatedPasswordCollector | SingleSelectCollector | TextCollector | ValidatedTextCollector | BooleanCollector | ValidatedBooleanCollector | SingleValueCollectorWithValue<'SingleValueCollector'>; - -// @public -export type SingleValueCollectorTypes = 'PasswordCollector' | 'ValidatedPasswordCollector' | 'BooleanCollector' | 'ValidatedBooleanCollector' | 'SingleValueCollector' | 'SingleSelectCollector' | 'SingleSelectObjectCollector' | 'TextCollector' | 'ValidatedTextCollector'; - -// @public (undocumented) -export interface SingleValueCollectorWithValue { - // (undocumented) - category: 'SingleValueCollector'; - // (undocumented) - error: string | null; - // (undocumented) - id: string; - // (undocumented) - input: { - key: string; - value: V; - type: string; - }; - // (undocumented) - name: string; - // (undocumented) - output: { - key: string; - label: string; - type: string; - value: V; - }; - // (undocumented) - type: T; -} - -// @public (undocumented) -export type SingleValueFields = StandardField | PasswordField | ValidatedField | SingleCheckboxField | SingleSelectField | ProtectField; - -// @public (undocumented) -export type StandardField = { - type: 'TEXT' | 'SUBMIT_BUTTON' | 'FLOW_BUTTON' | 'FLOW_LINK' | 'BUTTON'; - key: string; - label: string; - required?: boolean; -}; - -// @public (undocumented) -export interface StartNode { - // (undocumented) - cache: null; - // (undocumented) - client: { - status: 'start'; - }; - // (undocumented) - error: DaVinciError | null; - // (undocumented) - server: { - status: 'start'; - }; - // (undocumented) - status: 'start'; -} - -// @public (undocumented) -export interface StartOptions { - // (undocumented) - query: Query; -} - -// @public (undocumented) -export type SubmitCollector = ActionCollectorNoUrl<'SubmitCollector'>; - -// @public (undocumented) -export interface SuccessNode { - // (undocumented) - cache: { - key: string; - }; - // (undocumented) - client: { - authorization?: { - code?: string; - state?: string; - }; - status: 'success'; - } | null; - // (undocumented) - error: null; - // (undocumented) - httpStatus: number; - // (undocumented) - server: { - _links?: Links; - eventName?: string; - id?: string; - interactionId?: string; - interactionToken?: string; - href?: string; - session?: string; - status: 'success'; - }; - // (undocumented) - status: 'success'; -} - -// @public (undocumented) -export type TextCollector = SingleValueCollectorWithValue<'TextCollector'>; - -// @public (undocumented) -export interface ThrownQueryError { - // (undocumented) - error: FetchBaseQueryError; - // (undocumented) - isHandledError: boolean; - // (undocumented) - meta: FetchBaseQueryMeta; -} - -// @public -export type UnknownCollector = { - category: 'UnknownCollector'; - error: string | null; - type: 'UnknownCollector'; - id: string; - name: string; - output: { - key: string; - label: string; - type: string; - }; -}; - -// @public (undocumented) -export type UnknownField = Record; - -// @public -export type UpdatableCollectors = SingleValueCollectors | MultiSelectCollector | ObjectValueCollectors | AutoCollectors; - -// @public (undocumented) -export const updateCollectorValues: ActionCreatorWithPayload< { -id: string; -value: CollectorValueTypes; -index?: number; -}, string>; - -// @public -export type Updater = (value: CollectorValueType, index?: number) => InternalErrorResponse | null; - -// @public (undocumented) -export interface ValidatedBooleanCollector extends ValidatedSingleValueCollectorWithValue<'ValidatedBooleanCollector', boolean> { - // (undocumented) - output: ValidatedSingleValueCollectorWithValue<'ValidatedBooleanCollector', boolean>['output'] & { - appearance: string; - richContent?: CollectorRichContent; - }; -} - -// @public -export type ValidatedCollectors = ValidatedTextCollector | ValidatedBooleanCollector | ValidatedPasswordCollector | ObjectValueCollectors | MultiValueCollectors | AutoCollectors; - -// @public (undocumented) -export type ValidatedField = { - type: 'TEXT'; - key: string; - label: string; - required: boolean; - validation: { - regex: string; - errorMessage: string; - }; -}; - -// @public (undocumented) -export interface ValidatedPasswordCollector { - // (undocumented) - category: 'SingleValueCollector'; - // (undocumented) - error: string | null; - // (undocumented) - id: string; - // (undocumented) - input: { - key: string; - value: string | number | boolean; - type: string; - validation: PasswordPolicy; - }; - // (undocumented) - name: string; - // (undocumented) - output: { - key: string; - label: string; - type: string; - verify: boolean; - }; - // (undocumented) - type: 'ValidatedPasswordCollector'; -} - -// @public (undocumented) -export interface ValidatedSingleValueCollectorWithValue { - // (undocumented) - category: 'ValidatedSingleValueCollector'; - // (undocumented) - error: string | null; - // (undocumented) - id: string; - // (undocumented) - input: { - key: string; - type: string; - validation: (ValidationRequired | ValidationRegex)[]; - value: V; - }; - // (undocumented) - name: string; - // (undocumented) - output: { - key: string; - label: string; - type: string; - value: V; - }; - // (undocumented) - type: T; -} - -// @public (undocumented) -export type ValidatedTextCollector = ValidatedSingleValueCollectorWithValue<'TextCollector'>; - -// @public (undocumented) -export interface ValidationPhoneNumber { - // (undocumented) - message: string; - // (undocumented) - rule: boolean; - // (undocumented) - type: 'validatePhoneNumber'; -} - -// @public (undocumented) -export interface ValidationRegex { - // (undocumented) - message: string; - // (undocumented) - rule: string; - // (undocumented) - type: 'regex'; -} - -// @public (undocumented) -export interface ValidationRequired { - // (undocumented) - message: string; - // (undocumented) - rule: boolean; - // (undocumented) - type: 'required'; -} - -// @public -export type Validator = (value: CollectorValueType) => string[] | { - error: { - message: string; - type: string; - }; - type: string; -}; - -// (No @packageDocumentation comment for this package) - -``` +## API Report File for "@forgerock/davinci-client" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { ActionCreatorWithPayload } from '@reduxjs/toolkit'; +import { ActionTypes } from '@forgerock/sdk-request-middleware'; +import { CustomLogger } from '@forgerock/sdk-logger'; +import type { DaVinciConfig } from '@forgerock/sdk-types'; +import { FetchBaseQueryError } from '@reduxjs/toolkit/query'; +import type { FetchBaseQueryMeta } from '@reduxjs/toolkit/query'; +import { GenericError } from '@forgerock/sdk-types'; +import { LogLevel } from '@forgerock/sdk-logger'; +import { makeDavinciConfig } from '@forgerock/sdk-utilities'; +import type { MutationResultSelectorResult } from '@reduxjs/toolkit/query'; +import { QueryStatus } from '@reduxjs/toolkit/query'; +import { Reducer } from '@reduxjs/toolkit'; +import { RequestMiddleware } from '@forgerock/sdk-request-middleware'; +import { SerializedError } from '@reduxjs/toolkit'; +import { Unsubscribe } from '@reduxjs/toolkit'; + +// @public (undocumented) +export type ActionCollector = + | ActionCollectorNoUrl + | ActionCollectorWithUrl; + +// @public (undocumented) +export interface ActionCollectorNoUrl { + // (undocumented) + category: 'ActionCollector'; + // (undocumented) + error: string | null; + // (undocumented) + id: string; + // (undocumented) + name: string; + // (undocumented) + output: { + key: string; + label: string; + type: string; + }; + // (undocumented) + type: T; +} + +// @public (undocumented) +export type ActionCollectors = + | ActionCollectorWithUrl<'IdpCollector'> + | ActionCollectorNoUrl<'ActionCollector'> + | ActionCollectorNoUrl<'FlowCollector'> + | ActionCollectorNoUrl<'SubmitCollector'>; + +// @public +export type ActionCollectorTypes = + | 'FlowCollector' + | 'SubmitCollector' + | 'IdpCollector' + | 'ActionCollector'; + +// @public (undocumented) +export interface ActionCollectorWithUrl { + // (undocumented) + category: 'ActionCollector'; + // (undocumented) + error: string | null; + // (undocumented) + id: string; + // (undocumented) + name: string; + // (undocumented) + output: { + key: string; + label: string; + type: string; + url?: string | null; + }; + // (undocumented) + type: T; +} + +export { ActionTypes }; + +// @public (undocumented) +export type AgreementField = { + type: 'AGREEMENT'; + key: string; + content: string; + titleEnabled: boolean; + title?: string; + agreement: { + id: string; + useDynamicAgreement: boolean; + }; + enabled: boolean; +}; + +// @public (undocumented) +export interface AssertionValue extends Omit< + PublicKeyCredential, + 'rawId' | 'response' | 'getClientExtensionResults' | 'toJSON' +> { + // (undocumented) + rawId: string; + // (undocumented) + response: { + clientDataJSON: string; + authenticatorData: string; + signature: string; + userHandle: string | null; + }; +} + +// @public (undocumented) +export interface AttestationValue extends Omit< + PublicKeyCredential, + 'rawId' | 'response' | 'getClientExtensionResults' | 'toJSON' +> { + // (undocumented) + rawId: string; + // (undocumented) + response: { + clientDataJSON: string; + attestationObject: string; + }; +} + +// @public (undocumented) +export interface AutoCollector< + C extends AutoCollectorCategories, + T extends AutoCollectorTypes, + IV = string, + OV = Record, +> { + // (undocumented) + category: C; + // (undocumented) + error: string | null; + // (undocumented) + id: string; + // (undocumented) + input: { + key: string; + value: IV; + type: string; + validation?: ValidationRequired[] | null; + }; + // (undocumented) + name: string; + // (undocumented) + output: { + key: string; + type: string; + config: OV; + }; + // (undocumented) + type: T; +} + +// @public (undocumented) +export type AutoCollectorCategories = 'SingleValueAutoCollector' | 'ObjectValueAutoCollector'; + +// @public (undocumented) +export type AutoCollectors = + | ProtectCollector + | FidoRegistrationCollector + | FidoAuthenticationCollector + | MetadataCollector + | PollingCollector + | SingleValueAutoCollector + | ObjectValueAutoCollector; + +// @public (undocumented) +export type AutoCollectorTypes = SingleValueAutoCollectorTypes | ObjectValueAutoCollectorTypes; + +// @public (undocumented) +export interface BooleanCollector extends SingleValueCollectorWithValue< + 'BooleanCollector', + boolean +> { + // (undocumented) + output: SingleValueCollectorWithValue<'BooleanCollector', boolean>['output'] & { + appearance: string; + richContent?: CollectorRichContent; + }; +} + +// @public (undocumented) +export type CollectorCategory = Collectors['category']; + +// @public (undocumented) +export interface CollectorErrors { + // (undocumented) + code: string; + // (undocumented) + message: string; + // (undocumented) + target: string; +} + +// @public +export interface CollectorRichContent { + // (undocumented) + content: string; + // (undocumented) + replacements: RichContentLink[]; +} + +// @public (undocumented) +export type Collectors = + | FlowCollector + | MetadataCollector + | PasswordCollector + | ValidatedPasswordCollector + | TextCollector + | BooleanCollector + | ValidatedBooleanCollector + | SingleSelectCollector + | IdpCollector + | SubmitCollector + | ActionCollector<'ActionCollector'> + | SingleValueCollector<'SingleValueCollector'> + | MultiSelectCollector + | DeviceAuthenticationCollector + | DeviceRegistrationCollector + | PhoneNumberCollector + | PhoneNumberExtensionCollector + | ReadOnlyCollector + | RichTextCollector + | ValidatedTextCollector + | ProtectCollector + | PollingCollector + | FidoRegistrationCollector + | FidoAuthenticationCollector + | QrCodeCollector + | ImageCollector + | UnknownCollector; + +// @public +export type CollectorValueType = T extends + | { + type: 'PasswordCollector'; + } + | { + type: 'ValidatedPasswordCollector'; + } + | { + type: 'SingleSelectCollector'; + } + | { + type: 'DeviceRegistrationCollector'; + } + | { + type: 'DeviceAuthenticationCollector'; + } + | { + type: 'ProtectCollector'; + } + | { + type: 'PollingCollector'; + } + ? string + : T extends { + type: 'TextCollector'; + category: 'SingleValueCollector'; + } + ? string + : T extends { + type: 'TextCollector'; + category: 'ValidatedSingleValueCollector'; + } + ? string + : T extends + | { + type: 'BooleanCollector'; + } + | { + type: 'ValidatedBooleanCollector'; + } + ? boolean + : T extends { + type: 'MultiSelectCollector'; + } + ? string | string[] + : T extends { + type: 'PhoneNumberCollector'; + } + ? PhoneNumberInputValue + : T extends { + type: 'PhoneNumberExtensionCollector'; + } + ? PhoneNumberExtensionInputValue + : T extends { + type: 'FidoRegistrationCollector'; + } + ? FidoRegistrationInputValue | GenericError + : T extends { + type: 'FidoAuthenticationCollector'; + } + ? FidoAuthenticationInputValue | GenericError + : T extends { + type: 'MetadataCollector'; + } + ? Record | MetadataError + : T extends { + category: 'SingleValueCollector'; + } + ? string + : T extends { + category: 'ValidatedSingleValueCollector'; + } + ? string + : T extends { + category: 'SingleValueAutoCollector'; + } + ? string + : T extends { + category: 'MultiValueCollector'; + } + ? string | string[] + : T extends { + category: 'ActionCollector'; + } + ? never + : T extends { + category: 'NoValueCollector'; + } + ? never + : CollectorValueTypes; + +// @public +export type CollectorValueTypes = + | string + | string[] + | boolean + | PhoneNumberInputValue + | PhoneNumberExtensionInputValue + | FidoRegistrationInputValue + | FidoAuthenticationInputValue + | MetadataError + | GenericError; + +// @public (undocumented) +export type ComplexValueFields = + | DeviceAuthenticationField + | DeviceRegistrationField + | PhoneNumberField + | PhoneNumberExtensionField + | FidoRegistrationField + | FidoAuthenticationField + | PollingField + | MetadataField; + +// @public (undocumented) +export interface ContinueNode { + // (undocumented) + cache: { + key: string; + }; + // (undocumented) + client: { + action: string; + collectors: Collectors[]; + description?: string; + name?: string; + status: 'continue'; + }; + // (undocumented) + error: null; + // (undocumented) + httpStatus: number; + // (undocumented) + server: { + _links?: Links; + id?: string; + interactionId?: string; + interactionToken?: string; + href?: string; + eventName?: string; + status: 'continue'; + }; + // (undocumented) + status: 'continue'; +} + +export { CustomLogger }; + +// @public +export type CustomPollingStatus = string & {}; + +// @public +export function davinci(input: { + config: DaVinciConfig; + requestMiddleware?: RequestMiddleware[]; + logger?: { + level: LogLevel; + custom?: CustomLogger; + }; +}): Promise<{ + subscribe: (listener: () => void) => Unsubscribe; + externalIdp: () => () => Promise; + flow: (action: DaVinciAction) => InitFlow; + next: (args?: DaVinciRequest) => Promise; + resume: (input: { continueToken: string }) => Promise; + start: ( + options?: StartOptions | undefined, + ) => Promise; + update: (collector: T) => Updater; + validate: ( + collector: + | SingleValueCollectors + | ObjectValueCollectors + | MultiValueCollectors + | AutoCollectors, + ) => Validator; + pollStatus: (collector: PollingCollector) => Poller; + getClient: () => + | { + action: string; + collectors: Collectors[]; + description?: string; + name?: string; + status: 'continue'; + } + | { + action: string; + collectors: Collectors[]; + description?: string; + name?: string; + status: 'error'; + } + | { + status: 'failure'; + } + | { + status: 'start'; + } + | { + authorization?: { + code?: string; + state?: string; + }; + status: 'success'; + } + | null; + getCollectors: () => Collectors[]; + getError: () => DaVinciError | null; + getErrorCollectors: () => CollectorErrors[]; + getNode: () => ContinueNode | ErrorNode | FailureNode | StartNode | SuccessNode; + getServer: () => + | { + _links?: Links; + id?: string; + interactionId?: string; + interactionToken?: string; + href?: string; + eventName?: string; + status: 'continue'; + } + | { + _links?: Links; + eventName?: string; + id?: string; + interactionId?: string; + interactionToken?: string; + status: 'error'; + } + | { + _links?: Links; + eventName?: string; + href?: string; + id?: string; + interactionId?: string; + interactionToken?: string; + status: 'failure'; + } + | { + status: 'start'; + } + | { + _links?: Links; + eventName?: string; + id?: string; + interactionId?: string; + interactionToken?: string; + href?: string; + session?: string; + status: 'success'; + } + | null; + cache: { + getLatestResponse: () => + | ({ + status: QueryStatus.fulfilled; + } & Omit< + { + requestId: string; + data?: unknown; + error?: FetchBaseQueryError | SerializedError | undefined; + endpointName: string; + startedTimeStamp: number; + fulfilledTimeStamp?: number; + }, + 'data' | 'fulfilledTimeStamp' + > & + Required< + Pick< + { + requestId: string; + data?: unknown; + error?: FetchBaseQueryError | SerializedError | undefined; + endpointName: string; + startedTimeStamp: number; + fulfilledTimeStamp?: number; + }, + 'data' | 'fulfilledTimeStamp' + > + > & { + error: undefined; + } & { + status: QueryStatus.fulfilled; + isUninitialized: false; + isLoading: false; + isSuccess: true; + isError: false; + }) + | ({ + status: QueryStatus.rejected; + } & Omit< + { + requestId: string; + data?: unknown; + error?: FetchBaseQueryError | SerializedError | undefined; + endpointName: string; + startedTimeStamp: number; + fulfilledTimeStamp?: number; + }, + 'error' + > & + Required< + Pick< + { + requestId: string; + data?: unknown; + error?: FetchBaseQueryError | SerializedError | undefined; + endpointName: string; + startedTimeStamp: number; + fulfilledTimeStamp?: number; + }, + 'error' + > + > & { + status: QueryStatus.rejected; + isUninitialized: false; + isLoading: false; + isSuccess: false; + isError: true; + }) + | { + error: { + message: string; + type: string; + }; + }; + getResponseWithId: (requestId: string) => + | ({ + status: QueryStatus.fulfilled; + } & Omit< + { + requestId: string; + data?: unknown; + error?: FetchBaseQueryError | SerializedError | undefined; + endpointName: string; + startedTimeStamp: number; + fulfilledTimeStamp?: number; + }, + 'data' | 'fulfilledTimeStamp' + > & + Required< + Pick< + { + requestId: string; + data?: unknown; + error?: FetchBaseQueryError | SerializedError | undefined; + endpointName: string; + startedTimeStamp: number; + fulfilledTimeStamp?: number; + }, + 'data' | 'fulfilledTimeStamp' + > + > & { + error: undefined; + } & { + status: QueryStatus.fulfilled; + isUninitialized: false; + isLoading: false; + isSuccess: true; + isError: false; + }) + | ({ + status: QueryStatus.rejected; + } & Omit< + { + requestId: string; + data?: unknown; + error?: FetchBaseQueryError | SerializedError | undefined; + endpointName: string; + startedTimeStamp: number; + fulfilledTimeStamp?: number; + }, + 'error' + > & + Required< + Pick< + { + requestId: string; + data?: unknown; + error?: FetchBaseQueryError | SerializedError | undefined; + endpointName: string; + startedTimeStamp: number; + fulfilledTimeStamp?: number; + }, + 'error' + > + > & { + status: QueryStatus.rejected; + isUninitialized: false; + isLoading: false; + isSuccess: false; + isError: true; + }) + | { + error: { + message: string; + type: string; + }; + }; + }; +}>; + +// @public +export interface DaVinciAction { + // (undocumented) + action: string; +} + +// @public +export interface DaVinciBaseResponse { + // (undocumented) + capabilityName?: string; + // (undocumented) + companyId?: string; + // (undocumented) + connectionId?: string; + // (undocumented) + connectorId?: string; + // (undocumented) + id?: string; + // (undocumented) + interactionId?: string; + // (undocumented) + interactionToken?: string; + // (undocumented) + isResponseCompatibleWithMobileAndWebSdks?: boolean; + // (undocumented) + status?: string; +} + +// @public +export type DaVinciCacheEntry = { + data?: DaVinciBaseResponse; + error?: { + data: DaVinciBaseResponse; + status: number; + }; +} & { + data?: any; + error?: any; +} & MutationResultSelectorResult; + +// @public (undocumented) +export type DavinciClient = Awaited>; + +export { DaVinciConfig }; + +// @public (undocumented) +export interface DaVinciError extends Omit { + // (undocumented) + collectors?: CollectorErrors[]; + // (undocumented) + internalHttpStatus?: number; + // (undocumented) + message: string; + // (undocumented) + status: 'error' | 'failure' | 'unknown'; +} + +// @public (undocumented) +export interface DaVinciErrorCacheEntry { + // (undocumented) + endpointName: 'next' | 'flow' | 'start'; + // (undocumented) + error: { + data: T; + }; + // (undocumented) + fulfilledTimeStamp: number; + // (undocumented) + isError: boolean; + // (undocumented) + isLoading: boolean; + // (undocumented) + isSuccess: boolean; + // (undocumented) + isUninitialized: boolean; + // (undocumented) + requestId: string; + // (undocumented) + startedTimeStamp: number; + // (undocumented) + status: 'fulfilled' | 'pending' | 'rejected'; +} + +// @public (undocumented) +export interface DavinciErrorResponse extends DaVinciBaseResponse { + // (undocumented) + cause?: string | null; + // (undocumented) + code: string | number; + // (undocumented) + details?: ErrorDetail[]; + // (undocumented) + doNotSendToOE?: boolean; + // (undocumented) + error?: { + code?: string; + message?: string; + }; + // (undocumented) + errorCategory?: string; + // (undocumented) + errorMessage?: string; + // (undocumented) + expected?: boolean; + // (undocumented) + httpResponseCode: number; + // (undocumented) + isErrorCustomized?: boolean; + // (undocumented) + message: string; + // (undocumented) + metricAttributes?: { + [key: string]: unknown; + }; +} + +// @public (undocumented) +export interface DaVinciFailureResponse extends DaVinciBaseResponse { + // (undocumented) + error?: { + code?: string; + message?: string; + [key: string]: unknown; + }; +} + +// @public (undocumented) +export type DaVinciField = + | ComplexValueFields + | MultiValueFields + | ReadOnlyFields + | RedirectFields + | SingleValueFields; + +// @public +export interface DaVinciNextResponse extends DaVinciBaseResponse { + // (undocumented) + eventName?: string; + // (undocumented) + form?: { + name?: string; + description?: string; + components?: { + fields?: DaVinciField[]; + }; + }; + // (undocumented) + formData?: { + value?: { + [key: string]: string; + }; + }; + // (undocumented) + _links?: Links; +} + +// @public +export interface DaVinciPollResponse extends DaVinciBaseResponse { + // (undocumented) + eventName?: string; + // (undocumented) + _links?: Links; + // (undocumented) + success?: boolean; +} + +// @public (undocumented) +export interface DaVinciRequest { + // (undocumented) + eventName: string; + // (undocumented) + id: string; + // (undocumented) + interactionId: string; + // (undocumented) + parameters: { + eventType: 'submit' | 'action' | 'polling'; + data: { + actionKey: string; + formData?: Record; + }; + }; +} + +// @public +export type DaVinciRequestValueTypes = + | string + | number + | boolean + | (string | number | boolean)[] + | DeviceValue + | PhoneNumberInputValue + | FidoRegistrationInputValue + | FidoAuthenticationInputValue + | MetadataError + | GenericError; + +// @public (undocumented) +export interface DaVinciSuccessResponse extends DaVinciBaseResponse { + // (undocumented) + authorizeResponse?: OAuthDetails; + // (undocumented) + environment: { + id: string; + [key: string]: unknown; + }; + // (undocumented) + _links?: Links; + // (undocumented) + resetCookie?: boolean; + // (undocumented) + session?: { + id?: string; + [key: string]: unknown; + }; + // (undocumented) + sessionToken?: string; + // (undocumented) + sessionTokenMaxAge?: number; + // (undocumented) + status: string; + // (undocumented) + subFlowSettings?: { + cssLinks?: unknown[]; + cssUrl?: unknown; + jsLinks?: unknown[]; + loadingScreenSettings?: unknown; + reactSkUrl?: unknown; + }; + // (undocumented) + success: true; +} + +// @public (undocumented) +export type DeviceAuthenticationCollector = ObjectOptionsCollectorWithObjectValue< + 'DeviceAuthenticationCollector', + DeviceValue +>; + +// @public (undocumented) +export type DeviceAuthenticationField = { + type: 'DEVICE_AUTHENTICATION'; + key: string; + label: string; + options: { + type: string; + iconSrc: string; + title: string; + id: string; + default: boolean; + description: string; + }[]; + required: boolean; +}; + +// @public (undocumented) +export interface DeviceOptionNoDefault { + // (undocumented) + content: string; + // (undocumented) + key: string; + // (undocumented) + label: string; + // (undocumented) + type: string; + // (undocumented) + value: string; +} + +// @public (undocumented) +export interface DeviceOptionWithDefault { + // (undocumented) + content: string; + // (undocumented) + default: boolean; + // (undocumented) + key: string; + // (undocumented) + label: string; + // (undocumented) + type: string; + // (undocumented) + value: string; +} + +// @public (undocumented) +export type DeviceRegistrationCollector = ObjectOptionsCollectorWithStringValue< + 'DeviceRegistrationCollector', + string +>; + +// @public (undocumented) +export type DeviceRegistrationField = { + type: 'DEVICE_REGISTRATION'; + key: string; + label: string; + options: { + type: string; + iconSrc: string; + title: string; + description: string; + }[]; + required: boolean; +}; + +// @public (undocumented) +export interface DeviceValue { + // (undocumented) + id: string; + // (undocumented) + type: string; + // (undocumented) + value: string; +} + +// @public (undocumented) +export interface ErrorDetail { + // (undocumented) + message?: string; + // (undocumented) + rawResponse?: { + _embedded?: { + users?: Array; + }; + code?: string; + count?: number; + details?: NestedErrorDetails[]; + id?: string; + message?: string; + size?: number; + userFilter?: string; + [key: string]: unknown; + }; + // (undocumented) + statusCode?: number; +} + +// @public (undocumented) +export interface ErrorNode { + // (undocumented) + cache: { + key: string; + }; + // (undocumented) + client: { + action: string; + collectors: Collectors[]; + description?: string; + name?: string; + status: 'error'; + }; + // (undocumented) + error: DaVinciError; + // (undocumented) + httpStatus: number; + // (undocumented) + server: { + _links?: Links; + eventName?: string; + id?: string; + interactionId?: string; + interactionToken?: string; + status: 'error'; + } | null; + // (undocumented) + status: 'error'; +} + +// @public (undocumented) +export interface FailureNode { + // (undocumented) + cache: { + key: string; + }; + // (undocumented) + client: { + status: 'failure'; + }; + // (undocumented) + error: DaVinciError; + // (undocumented) + httpStatus: number; + // (undocumented) + server: { + _links?: Links; + eventName?: string; + href?: string; + id?: string; + interactionId?: string; + interactionToken?: string; + status: 'failure'; + } | null; + // (undocumented) + status: 'failure'; +} + +// @public +export function fido(): FidoClient; + +// @public (undocumented) +export type FidoAuthenticationCollector = AutoCollector< + 'ObjectValueAutoCollector', + 'FidoAuthenticationCollector', + FidoAuthenticationInputValue | GenericError, + FidoAuthenticationOutputValue +>; + +// @public (undocumented) +export type FidoAuthenticationField = { + type: 'FIDO2'; + key: string; + label: string; + publicKeyCredentialRequestOptions: FidoAuthenticationOptions; + action: 'AUTHENTICATE'; + trigger: string; + required: boolean; +}; + +// @public (undocumented) +export interface FidoAuthenticationInputValue { + // (undocumented) + assertionValue?: AssertionValue; +} + +// @public (undocumented) +export interface FidoAuthenticationOptions extends Omit< + PublicKeyCredentialRequestOptions, + 'challenge' | 'allowCredentials' +> { + // (undocumented) + allowCredentials?: { + id: number[]; + transports?: AuthenticatorTransport[]; + type: PublicKeyCredentialType; + }[]; + // (undocumented) + challenge: number[]; +} + +// @public (undocumented) +export interface FidoAuthenticationOutputValue { + // (undocumented) + action: 'AUTHENTICATE'; + // (undocumented) + publicKeyCredentialRequestOptions: FidoAuthenticationOptions; + // (undocumented) + trigger: string; +} + +// @public (undocumented) +export interface FidoClient { + authenticate: ( + options: FidoAuthenticationOptions, + ) => Promise; + register: ( + options: FidoRegistrationOptions, + ) => Promise; +} + +// @public +export type FidoErrorCode = + | 'NotAllowedError' + | 'AbortError' + | 'InvalidStateError' + | 'NotSupportedError' + | 'SecurityError' + | 'TimeoutError' + | 'UnknownError'; + +// @public (undocumented) +export type FidoRegistrationCollector = AutoCollector< + 'ObjectValueAutoCollector', + 'FidoRegistrationCollector', + FidoRegistrationInputValue | GenericError, + FidoRegistrationOutputValue +>; + +// @public (undocumented) +export type FidoRegistrationField = { + type: 'FIDO2'; + key: string; + label: string; + publicKeyCredentialCreationOptions: FidoRegistrationOptions; + action: 'REGISTER'; + trigger: string; + required: boolean; +}; + +// @public (undocumented) +export interface FidoRegistrationInputValue { + // (undocumented) + attestationValue?: AttestationValue; +} + +// @public (undocumented) +export interface FidoRegistrationOptions extends Omit< + PublicKeyCredentialCreationOptions, + 'challenge' | 'user' | 'pubKeyCredParams' | 'excludeCredentials' +> { + // (undocumented) + challenge: number[]; + // (undocumented) + excludeCredentials?: { + id: number[]; + transports?: AuthenticatorTransport[]; + type: PublicKeyCredentialType; + }[]; + // (undocumented) + pubKeyCredParams: { + alg: string | number; + type: PublicKeyCredentialType; + }[]; + // (undocumented) + user: { + id: number[]; + name: string; + displayName: string; + }; +} + +// @public (undocumented) +export interface FidoRegistrationOutputValue { + // (undocumented) + action: 'REGISTER'; + // (undocumented) + publicKeyCredentialCreationOptions: FidoRegistrationOptions; + // (undocumented) + trigger: string; +} + +// @public (undocumented) +export type FlowCollector = ActionCollectorNoUrl<'FlowCollector'>; + +// @public (undocumented) +export type FlowNode = ContinueNode | ErrorNode | StartNode | SuccessNode | FailureNode; + +// @public +export type GetClient = + | StartNode['client'] + | ContinueNode['client'] + | ErrorNode['client'] + | SuccessNode['client'] + | FailureNode['client']; + +// @public (undocumented) +export type IdpCollector = ActionCollectorWithUrl<'IdpCollector'>; + +// @public +export interface ImageCollector extends NoValueCollectorBase<'ImageCollector'> { + // (undocumented) + output: NoValueCollectorBase<'ImageCollector'>['output'] & { + src: string; + alt: string; + href?: string; + }; +} + +// @public (undocumented) +export type ImageField = { + type: 'IMAGE'; + key: string; + description: string; + imageUrl: string; + hyperlinkUrl?: string; +}; + +// @public (undocumented) +export type InferActionCollectorType = T extends 'IdpCollector' + ? IdpCollector + : T extends 'SubmitCollector' + ? SubmitCollector + : T extends 'FlowCollector' + ? FlowCollector + : ActionCollectorWithUrl<'ActionCollector'> | ActionCollectorNoUrl<'ActionCollector'>; + +// @public +export type InferAutoCollectorType = T extends 'ProtectCollector' + ? ProtectCollector + : T extends 'PollingCollector' + ? PollingCollector + : T extends 'FidoRegistrationCollector' + ? FidoRegistrationCollector + : T extends 'FidoAuthenticationCollector' + ? FidoAuthenticationCollector + : T extends 'MetadataCollector' + ? MetadataCollector + : T extends 'ObjectValueAutoCollector' + ? ObjectValueAutoCollector + : SingleValueAutoCollector; + +// @public +export type InferMultiValueCollectorType = + T extends 'MultiSelectCollector' + ? MultiValueCollectorWithValue<'MultiSelectCollector'> + : + | MultiValueCollectorWithValue<'MultiValueCollector'> + | MultiValueCollectorNoValue<'MultiValueCollector'>; + +// @public +export type InferNoValueCollectorType = + T extends 'ReadOnlyCollector' + ? ReadOnlyCollector + : T extends 'RichTextCollector' + ? RichTextCollector + : T extends 'QrCodeCollector' + ? QrCodeCollector + : T extends 'ImageCollector' + ? ImageCollector + : NoValueCollectorBase<'NoValueCollector'>; + +// @public +export type InferSingleValueCollectorType = + T extends 'TextCollector' + ? TextCollector + : T extends 'SingleSelectCollector' + ? SingleSelectCollector + : T extends 'ValidatedTextCollector' + ? ValidatedTextCollector + : T extends 'PasswordCollector' + ? PasswordCollector + : T extends 'ValidatedPasswordCollector' + ? ValidatedPasswordCollector + : T extends 'BooleanCollector' + ? BooleanCollector + : T extends 'ValidatedBooleanCollector' + ? ValidatedBooleanCollector + : + | SingleValueCollectorWithValue<'SingleValueCollector'> + | SingleValueCollectorNoValue<'SingleValueCollector'>; + +// @public (undocumented) +export type InferValueObjectCollectorType = + T extends 'DeviceAuthenticationCollector' + ? DeviceAuthenticationCollector + : T extends 'DeviceRegistrationCollector' + ? DeviceRegistrationCollector + : T extends 'PhoneNumberCollector' + ? PhoneNumberCollector + : T extends 'PhoneNumberExtensionCollector' + ? PhoneNumberExtensionCollector + : + | ObjectOptionsCollectorWithObjectValue<'ObjectValueCollector'> + | ObjectOptionsCollectorWithStringValue<'ObjectValueCollector'>; + +// @public (undocumented) +export type InitFlow = () => Promise; + +// @public (undocumented) +export interface InternalErrorResponse { + // (undocumented) + error: Omit & { + message: string; + }; + // (undocumented) + type: 'internal_error'; +} + +// @public (undocumented) +export interface Links { + // (undocumented) + [key: string]: { + href?: string; + }; +} + +export { LogLevel }; + +export { makeDavinciConfig }; + +// @public (undocumented) +export type MetadataCollector = AutoCollector< + 'ObjectValueAutoCollector', + 'MetadataCollector', + MetadataCollectorInputValue, + Record +>; + +// @public (undocumented) +export type MetadataCollectorInputValue = Record | MetadataError; + +// @public +export interface MetadataError { + // (undocumented) + code: string; + // (undocumented) + message: string; +} + +// @public (undocumented) +export type MetadataField = { + type: 'METADATA'; + key: string; + payload: Record; +}; + +// @public (undocumented) +export type MultiSelectCollector = MultiValueCollectorWithValue<'MultiSelectCollector'>; + +// @public (undocumented) +export type MultiSelectField = { + inputType: 'MULTI_SELECT'; + key: string; + label: string; + options: { + label: string; + value: string; + }[]; + required?: boolean; + type: 'CHECKBOX' | 'COMBOBOX'; +}; + +// @public (undocumented) +export type MultiValueCollector = + | MultiValueCollectorWithValue + | MultiValueCollectorNoValue; + +// @public (undocumented) +export interface MultiValueCollectorNoValue { + // (undocumented) + category: 'MultiValueCollector'; + // (undocumented) + error: string | null; + // (undocumented) + id: string; + // (undocumented) + input: { + key: string; + value: string[]; + type: string; + validation: ValidationRequired[] | null; + }; + // (undocumented) + name: string; + // (undocumented) + output: { + key: string; + label: string; + type: string; + options: SelectorOption[]; + }; + // (undocumented) + type: T; +} + +// @public (undocumented) +export type MultiValueCollectors = + | MultiValueCollectorWithValue<'MultiValueCollector'> + | MultiValueCollectorWithValue<'MultiSelectCollector'>; + +// @public +export type MultiValueCollectorTypes = 'MultiSelectCollector' | 'MultiValueCollector'; + +// @public (undocumented) +export interface MultiValueCollectorWithValue { + // (undocumented) + category: 'MultiValueCollector'; + // (undocumented) + error: string | null; + // (undocumented) + id: string; + // (undocumented) + input: { + key: string; + value: string[]; + type: string; + validation: ValidationRequired[] | null; + }; + // (undocumented) + name: string; + // (undocumented) + output: { + key: string; + label: string; + type: string; + value: string[]; + options: SelectorOption[]; + }; + // (undocumented) + type: T; +} + +// @public (undocumented) +export type MultiValueFields = MultiSelectField; + +// @public +export interface NestedErrorDetails { + // (undocumented) + code?: string; + // (undocumented) + innerError?: { + history?: string; + unsatisfiedRequirements?: string[]; + failuresRemaining?: number; + }; + // (undocumented) + message?: string; + // (undocumented) + target?: string; +} + +// @public +export const nextCollectorValues: ActionCreatorWithPayload< + { + fields: DaVinciField[]; + formData: { + value: Record; + }; + }, + string +>; + +// @public +export const nodeCollectorReducer: Reducer & { + getInitialState: () => Collectors[]; +}; + +// @public (undocumented) +export type NodeStates = StartNode | ContinueNode | ErrorNode | SuccessNode | FailureNode; + +// @public (undocumented) +export type NoValueCollector = InferNoValueCollectorType; + +// @public (undocumented) +export interface NoValueCollectorBase { + // (undocumented) + category: 'NoValueCollector'; + // (undocumented) + error: string | null; + // (undocumented) + id: string; + // (undocumented) + name: string; + // (undocumented) + output: { + key: string; + label: string; + type: string; + }; + // (undocumented) + type: T; +} + +// @public (undocumented) +export type NoValueCollectors = + | NoValueCollectorBase<'NoValueCollector'> + | ReadOnlyCollector + | RichTextCollector + | QrCodeCollector + | ImageCollector; + +// @public +export type NoValueCollectorTypes = + | 'ReadOnlyCollector' + | 'RichTextCollector' + | 'NoValueCollector' + | 'QrCodeCollector' + | 'ImageCollector'; + +// @public +export interface OAuthDetails { + // (undocumented) + [key: string]: unknown; + // (undocumented) + code?: string; + // (undocumented) + state?: string; +} + +// @public (undocumented) +export interface ObjectOptionsCollectorWithObjectValue< + T extends ObjectValueCollectorTypes, + V = Record, + D = Record, +> { + // (undocumented) + category: 'ObjectValueCollector'; + // (undocumented) + error: string | null; + // (undocumented) + id: string; + // (undocumented) + input: { + key: string; + value: V; + type: string; + validation: ValidationRequired[] | null; + }; + // (undocumented) + name: string; + // (undocumented) + output: { + key: string; + label: string; + type: string; + options: DeviceOptionWithDefault[]; + value?: D | null; + }; + // (undocumented) + type: T; +} + +// @public (undocumented) +export interface ObjectOptionsCollectorWithStringValue< + T extends ObjectValueCollectorTypes, + V = string, +> { + // (undocumented) + category: 'ObjectValueCollector'; + // (undocumented) + error: string | null; + // (undocumented) + id: string; + // (undocumented) + input: { + key: string; + value: V; + type: string; + validation: ValidationRequired[] | null; + }; + // (undocumented) + name: string; + // (undocumented) + output: { + key: string; + label: string; + type: string; + options: DeviceOptionNoDefault[]; + }; + // (undocumented) + type: T; +} + +// @public (undocumented) +export type ObjectValueAutoCollector = AutoCollector< + 'ObjectValueAutoCollector', + 'ObjectValueAutoCollector', + Record +>; + +// @public (undocumented) +export type ObjectValueAutoCollectorTypes = + | 'ObjectValueAutoCollector' + | 'FidoRegistrationCollector' + | 'FidoAuthenticationCollector' + | 'MetadataCollector'; + +// @public (undocumented) +export type ObjectValueCollector = + | ObjectOptionsCollectorWithObjectValue + | ObjectOptionsCollectorWithStringValue + | ObjectValueCollectorWithObjectValue; + +// @public (undocumented) +export type ObjectValueCollectors = + | DeviceAuthenticationCollector + | DeviceRegistrationCollector + | PhoneNumberCollector + | PhoneNumberExtensionCollector + | ObjectOptionsCollectorWithObjectValue<'ObjectSelectCollector'> + | ObjectOptionsCollectorWithStringValue<'ObjectSelectCollector'>; + +// @public +export type ObjectValueCollectorTypes = + | 'DeviceAuthenticationCollector' + | 'DeviceRegistrationCollector' + | 'PhoneNumberCollector' + | 'PhoneNumberExtensionCollector' + | 'ObjectOptionsCollector' + | 'ObjectValueCollector' + | 'ObjectSelectCollector'; + +// @public (undocumented) +export interface ObjectValueCollectorWithObjectValue< + T extends ObjectValueCollectorTypes, + IV = Record, + OV = Record, +> { + // (undocumented) + category: 'ObjectValueCollector'; + // (undocumented) + error: string | null; + // (undocumented) + id: string; + // (undocumented) + input: { + key: string; + value: IV; + type: string; + validation: (ValidationRequired | ValidationPhoneNumber)[] | null; + }; + // (undocumented) + name: string; + // (undocumented) + output: { + key: string; + label: string; + type: string; + value?: OV | null; + }; + // (undocumented) + type: T; +} + +// @public (undocumented) +export interface OutgoingQueryParams { + // (undocumented) + [key: string]: string | string[]; +} + +// @public (undocumented) +export interface PasswordCollector { + // (undocumented) + category: 'SingleValueCollector'; + // (undocumented) + error: string | null; + // (undocumented) + id: string; + // (undocumented) + input: { + key: string; + value: string | number | boolean; + type: string; + }; + // (undocumented) + name: string; + // (undocumented) + output: { + key: string; + label: string; + type: string; + verify: boolean; + }; + // (undocumented) + type: 'PasswordCollector'; +} + +// @public +export type PasswordField = { + type: 'PASSWORD' | 'PASSWORD_VERIFY'; + key: string; + label: string; + required?: boolean; + verify?: boolean; + passwordPolicy?: PasswordPolicy; +}; + +// @public +export interface PasswordPolicy { + // (undocumented) + createdAt?: string; + // (undocumented) + default?: boolean; + // (undocumented) + description?: string; + // (undocumented) + excludesCommonlyUsed?: boolean; + // (undocumented) + excludesProfileData?: boolean; + // (undocumented) + history?: { + count?: number; + retentionDays?: number; + }; + // (undocumented) + id?: string; + // (undocumented) + length?: { + min?: number; + max?: number; + }; + // (undocumented) + lockout?: { + failureCount?: number; + durationSeconds?: number; + }; + // (undocumented) + maxAgeDays?: number; + // (undocumented) + maxRepeatedCharacters?: number; + // (undocumented) + minAgeDays?: number; + // (undocumented) + minCharacters?: Record; + // (undocumented) + minUniqueCharacters?: number; + // (undocumented) + name?: string; + // (undocumented) + notSimilarToCurrent?: boolean; + // (undocumented) + populationCount?: number; + // (undocumented) + updatedAt?: string; +} + +// @public (undocumented) +export type PhoneNumberCollector = ObjectValueCollectorWithObjectValue< + 'PhoneNumberCollector', + PhoneNumberInputValue, + PhoneNumberOutputValue +>; + +// @public (undocumented) +export interface PhoneNumberExtensionCollector { + // (undocumented) + category: 'ObjectValueCollector'; + // (undocumented) + error: string | null; + // (undocumented) + id: string; + // (undocumented) + input: { + key: string; + value: PhoneNumberExtensionInputValue; + type: string; + validation: (ValidationRequired | ValidationPhoneNumber)[] | null; + }; + // (undocumented) + name: string; + // (undocumented) + output: { + key: string; + label: string; + type: string; + extensionLabel: string; + value: PhoneNumberExtensionOutputValue; + }; + // (undocumented) + type: 'PhoneNumberExtensionCollector'; +} + +// @public (undocumented) +export type PhoneNumberExtensionField = PhoneNumberField & { + showExtension: boolean; + extensionLabel: string; +}; + +// @public (undocumented) +export interface PhoneNumberExtensionInputValue { + // (undocumented) + countryCode: string; + // (undocumented) + extension: string; + // (undocumented) + phoneNumber: string; +} + +// @public (undocumented) +export interface PhoneNumberExtensionOutputValue { + // (undocumented) + countryCode?: string; + // (undocumented) + extension?: string; + // (undocumented) + phoneNumber?: string; +} + +// @public (undocumented) +export type PhoneNumberField = { + type: 'PHONE_NUMBER'; + key: string; + label: string; + required: boolean; + defaultCountryCode: string | null; + validatePhoneNumber: boolean; +}; + +// @public (undocumented) +export interface PhoneNumberInputValue { + // (undocumented) + countryCode: string; + // (undocumented) + phoneNumber: string; +} + +// @public (undocumented) +export interface PhoneNumberOutputValue { + // (undocumented) + countryCode?: string; + // (undocumented) + phoneNumber?: string; +} + +// @public +export type Poller = () => Promise; + +// @public (undocumented) +export type PollingCollector = AutoCollector< + 'SingleValueAutoCollector', + 'PollingCollector', + string, + PollingOutputValue +>; + +// @public (undocumented) +export type PollingField = { + type: 'POLLING'; + key: string; + pollInterval: number; + pollRetries: number; + pollChallengeStatus?: boolean; + challenge?: string; +}; + +// @public (undocumented) +export interface PollingOutputValue { + // (undocumented) + challenge?: string; + // (undocumented) + pollChallengeStatus?: boolean; + // (undocumented) + pollInterval: number; + // (undocumented) + pollRetries: number; + // (undocumented) + retriesRemaining?: number; +} + +// @public (undocumented) +export type PollingStatus = PollingStatusContinue | PollingStatusChallenge; + +// @public (undocumented) +export type PollingStatusChallenge = + | PollingStatusChallengeComplete + | 'expired' + | 'timedOut' + | 'error'; + +// @public (undocumented) +export type PollingStatusChallengeComplete = + | 'approved' + | 'denied' + | 'continue' + | CustomPollingStatus; + +// @public (undocumented) +export type PollingStatusContinue = 'continue' | 'timedOut'; + +// @public (undocumented) +export type ProtectCollector = AutoCollector< + 'SingleValueAutoCollector', + 'ProtectCollector', + string, + ProtectOutputValue +>; + +// @public (undocumented) +export type ProtectField = { + type: 'PROTECT'; + key: string; + behavioralDataCollection: boolean; + universalDeviceIdentification: boolean; +}; + +// @public +export interface ProtectOutputValue { + // (undocumented) + behavioralDataCollection: boolean; + // (undocumented) + universalDeviceIdentification: boolean; +} + +// @public +export interface QrCodeCollector extends NoValueCollectorBase<'QrCodeCollector'> { + // (undocumented) + output: NoValueCollectorBase<'QrCodeCollector'>['output'] & { + src: string; + }; +} + +// @public (undocumented) +export type QrCodeField = { + type: 'QR_CODE'; + key: string; + content: string; + fallbackText?: string; +}; + +// @public +export interface ReadOnlyCollector extends NoValueCollectorBase<'ReadOnlyCollector'> { + // (undocumented) + output: NoValueCollectorBase<'ReadOnlyCollector'>['output'] & { + content: string; + title?: string; + }; +} + +// @public (undocumented) +export type ReadOnlyField = { + type: 'LABEL'; + content: string; + richContent?: RichContent; + key?: string; +}; + +// @public (undocumented) +export type ReadOnlyFields = ReadOnlyField | QrCodeField | AgreementField | ImageField; + +// @public (undocumented) +export type RedirectField = { + type: 'SOCIAL_LOGIN_BUTTON'; + key: string; + label: string; + links: Links; +}; + +// @public (undocumented) +export type RedirectFields = RedirectField; + +export { RequestMiddleware }; + +// @public +export type RichContent = { + content: string; + replacements?: Record; +}; + +// @public +export interface RichContentLink { + // (undocumented) + href: string; + // (undocumented) + key: string; + // (undocumented) + target?: '_self' | '_blank'; + // (undocumented) + type: 'link'; + // (undocumented) + value: string; +} + +// @public +export type RichContentReplacement = { + type: 'link'; + value: string; + href: string; + target?: '_self' | '_blank'; +}; + +// @public +export interface RichTextCollector extends NoValueCollectorBase<'RichTextCollector'> { + // (undocumented) + output: NoValueCollectorBase<'RichTextCollector'>['output'] & { + content: string; + richContent: CollectorRichContent; + }; +} + +// @public (undocumented) +export interface SelectorOption { + // (undocumented) + label: string; + // (undocumented) + value: string; +} + +// @public (undocumented) +export type SingleCheckboxField = { + type: 'SINGLE_CHECKBOX'; + inputType: 'BOOLEAN'; + key: string; + label: string; + required?: boolean; + errorMessage?: string; + appearance: string; + richContent?: RichContent; +}; + +// @public (undocumented) +export type SingleSelectCollector = SingleSelectCollectorWithValue<'SingleSelectCollector'>; + +// @public (undocumented) +export interface SingleSelectCollectorNoValue { + // (undocumented) + category: 'SingleValueCollector'; + // (undocumented) + error: string | null; + // (undocumented) + id: string; + // (undocumented) + input: { + key: string; + value: string | number | boolean; + type: string; + }; + // (undocumented) + name: string; + // (undocumented) + output: { + key: string; + label: string; + type: string; + options: SelectorOption[]; + }; + // (undocumented) + type: T; +} + +// @public (undocumented) +export interface SingleSelectCollectorWithValue { + // (undocumented) + category: 'SingleValueCollector'; + // (undocumented) + error: string | null; + // (undocumented) + id: string; + // (undocumented) + input: { + key: string; + value: string | number | boolean; + type: string; + }; + // (undocumented) + name: string; + // (undocumented) + output: { + key: string; + label: string; + type: string; + value: string | number | boolean; + options: SelectorOption[]; + }; + // (undocumented) + type: T; +} + +// @public (undocumented) +export type SingleSelectField = { + inputType: 'SINGLE_SELECT'; + key: string; + label: string; + options: { + label: string; + value: string; + }[]; + required?: boolean; + type: 'RADIO' | 'DROPDOWN'; +}; + +// @public (undocumented) +export type SingleValueAutoCollector = AutoCollector< + 'SingleValueAutoCollector', + 'SingleValueAutoCollector', + string +>; + +// @public (undocumented) +export type SingleValueAutoCollectorTypes = + | 'SingleValueAutoCollector' + | 'ProtectCollector' + | 'PollingCollector'; + +// @public +export type SingleValueCollector = + | SingleValueCollectorWithValue + | SingleValueCollectorNoValue; + +// @public (undocumented) +export interface SingleValueCollectorNoValue { + // (undocumented) + category: 'SingleValueCollector'; + // (undocumented) + error: string | null; + // (undocumented) + id: string; + // (undocumented) + input: { + key: string; + value: string | number | boolean; + type: string; + }; + // (undocumented) + name: string; + // (undocumented) + output: { + key: string; + label: string; + type: string; + }; + // (undocumented) + type: T; +} + +// @public (undocumented) +export type SingleValueCollectors = + | PasswordCollector + | ValidatedPasswordCollector + | SingleSelectCollector + | TextCollector + | ValidatedTextCollector + | BooleanCollector + | ValidatedBooleanCollector + | SingleValueCollectorWithValue<'SingleValueCollector'>; + +// @public +export type SingleValueCollectorTypes = + | 'PasswordCollector' + | 'ValidatedPasswordCollector' + | 'BooleanCollector' + | 'ValidatedBooleanCollector' + | 'SingleValueCollector' + | 'SingleSelectCollector' + | 'SingleSelectObjectCollector' + | 'TextCollector' + | 'ValidatedTextCollector'; + +// @public (undocumented) +export interface SingleValueCollectorWithValue { + // (undocumented) + category: 'SingleValueCollector'; + // (undocumented) + error: string | null; + // (undocumented) + id: string; + // (undocumented) + input: { + key: string; + value: V; + type: string; + }; + // (undocumented) + name: string; + // (undocumented) + output: { + key: string; + label: string; + type: string; + value: V; + }; + // (undocumented) + type: T; +} + +// @public (undocumented) +export type SingleValueFields = + | StandardField + | PasswordField + | ValidatedField + | SingleCheckboxField + | SingleSelectField + | ProtectField; + +// @public (undocumented) +export type StandardField = { + type: 'TEXT' | 'SUBMIT_BUTTON' | 'FLOW_BUTTON' | 'FLOW_LINK' | 'BUTTON'; + key: string; + label: string; + required?: boolean; +}; + +// @public (undocumented) +export interface StartNode { + // (undocumented) + cache: null; + // (undocumented) + client: { + status: 'start'; + }; + // (undocumented) + error: DaVinciError | null; + // (undocumented) + server: { + status: 'start'; + }; + // (undocumented) + status: 'start'; +} + +// @public (undocumented) +export interface StartOptions { + // (undocumented) + query: Query; +} + +// @public (undocumented) +export type SubmitCollector = ActionCollectorNoUrl<'SubmitCollector'>; + +// @public (undocumented) +export interface SuccessNode { + // (undocumented) + cache: { + key: string; + }; + // (undocumented) + client: { + authorization?: { + code?: string; + state?: string; + }; + status: 'success'; + } | null; + // (undocumented) + error: null; + // (undocumented) + httpStatus: number; + // (undocumented) + server: { + _links?: Links; + eventName?: string; + id?: string; + interactionId?: string; + interactionToken?: string; + href?: string; + session?: string; + status: 'success'; + }; + // (undocumented) + status: 'success'; +} + +// @public (undocumented) +export type TextCollector = SingleValueCollectorWithValue<'TextCollector'>; + +// @public (undocumented) +export interface ThrownQueryError { + // (undocumented) + error: FetchBaseQueryError; + // (undocumented) + isHandledError: boolean; + // (undocumented) + meta: FetchBaseQueryMeta; +} + +// @public +export type UnknownCollector = { + category: 'UnknownCollector'; + error: string | null; + type: 'UnknownCollector'; + id: string; + name: string; + output: { + key: string; + label: string; + type: string; + }; +}; + +// @public (undocumented) +export type UnknownField = Record; + +// @public +export type UpdatableCollectors = + | SingleValueCollectors + | MultiSelectCollector + | ObjectValueCollectors + | AutoCollectors; + +// @public (undocumented) +export const updateCollectorValues: ActionCreatorWithPayload< + { + id: string; + value: CollectorValueTypes; + index?: number; + }, + string +>; + +// @public +export type Updater = ( + value: CollectorValueType, + index?: number, +) => InternalErrorResponse | null; + +// @public (undocumented) +export interface ValidatedBooleanCollector extends ValidatedSingleValueCollectorWithValue< + 'ValidatedBooleanCollector', + boolean +> { + // (undocumented) + output: ValidatedSingleValueCollectorWithValue<'ValidatedBooleanCollector', boolean>['output'] & { + appearance: string; + richContent?: CollectorRichContent; + }; +} + +// @public +export type ValidatedCollectors = + | ValidatedTextCollector + | ValidatedBooleanCollector + | ValidatedPasswordCollector + | ObjectValueCollectors + | MultiValueCollectors + | AutoCollectors; + +// @public (undocumented) +export type ValidatedField = { + type: 'TEXT'; + key: string; + label: string; + required: boolean; + validation: { + regex: string; + errorMessage: string; + }; +}; + +// @public (undocumented) +export interface ValidatedPasswordCollector { + // (undocumented) + category: 'SingleValueCollector'; + // (undocumented) + error: string | null; + // (undocumented) + id: string; + // (undocumented) + input: { + key: string; + value: string | number | boolean; + type: string; + validation: PasswordPolicy; + }; + // (undocumented) + name: string; + // (undocumented) + output: { + key: string; + label: string; + type: string; + verify: boolean; + }; + // (undocumented) + type: 'ValidatedPasswordCollector'; +} + +// @public (undocumented) +export interface ValidatedSingleValueCollectorWithValue< + T extends SingleValueCollectorTypes, + V = string, +> { + // (undocumented) + category: 'ValidatedSingleValueCollector'; + // (undocumented) + error: string | null; + // (undocumented) + id: string; + // (undocumented) + input: { + key: string; + type: string; + validation: (ValidationRequired | ValidationRegex)[]; + value: V; + }; + // (undocumented) + name: string; + // (undocumented) + output: { + key: string; + label: string; + type: string; + value: V; + }; + // (undocumented) + type: T; +} + +// @public (undocumented) +export type ValidatedTextCollector = ValidatedSingleValueCollectorWithValue<'TextCollector'>; + +// @public (undocumented) +export interface ValidationPhoneNumber { + // (undocumented) + message: string; + // (undocumented) + rule: boolean; + // (undocumented) + type: 'validatePhoneNumber'; +} + +// @public (undocumented) +export interface ValidationRegex { + // (undocumented) + message: string; + // (undocumented) + rule: string; + // (undocumented) + type: 'regex'; +} + +// @public (undocumented) +export interface ValidationRequired { + // (undocumented) + message: string; + // (undocumented) + rule: boolean; + // (undocumented) + type: 'required'; +} + +// @public +export type Validator = ( + value: CollectorValueType, +) => + | string[] + | { + error: { + message: string; + type: string; + }; + type: string; + }; + +// (No @packageDocumentation comment for this package) +``` 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 365118aac09..0714104d23c 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 9923ea4b676..5828de19d70 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 ef6c2a96237..ff1892b9843 100644 --- a/packages/davinci-client/src/lib/client.store.test.ts +++ b/packages/davinci-client/src/lib/client.store.test.ts @@ -5,10 +5,11 @@ * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ +import { makeDavinciConfig } from '@forgerock/sdk-utilities'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { davinci } from './client.store.js'; -import { makeDavinciConfig } from '@forgerock/sdk-utilities'; + 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 c92def90d84..1fae4b490c1 100644 --- a/packages/davinci-client/src/lib/client.store.ts +++ b/packages/davinci-client/src/lib/client.store.ts @@ -4,12 +4,13 @@ * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ -import { Micro, Either } from 'effect'; -import { exitIsFail, exitIsSuccess } from 'effect/Micro'; -import { type CustomLogger, logger as loggerFn, type LogLevel } from '@forgerock/sdk-logger'; +import { logger as loggerFn } from '@forgerock/sdk-logger'; +import { createWellknownError, isGenericError } from '@forgerock/sdk-utilities'; import { createStorage } from '@forgerock/storage'; -import { isGenericError, createWellknownError } from '@forgerock/sdk-utilities'; +import { Either, Micro } from 'effect'; +import { exitIsFail, exitIsSuccess } from 'effect/Micro'; +import { getPollingModeµ, pollingµ } from './client.store.effects.js'; /** * Import RTK slices and api */ @@ -19,15 +20,35 @@ import { handleUpdateValidateError, isValidCollectorCategory, resolveCollectorUpdateValue, - 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, + UpdatableCollectors, + Updater, + Validator, +} from './client.types.js'; +import type { + AutoCollectors, + MultiValueCollectors, + ObjectValueCollectors, + PollingCollector, + SingleValueCollectors, +} from './collector.types.js'; /** * Import the DaVinciRequest types */ @@ -38,25 +59,6 @@ import type { OutgoingQueryParams, StartOptions, } from './davinci.types.js'; -import type { - SingleValueCollectors, - ObjectValueCollectors, - AutoCollectors, - PollingCollector, - MultiValueCollectors, -} from './collector.types.js'; -import type { - InitFlow, - InternalErrorResponse, - NodeStates, - Updater, - UpdatableCollectors, - 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 ae6034f2464..31e4eda11dc 100644 --- a/packages/davinci-client/src/lib/client.store.utils.ts +++ b/packages/davinci-client/src/lib/client.store.utils.ts @@ -5,31 +5,31 @@ * of the MIT license. See the LICENSE file for details. */ import { configureStore } from '@reduxjs/toolkit'; -import { Match, Either } from 'effect'; +import { Either, Match } from 'effect'; + +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 { ActionTypes, RequestMiddleware } from '@forgerock/sdk-request-middleware'; 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, - Collectors, - CollectorCategory, -} from './node.types.js'; import type { CollectorValueType, CollectorValueTypes, InternalErrorResponse, UpdatableCollectors, } 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'; +import type { + CollectorCategory, + Collectors, + ContinueNode, + ErrorNode, + StartNode, + SuccessNode, +} from './node.types.js'; export function createClientStore({ requestMiddleware, 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 f36a8b87ca2..1eb04376fa4 100644 --- a/packages/davinci-client/src/lib/client.types.test-d.ts +++ b/packages/davinci-client/src/lib/client.types.test-d.ts @@ -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 f244b7a087b..094d3ff016a 100644 --- a/packages/davinci-client/src/lib/client.types.ts +++ b/packages/davinci-client/src/lib/client.types.ts @@ -7,21 +7,21 @@ import type { GenericError } from '@forgerock/sdk-types'; import type { - FidoRegistrationInputValue, - FidoAuthenticationInputValue, - PhoneNumberInputValue, - PhoneNumberExtensionInputValue, AutoCollectors, + FidoAuthenticationInputValue, + FidoRegistrationInputValue, + MetadataError, MultiSelectCollector, MultiValueCollectors, ObjectValueCollectors, + PhoneNumberExtensionInputValue, + PhoneNumberInputValue, SingleValueCollectors, - ValidatedTextCollector, ValidatedBooleanCollector, ValidatedPasswordCollector, - MetadataError, + 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 35c560e3ad5..aaf60c447e0 100644 --- a/packages/davinci-client/src/lib/collector.types.test-d.ts +++ b/packages/davinci-client/src/lib/collector.types.test-d.ts @@ -5,43 +5,44 @@ * 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, + ImageCollector, InferActionCollectorType, + InferMultiValueCollectorType, InferNoValueCollectorType, - ReadOnlyCollector, - RichTextCollector, - QrCodeCollector, - ImageCollector, + 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.types.ts b/packages/davinci-client/src/lib/collector.types.ts index e88c6fec12a..5dec03031c1 100644 --- a/packages/davinci-client/src/lib/collector.types.ts +++ b/packages/davinci-client/src/lib/collector.types.ts @@ -6,6 +6,7 @@ */ import type { GenericError } from '@forgerock/sdk-types'; + import type { FidoAuthenticationOptions, FidoRegistrationOptions, diff --git a/packages/davinci-client/src/lib/collector.utils.test.ts b/packages/davinci-client/src/lib/collector.utils.test.ts index 3ac6393d744..62979e72d01 100644 --- a/packages/davinci-client/src/lib/collector.utils.test.ts +++ b/packages/davinci-client/src/lib/collector.utils.test.ts @@ -4,65 +4,67 @@ * 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, + returnImageCollector, + returnMetadataCollector, returnMultiSelectCollector, - returnValidator, - returnReadOnlyCollector, returnNoValueCollector, returnObjectSelectCollector, - returnObjectValueCollector, - returnMetadataCollector, - returnSingleValueAutoCollector, returnObjectValueAutoCollector, - returnImageCollector, + 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, + FidoAuthenticationField, + FidoRegistrationField, ImageField, MetadataField, PasswordField, - FidoAuthenticationField, - FidoRegistrationField, 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 c8c690a93d6..968fdc2d690 100644 --- a/packages/davinci-client/src/lib/collector.utils.ts +++ b/packages/davinci-client/src/lib/collector.utils.ts @@ -7,41 +7,42 @@ /** * 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, + ImageCollector, InferActionCollectorType, - NoValueCollectorTypes, + InferAutoCollectorType, + InferMultiValueCollectorType, InferNoValueCollectorType, - ValidatedBooleanCollector, - ValidatedSingleValueCollectorWithValue, - ValidatedTextCollector, + InferSingleValueCollectorType, InferValueObjectCollectorType, - ObjectValueCollectorTypes, - UnknownCollector, - InferAutoCollectorType, - PhoneNumberOutputValue, MultiValueCollectors, - ObjectValueCollectors, - AutoCollectors, - SingleValueAutoCollectorTypes, + MultiValueCollectorTypes, + NoValueCollectorTypes, ObjectValueAutoCollectorTypes, - ImageCollector, + 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, @@ -50,20 +51,19 @@ import type { MetadataField, 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 e3149453b90..5dda0d85882 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 4f0c89c6f5b..a7d9fba0475 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 6b5c1ba7d55..37e03af8ec5 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 05e94872ef6..0eabf2419f8 100644 --- a/packages/davinci-client/src/lib/davinci.api.ts +++ b/packages/davinci-client/src/lib/davinci.api.ts @@ -8,40 +8,38 @@ * 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 { GenericError } from '@forgerock/sdk-types'; +import type { + FetchArgs, + FetchBaseQueryError, + FetchBaseQueryMeta, + QueryReturnValue, +} from '@reduxjs/toolkit/query'; +import type { StartNode } from '../types.js'; /** * Import the DaVinci types */ import type { RootStateWithNode } from './client.store.utils.js'; +import type { FidoAuthenticationCollector, FidoRegistrationCollector } from './collector.types.js'; import type { DaVinciCacheEntry, OutgoingQueryParams, StartOptions, ThrownQueryError, } from './davinci.types.js'; -import type { GenericError } from '@forgerock/sdk-types'; -import type { FidoRegistrationCollector, FidoAuthenticationCollector } from './collector.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.types.ts b/packages/davinci-client/src/lib/davinci.types.ts index da467c4ca86..3e3f4de607a 100644 --- a/packages/davinci-client/src/lib/davinci.types.ts +++ b/packages/davinci-client/src/lib/davinci.types.ts @@ -8,19 +8,20 @@ * Request for DaVinci API */ +import type { GenericError } from '@forgerock/sdk-types'; import type { FetchBaseQueryError, FetchBaseQueryMeta, MutationResultSelectorResult, } from '@reduxjs/toolkit/query'; -import { + +import type { DeviceValue, - PhoneNumberInputValue, - FidoRegistrationInputValue, FidoAuthenticationInputValue, + FidoRegistrationInputValue, MetadataError, + PhoneNumberInputValue, } from './collector.types.js'; -import { GenericError } from '@forgerock/sdk-types'; export interface DaVinciRequest { id: string; diff --git a/packages/davinci-client/src/lib/davinci.utils.test.ts b/packages/davinci-client/src/lib/davinci.utils.test.ts index 36c6c699dd9..b47ef1e4351 100644 --- a/packages/davinci-client/src/lib/davinci.utils.test.ts +++ b/packages/davinci-client/src/lib/davinci.utils.test.ts @@ -4,18 +4,17 @@ * 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 cd1a83fa907..c29e682674f 100644 --- a/packages/davinci-client/src/lib/davinci.utils.ts +++ b/packages/davinci-client/src/lib/davinci.utils.ts @@ -7,12 +7,12 @@ /** * 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 { DaVinciRequestValueTypes } from './davinci.types.js'; import type { DaVinciCacheEntry, DavinciErrorResponse, @@ -22,7 +22,6 @@ import type { DaVinciSuccessResponse, } from './davinci.types.js'; import type { ContinueNode } from './node.types.js'; -import { DaVinciRequestValueTypes } from './davinci.types.js'; /** * @function transformSubmitRequest - Transforms a NextNode into a DaVinciRequest for form submissions diff --git a/packages/davinci-client/src/lib/fido/fido.test.ts b/packages/davinci-client/src/lib/fido/fido.test.ts index a1c4753725e..6738d12fd0b 100644 --- a/packages/davinci-client/src/lib/fido/fido.test.ts +++ b/packages/davinci-client/src/lib/fido/fido.test.ts @@ -4,12 +4,14 @@ * 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, afterEach } from 'vitest'; +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; + import { fido } from './fido.js'; -import type { FidoRegistrationOptions, FidoAuthenticationOptions } from '../davinci.types'; import type { GenericError } from '@forgerock/sdk-types'; +import type { FidoAuthenticationOptions, FidoRegistrationOptions } from '../davinci.types'; + const mockRegistrationOptions: FidoRegistrationOptions = { rp: { id: 'test.example.com', name: 'Test RP' }, user: { id: [1, 2, 3], displayName: 'test@example.com', name: 'Test User' }, diff --git a/packages/davinci-client/src/lib/fido/fido.ts b/packages/davinci-client/src/lib/fido/fido.ts index 2434012d21c..e49305d6c79 100644 --- a/packages/davinci-client/src/lib/fido/fido.ts +++ b/packages/davinci-client/src/lib/fido/fido.ts @@ -8,8 +8,8 @@ import { Micro } from 'effect'; import { exitIsFail, exitIsSuccess } from 'effect/Micro'; import { - toFidoErrorCode, createFidoError, + toFidoErrorCode, transformAssertion, transformAuthenticationOptions, transformPublicKeyCredential, @@ -17,12 +17,13 @@ import { } from './fido.utils.js'; import type { GenericError } from '@forgerock/sdk-types'; -import type { FidoClient } from './fido.types.js'; + import type { FidoAuthenticationInputValue, FidoRegistrationInputValue, } from '../collector.types.js'; import type { FidoAuthenticationOptions, FidoRegistrationOptions } from '../davinci.types.js'; +import type { FidoClient } from './fido.types.js'; /** * A client function that returns a set of methods for transforming DaVinci data and diff --git a/packages/davinci-client/src/lib/fido/fido.types.test.ts b/packages/davinci-client/src/lib/fido/fido.types.test.ts index 72b1694e6dd..10b52b3425a 100644 --- a/packages/davinci-client/src/lib/fido/fido.types.test.ts +++ b/packages/davinci-client/src/lib/fido/fido.types.test.ts @@ -4,7 +4,8 @@ * 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 { toFidoErrorCode } from './fido.utils'; describe('toFidoErrorCode', () => { diff --git a/packages/davinci-client/src/lib/fido/fido.types.ts b/packages/davinci-client/src/lib/fido/fido.types.ts index 931386779a1..652945fdbd2 100644 --- a/packages/davinci-client/src/lib/fido/fido.types.ts +++ b/packages/davinci-client/src/lib/fido/fido.types.ts @@ -6,11 +6,12 @@ */ import type { GenericError } from '@forgerock/sdk-types'; + import type { - FidoRegistrationInputValue, FidoAuthenticationInputValue, + FidoRegistrationInputValue, } from '../collector.types.js'; -import type { FidoRegistrationOptions, FidoAuthenticationOptions } from '../davinci.types.js'; +import type { FidoAuthenticationOptions, FidoRegistrationOptions } from '../davinci.types.js'; export interface FidoClient { /** 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 5470cfeff12..6255816c4ab 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/fido/fido.utils.ts b/packages/davinci-client/src/lib/fido/fido.utils.ts index 7a9a5afec35..fa6ababadd9 100644 --- a/packages/davinci-client/src/lib/fido/fido.utils.ts +++ b/packages/davinci-client/src/lib/fido/fido.utils.ts @@ -5,6 +5,7 @@ * of the MIT license. See the LICENSE file for details. */ import type { GenericError } from '@forgerock/sdk-types'; + import type { FidoAuthenticationInputValue, FidoRegistrationInputValue, diff --git a/packages/davinci-client/src/lib/node.reducer.test.ts b/packages/davinci-client/src/lib/node.reducer.test.ts index 7e392bdf152..fb2a5b214b7 100644 --- a/packages/davinci-client/src/lib/node.reducer.test.ts +++ b/packages/davinci-client/src/lib/node.reducer.test.ts @@ -4,31 +4,33 @@ * 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 { GenericError } from '@forgerock/sdk-types'; + import type { + BooleanCollector, DeviceAuthenticationCollector, DeviceRegistrationCollector, FidoAuthenticationCollector, FidoRegistrationCollector, + ImageCollector, MetadataCollector, MultiSelectCollector, PasswordCollector, - ValidatedPasswordCollector, PhoneNumberCollector, PhoneNumberExtensionCollector, PollingCollector, ProtectCollector, QrCodeCollector, ReadOnlyCollector, - ImageCollector, SubmitCollector, TextCollector, - BooleanCollector, ValidatedBooleanCollector, + ValidatedPasswordCollector, } from './collector.types.js'; -import type { GenericError } from '@forgerock/sdk-types'; import type { FidoAuthenticationOptions, FidoRegistrationOptions } from './davinci.types.js'; describe('The node collector reducer', () => { diff --git a/packages/davinci-client/src/lib/node.reducer.ts b/packages/davinci-client/src/lib/node.reducer.ts index f7215f85fb3..65c7af5e93c 100644 --- a/packages/davinci-client/src/lib/node.reducer.ts +++ b/packages/davinci-client/src/lib/node.reducer.ts @@ -10,41 +10,42 @@ import { createAction, createReducer } from '@reduxjs/toolkit'; import { Either } from 'effect'; +import { resolveCollectorUpdateValue } from './client.store.utils.js'; /** * Import the collector utilities */ import { returnActionCollector, + returnBooleanCollector, + returnFidoAuthenticationCollector, + returnFidoRegistrationCollector, returnFlowCollector, - returnMetadataCollector, - returnPasswordCollector, - returnValidatedPasswordCollector, returnIdpCollector, - returnSubmitCollector, - returnTextCollector, - returnBooleanCollector, - returnValidatedBooleanCollector, - returnSingleSelectCollector, + returnImageCollector, + returnMetadataCollector, returnMultiSelectCollector, - returnReadOnlyCollector, returnObjectSelectCollector, returnObjectValueCollector, - returnProtectCollector, + returnPasswordCollector, returnPollingCollector, - returnUnknownCollector, - returnFidoRegistrationCollector, - returnFidoAuthenticationCollector, + returnProtectCollector, returnQrCodeCollector, - returnImageCollector, + returnReadOnlyCollector, + returnSingleSelectCollector, + returnSubmitCollector, + returnTextCollector, + returnUnknownCollector, + returnValidatedBooleanCollector, + returnValidatedPasswordCollector, } from './collector.utils.js'; -import { resolveCollectorUpdateValue } from './client.store.utils.js'; -import type { DaVinciField, UnknownField } from './davinci.types.js'; -import type { PhoneNumberOutputValue, PhoneNumberExtensionOutputValue } from './collector.types.js'; + import type { CollectorValueType, CollectorValueTypes, UpdatableCollectors, } 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 6156dd8aca5..948034d52fb 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 5cc3c2907d9..f9d68afe6e6 100644 --- a/packages/davinci-client/src/lib/node.slice.ts +++ b/packages/davinci-client/src/lib/node.slice.ts @@ -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 8e3e02a7aa5..bbeee50c954 100644 --- a/packages/davinci-client/src/lib/node.types.test-d.ts +++ b/packages/davinci-client/src/lib/node.types.test-d.ts @@ -6,45 +6,46 @@ */ /* 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, + ImageCollector, MetadataCollector, 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, - ImageCollector, + 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 b94f4bbaece..93d0a821c0f 100644 --- a/packages/davinci-client/src/lib/node.types.ts +++ b/packages/davinci-client/src/lib/node.types.ts @@ -4,36 +4,36 @@ * 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, - MetadataCollector, - PasswordCollector, - ValidatedPasswordCollector, - TextCollector, - IdpCollector, - SubmitCollector, ActionCollector, BooleanCollector, - ValidatedBooleanCollector, - SingleValueCollector, - SingleSelectCollector, - MultiSelectCollector, DeviceAuthenticationCollector, DeviceRegistrationCollector, - ReadOnlyCollector, - RichTextCollector, - ValidatedTextCollector, - PhoneNumberCollector, - ProtectCollector, - PollingCollector, - UnknownCollector, - FidoRegistrationCollector, FidoAuthenticationCollector, - QrCodeCollector, + FidoRegistrationCollector, + FlowCollector, + IdpCollector, ImageCollector, + MetadataCollector, + MultiSelectCollector, + PasswordCollector, + PhoneNumberCollector, PhoneNumberExtensionCollector, + PollingCollector, + ProtectCollector, + QrCodeCollector, + 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 7dd403f5930..44a569cdaec 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 4eee644f1a8..a597e02e9b2 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 2d6f517fe53..07dfd6f3487 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 8b9772094ed..882a66bcc38 100644 --- a/packages/davinci-client/src/lib/wellknown.api.ts +++ b/packages/davinci-client/src/lib/wellknown.api.ts @@ -5,9 +5,9 @@ * 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 8cf841a0ea8..bd408e56f19 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 ee3d60e93ee..864026c385d 100644 --- a/packages/davinci-client/src/types.ts +++ b/packages/davinci-client/src/types.ts @@ -36,7 +36,14 @@ 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'; +import type { + ContinueNode, + ErrorNode, + FailureNode, + StartNode, + SuccessNode, +} from './lib/node.types.js'; export type DavinciClient = Awaited>; @@ -45,8 +52,8 @@ export type DavinciClient = Awaited>; * 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 4e006874d13..d3b756bafd3 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 32e9c3a08a9..aeb20522c61 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 8b18f5ac6f6..11b2c284e69 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 7e62f5e0c27..adc413dc0cd 100644 --- a/packages/device-client/src/lib/device.store.utils.ts +++ b/packages/device-client/src/lib/device.store.utils.ts @@ -1,5 +1,12 @@ -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 { SerializedError } from '@reduxjs/toolkit'; +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 3c53c7bfd8d..fee186559a6 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 85d366d902d..2146047f834 100644 --- a/packages/device-client/src/lib/services/index.ts +++ b/packages/device-client/src/lib/services/index.ts @@ -5,26 +5,34 @@ * 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 884c2a1d051..5cfa9401447 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/api-report/journey-client.api.md b/packages/journey-client/api-report/journey-client.api.md index 717f910d979..9d73fafebaa 100644 --- a/packages/journey-client/api-report/journey-client.api.md +++ b/packages/journey-client/api-report/journey-client.api.md @@ -1,503 +1,504 @@ -## API Report File for "@forgerock/journey-client" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import { ActionTypes } from '@forgerock/sdk-request-middleware'; -import { AuthResponse } from '@forgerock/sdk-types'; -import { Callback } from '@forgerock/sdk-types'; -import { CallbackType } from '@forgerock/sdk-types'; -import { callbackType } from '@forgerock/sdk-types'; -import { createWellknownError } from '@forgerock/sdk-utilities'; -import { CustomLogger } from '@forgerock/sdk-logger'; -import { FailedPolicyRequirement } from '@forgerock/sdk-types'; -import { FailureDetail } from '@forgerock/sdk-types'; -import { GenericError } from '@forgerock/sdk-types'; -import { isValidWellknownUrl } from '@forgerock/sdk-utilities'; -import { JourneyClientConfig } from '@forgerock/sdk-types'; -import { JourneyServerConfig } from '@forgerock/sdk-types'; -import { LogLevel } from '@forgerock/sdk-logger'; -import { makeJourneyConfig } from '@forgerock/sdk-utilities'; -import { NameValue } from '@forgerock/sdk-types'; -import { PolicyKey } from '@forgerock/sdk-types'; -import { PolicyParams } from '@forgerock/sdk-types'; -import { PolicyRequirement } from '@forgerock/sdk-types'; -import { RequestMiddleware } from '@forgerock/sdk-request-middleware'; -import { Step } from '@forgerock/sdk-types'; -import { StepDetail } from '@forgerock/sdk-types'; -import { StepType } from '@forgerock/sdk-types'; -import { WellknownResponse } from '@forgerock/sdk-types'; - -export { ActionTypes } - -// @public -export class AttributeInputCallback extends BaseCallback { - constructor(payload: Callback); - getFailedPolicies(): PolicyRequirement[]; - getName(): string; - getPolicies(): Record; - getPrompt(): string; - isRequired(): boolean; - // (undocumented) - payload: Callback; - setValidateOnly(value: boolean): void; - setValue(value: T): void; -} - -export { AuthResponse } - -// @public -export class BaseCallback { - constructor(payload: Callback); - getInputValue(selector?: number | string): unknown; - getOutputByName(name: string, defaultValue: T): T; - getOutputValue(selector?: number | string): unknown; - getType(): CallbackType; - // (undocumented) - payload: Callback; - setInputValue(value: unknown, selector?: number | string | RegExp): void; -} - -export { Callback } - -// @public (undocumented) -export type CallbackFactory = (callback: Callback) => BaseCallback; - -export { CallbackType } - -export { callbackType } - -// @public -export class ChoiceCallback extends BaseCallback { - constructor(payload: Callback); - getChoices(): string[]; - getDefaultChoice(): number; - getPrompt(): string; - // (undocumented) - payload: Callback; - setChoiceIndex(index: number): void; - setChoiceValue(value: string): void; -} - -// @public -export class ConfirmationCallback extends BaseCallback { - constructor(payload: Callback); - getDefaultOption(): number; - getMessageType(): number; - getOptions(): string[]; - getOptionType(): number; - getPrompt(): string; - // (undocumented) - payload: Callback; - setOptionIndex(index: number): void; - setOptionValue(value: string): void; -} - -// @public (undocumented) -export function createCallback(callback: Callback): BaseCallback; - -export { createWellknownError } - -export { CustomLogger } - -// @public -export class DeviceProfileCallback extends BaseCallback { - constructor(payload: Callback); - getMessage(): string; - isLocationRequired(): boolean; - isMetadataRequired(): boolean; - // (undocumented) - payload: Callback; - setProfile(profile: DeviceProfileData): void; -} - -// @public (undocumented) -export interface DeviceProfileData { - // (undocumented) - identifier: string; - // (undocumented) - location?: Geolocation_2 | Record; - // (undocumented) - metadata?: { - hardware: { - display: { - [key: string]: string | number | null; - }; - [key: string]: any; - }; - browser: { - [key: string]: string | number | null; - }; - platform: { - [key: string]: string | number | null; - }; - }; -} - -export { FailedPolicyRequirement } - -export { FailureDetail } - -export { GenericError } - -// @public (undocumented) -interface Geolocation_2 { - // (undocumented) - latitude: number; - // (undocumented) - longitude: number; -} -export { Geolocation_2 as Geolocation } - -// @public -export class HiddenValueCallback extends BaseCallback { - constructor(payload: Callback); - // (undocumented) - payload: Callback; -} - -// @public (undocumented) -export interface IdPValue { - // (undocumented) - provider: string; - // (undocumented) - uiConfig: { - [key: string]: string; - }; -} - -// @internal -export interface InternalJourneyClientConfig { - // (undocumented) - error?: GenericError; - // (undocumented) - serverConfig: ResolvedServerConfig; -} - -export { isValidWellknownUrl } - -// @public -export function journey(input: { - config: JourneyClientConfig; - requestMiddleware?: RequestMiddleware[]; - logger?: { - level: LogLevel; - custom?: CustomLogger; - }; -}): Promise; - -// @public -export interface JourneyClient { - // (undocumented) - next: (step: JourneyStep, options?: NextOptions) => Promise; - // (undocumented) - redirect: (step: JourneyStep) => Promise; - // (undocumented) - resume: (url: string, options?: ResumeOptions) => Promise; - // (undocumented) - start: (options?: StartParam) => Promise; - // (undocumented) - subscribe: (listener: () => void) => () => void; - // (undocumented) - terminate: (options?: { - query?: Record; - }) => Promise; -} - -export { JourneyClientConfig } - -// @public (undocumented) -export type JourneyLoginFailure = AuthResponse & { - type: StepType.LoginFailure; - payload: Step; - getCode: () => number; - getDetail: () => FailureDetail | undefined; - getMessage: () => string | undefined; - getProcessedMessage: (messageCreator?: MessageCreator) => ProcessedPropertyError[]; - getReason: () => string | undefined; -}; - -// @public (undocumented) -export type JourneyLoginSuccess = AuthResponse & { - type: StepType.LoginSuccess; - payload: Step; - getRealm: () => string | undefined; - getSessionToken: () => string | undefined; - getSuccessUrl: () => string | undefined; -}; - -// @public (undocumented) -export type JourneyResult = JourneyStep | JourneyLoginSuccess | JourneyLoginFailure | GenericError; - -export { JourneyServerConfig } - -// @public (undocumented) -export type JourneyStep = AuthResponse & { - type: StepType.Step; - payload: Step; - callbacks: BaseCallback[]; - getCallbackOfType: (type: CallbackType) => T; - getCallbacksOfType: (type: CallbackType) => T[]; - setCallbackValue: (type: CallbackType, value: unknown) => void; - getDescription: () => string | undefined; - getHeader: () => string | undefined; - getStage: () => string | undefined; -}; - -// @public -export class KbaCreateCallback extends BaseCallback { - constructor(payload: Callback); - getPredefinedQuestions(): string[]; - getPrompt(): string; - isAllowedUserDefinedQuestions(): boolean; - // (undocumented) - payload: Callback; - setAnswer(answer: string): void; - setQuestion(question: string): void; -} - -export { LogLevel } - -export { makeJourneyConfig } - -// @public (undocumented) -export interface MessageCreator { - // (undocumented) - [key: string]: (propertyName: string, params?: { - [key: string]: unknown; - }) => string; -} - -// @public -export class MetadataCallback extends BaseCallback { - constructor(payload: Callback); - getData(): T; - // (undocumented) - payload: Callback; -} - -// @public -export class NameCallback extends BaseCallback { - constructor(payload: Callback); - getPrompt(): string; - // (undocumented) - payload: Callback; - setName(name: string): void; -} - -export { NameValue } - -// @public (undocumented) -export interface NextOptions { - // (undocumented) - query?: Record; -} - -// @public -export class PasswordCallback extends BaseCallback { - constructor(payload: Callback); - getFailedPolicies(): PolicyRequirement[]; - getPolicies(): string[]; - getPrompt(): string; - // (undocumented) - payload: Callback; - setPassword(password: string): void; -} - -// @public -export class PingOneProtectEvaluationCallback extends BaseCallback { - constructor(payload: Callback); - getPauseBehavioralData(): boolean; - // (undocumented) - payload: Callback; - setClientError(errorMessage: string): void; - setData(data: string): void; -} - -// @public -export class PingOneProtectInitializeCallback extends BaseCallback { - constructor(payload: Callback); - getConfig(): Record | { - envId: string; - consoleLogEnabled: boolean; - deviceAttributesToIgnore: string[]; - customHost: string; - lazyMetadata: boolean; - behavioralDataCollection: boolean; - deviceKeyRsyncIntervals: number; - enableTrust: boolean; - disableTags: boolean; - disableHub: boolean; - }; - // (undocumented) - payload: Callback; - // (undocumented) - setClientError(errorMessage: string): void; -} - -export { PolicyKey } - -export { PolicyParams } - -export { PolicyRequirement } - -// @public -export class PollingWaitCallback extends BaseCallback { - constructor(payload: Callback); - getMessage(): string; - getWaitTime(): number; - // (undocumented) - payload: Callback; -} - -// @public (undocumented) -export interface ProcessedPropertyError { - // (undocumented) - detail: FailedPolicyRequirement; - // (undocumented) - messages: string[]; -} - -// @public -export class ReCaptchaCallback extends BaseCallback { - constructor(payload: Callback); - getSiteKey(): string; - // (undocumented) - payload: Callback; - setResult(result: string): void; -} - -// @public -export class ReCaptchaEnterpriseCallback extends BaseCallback { - constructor(payload: Callback); - getApiUrl(): string; - getElementClass(): string; - getSiteKey(): string; - // (undocumented) - payload: Callback; - setAction(action: string): void; - setClientError(error: string): void; - setPayload(payload: unknown): void; - setResult(result: string): void; -} - -// @public -export class RedirectCallback extends BaseCallback { - constructor(payload: Callback); - getRedirectUrl(): string; - // (undocumented) - payload: Callback; -} - -export { RequestMiddleware } - -// @public -export interface ResolvedServerConfig { - // (undocumented) - baseUrl: string; - // (undocumented) - paths: { - authenticate: string; - sessions: string; - }; -} - -// @public (undocumented) -export interface ResumeOptions { - // (undocumented) - journey?: string; - // (undocumented) - query?: Record; -} - -// @public -export class SelectIdPCallback extends BaseCallback { - constructor(payload: Callback); - getProviders(): IdPValue[]; - // (undocumented) - payload: Callback; - setProvider(value: string): void; -} - -// @public (undocumented) -export interface StartParam { - // (undocumented) - journey: string; - // (undocumented) - query?: Record; -} - -export { Step } - -export { StepDetail } - -export { StepType } - -// @public -export class SuspendedTextOutputCallback extends TextOutputCallback { - constructor(payload: Callback); - // (undocumented) - payload: Callback; -} - -// @public -export class TermsAndConditionsCallback extends BaseCallback { - constructor(payload: Callback); - getCreateDate(): Date | null; - getTerms(): string; - getVersion(): string; - // (undocumented) - payload: Callback; - setAccepted(accepted?: boolean): void; -} - -// @public -export class TextInputCallback extends BaseCallback { - constructor(payload: Callback); - getPrompt(): string; - // (undocumented) - payload: Callback; - setInput(input: string): void; -} - -// @public -export class TextOutputCallback extends BaseCallback { - constructor(payload: Callback); - getMessage(): string; - getMessageType(): string; - // (undocumented) - payload: Callback; -} - -// @public -export class ValidatedCreatePasswordCallback extends BaseCallback { - constructor(payload: Callback); - getFailedPolicies(): PolicyRequirement[]; - getPolicies(): Record; - getPrompt(): string; - isRequired(): boolean; - // (undocumented) - payload: Callback; - setPassword(password: string): void; - setValidateOnly(value: boolean): void; -} - -// @public -export class ValidatedCreateUsernameCallback extends BaseCallback { - constructor(payload: Callback); - getFailedPolicies(): PolicyRequirement[]; - getPolicies(): Record; - getPrompt(): string; - isRequired(): boolean; - // (undocumented) - payload: Callback; - setName(name: string): void; - setValidateOnly(value: boolean): void; -} - -export { WellknownResponse } - -// (No @packageDocumentation comment for this package) - -``` +## API Report File for "@forgerock/journey-client" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { ActionTypes } from '@forgerock/sdk-request-middleware'; +import { AuthResponse } from '@forgerock/sdk-types'; +import { Callback } from '@forgerock/sdk-types'; +import { CallbackType } from '@forgerock/sdk-types'; +import { callbackType } from '@forgerock/sdk-types'; +import { createWellknownError } from '@forgerock/sdk-utilities'; +import { CustomLogger } from '@forgerock/sdk-logger'; +import { FailedPolicyRequirement } from '@forgerock/sdk-types'; +import { FailureDetail } from '@forgerock/sdk-types'; +import { GenericError } from '@forgerock/sdk-types'; +import { isValidWellknownUrl } from '@forgerock/sdk-utilities'; +import { JourneyClientConfig } from '@forgerock/sdk-types'; +import { JourneyServerConfig } from '@forgerock/sdk-types'; +import { LogLevel } from '@forgerock/sdk-logger'; +import { makeJourneyConfig } from '@forgerock/sdk-utilities'; +import { NameValue } from '@forgerock/sdk-types'; +import { PolicyKey } from '@forgerock/sdk-types'; +import { PolicyParams } from '@forgerock/sdk-types'; +import { PolicyRequirement } from '@forgerock/sdk-types'; +import { RequestMiddleware } from '@forgerock/sdk-request-middleware'; +import { Step } from '@forgerock/sdk-types'; +import { StepDetail } from '@forgerock/sdk-types'; +import { StepType } from '@forgerock/sdk-types'; +import { WellknownResponse } from '@forgerock/sdk-types'; + +export { ActionTypes }; + +// @public +export class AttributeInputCallback extends BaseCallback { + constructor(payload: Callback); + getFailedPolicies(): PolicyRequirement[]; + getName(): string; + getPolicies(): Record; + getPrompt(): string; + isRequired(): boolean; + // (undocumented) + payload: Callback; + setValidateOnly(value: boolean): void; + setValue(value: T): void; +} + +export { AuthResponse }; + +// @public +export class BaseCallback { + constructor(payload: Callback); + getInputValue(selector?: number | string): unknown; + getOutputByName(name: string, defaultValue: T): T; + getOutputValue(selector?: number | string): unknown; + getType(): CallbackType; + // (undocumented) + payload: Callback; + setInputValue(value: unknown, selector?: number | string | RegExp): void; +} + +export { Callback }; + +// @public (undocumented) +export type CallbackFactory = (callback: Callback) => BaseCallback; + +export { CallbackType }; + +export { callbackType }; + +// @public +export class ChoiceCallback extends BaseCallback { + constructor(payload: Callback); + getChoices(): string[]; + getDefaultChoice(): number; + getPrompt(): string; + // (undocumented) + payload: Callback; + setChoiceIndex(index: number): void; + setChoiceValue(value: string): void; +} + +// @public +export class ConfirmationCallback extends BaseCallback { + constructor(payload: Callback); + getDefaultOption(): number; + getMessageType(): number; + getOptions(): string[]; + getOptionType(): number; + getPrompt(): string; + // (undocumented) + payload: Callback; + setOptionIndex(index: number): void; + setOptionValue(value: string): void; +} + +// @public (undocumented) +export function createCallback(callback: Callback): BaseCallback; + +export { createWellknownError }; + +export { CustomLogger }; + +// @public +export class DeviceProfileCallback extends BaseCallback { + constructor(payload: Callback); + getMessage(): string; + isLocationRequired(): boolean; + isMetadataRequired(): boolean; + // (undocumented) + payload: Callback; + setProfile(profile: DeviceProfileData): void; +} + +// @public (undocumented) +export interface DeviceProfileData { + // (undocumented) + identifier: string; + // (undocumented) + location?: Geolocation_2 | Record; + // (undocumented) + metadata?: { + hardware: { + display: { + [key: string]: string | number | null; + }; + [key: string]: any; + }; + browser: { + [key: string]: string | number | null; + }; + platform: { + [key: string]: string | number | null; + }; + }; +} + +export { FailedPolicyRequirement }; + +export { FailureDetail }; + +export { GenericError }; + +// @public (undocumented) +interface Geolocation_2 { + // (undocumented) + latitude: number; + // (undocumented) + longitude: number; +} +export { Geolocation_2 as Geolocation }; + +// @public +export class HiddenValueCallback extends BaseCallback { + constructor(payload: Callback); + // (undocumented) + payload: Callback; +} + +// @public (undocumented) +export interface IdPValue { + // (undocumented) + provider: string; + // (undocumented) + uiConfig: { + [key: string]: string; + }; +} + +// @internal +export interface InternalJourneyClientConfig { + // (undocumented) + error?: GenericError; + // (undocumented) + serverConfig: ResolvedServerConfig; +} + +export { isValidWellknownUrl }; + +// @public +export function journey(input: { + config: JourneyClientConfig; + requestMiddleware?: RequestMiddleware[]; + logger?: { + level: LogLevel; + custom?: CustomLogger; + }; +}): Promise; + +// @public +export interface JourneyClient { + // (undocumented) + next: (step: JourneyStep, options?: NextOptions) => Promise; + // (undocumented) + redirect: (step: JourneyStep) => Promise; + // (undocumented) + resume: (url: string, options?: ResumeOptions) => Promise; + // (undocumented) + start: (options?: StartParam) => Promise; + // (undocumented) + subscribe: (listener: () => void) => () => void; + // (undocumented) + terminate: (options?: { query?: Record }) => Promise; +} + +export { JourneyClientConfig }; + +// @public (undocumented) +export type JourneyLoginFailure = AuthResponse & { + type: StepType.LoginFailure; + payload: Step; + getCode: () => number; + getDetail: () => FailureDetail | undefined; + getMessage: () => string | undefined; + getProcessedMessage: (messageCreator?: MessageCreator) => ProcessedPropertyError[]; + getReason: () => string | undefined; +}; + +// @public (undocumented) +export type JourneyLoginSuccess = AuthResponse & { + type: StepType.LoginSuccess; + payload: Step; + getRealm: () => string | undefined; + getSessionToken: () => string | undefined; + getSuccessUrl: () => string | undefined; +}; + +// @public (undocumented) +export type JourneyResult = JourneyStep | JourneyLoginSuccess | JourneyLoginFailure | GenericError; + +export { JourneyServerConfig }; + +// @public (undocumented) +export type JourneyStep = AuthResponse & { + type: StepType.Step; + payload: Step; + callbacks: BaseCallback[]; + getCallbackOfType: (type: CallbackType) => T; + getCallbacksOfType: (type: CallbackType) => T[]; + setCallbackValue: (type: CallbackType, value: unknown) => void; + getDescription: () => string | undefined; + getHeader: () => string | undefined; + getStage: () => string | undefined; +}; + +// @public +export class KbaCreateCallback extends BaseCallback { + constructor(payload: Callback); + getPredefinedQuestions(): string[]; + getPrompt(): string; + isAllowedUserDefinedQuestions(): boolean; + // (undocumented) + payload: Callback; + setAnswer(answer: string): void; + setQuestion(question: string): void; +} + +export { LogLevel }; + +export { makeJourneyConfig }; + +// @public (undocumented) +export interface MessageCreator { + // (undocumented) + [key: string]: ( + propertyName: string, + params?: { + [key: string]: unknown; + }, + ) => string; +} + +// @public +export class MetadataCallback extends BaseCallback { + constructor(payload: Callback); + getData(): T; + // (undocumented) + payload: Callback; +} + +// @public +export class NameCallback extends BaseCallback { + constructor(payload: Callback); + getPrompt(): string; + // (undocumented) + payload: Callback; + setName(name: string): void; +} + +export { NameValue }; + +// @public (undocumented) +export interface NextOptions { + // (undocumented) + query?: Record; +} + +// @public +export class PasswordCallback extends BaseCallback { + constructor(payload: Callback); + getFailedPolicies(): PolicyRequirement[]; + getPolicies(): string[]; + getPrompt(): string; + // (undocumented) + payload: Callback; + setPassword(password: string): void; +} + +// @public +export class PingOneProtectEvaluationCallback extends BaseCallback { + constructor(payload: Callback); + getPauseBehavioralData(): boolean; + // (undocumented) + payload: Callback; + setClientError(errorMessage: string): void; + setData(data: string): void; +} + +// @public +export class PingOneProtectInitializeCallback extends BaseCallback { + constructor(payload: Callback); + getConfig(): + | Record + | { + envId: string; + consoleLogEnabled: boolean; + deviceAttributesToIgnore: string[]; + customHost: string; + lazyMetadata: boolean; + behavioralDataCollection: boolean; + deviceKeyRsyncIntervals: number; + enableTrust: boolean; + disableTags: boolean; + disableHub: boolean; + }; + // (undocumented) + payload: Callback; + // (undocumented) + setClientError(errorMessage: string): void; +} + +export { PolicyKey }; + +export { PolicyParams }; + +export { PolicyRequirement }; + +// @public +export class PollingWaitCallback extends BaseCallback { + constructor(payload: Callback); + getMessage(): string; + getWaitTime(): number; + // (undocumented) + payload: Callback; +} + +// @public (undocumented) +export interface ProcessedPropertyError { + // (undocumented) + detail: FailedPolicyRequirement; + // (undocumented) + messages: string[]; +} + +// @public +export class ReCaptchaCallback extends BaseCallback { + constructor(payload: Callback); + getSiteKey(): string; + // (undocumented) + payload: Callback; + setResult(result: string): void; +} + +// @public +export class ReCaptchaEnterpriseCallback extends BaseCallback { + constructor(payload: Callback); + getApiUrl(): string; + getElementClass(): string; + getSiteKey(): string; + // (undocumented) + payload: Callback; + setAction(action: string): void; + setClientError(error: string): void; + setPayload(payload: unknown): void; + setResult(result: string): void; +} + +// @public +export class RedirectCallback extends BaseCallback { + constructor(payload: Callback); + getRedirectUrl(): string; + // (undocumented) + payload: Callback; +} + +export { RequestMiddleware }; + +// @public +export interface ResolvedServerConfig { + // (undocumented) + baseUrl: string; + // (undocumented) + paths: { + authenticate: string; + sessions: string; + }; +} + +// @public (undocumented) +export interface ResumeOptions { + // (undocumented) + journey?: string; + // (undocumented) + query?: Record; +} + +// @public +export class SelectIdPCallback extends BaseCallback { + constructor(payload: Callback); + getProviders(): IdPValue[]; + // (undocumented) + payload: Callback; + setProvider(value: string): void; +} + +// @public (undocumented) +export interface StartParam { + // (undocumented) + journey: string; + // (undocumented) + query?: Record; +} + +export { Step }; + +export { StepDetail }; + +export { StepType }; + +// @public +export class SuspendedTextOutputCallback extends TextOutputCallback { + constructor(payload: Callback); + // (undocumented) + payload: Callback; +} + +// @public +export class TermsAndConditionsCallback extends BaseCallback { + constructor(payload: Callback); + getCreateDate(): Date | null; + getTerms(): string; + getVersion(): string; + // (undocumented) + payload: Callback; + setAccepted(accepted?: boolean): void; +} + +// @public +export class TextInputCallback extends BaseCallback { + constructor(payload: Callback); + getPrompt(): string; + // (undocumented) + payload: Callback; + setInput(input: string): void; +} + +// @public +export class TextOutputCallback extends BaseCallback { + constructor(payload: Callback); + getMessage(): string; + getMessageType(): string; + // (undocumented) + payload: Callback; +} + +// @public +export class ValidatedCreatePasswordCallback extends BaseCallback { + constructor(payload: Callback); + getFailedPolicies(): PolicyRequirement[]; + getPolicies(): Record; + getPrompt(): string; + isRequired(): boolean; + // (undocumented) + payload: Callback; + setPassword(password: string): void; + setValidateOnly(value: boolean): void; +} + +// @public +export class ValidatedCreateUsernameCallback extends BaseCallback { + constructor(payload: Callback); + getFailedPolicies(): PolicyRequirement[]; + getPolicies(): Record; + getPrompt(): string; + isRequired(): boolean; + // (undocumented) + payload: Callback; + setName(name: string): void; + setValidateOnly(value: boolean): void; +} + +export { WellknownResponse }; + +// (No @packageDocumentation comment for this package) +``` diff --git a/packages/journey-client/eslint.config.mjs b/packages/journey-client/eslint.config.mjs index 68e527a4f2c..ec7ff99923c 100644 --- a/packages/journey-client/eslint.config.mjs +++ b/packages/journey-client/eslint.config.mjs @@ -8,7 +8,11 @@ export default [ '@nx/dependency-checks': [ 'warn', { - ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs,ts,cts,mts}'], + ignoredFiles: [ + '{projectRoot}/eslint.config.{js,cjs,mjs,ts,cts,mts}', + '{projectRoot}/vite.config.{js,ts,mjs,mts}', + '{projectRoot}/vitest.setup.{js,ts,mjs,mts}', + ], }, ], }, diff --git a/packages/journey-client/src/__tests__/types-reexport.typecheck.ts b/packages/journey-client/src/__tests__/types-reexport.typecheck.ts index 136becfe450..bff6543a2d6 100644 --- a/packages/journey-client/src/__tests__/types-reexport.typecheck.ts +++ b/packages/journey-client/src/__tests__/types-reexport.typecheck.ts @@ -1,30 +1,35 @@ +/* + * 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, + 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 d39f203cb56..d9d2794be7c 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 9977b1d9f82..0692e874eb1 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 35a0da5cb3b..95dbd691c58 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 16eb5fc1682..f0f4fdf3e00 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 89397b0171c..b39500086d7 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 2769f6fcecf..80c4796ce70 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 b93df5ac8f5..81676a8a590 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 baeadfb078a..e10d0bc8f17 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 3792447ec85..0acebe70526 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 78beeb1a193..ffc7ecd11c2 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 ee178e5264d..0b5c72c37b1 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 9eaae7d0391..f0ebdeec78d 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 199a55d4e4b..6c6e1159e49 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 deaa2fb7f8d..9650a71f359 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 3ac9b45e1c0..88a44d3ee2d 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 d98d34302f8..980bbcb6d88 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 18932508a55..533de8c0123 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 55abdc73604..d7c65765b50 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 5c9dbe2e127..15f10631f30 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 dd8e5a36add..4eecf0d1a55 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 2cba416a412..7a97776bb00 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 dc264ec90d9..028cee73459 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 564032de62f..8d675173134 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) 2024 - 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 a3ea0cf79bd..1e13eaf58b4 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) 2024 - 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 58d774e798a..a36b79a766b 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 4e5d99018ff..1c497c16108 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 03c1ee1fba4..c919a7ce879 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 50ceb030a3b..f607e202eea 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 f5ec9fdaa31..db46cc3b532 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 f2d2fbe8c62..f5846abfc69 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 950dd1a6885..5ae3672b492 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 07eb1ab539d..287da26e7c7 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 31f7ec3d1e6..89f61a01a6b 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 37c48dd2e62..71e836faff9 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 eeea3569a0c..ad9b868b9b6 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 47cf23f2a55..02b92a644f1 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 80abcc60339..8f31a45db64 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 79654dff51a..4e918b9723e 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 c6f9f6de87c..c04942f7869 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 66e8d5e15e9..dc6cf4dfbd7 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 947ac6ab76f..85a960993ab 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 d60233b7184..3d64c21afba 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 29bacb7984a..7d4c8a82632 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 d1647af1018..98e67debb77 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 ec370ab701c..62a1e4537dd 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 31532363cff..37cff4c9769 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 8c7674deafb..654156584ff 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 ec41bed1468..e3c9636a8ce 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 7d0ddf9345d..433b1a832b3 100644 --- a/packages/journey-client/src/lib/client.store.test.ts +++ b/packages/journey-client/src/lib/client.store.test.ts @@ -6,15 +6,15 @@ * of the MIT license. See the LICENSE file for details. */ +import { makeJourneyConfig } from '@forgerock/sdk-utilities'; import { afterEach, describe, expect, test, vi } from 'vitest'; +import { callbackType } from '../index.js'; import { journey } from './client.store.js'; -import { makeJourneyConfig } from '@forgerock/sdk-utilities'; 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 32c2689a645..ef2cfe63343 100644 --- a/packages/journey-client/src/lib/client.store.ts +++ b/packages/journey-client/src/lib/client.store.ts @@ -5,30 +5,32 @@ * 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 7c08201f872..6439d9a4a5a 100644 --- a/packages/journey-client/src/lib/client.store.utils.ts +++ b/packages/journey-client/src/lib/client.store.utils.ts @@ -5,14 +5,15 @@ * 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 92c265713f1..5d3adc730e5 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 0affaf7cce0..31323ad4e0c 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 02cac721026..e1924f25125 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 d314f040fe4..eda4cdc400b 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 34dc7ec0e46..bc73793e199 100644 --- a/packages/journey-client/src/lib/config.types.ts +++ b/packages/journey-client/src/lib/config.types.ts @@ -6,6 +6,7 @@ */ import type { GenericError } from '@forgerock/sdk-types'; + import type { ResolvedServerConfig } from './wellknown.utils.js'; export type { JourneyServerConfig, JourneyClientConfig } from '@forgerock/sdk-types'; 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 0fd2d9a677b..88367684ce9 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 6c3e5f6b3c2..29d365ba2df 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 0dc93ca8429..6fa405f1d18 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 66c4da9a299..5ce1ce09c0b 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 30718d8159d..88d5a4c5d8a 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 198721e43e1..1ea88f88976 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 88fa4cfcc85..ac0874ace2e 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 1be9840c794..e3e283d19c8 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 3a5c65cac1e..b884d57fc98 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 ac562864d6f..d78f769f349 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 50679559071..cb028ca3081 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) 2024 - 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 8c64d7fbf0c..42f241b86a7 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) 2024 - 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 f9f09c6fd89..8d659e4aff1 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 1406dd34976..7d3a52241c6 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 7218364b31c..69f06564a98 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 b81ed2a7c34..afc691eca75 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 de5109b980a..23f3a56afdf 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 60714f14346..6db4031d9cd 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 0c2da99b7f8..8b2c8e111fd 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 d8f2dde9367..ad89ff6cd68 100644 --- a/packages/journey-client/src/lib/wellknown.api.ts +++ b/packages/journey-client/src/lib/wellknown.api.ts @@ -5,8 +5,8 @@ * 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 9160ec48a34..85007e8d5a3 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 bcdce96e278..f89ff5a58a5 100644 --- a/packages/oidc-client/api-report/oidc-client.api.md +++ b/packages/oidc-client/api-report/oidc-client.api.md @@ -1,419 +1,659 @@ -## API Report File for "@forgerock/oidc-client" - -> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). - -```ts - -import { ActionTypes } from '@forgerock/sdk-request-middleware'; -import { BaseQueryFn } from '@reduxjs/toolkit/query'; -import { CombinedState } from '@reduxjs/toolkit/query'; -import { CustomLogger } from '@forgerock/sdk-logger'; -import { EnhancedStore } from '@reduxjs/toolkit'; -import { FetchArgs } from '@reduxjs/toolkit/query'; -import type { FetchBaseQueryError } from '@reduxjs/toolkit/query'; -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 { LogLevel } from '@forgerock/sdk-logger'; -import { LogMessage } from '@forgerock/sdk-logger'; -import { makeOidcConfig } from '@forgerock/sdk-utilities'; -import { MutationDefinition } from '@reduxjs/toolkit/query'; -import { OidcConfig } from '@forgerock/sdk-types'; -import { QueryDefinition } from '@reduxjs/toolkit/query'; -import { RequestMiddleware } from '@forgerock/sdk-request-middleware'; -import { ResponseType as ResponseType_2 } from '@forgerock/sdk-types'; -import { StorageConfig } from '@forgerock/storage'; -import { StoreEnhancer } from '@reduxjs/toolkit'; -import { ThunkDispatch } from '@reduxjs/toolkit'; -import { Tuple } from '@reduxjs/toolkit'; -import { UnknownAction } from '@reduxjs/toolkit'; -import { Unsubscribe } from '@reduxjs/toolkit'; -import { WellknownResponse } from '@forgerock/sdk-types'; - -export { ActionTypes } - -// @public (undocumented) -export type AppDispatch = ReturnType; - -// @public (undocumented) -export interface AuthorizationError { - // (undocumented) - error: string; - // (undocumented) - error_description: string; - // (undocumented) - redirectUrl?: string; - // (undocumented) - type: 'auth_error' | 'argument_error' | 'network_error' | 'unknown_error' | 'wellknown_error'; -} - -// @public (undocumented) -export interface AuthorizationSuccess { - // (undocumented) - code: string; - // (undocumented) - state: string; -} - -// @public (undocumented) -export interface AuthorizeErrorResponse { - // (undocumented) - code?: string; - // (undocumented) - details?: [ - { - code: string; - message: string; - } - ]; - // (undocumented) - id?: string; - // (undocumented) - message?: string; -} - -// @public (undocumented) -export interface AuthorizeSuccessResponse { - // (undocumented) - authorizeResponse?: { - code: string; - state: string; - }; - // (undocumented) - createdAt?: string; - // (undocumented) - _embedded?: { - [key: string]: unknown; - }; - // (undocumented) - environment?: { - id: string; - }; - // (undocumented) - expiresAt?: string; - // (undocumented) - id?: string; - // (undocumented) - _links?: { - [key: string]: { - href: string; - }; - }; - // (undocumented) - resumeUrl?: string; - // (undocumented) - session?: { - id: string; - }; - // (undocumented) - status?: string; -} - -// @public (undocumented) -export type BuildAuthorizationData = [string, GetAuthorizationUrlOptions]; - -// @public (undocumented) -export type ClientStore = ReturnType; - -// @public -export function createClientStore(input: { - requestMiddleware?: RequestMiddleware[]; - logger?: ReturnType; -}): EnhancedStore< { -oidc: CombinedState< { -authorizeFetch: MutationDefinition< { -url: string; -}, BaseQueryFn, never, AuthorizeSuccessResponse, "oidc", unknown>; -par: MutationDefinition< { -endpoint: string; -body: URLSearchParams; -}, BaseQueryFn, never, PushAuthorizationResponse, "oidc", unknown>; -sessionCheckIframe: MutationDefinition< { -url: string; -responseType: SessionCheckResponseType; -}, BaseQueryFn, never, { -params: Record; -}, "oidc", unknown>; -sessionCheckFetch: MutationDefinition< { -url: string; -}, BaseQueryFn, never, { -status: 204; -}, "oidc", unknown>; -authorizeIframe: MutationDefinition< { -url: string; -}, BaseQueryFn, never, AuthorizationSuccess, "oidc", unknown>; -endSession: MutationDefinition< { -idToken: string; -endpoint: string; -signOutRedirectUri?: string; -}, BaseQueryFn, never, null, "oidc", unknown>; -exchange: MutationDefinition< { -code: string; -config: OidcConfig; -endpoint: string; -verifier?: string; -}, BaseQueryFn, never, TokenExchangeResponse, "oidc", unknown>; -revoke: MutationDefinition< { -accessToken: string; -clientId?: string; -endpoint: string; -}, BaseQueryFn, never, object, "oidc", unknown>; -userInfo: MutationDefinition< { -accessToken: string; -endpoint: string; -}, BaseQueryFn, never, UserInfoResponse, "oidc", unknown>; -}, never, "oidc">; -wellknown: CombinedState< { -configuration: QueryDefinition, never, WellknownResponse, "wellknown", unknown>; -}, never, "wellknown">; -}, UnknownAction, Tuple<[StoreEnhancer< { -dispatch: ThunkDispatch< { -oidc: CombinedState< { -authorizeFetch: MutationDefinition< { -url: string; -}, BaseQueryFn, never, AuthorizeSuccessResponse, "oidc", unknown>; -par: MutationDefinition< { -endpoint: string; -body: URLSearchParams; -}, BaseQueryFn, never, PushAuthorizationResponse, "oidc", unknown>; -sessionCheckIframe: MutationDefinition< { -url: string; -responseType: SessionCheckResponseType; -}, BaseQueryFn, never, { -params: Record; -}, "oidc", unknown>; -sessionCheckFetch: MutationDefinition< { -url: string; -}, BaseQueryFn, never, { -status: 204; -}, "oidc", unknown>; -authorizeIframe: MutationDefinition< { -url: string; -}, BaseQueryFn, never, AuthorizationSuccess, "oidc", unknown>; -endSession: MutationDefinition< { -idToken: string; -endpoint: string; -signOutRedirectUri?: string; -}, BaseQueryFn, never, null, "oidc", unknown>; -exchange: MutationDefinition< { -code: string; -config: OidcConfig; -endpoint: string; -verifier?: string; -}, BaseQueryFn, never, TokenExchangeResponse, "oidc", unknown>; -revoke: MutationDefinition< { -accessToken: string; -clientId?: string; -endpoint: string; -}, BaseQueryFn, never, object, "oidc", unknown>; -userInfo: MutationDefinition< { -accessToken: string; -endpoint: string; -}, BaseQueryFn, never, UserInfoResponse, "oidc", unknown>; -}, never, "oidc">; -wellknown: CombinedState< { -configuration: QueryDefinition, never, WellknownResponse, "wellknown", unknown>; -}, never, "wellknown">; -}, { -requestMiddleware: RequestMiddleware[] | undefined; -logger: { -changeLevel: (level: LogLevel) => void; -error: (...args: LogMessage[]) => void; -warn: (...args: LogMessage[]) => void; -info: (...args: LogMessage[]) => void; -debug: (...args: LogMessage[]) => void; -} | undefined; -}, UnknownAction>; -}>, StoreEnhancer]>>; - -export { CustomLogger } - -export { GenericError } - -export { GetAuthorizationUrlOptions } - -// @public (undocumented) -export interface GetTokensOptions { - // (undocumented) - authorizeOptions?: GetAuthorizationUrlOptions; - // (undocumented) - backgroundRenew?: boolean; - // (undocumented) - forceRenew?: boolean; - // (undocumented) - storageOptions?: Partial; -} - -export { LogLevel } - -// @public (undocumented) -export type LogoutErrorResult = { - error: string; - sessionResponse: GenericError | null; - revokeResponse: GenericError | null; - deleteResponse: GenericError | null; -}; - -// @public (undocumented) -export type LogoutSuccessResult = RevokeSuccessResult & { - sessionResponse: null; -}; - -export { makeOidcConfig } - -// @public (undocumented) -export interface OauthTokens { - // (undocumented) - accessToken: string; - // (undocumented) - expiresAt?: number; - // (undocumented) - expiryTimestamp?: number; - // (undocumented) - idToken: string; - // (undocumented) - refreshToken?: string; -} - -// @public -export function oidc(input: { - config: OidcConfig; - requestMiddleware?: RequestMiddleware[]; - logger?: { - level: LogLevel; - custom?: CustomLogger; - }; - storage?: Partial; -}): Promise<{ - error: string; - type: string; - subscribe?: undefined; - authorize?: undefined; - token?: undefined; - user?: undefined; -} | { - subscribe: (listener: () => void) => Unsubscribe; - authorize: { - url: (options?: GetAuthorizationUrlOptions) => Promise; - background: (options?: GetAuthorizationUrlOptions) => Promise; - }; - token: { - exchange: (code: string, state: string, options?: Partial) => Promise; - get: (options?: GetTokensOptions) => Promise; - revoke: () => Promise; - }; - user: { - info: () => Promise; - logout: () => Promise; - session: (options?: SessionCheckOptions) => Promise; - }; - error?: undefined; - type?: undefined; -}>; - -// @public (undocumented) -export type OidcClient = Awaited>; - -export { OidcConfig } - -// @public (undocumented) -export type OptionalAuthorizeOptions = Partial; - -// @public (undocumented) -export interface PushAuthorizationResponse { - // (undocumented) - expires_in: number; - // (undocumented) - request_uri: string; -} - -export { RequestMiddleware } - -export { ResponseType_2 as ResponseType } - -// @public (undocumented) -export type RevokeErrorResult = { - error: string; - revokeResponse: GenericError | null; - deleteResponse: GenericError | null; -}; - -// @public (undocumented) -export type RevokeSuccessResult = { - revokeResponse: null; - deleteResponse: null; -}; - -// @public (undocumented) -export type RootState = ReturnType; - -// @public -export interface SessionCheckOptions { - redirectUri?: string; - responseType?: SessionCheckResponseType; - scope?: string; - subject?: string; -} - -// @public (undocumented) -export type SessionCheckResponseType = 'id_token' | 'none'; - -// @public (undocumented) -export type SessionCheckSuccess = { - responseType: SessionCheckResponseType; - claims?: JWTPayload; -}; - -export { StorageConfig } - -// @public (undocumented) -export interface TokenExchangeErrorResponse { - // (undocumented) - error: string; - // (undocumented) - message: string; - // (undocumented) - type: 'exchange_error' | 'network_error' | 'state_error' | 'unknown_error'; -} - -// @public (undocumented) -export interface TokenExchangeResponse { - // (undocumented) - access_token: string; - // (undocumented) - expires_in?: number; - // (undocumented) - id_token: string; - // (undocumented) - refresh_token?: string; - // (undocumented) - scope?: string; - // (undocumented) - token_type?: string; -} - -// @public (undocumented) -export interface TokenRequestOptions { - // (undocumented) - code: string; - // (undocumented) - config: OidcConfig; - // (undocumented) - endpoint: string; - // (undocumented) - verifier?: string; -} - -// @public (undocumented) -export type UserInfoResponse = { - sub: string; - [key: string]: unknown; -}; - -export { WellknownResponse } - -// (No @packageDocumentation comment for this package) - -``` +## API Report File for "@forgerock/oidc-client" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { ActionTypes } from '@forgerock/sdk-request-middleware'; +import { BaseQueryFn } from '@reduxjs/toolkit/query'; +import { CombinedState } from '@reduxjs/toolkit/query'; +import { CustomLogger } from '@forgerock/sdk-logger'; +import { EnhancedStore } from '@reduxjs/toolkit'; +import { FetchArgs } from '@reduxjs/toolkit/query'; +import type { FetchBaseQueryError } from '@reduxjs/toolkit/query'; +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 { LogLevel } from '@forgerock/sdk-logger'; +import { LogMessage } from '@forgerock/sdk-logger'; +import { makeOidcConfig } from '@forgerock/sdk-utilities'; +import { MutationDefinition } from '@reduxjs/toolkit/query'; +import { OidcConfig } from '@forgerock/sdk-types'; +import { QueryDefinition } from '@reduxjs/toolkit/query'; +import { RequestMiddleware } from '@forgerock/sdk-request-middleware'; +import { ResponseType as ResponseType_2 } from '@forgerock/sdk-types'; +import { StorageConfig } from '@forgerock/storage'; +import { StoreEnhancer } from '@reduxjs/toolkit'; +import { ThunkDispatch } from '@reduxjs/toolkit'; +import { Tuple } from '@reduxjs/toolkit'; +import { UnknownAction } from '@reduxjs/toolkit'; +import { Unsubscribe } from '@reduxjs/toolkit'; +import { WellknownResponse } from '@forgerock/sdk-types'; + +export { ActionTypes }; + +// @public (undocumented) +export type AppDispatch = ReturnType; + +// @public (undocumented) +export interface AuthorizationError { + // (undocumented) + error: string; + // (undocumented) + error_description: string; + // (undocumented) + redirectUrl?: string; + // (undocumented) + type: 'auth_error' | 'argument_error' | 'network_error' | 'unknown_error' | 'wellknown_error'; +} + +// @public (undocumented) +export interface AuthorizationSuccess { + // (undocumented) + code: string; + // (undocumented) + state: string; +} + +// @public (undocumented) +export interface AuthorizeErrorResponse { + // (undocumented) + code?: string; + // (undocumented) + details?: [ + { + code: string; + message: string; + }, + ]; + // (undocumented) + id?: string; + // (undocumented) + message?: string; +} + +// @public (undocumented) +export interface AuthorizeSuccessResponse { + // (undocumented) + authorizeResponse?: { + code: string; + state: string; + }; + // (undocumented) + createdAt?: string; + // (undocumented) + _embedded?: { + [key: string]: unknown; + }; + // (undocumented) + environment?: { + id: string; + }; + // (undocumented) + expiresAt?: string; + // (undocumented) + id?: string; + // (undocumented) + _links?: { + [key: string]: { + href: string; + }; + }; + // (undocumented) + resumeUrl?: string; + // (undocumented) + session?: { + id: string; + }; + // (undocumented) + status?: string; +} + +// @public (undocumented) +export type BuildAuthorizationData = [string, GetAuthorizationUrlOptions]; + +// @public (undocumented) +export type ClientStore = ReturnType; + +// @public +export function createClientStore(input: { + requestMiddleware?: RequestMiddleware[]; + logger?: ReturnType; +}): EnhancedStore< + { + oidc: CombinedState< + { + authorizeFetch: MutationDefinition< + { + url: string; + }, + BaseQueryFn, + never, + AuthorizeSuccessResponse, + 'oidc', + unknown + >; + par: MutationDefinition< + { + endpoint: string; + body: URLSearchParams; + }, + BaseQueryFn, + never, + PushAuthorizationResponse, + 'oidc', + unknown + >; + sessionCheckIframe: MutationDefinition< + { + url: string; + responseType: SessionCheckResponseType; + }, + BaseQueryFn, + never, + { + params: Record; + }, + 'oidc', + unknown + >; + sessionCheckFetch: MutationDefinition< + { + url: string; + }, + BaseQueryFn, + never, + { + status: 204; + }, + 'oidc', + unknown + >; + authorizeIframe: MutationDefinition< + { + url: string; + }, + BaseQueryFn, + never, + AuthorizationSuccess, + 'oidc', + unknown + >; + endSession: MutationDefinition< + { + idToken: string; + endpoint: string; + signOutRedirectUri?: string; + }, + BaseQueryFn, + never, + null, + 'oidc', + unknown + >; + exchange: MutationDefinition< + { + code: string; + config: OidcConfig; + endpoint: string; + verifier?: string; + }, + BaseQueryFn, + never, + TokenExchangeResponse, + 'oidc', + unknown + >; + revoke: MutationDefinition< + { + accessToken: string; + clientId?: string; + endpoint: string; + }, + BaseQueryFn, + never, + object, + 'oidc', + unknown + >; + userInfo: MutationDefinition< + { + accessToken: string; + endpoint: string; + }, + BaseQueryFn, + never, + UserInfoResponse, + 'oidc', + unknown + >; + }, + never, + 'oidc' + >; + wellknown: CombinedState< + { + configuration: QueryDefinition< + string, + BaseQueryFn, + never, + WellknownResponse, + 'wellknown', + unknown + >; + }, + never, + 'wellknown' + >; + }, + UnknownAction, + Tuple< + [ + StoreEnhancer<{ + dispatch: ThunkDispatch< + { + oidc: CombinedState< + { + authorizeFetch: MutationDefinition< + { + url: string; + }, + BaseQueryFn< + string | FetchArgs, + unknown, + FetchBaseQueryError, + {}, + FetchBaseQueryMeta + >, + never, + AuthorizeSuccessResponse, + 'oidc', + unknown + >; + par: MutationDefinition< + { + endpoint: string; + body: URLSearchParams; + }, + BaseQueryFn< + string | FetchArgs, + unknown, + FetchBaseQueryError, + {}, + FetchBaseQueryMeta + >, + never, + PushAuthorizationResponse, + 'oidc', + unknown + >; + sessionCheckIframe: MutationDefinition< + { + url: string; + responseType: SessionCheckResponseType; + }, + BaseQueryFn< + string | FetchArgs, + unknown, + FetchBaseQueryError, + {}, + FetchBaseQueryMeta + >, + never, + { + params: Record; + }, + 'oidc', + unknown + >; + sessionCheckFetch: MutationDefinition< + { + url: string; + }, + BaseQueryFn< + string | FetchArgs, + unknown, + FetchBaseQueryError, + {}, + FetchBaseQueryMeta + >, + never, + { + status: 204; + }, + 'oidc', + unknown + >; + authorizeIframe: MutationDefinition< + { + url: string; + }, + BaseQueryFn< + string | FetchArgs, + unknown, + FetchBaseQueryError, + {}, + FetchBaseQueryMeta + >, + never, + AuthorizationSuccess, + 'oidc', + unknown + >; + endSession: MutationDefinition< + { + idToken: string; + endpoint: string; + signOutRedirectUri?: string; + }, + BaseQueryFn< + string | FetchArgs, + unknown, + FetchBaseQueryError, + {}, + FetchBaseQueryMeta + >, + never, + null, + 'oidc', + unknown + >; + exchange: MutationDefinition< + { + code: string; + config: OidcConfig; + endpoint: string; + verifier?: string; + }, + BaseQueryFn< + string | FetchArgs, + unknown, + FetchBaseQueryError, + {}, + FetchBaseQueryMeta + >, + never, + TokenExchangeResponse, + 'oidc', + unknown + >; + revoke: MutationDefinition< + { + accessToken: string; + clientId?: string; + endpoint: string; + }, + BaseQueryFn< + string | FetchArgs, + unknown, + FetchBaseQueryError, + {}, + FetchBaseQueryMeta + >, + never, + object, + 'oidc', + unknown + >; + userInfo: MutationDefinition< + { + accessToken: string; + endpoint: string; + }, + BaseQueryFn< + string | FetchArgs, + unknown, + FetchBaseQueryError, + {}, + FetchBaseQueryMeta + >, + never, + UserInfoResponse, + 'oidc', + unknown + >; + }, + never, + 'oidc' + >; + wellknown: CombinedState< + { + configuration: QueryDefinition< + string, + BaseQueryFn< + string | FetchArgs, + unknown, + FetchBaseQueryError, + {}, + FetchBaseQueryMeta + >, + never, + WellknownResponse, + 'wellknown', + unknown + >; + }, + never, + 'wellknown' + >; + }, + { + requestMiddleware: RequestMiddleware[] | undefined; + logger: + | { + changeLevel: (level: LogLevel) => void; + error: (...args: LogMessage[]) => void; + warn: (...args: LogMessage[]) => void; + info: (...args: LogMessage[]) => void; + debug: (...args: LogMessage[]) => void; + } + | undefined; + }, + UnknownAction + >; + }>, + StoreEnhancer, + ] + > +>; + +export { CustomLogger }; + +export { GenericError }; + +export { GetAuthorizationUrlOptions }; + +// @public (undocumented) +export interface GetTokensOptions { + // (undocumented) + authorizeOptions?: GetAuthorizationUrlOptions; + // (undocumented) + backgroundRenew?: boolean; + // (undocumented) + forceRenew?: boolean; + // (undocumented) + storageOptions?: Partial; +} + +export { LogLevel }; + +// @public (undocumented) +export type LogoutErrorResult = { + error: string; + sessionResponse: GenericError | null; + revokeResponse: GenericError | null; + deleteResponse: GenericError | null; +}; + +// @public (undocumented) +export type LogoutSuccessResult = RevokeSuccessResult & { + sessionResponse: null; +}; + +export { makeOidcConfig }; + +// @public (undocumented) +export interface OauthTokens { + // (undocumented) + accessToken: string; + // (undocumented) + expiresAt?: number; + // (undocumented) + expiryTimestamp?: number; + // (undocumented) + idToken: string; + // (undocumented) + refreshToken?: string; +} + +// @public +export function oidc(input: { + config: OidcConfig; + requestMiddleware?: RequestMiddleware[]; + logger?: { + level: LogLevel; + custom?: CustomLogger; + }; + storage?: Partial; +}): Promise< + | { + error: string; + type: string; + subscribe?: undefined; + authorize?: undefined; + token?: undefined; + user?: undefined; + } + | { + subscribe: (listener: () => void) => Unsubscribe; + authorize: { + url: (options?: GetAuthorizationUrlOptions) => Promise; + background: ( + options?: GetAuthorizationUrlOptions, + ) => Promise; + }; + token: { + exchange: ( + code: string, + state: string, + options?: Partial, + ) => Promise; + get: ( + options?: GetTokensOptions, + ) => Promise; + revoke: () => Promise; + }; + user: { + info: () => Promise; + logout: () => Promise; + session: (options?: SessionCheckOptions) => Promise; + }; + error?: undefined; + type?: undefined; + } +>; + +// @public (undocumented) +export type OidcClient = Awaited>; + +export { OidcConfig }; + +// @public (undocumented) +export type OptionalAuthorizeOptions = Partial; + +// @public (undocumented) +export interface PushAuthorizationResponse { + // (undocumented) + expires_in: number; + // (undocumented) + request_uri: string; +} + +export { RequestMiddleware }; + +export { ResponseType_2 as ResponseType }; + +// @public (undocumented) +export type RevokeErrorResult = { + error: string; + revokeResponse: GenericError | null; + deleteResponse: GenericError | null; +}; + +// @public (undocumented) +export type RevokeSuccessResult = { + revokeResponse: null; + deleteResponse: null; +}; + +// @public (undocumented) +export type RootState = ReturnType; + +// @public +export interface SessionCheckOptions { + redirectUri?: string; + responseType?: SessionCheckResponseType; + scope?: string; + subject?: string; +} + +// @public (undocumented) +export type SessionCheckResponseType = 'id_token' | 'none'; + +// @public (undocumented) +export type SessionCheckSuccess = { + responseType: SessionCheckResponseType; + claims?: JWTPayload; +}; + +export { StorageConfig }; + +// @public (undocumented) +export interface TokenExchangeErrorResponse { + // (undocumented) + error: string; + // (undocumented) + message: string; + // (undocumented) + type: 'exchange_error' | 'network_error' | 'state_error' | 'unknown_error'; +} + +// @public (undocumented) +export interface TokenExchangeResponse { + // (undocumented) + access_token: string; + // (undocumented) + expires_in?: number; + // (undocumented) + id_token: string; + // (undocumented) + refresh_token?: string; + // (undocumented) + scope?: string; + // (undocumented) + token_type?: string; +} + +// @public (undocumented) +export interface TokenRequestOptions { + // (undocumented) + code: string; + // (undocumented) + config: OidcConfig; + // (undocumented) + endpoint: string; + // (undocumented) + verifier?: string; +} + +// @public (undocumented) +export type UserInfoResponse = { + sub: string; + [key: string]: unknown; +}; + +export { WellknownResponse }; + +// (No @packageDocumentation comment for this package) +``` diff --git a/packages/oidc-client/src/__tests__/types-reexport.typecheck.ts b/packages/oidc-client/src/__tests__/types-reexport.typecheck.ts index 7d1d6bdb3dc..8907f6c82fd 100644 --- a/packages/oidc-client/src/__tests__/types-reexport.typecheck.ts +++ b/packages/oidc-client/src/__tests__/types-reexport.typecheck.ts @@ -1,19 +1,24 @@ +/* + * 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 { - // Already re-exported (regression guard) - GenericError, - GetAuthorizationUrlOptions, - WellknownResponse, - StorageConfig, ActionTypes, - RequestMiddleware, CustomLogger, + GenericError, + GetAuthorizationUrlOptions, LogLevel, - // Should be re-exported but is not yet + RequestMiddleware, 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 289617eae9e..079ab93df0f 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 59fcc93caf8..53098144839 100644 --- a/packages/oidc-client/src/lib/authorize.request.micros.ts +++ b/packages/oidc-client/src/lib/authorize.request.micros.ts @@ -18,13 +18,13 @@ import { isFetchBaseQueryError, toDispatchError, } from './authorize.request.utils.js'; -import type { AuthPromptValue } from '@forgerock/sdk-utilities'; - import { oidcApi } from './oidc.api.js'; +import type { GetAuthorizationUrlOptions, WellknownResponse } from '@forgerock/sdk-types'; +import type { AuthPromptValue } from '@forgerock/sdk-utilities'; 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, diff --git a/packages/oidc-client/src/lib/authorize.request.ts b/packages/oidc-client/src/lib/authorize.request.ts index 826ce8ec51c..0b3d34dfc77 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 d267eb593f5..bb2ea10d7c7 100644 --- a/packages/oidc-client/src/lib/authorize.request.utils.test.ts +++ b/packages/oidc-client/src/lib/authorize.request.utils.test.ts @@ -5,22 +5,26 @@ * of the MIT license. See the LICENSE file for details. */ import { it } from '@effect/vitest'; -import { Micro } from 'effect'; -import { vi, afterEach, expect } from 'vitest'; import * as sdkOidc from '@forgerock/sdk-oidc'; -import { createParAuthorizeUrlµ, authorizeµ } from './authorize.request.js'; +import { Micro } from 'effect'; +import { afterEach, expect, 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 69e23383e33..9c58ff5f2aa 100644 --- a/packages/oidc-client/src/lib/authorize.request.utils.ts +++ b/packages/oidc-client/src/lib/authorize.request.utils.ts @@ -4,10 +4,11 @@ * 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 { AuthPromptValue } from '@forgerock/sdk-utilities'; import type { SerializedError } from '@reduxjs/toolkit'; import type { FetchBaseQueryError } from '@reduxjs/toolkit/query'; -import type { WellknownResponse, GetAuthorizationUrlOptions } from '@forgerock/sdk-types'; -import type { AuthPromptValue } from '@forgerock/sdk-utilities'; + 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 f7cce5aa3df..64d5b6695c8 100644 --- a/packages/oidc-client/src/lib/client.store.test.ts +++ b/packages/oidc-client/src/lib/client.store.test.ts @@ -5,12 +5,12 @@ * of the MIT license. See the LICENSE file for details. */ +import { makeOidcConfig } from '@forgerock/sdk-utilities'; 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'; -import { makeOidcConfig } from '@forgerock/sdk-utilities'; import type { OidcConfig } from './config.types.js'; diff --git a/packages/oidc-client/src/lib/client.store.ts b/packages/oidc-client/src/lib/client.store.ts index dbd80e42216..e971a35ea7d 100644 --- a/packages/oidc-client/src/lib/client.store.ts +++ b/packages/oidc-client/src/lib/client.store.ts @@ -6,25 +6,26 @@ */ 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 a011974bf60..be2f53eb7cb 100644 --- a/packages/oidc-client/src/lib/client.store.utils.ts +++ b/packages/oidc-client/src/lib/client.store.utils.ts @@ -4,14 +4,15 @@ * 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 6a04c919b38..7e091b84fc9 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 4fb4e57110b..4edded807c0 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 d64cccabc84..903b70829cb 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 b3314a6ab4d..6cb64234767 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 1beaf712f43..e0591ceebac 100644 --- a/packages/oidc-client/src/lib/logout.request.test.ts +++ b/packages/oidc-client/src/lib/logout.request.test.ts @@ -4,15 +4,17 @@ * 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 '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 { describe, expect, it } from 'vitest'; + 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 636ab5fdd93..6804d9fea61 100644 --- a/packages/oidc-client/src/lib/logout.request.ts +++ b/packages/oidc-client/src/lib/logout.request.ts @@ -5,13 +5,15 @@ * 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 be666dcf7b1..7618f86285e 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 5f8283f401c..9e85a69b3ba 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 581d84d3665..12817cb8c1e 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 561291dce08..7c61f25ffa3 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/session.types.ts b/packages/oidc-client/src/lib/session.types.ts index 132c972250b..0611fa195f2 100644 --- a/packages/oidc-client/src/lib/session.types.ts +++ b/packages/oidc-client/src/lib/session.types.ts @@ -1,5 +1,5 @@ /* - * 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. diff --git a/packages/oidc-client/src/lib/wellknown.api.ts b/packages/oidc-client/src/lib/wellknown.api.ts index ddcd254d4d1..44a5ba10f82 100644 --- a/packages/oidc-client/src/lib/wellknown.api.ts +++ b/packages/oidc-client/src/lib/wellknown.api.ts @@ -5,9 +5,9 @@ * 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/oidc-client/src/types.ts b/packages/oidc-client/src/types.ts index 6a17dcbfef9..89cc92ba4cd 100644 --- a/packages/oidc-client/src/types.ts +++ b/packages/oidc-client/src/types.ts @@ -1,4 +1,4 @@ -/* 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. diff --git a/packages/protect/src/index.ts b/packages/protect/src/index.ts index b5c561f3354..9c321e8c05c 100644 --- a/packages/protect/src/index.ts +++ b/packages/protect/src/index.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. diff --git a/packages/protect/src/lib/protect.test.ts b/packages/protect/src/lib/protect.test.ts index ed3a0d96a3a..d72b7f1e49f 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 c25a9fe75c4..7d9e37bb3d5 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/protect/src/lib/protect.types.ts b/packages/protect/src/lib/protect.types.ts index f6e05f46553..687addc5c81 100644 --- a/packages/protect/src/lib/protect.types.ts +++ b/packages/protect/src/lib/protect.types.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. diff --git a/packages/protect/src/lib/signals-sdk.js b/packages/protect/src/lib/signals-sdk.js index 8a55bb73fa1..6f5f2b4bdcb 100644 --- a/packages/protect/src/lib/signals-sdk.js +++ b/packages/protect/src/lib/signals-sdk.js @@ -1,6 +1,6 @@ /* * - * Copyright © 2026 Ping Identity Corporation. All right reserved. + * Copyright (c) 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. @@ -1602,7 +1602,6 @@ if (typeof window !== 'undefined') { null || K === void 0 ) && K.body ); - ) await i(C); return await h(Q, Q.contentWindow); @@ -5346,7 +5345,6 @@ components: ${Pt(ie)} for ( (o = o || e.length) > e.length && (o = e.length), s = o - 1; s >= 0 && (192 & e[s]) == 128; - ) s--; return s < 0 || s === 0 ? o : s + t[e[s]] > o ? s : o; @@ -5534,7 +5532,6 @@ components: ${Pt(ie)} ce++, u.insert--, !(u.lookahead + u.insert < _e)); - ); } while (u.lookahead < Ve && u.strm.avail_in !== 0); } @@ -6048,7 +6045,6 @@ components: ${Pt(ie)} c(u), (te = T.pending), T.pending !== T.pending_buf_size)); - ) (n(T, 255 & T.gzhead.extra[T.gzindex]), T.gzindex++); (T.gzhead.hcrc && @@ -6216,7 +6212,6 @@ components: ${Pt(ie)} u.input = F, x(H); H.lookahead >= _e; - ) { ((T = H.strstart), (te = H.lookahead - (_e - 1))); do @@ -6418,7 +6413,6 @@ components: ${Pt(ie)} $ <= b.heap_len && ($ < b.heap_len && A(V, b.heap[$ + 1], b.heap[$], b.depth) && $++, !A(V, W, b.heap[$], b.depth)); - ) ((b.heap[j] = b.heap[$]), (j = $), ($ <<= 1)); b.heap[j] = W; diff --git a/packages/protect/src/types.ts b/packages/protect/src/types.ts index c20bf72128a..b711aba5089 100644 --- a/packages/protect/src/types.ts +++ b/packages/protect/src/types.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. diff --git a/packages/recognize/src/lib/defs/constants.ts b/packages/recognize/src/lib/defs/constants.ts index ed6507a4ec9..93af5232b76 100644 --- a/packages/recognize/src/lib/defs/constants.ts +++ b/packages/recognize/src/lib/defs/constants.ts @@ -1,6 +1,6 @@ /* * - * Copyright © 2026 Ping Identity Corporation. All right reserved. + * Copyright (c) 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. diff --git a/packages/recognize/src/lib/defs/recognize-error-code.ts b/packages/recognize/src/lib/defs/recognize-error-code.ts index c7cca031a8f..1f5f7e14327 100644 --- a/packages/recognize/src/lib/defs/recognize-error-code.ts +++ b/packages/recognize/src/lib/defs/recognize-error-code.ts @@ -1,6 +1,6 @@ /* * - * Copyright © 2026 Ping Identity Corporation. All right reserved. + * Copyright (c) 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. diff --git a/packages/recognize/src/lib/defs/recognize-sdk-to-recognize-proxy-error-map.ts b/packages/recognize/src/lib/defs/recognize-sdk-to-recognize-proxy-error-map.ts index 2cce5a7b3f2..417d047f7d8 100644 --- a/packages/recognize/src/lib/defs/recognize-sdk-to-recognize-proxy-error-map.ts +++ b/packages/recognize/src/lib/defs/recognize-sdk-to-recognize-proxy-error-map.ts @@ -1,15 +1,16 @@ /* * - * Copyright © 2026 Ping Identity Corporation. All right reserved. + * Copyright (c) 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 type { RecognizeErrorCodeValue } from '../recognize.types.js'; import { RECOGNIZE_ERROR_CODE } from './recognize-error-code.js'; +import type { RecognizeErrorCodeValue } from '../recognize.types.js'; + export const RECOGNIZE_SDK_TO_RECOGNIZE_PROXY_ERROR_MAP: Record = Object.freeze({ FRAME_RESULTS_SET_UNSET: RECOGNIZE_ERROR_CODE.SDK_ERROR, diff --git a/packages/recognize/src/lib/functions/create-recognize-error.ts b/packages/recognize/src/lib/functions/create-recognize-error.ts index 0a5ebe1a65e..5758e0a1204 100644 --- a/packages/recognize/src/lib/functions/create-recognize-error.ts +++ b/packages/recognize/src/lib/functions/create-recognize-error.ts @@ -1,18 +1,19 @@ /* * - * Copyright © 2026 Ping Identity Corporation. All right reserved. + * Copyright (c) 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 { getRecognizeErrorCodeKey } from './get-recognize-error-code-key.js'; + import type { CreateRecognizeErrorOptions, RecognizeError, RecognizeErrorCodeValue, } from '../recognize.types.js'; -import { getRecognizeErrorCodeKey } from './get-recognize-error-code-key.js'; /** @public */ export function createRecognizeError( diff --git a/packages/recognize/src/lib/functions/get-recognize-error-code-key.ts b/packages/recognize/src/lib/functions/get-recognize-error-code-key.ts index d5da898f5fd..70578bbb519 100644 --- a/packages/recognize/src/lib/functions/get-recognize-error-code-key.ts +++ b/packages/recognize/src/lib/functions/get-recognize-error-code-key.ts @@ -1,6 +1,6 @@ /* * - * Copyright © 2026 Ping Identity Corporation. All right reserved. + * Copyright (c) 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 { RECOGNIZE_ERROR_CODE } from '../defs/recognize-error-code.js'; + import type { RecognizeErrorCodeKey, RecognizeErrorCodeValue } from '../recognize.types.js'; /** @public */ diff --git a/packages/recognize/src/lib/functions/set-attributes.ts b/packages/recognize/src/lib/functions/set-attributes.ts index ce1d06a265b..e820cdf1f3b 100644 --- a/packages/recognize/src/lib/functions/set-attributes.ts +++ b/packages/recognize/src/lib/functions/set-attributes.ts @@ -1,6 +1,6 @@ /* * - * Copyright © 2026 Ping Identity Corporation. All right reserved. + * Copyright (c) 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. diff --git a/packages/recognize/src/lib/recognize.test.ts b/packages/recognize/src/lib/recognize.test.ts index 2c87ede5309..8b6da288ff7 100644 --- a/packages/recognize/src/lib/recognize.test.ts +++ b/packages/recognize/src/lib/recognize.test.ts @@ -1,6 +1,6 @@ /* * - * Copyright © 2026 Ping Identity Corporation. All right reserved. + * Copyright (c) 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. @@ -11,7 +11,8 @@ import { RECOGNIZE_ERROR_CODE } from './defs/recognize-error-code.js'; import { recognize } from './recognize.js'; -import { RecognizeWebComponentConfiguration } from './recognize.types.js'; + +import type { RecognizeWebComponentConfiguration } from './recognize.types.js'; vi.mock('./recognize-sdk/index.js', () => ({ KeylessRecoverableErrorEvent: class extends ErrorEvent {}, diff --git a/packages/recognize/src/lib/recognize.ts b/packages/recognize/src/lib/recognize.ts index 91e531c7302..66d41cc2d24 100644 --- a/packages/recognize/src/lib/recognize.ts +++ b/packages/recognize/src/lib/recognize.ts @@ -1,6 +1,6 @@ /* * - * Copyright © 2026 Ping Identity Corporation. All right reserved. + * Copyright (c) 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. @@ -12,13 +12,8 @@ import { RECOGNIZE_ERROR_CODE } from './defs/recognize-error-code.js'; import { RECOGNIZE_SDK_TO_RECOGNIZE_PROXY_ERROR_MAP } from './defs/recognize-sdk-to-recognize-proxy-error-map.js'; import { createRecognizeError } from './functions/create-recognize-error.js'; import { setAttributes } from './functions/set-attributes.js'; -import type { - KeylessRecognitionFailureEvent, - KeylessStepChangeEvent, - KeylessSuccessEvent, - KeylessVideoFrameQualityEvent, -} from './recognize-sdk/index.js'; import { KeylessRecoverableErrorEvent } from './recognize-sdk/index.js'; + import type { RecognizeError, RecognizeErrorCodeValue, @@ -30,6 +25,12 @@ import type { RecognizeWebComponentObserver, RecognizeWebComponentUnsubscribe, } from './recognize.types.js'; +import type { + KeylessRecognitionFailureEvent, + KeylessStepChangeEvent, + KeylessSuccessEvent, + KeylessVideoFrameQualityEvent, +} from './recognize-sdk/index.js'; /** * @function recognize - Returns a client to interact with the PingOne Recognize SDK web components diff --git a/packages/recognize/src/lib/recognize.types.ts b/packages/recognize/src/lib/recognize.types.ts index 5c36f962156..103535fb2f8 100644 --- a/packages/recognize/src/lib/recognize.types.ts +++ b/packages/recognize/src/lib/recognize.types.ts @@ -1,6 +1,6 @@ /* * - * Copyright © 2026 Ping Identity Corporation. All right reserved. + * Copyright (c) 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. 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 d2ebdefeca7..1edebc3d3fb 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/iframe-manager/src/lib/iframe-manager.effects.ts b/packages/sdk-effects/iframe-manager/src/lib/iframe-manager.effects.ts index 1321a2279a7..474b20887ce 100644 --- a/packages/sdk-effects/iframe-manager/src/lib/iframe-manager.effects.ts +++ b/packages/sdk-effects/iframe-manager/src/lib/iframe-manager.effects.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. diff --git a/packages/sdk-effects/logger/src/lib/logger.effects.ts b/packages/sdk-effects/logger/src/lib/logger.effects.ts index be365c42214..3f04247cb2d 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 cd36e2c1074..69d01c30636 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 f196238674e..e6ec8cb4507 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 437dc1f9af1..06df683cec3 100644 --- a/packages/sdk-effects/oidc/src/lib/authorize.test.ts +++ b/packages/sdk-effects/oidc/src/lib/authorize.test.ts @@ -5,12 +5,14 @@ * 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 f24df9fdfb4..eba5d807455 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 8c2e67b8345..428531d0b1b 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 cbf7033e30a..3c9d6ebf611 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 3836173422d..aa1fe837ed0 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 bd27a87d577..a1564568aa9 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 acecbdc3919..dd86f6ba647 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 55973eecde0..0db97d71792 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 2d4357a83e2..7b1b22744c5 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 64706f07f44..fbe66144dff 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 3752b970b4f..efce10b0e34 100644 --- a/packages/sdk-types/src/lib/config.types.ts +++ b/packages/sdk-types/src/lib/config.types.ts @@ -4,9 +4,9 @@ * 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 { AuthDisplayValue, AuthPromptValue, ResponseType } from './authorize.types.js'; import type { AsyncLegacyConfigOptions } from './legacy-config.types.js'; -import type { ResponseType, AuthDisplayValue, AuthPromptValue } from './authorize.types.js'; +import type { CustomStorageObject } from './tokens.types.js'; export const LOG_LEVEL_VALUES = ['none', 'error', 'warn', 'info', 'debug'] as const; export type LogLevel = (typeof LOG_LEVEL_VALUES)[number]; diff --git a/packages/sdk-types/src/lib/legacy-config.types.ts b/packages/sdk-types/src/lib/legacy-config.types.ts index a66da83553e..21302960454 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/index.ts b/packages/sdk-utilities/src/index.ts index f5dc55eb175..d89e9f96d5f 100644 --- a/packages/sdk-utilities/src/index.ts +++ b/packages/sdk-utilities/src/index.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. diff --git a/packages/sdk-utilities/src/lib/config/config.effects.ts b/packages/sdk-utilities/src/lib/config/config.effects.ts index 76defcf49a6..29add60d505 100644 --- a/packages/sdk-utilities/src/lib/config/config.effects.ts +++ b/packages/sdk-utilities/src/lib/config/config.effects.ts @@ -7,8 +7,9 @@ import * as Either from 'effect/Either'; -import { parseToOidcConfig, parseToJourneyConfig, parseToDavinciConfig } from './config.utils.js'; -import type { OidcConfig, JourneyClientConfig, DaVinciConfig } from './config.types.js'; +import { parseToDavinciConfig, parseToJourneyConfig, parseToOidcConfig } from './config.utils.js'; + +import type { DaVinciConfig, JourneyClientConfig, OidcConfig } from './config.types.js'; function throwOnLeft(result: Either.Either): T { if (Either.isLeft(result)) { diff --git a/packages/sdk-utilities/src/lib/config/config.test.ts b/packages/sdk-utilities/src/lib/config/config.test.ts index a48407f9d85..8f932ae9b22 100644 --- a/packages/sdk-utilities/src/lib/config/config.test.ts +++ b/packages/sdk-utilities/src/lib/config/config.test.ts @@ -5,17 +5,18 @@ * of the MIT license. See the LICENSE file for details. */ -import { describe, it, expect } from 'vitest'; import * as Either from 'effect/Either'; +import { describe, expect, it } from 'vitest'; + +import { makeDavinciConfig, makeJourneyConfig, makeOidcConfig } from './config.effects.js'; import { - parseToOidcConfig, - parseToJourneyConfig, - parseToDavinciConfig, collectErrors, parseOidcSection, + parseToDavinciConfig, + parseToJourneyConfig, + parseToOidcConfig, parseUnifiedSdkConfig, } from './config.utils.js'; -import { makeOidcConfig, makeJourneyConfig, makeDavinciConfig } from './config.effects.js'; const minimalOidc = { clientId: 'my-client', diff --git a/packages/sdk-utilities/src/lib/config/config.types.ts b/packages/sdk-utilities/src/lib/config/config.types.ts index bbcf2c2be11..03f1ded49bd 100644 --- a/packages/sdk-utilities/src/lib/config/config.types.ts +++ b/packages/sdk-utilities/src/lib/config/config.types.ts @@ -5,10 +5,9 @@ * of the MIT license. See the LICENSE file for details. */ +import type { AuthDisplayValue, AuthPromptValue, LogLevel } from '@forgerock/sdk-types'; import type * as Either from 'effect/Either'; -import type { LogLevel, AuthDisplayValue, AuthPromptValue } from '@forgerock/sdk-types'; - export type { OidcConfig } from '@forgerock/sdk-types'; export type { AuthDisplayValue, AuthPromptValue }; diff --git a/packages/sdk-utilities/src/lib/config/config.utils.ts b/packages/sdk-utilities/src/lib/config/config.utils.ts index 576d1b42f5e..0e04e8138f6 100644 --- a/packages/sdk-utilities/src/lib/config/config.utils.ts +++ b/packages/sdk-utilities/src/lib/config/config.utils.ts @@ -5,28 +5,28 @@ * of the MIT license. See the LICENSE file for details. */ -import { pipe } from 'effect'; -import * as Either from 'effect/Either'; - import { AUTH_DISPLAY_VALUES, AUTH_PROMPT_VALUES, LOG_LEVEL_UPPERCASE_VALUES, } from '@forgerock/sdk-types'; +import { pipe } from 'effect'; +import * as Either from 'effect/Either'; + import type { LogLevel } from '@forgerock/sdk-types'; import type { - UnifiedSdkConfig, - UnifiedOidcConfig, - UnifiedJourneyConfig, - OidcConfig, - JourneyClientConfig, - DaVinciConfig, ConfigValidationError, - ParseResult, - Parser, + DaVinciConfig, FieldParser, + JourneyClientConfig, + OidcConfig, ParsedProp, + Parser, + ParseResult, + UnifiedJourneyConfig, + UnifiedOidcConfig, + UnifiedSdkConfig, } from './config.types.js'; /* ------------------------------------------------------------------ * 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 d71b7071679..47ee41bcd8c 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 f5febe126dc..cf58145f3bd 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 6747f0cd839..7cb39136b8f 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/oidc/pkce.utils.ts b/packages/sdk-utilities/src/lib/oidc/pkce.utils.ts index 0331ea0ab54..80cdc8be4b3 100644 --- a/packages/sdk-utilities/src/lib/oidc/pkce.utils.ts +++ b/packages/sdk-utilities/src/lib/oidc/pkce.utils.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. 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 7c447d6e0f9..20eef7e1247 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/url/am-url.types.ts b/packages/sdk-utilities/src/lib/url/am-url.types.ts index bdf0a020cc2..e7c5cb9e8f1 100644 --- a/packages/sdk-utilities/src/lib/url/am-url.types.ts +++ b/packages/sdk-utilities/src/lib/url/am-url.types.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. diff --git a/packages/sdk-utilities/src/lib/url/am-url.utils.ts b/packages/sdk-utilities/src/lib/url/am-url.utils.ts index 581d4f67efb..5f20ff8dd32 100644 --- a/packages/sdk-utilities/src/lib/url/am-url.utils.ts +++ b/packages/sdk-utilities/src/lib/url/am-url.utils.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. 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 e325c6dac58..8213ee7f6c0 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/packages/sdk-utilities/src/types.ts b/packages/sdk-utilities/src/types.ts index 4fdfe866b8c..5827a331d36 100644 --- a/packages/sdk-utilities/src/types.ts +++ b/packages/sdk-utilities/src/types.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. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f3f8e024e4e..450ef369138 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -71,7 +71,7 @@ overrides: rollup: ^4.59.0 picomatch@>=4: ^4.0.4 picomatch@<3: ^2.3.2 - fast-uri: ^3.1.6 + fast-uri: ^3.1.7 qs: ^6.16.0 '@opentelemetry/core': ^2.8.0 brace-expansion@<2: ~1.1.15 @@ -79,7 +79,7 @@ overrides: brace-expansion@>=3 <4: ~3.0.2 brace-expansion@>=4: ~5.0.8 ws: ^8.21.1 - undici: ^7.29.0 + undici: ^7.29.1 nanoid: ^5.1.16 postcss: ^8.5.23 @@ -222,6 +222,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 @@ -4969,6 +4972,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'} @@ -4988,6 +4996,7 @@ packages: eslint@9.39.4: resolution: {integrity: sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. hasBin: true peerDependencies: jiti: '*' @@ -5143,8 +5152,8 @@ packages: fast-safe-stringify@2.1.1: resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} - fast-uri@3.1.6: - resolution: {integrity: sha512-7Ical1vFEMr0onbVzEDIreM22I4khW+fzyQPwvAFWBp1iwdshSZRsL4jjRvPG9JP1uiqMHRto+YU6R2/CzDz5Q==} + fast-uri@3.1.7: + resolution: {integrity: sha512-dOvZVzjdZdz7phd9v6jCbwxrBW3fK6n8Rc0CtdmM4bumzMnxywBYhuph6J819RRw/ku+rLbelwfMunktuzVVHg==} fastq@1.19.1: resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} @@ -8125,8 +8134,8 @@ packages: undici-types@7.16.0: resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} - undici@7.29.0: - resolution: {integrity: sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw==} + undici@7.29.1: + resolution: {integrity: sha512-RYONW2MeafgYlkVOKYKkA/Ag7BmXqgIWCa8t1m0JcxrQg9pI9lEqRhAOruOBCbAohOa/gkCF+iPi9hrgvTzu6Q==} engines: {node: '>=20.18.1'} unicode-canonical-property-names-ecmascript@2.0.1: @@ -8568,7 +8577,7 @@ snapshots: '@actions/http-client@4.0.1': dependencies: tunnel: 0.0.6 - undici: 7.29.0 + undici: 7.29.1 '@actions/io@3.0.2': {} @@ -9802,7 +9811,7 @@ snapshots: '@effect/sql': 0.44.2(@effect/experimental@0.54.6(@effect/platform@0.90.10(effect@3.21.0))(effect@3.21.0))(@effect/platform@0.90.10(effect@3.21.0))(effect@3.21.0) effect: 3.21.0 mime: 3.0.0 - undici: 7.29.0 + undici: 7.29.1 ws: 8.21.1 transitivePeerDependencies: - bufferutil @@ -10830,7 +10839,7 @@ snapshots: '@octokit/plugin-paginate-rest': 9.2.2(@octokit/core@5.2.2) '@octokit/plugin-rest-endpoint-methods': 10.4.1(@octokit/core@5.2.2) '@octokit/types': 12.6.0 - undici: 7.29.0 + undici: 7.29.1 '@octokit/auth-action@4.1.0': dependencies: @@ -12272,21 +12281,21 @@ snapshots: ajv@8.17.1: dependencies: fast-deep-equal: 3.1.3 - fast-uri: 3.1.6 + fast-uri: 3.1.7 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 ajv@8.18.0: dependencies: fast-deep-equal: 3.1.3 - fast-uri: 3.1.6 + fast-uri: 3.1.7 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 ajv@8.20.0: dependencies: fast-deep-equal: 3.1.3 - fast-uri: 3.1.6 + fast-uri: 3.1.7 json-schema-traverse: 1.0.0 require-from-string: 2.0.2 @@ -13553,6 +13562,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 @@ -13830,7 +13843,7 @@ snapshots: fast-safe-stringify@2.1.1: {} - fast-uri@3.1.6: {} + fast-uri@3.1.7: {} fastq@1.19.1: dependencies: @@ -17263,7 +17276,7 @@ snapshots: undici-types@7.16.0: {} - undici@7.29.0: {} + undici@7.29.1: {} unicode-canonical-property-names-ecmascript@2.0.1: {} diff --git a/tools/api-report/src/config.spec.ts b/tools/api-report/src/config.spec.ts index 8fe54527113..edbdbfca2ac 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 1f6224e9bee..b952aab13a4 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 b54fbe96d6d..5b260402799 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 e00a06a0b43..6461182fd9b 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 6d7e30c31ed..178a0b322a6 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 9cdd3ff9249..6cd163e7cf8 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 46b72efbca0..20226c9733e 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 6010f71658b..6fdd51ea43d 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 0b38f12759d..55dfbc79b72 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 b2b9d599a0c..6f83bbbc8bd 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 fb6f95db0ab..7bba8fa90d9 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 586ab868ef1..d61a60c1e7a 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 f0ae36d2363..235c1a94ff8 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 74a66a62903..150b4944aec 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 b7d900fafcc..e34a62d8a5f 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 3d8986f7801..9c6f21f7750 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 1ebe0a10890..873b11c3a8d 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 397c10ba1e7..260e1069ab9 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/generator.test.ts b/tools/interface-mapping-validator/src/generator.test.ts index 92190c189ca..02e097f6aaf 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 900fa497fe1..d39a7e4be7e 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 76198562512..c6e8ac4c70d 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 0fcb8633789..b615fd3a4a4 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 5db2f91fd60..a3910b697ce 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 013137644cb..179e494e69e 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 7106637e89f..ca37706133e 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/interface-mapping-validator/tsconfig.lib.json b/tools/interface-mapping-validator/tsconfig.lib.json index bd266ca12d2..1c41a7cb3d3 100644 --- a/tools/interface-mapping-validator/tsconfig.lib.json +++ b/tools/interface-mapping-validator/tsconfig.lib.json @@ -18,7 +18,8 @@ "declarationMap": true, "skipLibCheck": true, "sourceMap": true, - "lib": ["es2022"] + "lib": ["es2022"], + "types": ["node"] }, "references": [] } diff --git a/tools/user-scripts/src/index.ts b/tools/user-scripts/src/index.ts index e5a0907fe92..5d23a093988 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 18e657634f8..504218cb7e9 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')<{