@forgerock/javascript-sdk
Advanced tools
Comparing version 4.0.0 to 4.1.0-beta.0
{ | ||
"name": "@forgerock/javascript-sdk", | ||
"version": "4.1.0-beta.0", | ||
"description": "ForgeRock JavaScript SDK", | ||
@@ -13,3 +14,2 @@ "author": "ForgeRock", | ||
"homepage": "https://github.com/ForgeRock/forgerock-javascript-sdk#readme", | ||
"version": "4.0.0", | ||
"exports": { | ||
@@ -28,5 +28,5 @@ "./src/*": { | ||
"types": "./src/index.d.ts", | ||
"module": "./src/index.js", | ||
"main": "./src/index.cjs", | ||
"module": "./index.js", | ||
"main": "./index.cjs", | ||
"type": "module" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
import { Step, StepOptions } from './interfaces'; | ||
import type { Step, StepOptions } from './interfaces'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Provides direct access to the OpenAM authentication tree API. |
@@ -1,4 +0,4 @@ | ||
import { ConfigOptions } from '../config/interfaces'; | ||
import { StringDict } from '../shared/interfaces'; | ||
import { CallbackType } from './enums'; | ||
import type { ConfigOptions } from '../config/interfaces'; | ||
import type { StringDict } from '../shared/interfaces'; | ||
import type { CallbackType } from './enums'; | ||
/** | ||
@@ -78,2 +78,2 @@ * Represents the authentication tree API payload schema. | ||
} | ||
export { Callback, FailedPolicyRequirement, NameValue, PolicyParams, PolicyRequirement, Step, StepDetail, StepOptions, }; | ||
export type { Callback, FailedPolicyRequirement, NameValue, PolicyParams, PolicyRequirement, Step, StepDetail, StepOptions, }; |
import { DEFAULT_TIMEOUT } from './constants'; | ||
import { ConfigOptions, ServerConfig, ValidConfigOptions } from './interfaces'; | ||
import type { ConfigOptions, ServerConfig, ValidConfigOptions } from './interfaces'; | ||
/** | ||
@@ -38,2 +38,3 @@ * Utility for merging configuration defaults with one-off options. | ||
export default Config; | ||
export { DEFAULT_TIMEOUT, ConfigOptions, ServerConfig, ValidConfigOptions }; | ||
export type { ConfigOptions, ServerConfig, ValidConfigOptions }; | ||
export { DEFAULT_TIMEOUT }; |
@@ -1,4 +0,4 @@ | ||
import { ActionTypes } from './enums'; | ||
import { FRCallbackFactory } from '../fr-auth/callbacks/factory'; | ||
import { Tokens } from '../shared/interfaces'; | ||
import type { ActionTypes } from './enums'; | ||
import type { FRCallbackFactory } from '../fr-auth/callbacks/factory'; | ||
import type { Tokens } from '../shared/interfaces'; | ||
interface Action { | ||
@@ -64,2 +64,2 @@ type: ActionTypes; | ||
} | ||
export { Action, ConfigOptions, ConfigurablePaths, CustomPathConfig, RequestMiddleware, RequestObj, ServerConfig, TokenStoreObject, ValidConfigOptions, }; | ||
export type { Action, ConfigOptions, ConfigurablePaths, CustomPathConfig, RequestMiddleware, RequestObj, ServerConfig, TokenStoreObject, ValidConfigOptions, }; |
import FRCallback from '.'; | ||
import { Callback, PolicyRequirement } from '../../auth/interfaces'; | ||
import { StringDict } from '../../shared/interfaces'; | ||
import type { Callback, PolicyRequirement } from '../../auth/interfaces'; | ||
import type { StringDict } from '../../shared/interfaces'; | ||
/** | ||
@@ -5,0 +5,0 @@ * Represents a callback used to collect attributes. |
import FRCallback from '.'; | ||
import { Callback } from '../../auth/interfaces'; | ||
import type { Callback } from '../../auth/interfaces'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Represents a callback used to collect an answer to a choice. |
import FRCallback from '.'; | ||
import { Callback } from '../../auth/interfaces'; | ||
import type { Callback } from '../../auth/interfaces'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Represents a callback used to collect a confirmation to a message. |
import FRCallback from '.'; | ||
import { Callback } from '../../auth/interfaces'; | ||
import { DeviceProfileData } from '../../fr-device/interfaces'; | ||
import type { Callback } from '../../auth/interfaces'; | ||
import type { DeviceProfileData } from '../../fr-device/interfaces'; | ||
/** | ||
@@ -5,0 +5,0 @@ * Represents a callback used to collect device profile data. |
import FRCallback from '.'; | ||
import { Callback } from '../../auth/interfaces'; | ||
import type { Callback } from '../../auth/interfaces'; | ||
type FRCallbackFactory = (callback: Callback) => FRCallback; | ||
@@ -9,2 +9,2 @@ /** | ||
export default createCallback; | ||
export { FRCallbackFactory }; | ||
export type { FRCallbackFactory }; |
import FRCallback from '.'; |
import { Callback } from '../../auth/interfaces'; |
import type { Callback } from '../../auth/interfaces'; |
/** |
@@ -4,0 +4,0 @@ * Represents a callback used to collect information indirectly from the user. |
@@ -1,3 +0,3 @@ | ||
import { CallbackType } from '../../auth/enums'; | ||
import { Callback } from '../../auth/interfaces'; | ||
import type { CallbackType } from '../../auth/enums'; | ||
import type { Callback } from '../../auth/interfaces'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Base class for authentication tree callback wrappers. |
import FRCallback from '.'; | ||
import { Callback } from '../../auth/interfaces'; | ||
import type { Callback } from '../../auth/interfaces'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Represents a callback used to collect KBA-style security questions and answers. |
import FRCallback from '.'; | ||
import { Callback } from '../../auth/interfaces'; | ||
import type { Callback } from '../../auth/interfaces'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Represents a callback used to deliver and collect miscellaneous data. |
import FRCallback from '.'; | ||
import { Callback } from '../../auth/interfaces'; | ||
import type { Callback } from '../../auth/interfaces'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Represents a callback used to collect a username. |
import FRCallback from '.'; | ||
import { Callback, PolicyRequirement } from '../../auth/interfaces'; | ||
import type { Callback, PolicyRequirement } from '../../auth/interfaces'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Represents a callback used to collect a password. |
import FRCallback from '.'; | ||
import { Callback } from '../../auth/interfaces'; | ||
import type { Callback } from '../../auth/interfaces'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Represents a callback used to instruct the system to poll while a backend process completes. |
import FRCallback from '.'; | ||
import { Callback } from '../../auth/interfaces'; | ||
import type { Callback } from '../../auth/interfaces'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Represents a callback used to integrate reCAPTCHA. |
import FRCallback from '.'; | ||
import { Callback } from '../../auth/interfaces'; | ||
import type { Callback } from '../../auth/interfaces'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Represents a callback used to collect an answer to a choice. |
import FRCallback from '.'; | ||
import { Callback } from '../../auth/interfaces'; | ||
import type { Callback } from '../../auth/interfaces'; | ||
interface IdPValue { | ||
@@ -28,2 +28,2 @@ provider: string; | ||
export default SelectIdPCallback; | ||
export { IdPValue }; | ||
export type { IdPValue }; |
import TextOutputCallback from './text-output-callback'; | ||
import { Callback } from '../../auth/interfaces'; | ||
import type { Callback } from '../../auth/interfaces'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Represents a callback used to display a message. |
import FRCallback from '.'; | ||
import { Callback } from '../../auth/interfaces'; | ||
import type { Callback } from '../../auth/interfaces'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Represents a callback used to collect acceptance of terms and conditions. |
import FRCallback from '.'; | ||
import { Callback } from '../../auth/interfaces'; | ||
import type { Callback } from '../../auth/interfaces'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Represents a callback used to retrieve input from the user. |
import FRCallback from '.'; | ||
import { Callback } from '../../auth/interfaces'; | ||
import type { Callback } from '../../auth/interfaces'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Represents a callback used to display a message. |
import FRCallback from '.'; | ||
import { Callback, PolicyRequirement } from '../../auth/interfaces'; | ||
import { StringDict } from '../../shared/interfaces'; | ||
import type { Callback, PolicyRequirement } from '../../auth/interfaces'; | ||
import type { StringDict } from '../../shared/interfaces'; | ||
/** | ||
@@ -5,0 +5,0 @@ * Represents a callback used to collect a valid platform password. |
import FRCallback from '.'; | ||
import { Callback, PolicyRequirement } from '../../auth/interfaces'; | ||
import { StringDict } from '../../shared/interfaces'; | ||
import type { Callback, PolicyRequirement } from '../../auth/interfaces'; | ||
import type { StringDict } from '../../shared/interfaces'; | ||
/** | ||
@@ -5,0 +5,0 @@ * Represents a callback used to collect a valid platform username. |
@@ -1,5 +0,5 @@ | ||
import { MessageCreator, ProcessedPropertyError } from '../fr-policy/interfaces'; | ||
import { Step } from '../auth/interfaces'; | ||
import type { MessageCreator, ProcessedPropertyError } from '../fr-policy/interfaces'; | ||
import type { Step } from '../auth/interfaces'; | ||
import { StepType } from './enums'; | ||
import { AuthResponse, FailureDetail } from './interfaces'; | ||
import type { AuthResponse, FailureDetail } from './interfaces'; | ||
declare class FRLoginFailure implements AuthResponse { | ||
@@ -6,0 +6,0 @@ payload: Step; |
@@ -1,4 +0,4 @@ | ||
import { Step } from '../auth/interfaces'; | ||
import type { Step } from '../auth/interfaces'; | ||
import { StepType } from './enums'; | ||
import { AuthResponse } from './interfaces'; | ||
import type { AuthResponse } from './interfaces'; | ||
declare class FRLoginSuccess implements AuthResponse { | ||
@@ -5,0 +5,0 @@ payload: Step; |
@@ -1,7 +0,7 @@ | ||
import { CallbackType } from '../auth/enums'; | ||
import { Step } from '../auth/interfaces'; | ||
import FRCallback from './callbacks'; | ||
import { FRCallbackFactory } from './callbacks/factory'; | ||
import type { CallbackType } from '../auth/enums'; | ||
import type { Step } from '../auth/interfaces'; | ||
import type FRCallback from './callbacks'; | ||
import type { FRCallbackFactory } from './callbacks/factory'; | ||
import { StepType } from './enums'; | ||
import { AuthResponse } from './interfaces'; | ||
import type { AuthResponse } from './interfaces'; | ||
/** | ||
@@ -63,2 +63,2 @@ * Represents a single step of an authentication tree. | ||
export default FRStep; | ||
export { FRStepHandler }; | ||
export type { FRStepHandler }; |
@@ -1,2 +0,2 @@ | ||
import { StepOptions } from '../auth/interfaces'; | ||
import type { StepOptions } from '../auth/interfaces'; | ||
import FRLoginFailure from './fr-login-failure'; | ||
@@ -3,0 +3,0 @@ import FRLoginSuccess from './fr-login-success'; |
@@ -1,2 +0,2 @@ | ||
import { StepType } from './enums'; | ||
import type { StepType } from './enums'; | ||
/** | ||
@@ -14,2 +14,2 @@ * Base interface for all types of authentication step responses. | ||
} | ||
export { AuthResponse, FailureDetail }; | ||
export type { AuthResponse, FailureDetail }; |
@@ -1,2 +0,2 @@ | ||
import { StringDict } from '../shared/interfaces'; | ||
import type { StringDict } from '../shared/interfaces'; | ||
/** | ||
@@ -3,0 +3,0 @@ * @class Collector - base class for FRDevice |
@@ -1,2 +0,2 @@ | ||
import { BaseProfileConfig, CollectParameters, DeviceProfileData, Geolocation, ProfileConfigOptions } from './interfaces'; | ||
import type { BaseProfileConfig, CollectParameters, DeviceProfileData, Geolocation, ProfileConfigOptions } from './interfaces'; | ||
import Collector from './collector'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -43,2 +43,2 @@ type Category = 'fontNames' | 'displayProps' | 'browserProps' | 'hardwareProps' | 'platformProps'; | ||
} | ||
export { BaseProfileConfig, Category, CollectParameters, DeviceProfileData, Geolocation, ProfileConfigOptions, }; | ||
export type { BaseProfileConfig, Category, CollectParameters, DeviceProfileData, Geolocation, ProfileConfigOptions, }; |
@@ -1,4 +0,4 @@ | ||
import { FailedPolicyRequirement, PolicyRequirement, Step } from '../auth/interfaces'; | ||
import type { FailedPolicyRequirement, PolicyRequirement, Step } from '../auth/interfaces'; | ||
import { PolicyKey } from './enums'; | ||
import { MessageCreator, ProcessedPropertyError } from './interfaces'; | ||
import type { MessageCreator, ProcessedPropertyError } from './interfaces'; | ||
/** | ||
@@ -58,2 +58,3 @@ * Utility for processing policy failures into human readable messages. | ||
export default FRPolicy; | ||
export { PolicyKey, MessageCreator, ProcessedPropertyError }; | ||
export type { MessageCreator, ProcessedPropertyError }; | ||
export { PolicyKey }; |
@@ -1,2 +0,2 @@ | ||
import { FailedPolicyRequirement } from '../auth/interfaces'; | ||
import type { FailedPolicyRequirement } from '../auth/interfaces'; | ||
interface MessageCreator { | ||
@@ -11,2 +11,2 @@ [key: string]: (propertyName: string, params?: { | ||
} | ||
export { MessageCreator, ProcessedPropertyError }; | ||
export type { MessageCreator, ProcessedPropertyError }; |
@@ -1,3 +0,3 @@ | ||
import { MessageCreator } from './interfaces'; | ||
import type { MessageCreator } from './interfaces'; | ||
declare const defaultMessageCreator: MessageCreator; | ||
export default defaultMessageCreator; |
@@ -1,2 +0,2 @@ | ||
import FRStep from '../fr-auth/fr-step'; | ||
import type FRStep from '../fr-auth/fr-step'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Utility for handling recovery code nodes. |
@@ -1,3 +0,4 @@ | ||
import { ConfigOptions } from '../config'; | ||
import FRStep, { FRStepHandler } from '../fr-auth/fr-step'; | ||
import type { ConfigOptions } from '../config'; | ||
import type { FRStepHandler } from '../fr-auth/fr-step'; | ||
import type FRStep from '../fr-auth/fr-step'; | ||
/** | ||
@@ -4,0 +5,0 @@ * High-level API for logging a user in/out and getting profile information. |
@@ -1,2 +0,2 @@ | ||
import { ParsedCredential } from './interfaces'; | ||
import type { ParsedCredential } from './interfaces'; | ||
declare function ensureArray(arr: RegExpMatchArray | null): string[]; | ||
@@ -3,0 +3,0 @@ declare function arrayBufferToString(arrayBuffer: ArrayBuffer): string; |
@@ -1,7 +0,7 @@ | ||
import HiddenValueCallback from '../fr-auth/callbacks/hidden-value-callback'; | ||
import MetadataCallback from '../fr-auth/callbacks/metadata-callback'; | ||
import FRStep from '../fr-auth/fr-step'; | ||
import type HiddenValueCallback from '../fr-auth/callbacks/hidden-value-callback'; | ||
import type MetadataCallback from '../fr-auth/callbacks/metadata-callback'; | ||
import type FRStep from '../fr-auth/fr-step'; | ||
import { WebAuthnOutcome, WebAuthnStepType } from './enums'; | ||
import { AttestationType, RelyingParty, WebAuthnAuthenticationMetadata, WebAuthnCallbacks, WebAuthnRegistrationMetadata } from './interfaces'; | ||
import TextOutputCallback from '../fr-auth/callbacks/text-output-callback'; | ||
import type { AttestationType, RelyingParty, WebAuthnAuthenticationMetadata, WebAuthnCallbacks, WebAuthnRegistrationMetadata } from './interfaces'; | ||
import type TextOutputCallback from '../fr-auth/callbacks/text-output-callback'; | ||
type OutcomeWithName<ClientId extends string, Attestation extends AttestationType, PubKeyCred extends PublicKeyCredential, Name = ''> = Name extends infer P extends string ? `${ClientId}::${Attestation}::${PubKeyCred['id']}${P extends '' ? '' : `::${P}`}` : never; | ||
@@ -46,3 +46,3 @@ /** | ||
*/ | ||
static register<T extends string = undefined>(step: FRStep, deviceName?: T): Promise<FRStep>; | ||
static register<T extends string = ''>(step: FRStep, deviceName?: T): Promise<FRStep>; | ||
/** | ||
@@ -91,3 +91,3 @@ * Returns an object containing the two WebAuthn callbacks. | ||
*/ | ||
static getAuthenticationOutcome(credential: PublicKeyCredential | null): OutcomeWithName<string, AttestationType, typeof credential> | OutcomeWithName<string, AttestationType, typeof credential, string>; | ||
static getAuthenticationOutcome(credential: PublicKeyCredential | null): OutcomeWithName<string, AttestationType, PublicKeyCredential> | OutcomeWithName<string, AttestationType, PublicKeyCredential, string>; | ||
/** | ||
@@ -125,2 +125,3 @@ * Retrieves the credential from the browser Web Authentication API. | ||
export default FRWebAuthn; | ||
export { RelyingParty, WebAuthnAuthenticationMetadata, WebAuthnCallbacks, WebAuthnOutcome, WebAuthnRegistrationMetadata, WebAuthnStepType, }; | ||
export type { RelyingParty, WebAuthnAuthenticationMetadata, WebAuthnCallbacks, WebAuthnRegistrationMetadata, }; | ||
export { WebAuthnOutcome, WebAuthnStepType }; |
@@ -114,3 +114,3 @@ import { CallbackType } from '../auth/enums.js'; | ||
*/ | ||
// Can make this generic const in Typescritp 5.0 > and the name itself will | ||
// Can make this generic const in Typescript 5.0 > and the name itself will | ||
// be inferred from the type so `typeof deviceName` will not just return string | ||
@@ -127,8 +127,13 @@ // but the actual name of the deviceName passed in as a generic. | ||
publicKey = this.createRegistrationPublicKey(meta); | ||
const credential = await this.getRegistrationCredential(publicKey); | ||
outcome = this.getRegistrationOutcome(credential); | ||
} | ||
else if (textOutputCallback) { | ||
publicKey = parseWebAuthnRegisterText(textOutputCallback.getMessage()); | ||
const credential = await this.getRegistrationCredential(publicKey); | ||
outcome = this.getRegistrationOutcome(credential); | ||
} | ||
const credential = await this.getRegistrationCredential(publicKey); | ||
outcome = this.getRegistrationOutcome(credential); | ||
else { | ||
throw new Error('No Credential found from Public Key'); | ||
} | ||
} | ||
@@ -146,3 +151,3 @@ catch (error) { | ||
} | ||
hiddenCallback.setInputValue(deviceName ? `${outcome}::${deviceName}` : outcome); | ||
hiddenCallback.setInputValue(deviceName && deviceName.length > 0 ? `${outcome}::${deviceName}` : outcome); | ||
return step; | ||
@@ -149,0 +154,0 @@ } |
@@ -1,4 +0,4 @@ | ||
import HiddenValueCallback from '../fr-auth/callbacks/hidden-value-callback'; | ||
import MetadataCallback from '../fr-auth/callbacks/metadata-callback'; | ||
import TextOutputCallback from '../fr-auth/callbacks/text-output-callback'; | ||
import type HiddenValueCallback from '../fr-auth/callbacks/hidden-value-callback'; | ||
import type MetadataCallback from '../fr-auth/callbacks/metadata-callback'; | ||
import type TextOutputCallback from '../fr-auth/callbacks/text-output-callback'; | ||
declare enum AttestationType { | ||
@@ -78,2 +78,3 @@ Direct = "direct", | ||
} | ||
export { AttestationType, DeviceStepState, ParsedCredential, RelyingParty, ResponseCredential, Step, StepType, UserVerificationType, WebAuthnCallbacks, WebAuthnAuthenticationMetadata, WebAuthnRegistrationMetadata, WebAuthnTextOutputRegistration, }; | ||
export type { DeviceStepState, ParsedCredential, RelyingParty, ResponseCredential, Step, WebAuthnCallbacks, WebAuthnAuthenticationMetadata, WebAuthnRegistrationMetadata, WebAuthnTextOutputRegistration, }; | ||
export { AttestationType, StepType, UserVerificationType }; |
@@ -6,5 +6,5 @@ /** | ||
*/ | ||
import { CustomPathConfig } from '../config/interfaces'; | ||
import { Advices, HttpClientRequestOptions, RequiresNewTokenFn, AuthorizationJSON } from './interfaces'; | ||
import { Tokens } from '../shared/interfaces'; | ||
import type { CustomPathConfig } from '../config/interfaces'; | ||
import type { Advices, HttpClientRequestOptions, RequiresNewTokenFn, AuthorizationJSON } from './interfaces'; | ||
import type { Tokens } from '../shared/interfaces'; | ||
export declare function addAuthzInfoToHeaders(init: RequestInit, advices: Advices, tokens?: Tokens | void): Headers; | ||
@@ -11,0 +11,0 @@ export declare function addAuthzInfoToURL(url: string, advices: Advices, tokens?: Tokens | void): string; |
@@ -1,2 +0,2 @@ | ||
import { HttpClientRequestOptions, RequiresNewTokenFn } from './interfaces'; | ||
import type { HttpClientRequestOptions, RequiresNewTokenFn } from './interfaces'; | ||
/** | ||
@@ -36,2 +36,2 @@ * HTTP client that includes bearer token injection and refresh. | ||
export default HttpClient; | ||
export { HttpClientRequestOptions, RequiresNewTokenFn }; | ||
export type { HttpClientRequestOptions, RequiresNewTokenFn }; |
@@ -1,3 +0,3 @@ | ||
import { ConfigOptions } from '../config/interfaces'; | ||
import FRStep from '../fr-auth/fr-step'; | ||
import type { ConfigOptions } from '../config/interfaces'; | ||
import type FRStep from '../fr-auth/fr-step'; | ||
export interface Advices { | ||
@@ -4,0 +4,0 @@ AuthenticateToServiceConditionAdvice?: string[]; |
import Auth from './auth'; | ||
import { CallbackType, ErrorCode } from './auth/enums'; | ||
import { Callback, NameValue, PolicyRequirement, Step, StepDetail } from './auth/interfaces'; | ||
import Config, { ConfigOptions, ValidConfigOptions } from './config'; | ||
import type { Callback, NameValue, PolicyRequirement, Step, StepDetail } from './auth/interfaces'; | ||
import Config from './config'; | ||
import type { ConfigOptions, ValidConfigOptions } from './config'; | ||
import FRAuth from './fr-auth'; | ||
@@ -11,3 +12,3 @@ import FRCallback from './fr-auth/callbacks'; | ||
import DeviceProfileCallback from './fr-auth/callbacks/device-profile-callback'; | ||
import { FRCallbackFactory } from './fr-auth/callbacks/factory'; | ||
import type { FRCallbackFactory } from './fr-auth/callbacks/factory'; | ||
import HiddenValueCallback from './fr-auth/callbacks/hidden-value-callback'; | ||
@@ -21,3 +22,4 @@ import KbaCreateCallback from './fr-auth/callbacks/kba-create-callback'; | ||
import RedirectCallback from './fr-auth/callbacks/redirect-callback'; | ||
import SelectIdPCallback, { IdPValue } from './fr-auth/callbacks/select-idp-callback'; | ||
import type { IdPValue } from './fr-auth/callbacks/select-idp-callback'; | ||
import SelectIdPCallback from './fr-auth/callbacks/select-idp-callback'; | ||
import SuspendedTextOutputCallback from './fr-auth/callbacks/suspended-text-output-callback'; | ||
@@ -32,15 +34,20 @@ import TermsAndConditionsCallback from './fr-auth/callbacks/terms-and-conditions-callback'; | ||
import FRLoginSuccess from './fr-auth/fr-login-success'; | ||
import FRStep, { FRStepHandler } from './fr-auth/fr-step'; | ||
import { AuthResponse, FailureDetail } from './fr-auth/interfaces'; | ||
import type { FRStepHandler } from './fr-auth/fr-step'; | ||
import FRStep from './fr-auth/fr-step'; | ||
import type { AuthResponse, FailureDetail } from './fr-auth/interfaces'; | ||
import FRDevice from './fr-device'; | ||
import FRPolicy, { MessageCreator, PolicyKey, ProcessedPropertyError } from './fr-policy'; | ||
import type { MessageCreator, ProcessedPropertyError } from './fr-policy'; | ||
import FRPolicy, { PolicyKey } from './fr-policy'; | ||
import defaultMessageCreator from './fr-policy/message-creator'; | ||
import FRRecoveryCodes from './fr-recovery-codes'; | ||
import FRUser from './fr-user'; | ||
import FRWebAuthn, { RelyingParty, WebAuthnAuthenticationMetadata, WebAuthnCallbacks, WebAuthnOutcome, WebAuthnRegistrationMetadata, WebAuthnStepType } from './fr-webauthn'; | ||
import type { RelyingParty, WebAuthnAuthenticationMetadata, WebAuthnCallbacks, WebAuthnRegistrationMetadata } from './fr-webauthn'; | ||
import FRWebAuthn, { WebAuthnOutcome, WebAuthnStepType } from './fr-webauthn'; | ||
import HttpClient from './http-client'; | ||
import OAuth2Client, { GetAuthorizationUrlOptions, GetOAuth2TokensOptions, OAuth2Tokens, ResponseType } from './oauth2-client'; | ||
import type { GetAuthorizationUrlOptions, GetOAuth2TokensOptions, OAuth2Tokens } from './oauth2-client'; | ||
import OAuth2Client, { ResponseType } from './oauth2-client'; | ||
import SessionManager from './session-manager'; | ||
import { Tokens } from './shared/interfaces'; | ||
import TokenManager, { GetTokensOptions } from './token-manager'; | ||
import type { Tokens } from './shared/interfaces'; | ||
import type { GetTokensOptions } from './token-manager'; | ||
import TokenManager from './token-manager'; | ||
import TokenStorage from './token-storage'; | ||
@@ -51,2 +58,3 @@ import UserManager from './user-manager'; | ||
import LocalStorage from './util/storage'; | ||
export { defaultMessageCreator, AttributeInputCallback, Auth, AuthResponse, Callback, CallbackType, ChoiceCallback, Config, ConfigOptions, ConfirmationCallback, Deferred, DeviceProfileCallback, ErrorCode, FailureDetail, FRAuth, FRCallback, FRCallbackFactory, FRDevice, FRLoginFailure, FRLoginSuccess, FRPolicy, FRRecoveryCodes, FRStep, FRStepHandler, FRUser, FRWebAuthn, GetAuthorizationUrlOptions, GetOAuth2TokensOptions, GetTokensOptions, HiddenValueCallback, HttpClient, IdPValue, KbaCreateCallback, LocalStorage, MessageCreator, MetadataCallback, NameCallback, NameValue, OAuth2Client, OAuth2Tokens, PasswordCallback, PKCE, PolicyKey, PolicyRequirement, PollingWaitCallback, ProcessedPropertyError, ReCaptchaCallback, RedirectCallback, RelyingParty, ResponseType, SelectIdPCallback, SessionManager, Step, StepDetail, StepType, SuspendedTextOutputCallback, TermsAndConditionsCallback, TextInputCallback, TextOutputCallback, TokenManager, Tokens, TokenStorage, UserManager, ValidatedCreatePasswordCallback, ValidatedCreateUsernameCallback, ValidConfigOptions, WebAuthnAuthenticationMetadata, WebAuthnCallbacks, WebAuthnOutcome, WebAuthnRegistrationMetadata, WebAuthnStepType, }; | ||
export type { AuthResponse, Callback, ConfigOptions, FailureDetail, FRCallbackFactory, FRStepHandler, GetAuthorizationUrlOptions, GetOAuth2TokensOptions, GetTokensOptions, IdPValue, MessageCreator, NameValue, OAuth2Tokens, PolicyRequirement, ProcessedPropertyError, RelyingParty, Step, StepDetail, Tokens, ValidConfigOptions, WebAuthnAuthenticationMetadata, WebAuthnCallbacks, WebAuthnRegistrationMetadata, }; | ||
export { defaultMessageCreator, AttributeInputCallback, Auth, CallbackType, ChoiceCallback, Config, ConfirmationCallback, Deferred, DeviceProfileCallback, ErrorCode, FRAuth, FRCallback, FRDevice, FRLoginFailure, FRLoginSuccess, FRPolicy, FRRecoveryCodes, FRStep, FRUser, FRWebAuthn, HiddenValueCallback, HttpClient, KbaCreateCallback, LocalStorage, MetadataCallback, NameCallback, OAuth2Client, PasswordCallback, PKCE, PolicyKey, PollingWaitCallback, ReCaptchaCallback, RedirectCallback, ResponseType, SelectIdPCallback, SessionManager, StepType, SuspendedTextOutputCallback, TermsAndConditionsCallback, TextInputCallback, TextOutputCallback, TokenManager, TokenStorage, UserManager, ValidatedCreatePasswordCallback, ValidatedCreateUsernameCallback, WebAuthnOutcome, WebAuthnStepType, }; |
@@ -1,4 +0,4 @@ | ||
import { ConfigOptions } from '../config/index'; | ||
import type { ConfigOptions } from '../config/index'; | ||
import { ResponseType } from './enums'; | ||
import { GetAuthorizationUrlOptions, GetOAuth2TokensOptions, OAuth2Tokens } from './interfaces'; | ||
import type { GetAuthorizationUrlOptions, GetOAuth2TokensOptions, OAuth2Tokens } from './interfaces'; | ||
declare const allowedErrors: { | ||
@@ -50,2 +50,3 @@ AuthenticationConsentRequired: string; | ||
export default OAuth2Client; | ||
export { allowedErrors, GetAuthorizationUrlOptions, GetOAuth2TokensOptions, OAuth2Tokens, ResponseType, }; | ||
export type { GetAuthorizationUrlOptions, GetOAuth2TokensOptions, OAuth2Tokens }; | ||
export { allowedErrors, ResponseType }; |
@@ -189,15 +189,18 @@ import { ActionTypes } from '../config/enums.js'; | ||
const accessToken = tokens && tokens.accessToken; | ||
const init = { | ||
body: stringify({ client_id: clientId, token: accessToken }), | ||
credentials: 'include', | ||
headers: new Headers({ | ||
'Content-Type': 'application/x-www-form-urlencoded', | ||
}), | ||
method: 'POST', | ||
}; | ||
const response = await this.request('revoke', undefined, false, init, options); | ||
if (!isOkOr4xx(response)) { | ||
throw new Error(`Failed to revoke token; received ${response.status}`); | ||
if (accessToken) { | ||
const init = { | ||
body: stringify({ client_id: clientId, token: accessToken }), | ||
credentials: 'include', | ||
headers: new Headers({ | ||
'Content-Type': 'application/x-www-form-urlencoded', | ||
}), | ||
method: 'POST', | ||
}; | ||
const response = await this.request('revoke', undefined, false, init, options); | ||
if (!isOkOr4xx(response)) { | ||
throw new Error(`Failed to revoke token; received ${response.status}`); | ||
} | ||
return response; | ||
} | ||
return response; | ||
return new Response(); | ||
} | ||
@@ -204,0 +207,0 @@ static async request(endpoint, query, includeToken, init, options) { |
@@ -1,4 +0,4 @@ | ||
import { StringDict } from '../shared/interfaces'; | ||
import { ConfigOptions } from '../config'; | ||
import { ResponseType } from './enums'; | ||
import type { StringDict } from '../shared/interfaces'; | ||
import type { ConfigOptions } from '../config'; | ||
import type { ResponseType } from './enums'; | ||
/** | ||
@@ -39,2 +39,2 @@ * Tokens returned after successful authentication. | ||
} | ||
export { AccessTokenResponse, GetAuthorizationUrlOptions, GetOAuth2TokensOptions, OAuth2Tokens }; | ||
export type { AccessTokenResponse, GetAuthorizationUrlOptions, GetOAuth2TokensOptions, OAuth2Tokens, }; |
@@ -1,2 +0,2 @@ | ||
import { ConfigOptions } from '../config/index'; | ||
import type { ConfigOptions } from '../config/index'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Provides access to the session management API. |
@@ -10,2 +10,2 @@ interface StringDict<T> { | ||
} | ||
export { StringDict, Tokens }; | ||
export type { StringDict, Tokens }; |
@@ -7,2 +7,2 @@ /** | ||
type Noop = () => void; | ||
export { Noop }; | ||
export type { Noop }; |
@@ -1,4 +0,4 @@ | ||
import { ConfigOptions } from '../config'; | ||
import { OAuth2Tokens } from '../oauth2-client'; | ||
import { StringDict } from '../shared/interfaces'; | ||
import type { ConfigOptions } from '../config'; | ||
import type { OAuth2Tokens } from '../oauth2-client'; | ||
import type { StringDict } from '../shared/interfaces'; | ||
interface GetTokensOptions extends ConfigOptions { | ||
@@ -53,2 +53,2 @@ forceRenew?: boolean; | ||
export default TokenManager; | ||
export { GetTokensOptions }; | ||
export type { GetTokensOptions }; |
@@ -104,4 +104,4 @@ import Config from '../config/index.js'; | ||
const state = PKCE.createState(); | ||
/** strict mode requires us to be smarter about destructuring */ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
const { forceRenew, login, ...config } = options; | ||
@@ -108,0 +108,0 @@ const authorizeUrlOptions = { |
@@ -1,2 +0,2 @@ | ||
import { Tokens } from '../shared/interfaces'; | ||
import type { Tokens } from '../shared/interfaces'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Provides access to the token storage API. |
@@ -1,2 +0,2 @@ | ||
import { Tokens } from '../shared/interfaces'; | ||
import type { Tokens } from '../shared/interfaces'; | ||
/** @hidden */ | ||
@@ -10,2 +10,2 @@ interface TokenDbEventTarget extends EventTarget { | ||
} | ||
export { TokenDbEvent, TokenDbEventTarget }; | ||
export type { TokenDbEvent, TokenDbEventTarget }; |
@@ -1,2 +0,2 @@ | ||
import { Tokens } from '../shared/interfaces'; | ||
import type { Tokens } from '../shared/interfaces'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Provides wrapper for tokens with localStorage. |
@@ -1,2 +0,2 @@ | ||
import { Tokens } from '../shared/interfaces'; | ||
import type { Tokens } from '../shared/interfaces'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Provides wrapper for tokens with sessionStorage. |
@@ -1,2 +0,2 @@ | ||
import { ConfigOptions } from '../config/interfaces'; | ||
import type { ConfigOptions } from '../config/interfaces'; | ||
/** | ||
@@ -3,0 +3,0 @@ * Provides access to the current user's profile. |
@@ -1,3 +0,3 @@ | ||
import { RequestMiddleware, RequestObj } from '../config/interfaces'; | ||
import { ActionTypes } from '../config/enums'; | ||
import type { RequestMiddleware, RequestObj } from '../config/interfaces'; | ||
import type { ActionTypes } from '../config/enums'; | ||
/** | ||
@@ -4,0 +4,0 @@ * @function middlewareWrapper - A "Node" and "Redux" style middleware that is called just before |
@@ -1,3 +0,3 @@ | ||
import { ConfigurablePaths, CustomPathConfig } from '../config/interfaces'; | ||
import { StringDict } from '../shared/interfaces'; | ||
import type { ConfigurablePaths, CustomPathConfig } from '../config/interfaces'; | ||
import type { StringDict } from '../shared/interfaces'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Returns the base URL including protocol, hostname and any non-standard port. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
401153
11111
1