@forgerock/login-widget 0.0.0-beta-20260330171021

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,83 @@
1
+ /**
2
+ *
3
+ * Copyright © 2025 Ping Identity Corporation. All right reserved.
4
+ *
5
+ * This software may be modified and distributed under the terms
6
+ * of the MIT license. See the LICENSE file for details.
7
+ *
8
+ **/
9
+ import type { FRStep, FRLoginFailure, FRLoginSuccess, Step, StepOptions, StepDetail } from '@forgerock/javascript-sdk';
10
+ import type { Writable } from 'svelte/store';
11
+ import type { Maybe } from '../interfaces';
12
+ export interface CallbackMetadata {
13
+ derived: {
14
+ canForceUserInputOptionality: boolean;
15
+ isFirstInvalidInput: boolean;
16
+ isReadyForSubmission: boolean;
17
+ isSelfSubmitting: boolean;
18
+ isUserInputRequired: boolean;
19
+ };
20
+ idx: number;
21
+ platform?: Record<string, unknown>;
22
+ }
23
+ export interface StartOptions extends StepOptions {
24
+ recaptchaAction?: string;
25
+ }
26
+ export interface JourneyStore extends Pick<Writable<JourneyStoreValue>, 'subscribe'> {
27
+ next: (prevStep?: StepTypes, nextOptions?: StepOptions) => void;
28
+ pop: () => void;
29
+ push: (changeOptions: StepOptions) => void;
30
+ reset: () => void;
31
+ resume: (url: string, resumeOptions?: StepOptions) => void;
32
+ start: (startOptions?: StartOptions) => void;
33
+ }
34
+ export interface StageFormObject {
35
+ icon: boolean;
36
+ message: string;
37
+ status: string;
38
+ submit: () => void;
39
+ }
40
+ export interface StageJourneyObject {
41
+ loading: boolean;
42
+ pop: () => void;
43
+ push: (options: StepOptions) => void;
44
+ stack: StackStore;
45
+ }
46
+ export interface JourneyStoreValue {
47
+ completed: boolean;
48
+ error: Maybe<{
49
+ code: Maybe<number>;
50
+ message: Maybe<string>;
51
+ stage: Maybe<string>;
52
+ troubleshoot: Maybe<string>;
53
+ detail: Maybe<StepDetail>;
54
+ }>;
55
+ loading: boolean;
56
+ metadata: {
57
+ callbacks: CallbackMetadata[];
58
+ step: StepMetadata;
59
+ } | null;
60
+ step?: StepTypes;
61
+ successful: boolean;
62
+ response: Maybe<Step>;
63
+ recaptchaAction?: Maybe<string>;
64
+ }
65
+ export interface StackStore extends Pick<Writable<StepOptions[]>, 'subscribe'> {
66
+ latest: () => Promise<StepOptions>;
67
+ pop: () => Promise<StepOptions[]>;
68
+ push: (options?: StepOptions) => Promise<StepOptions[]>;
69
+ reset: () => void;
70
+ }
71
+ export interface StepMetadata {
72
+ derived: {
73
+ isUserInputOptional: boolean;
74
+ isStepSelfSubmittable: () => boolean;
75
+ numOfCallbacks: number;
76
+ numOfSelfSubmittableCbs: number;
77
+ numOfUserInputCbs: number;
78
+ stageName?: string;
79
+ };
80
+ platform?: Record<string, unknown>;
81
+ }
82
+ export type SelfSubmitFunction = () => void;
83
+ export type StepTypes = FRStep | FRLoginSuccess | FRLoginFailure | null;
@@ -0,0 +1,34 @@
1
+ /**
2
+ *
3
+ * Copyright © 2025 Ping Identity Corporation. All right reserved.
4
+ *
5
+ * This software may be modified and distributed under the terms
6
+ * of the MIT license. See the LICENSE file for details.
7
+ *
8
+ **/
9
+ import { type Writable } from 'svelte/store';
10
+ import { z } from 'zod';
11
+ export declare const linksSchema: z.ZodObject<{
12
+ termsAndConditions: z.ZodString;
13
+ }, "strict", z.ZodTypeAny, {
14
+ termsAndConditions: string;
15
+ }, {
16
+ termsAndConditions: string;
17
+ }>;
18
+ export declare const partialLinksSchema: z.ZodObject<{
19
+ termsAndConditions: z.ZodOptional<z.ZodString>;
20
+ }, "strict", z.ZodTypeAny, {
21
+ termsAndConditions?: string | undefined;
22
+ }, {
23
+ termsAndConditions?: string | undefined;
24
+ }>;
25
+ export declare const linksStore: Writable<z.infer<typeof partialLinksSchema> | undefined>;
26
+ /**
27
+ * @function initialize - Initialize the links store
28
+ * @param {object} customLinks - An object of custom links to merge with the default
29
+ * @returns {object} - The links store
30
+ * @example initialize({ termsAndConditions: 'https://example.com/terms' });
31
+ */
32
+ export declare function initialize(customLinks?: z.infer<typeof partialLinksSchema>): Writable<{
33
+ termsAndConditions?: string | undefined;
34
+ } | undefined>;