@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.
- package/LICENSE +21 -0
- package/README.md +517 -0
- package/dist/core/component.store.d.ts +40 -0
- package/dist/core/interfaces.d.ts +12 -0
- package/dist/core/journey/config.store.d.ts +114 -0
- package/dist/core/journey/journey.interfaces.d.ts +83 -0
- package/dist/core/links.store.d.ts +34 -0
- package/dist/core/locale.store.d.ts +966 -0
- package/dist/core/oauth/oauth.store.d.ts +38 -0
- package/dist/core/sdk.config.d.ts +257 -0
- package/dist/core/style.store.d.ts +184 -0
- package/dist/core/user/user.store.d.ts +37 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +11726 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces.d.ts +61 -0
- package/dist/types.d.ts +79 -0
- package/dist/widget.css +1 -0
- package/dist/widget.iife.js +32 -0
- package/dist/widget.iife.js.map +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1,38 @@
|
|
|
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 GetTokensOptions, type OAuth2Tokens } from '@forgerock/javascript-sdk';
|
|
10
|
+
import { type Writable } from 'svelte/store';
|
|
11
|
+
import type { Maybe } from '../interfaces';
|
|
12
|
+
export interface OAuthStore extends Pick<Writable<OAuthTokenStoreValue>, 'subscribe'> {
|
|
13
|
+
get: (getOptions?: GetTokensOptions) => void;
|
|
14
|
+
reset: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface OAuthTokenStoreValue {
|
|
17
|
+
completed: boolean;
|
|
18
|
+
error: Maybe<{
|
|
19
|
+
code?: Maybe<number>;
|
|
20
|
+
message: Maybe<string>;
|
|
21
|
+
troubleshoot: Maybe<string>;
|
|
22
|
+
}>;
|
|
23
|
+
loading: boolean;
|
|
24
|
+
successful: boolean;
|
|
25
|
+
response: Maybe<OAuth2Tokens> | void;
|
|
26
|
+
}
|
|
27
|
+
export declare const oauthStore: Writable<OAuthTokenStoreValue>;
|
|
28
|
+
/**
|
|
29
|
+
* @function initialize - Initializes the OAuth store with a get function and a reset function
|
|
30
|
+
* @param {object} initOptions - The options to pass to the TokenManager.getTokens function
|
|
31
|
+
* @returns {object} - The OAuth store
|
|
32
|
+
* @example initialize({ query: { prompt: 'none' } });
|
|
33
|
+
*/
|
|
34
|
+
export declare function initialize(initOptions?: GetTokensOptions): {
|
|
35
|
+
get: (getOptions?: GetTokensOptions) => Promise<void>;
|
|
36
|
+
reset: () => void;
|
|
37
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<OAuthTokenStoreValue>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
|
|
38
|
+
};
|
|
@@ -0,0 +1,257 @@
|
|
|
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 { CallbackType, FRCallback } from '@forgerock/javascript-sdk';
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
export declare const partialConfigSchema: z.ZodObject<{
|
|
12
|
+
callbackFactory: z.ZodOptional<z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
13
|
+
_id: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
input: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
value: z.ZodUnknown;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
name: string;
|
|
19
|
+
value?: unknown;
|
|
20
|
+
}, {
|
|
21
|
+
name: string;
|
|
22
|
+
value?: unknown;
|
|
23
|
+
}>, "many">>;
|
|
24
|
+
output: z.ZodArray<z.ZodObject<{
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
value: z.ZodUnknown;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
name: string;
|
|
29
|
+
value?: unknown;
|
|
30
|
+
}, {
|
|
31
|
+
name: string;
|
|
32
|
+
value?: unknown;
|
|
33
|
+
}>, "many">;
|
|
34
|
+
type: z.ZodNativeEnum<typeof CallbackType>;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
type: CallbackType;
|
|
37
|
+
output: {
|
|
38
|
+
name: string;
|
|
39
|
+
value?: unknown;
|
|
40
|
+
}[];
|
|
41
|
+
_id?: number | undefined;
|
|
42
|
+
input?: {
|
|
43
|
+
name: string;
|
|
44
|
+
value?: unknown;
|
|
45
|
+
}[] | undefined;
|
|
46
|
+
}, {
|
|
47
|
+
type: CallbackType;
|
|
48
|
+
output: {
|
|
49
|
+
name: string;
|
|
50
|
+
value?: unknown;
|
|
51
|
+
}[];
|
|
52
|
+
_id?: number | undefined;
|
|
53
|
+
input?: {
|
|
54
|
+
name: string;
|
|
55
|
+
value?: unknown;
|
|
56
|
+
}[] | undefined;
|
|
57
|
+
}>], z.ZodUnknown>, z.ZodType<FRCallback, z.ZodTypeDef, FRCallback>>>>;
|
|
58
|
+
clientId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
59
|
+
logLevel: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"none">, z.ZodLiteral<"error">, z.ZodLiteral<"warn">, z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>>>;
|
|
60
|
+
middleware: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnknown>, "many">>>;
|
|
61
|
+
realmPath: z.ZodOptional<z.ZodString>;
|
|
62
|
+
redirectUri: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
63
|
+
scope: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
64
|
+
serverConfig: z.ZodOptional<z.ZodObject<{
|
|
65
|
+
baseUrl: z.ZodString;
|
|
66
|
+
paths: z.ZodOptional<z.ZodObject<{
|
|
67
|
+
authenticate: z.ZodOptional<z.ZodString>;
|
|
68
|
+
authorize: z.ZodOptional<z.ZodString>;
|
|
69
|
+
accessToken: z.ZodOptional<z.ZodString>;
|
|
70
|
+
endSession: z.ZodOptional<z.ZodString>;
|
|
71
|
+
userInfo: z.ZodOptional<z.ZodString>;
|
|
72
|
+
revoke: z.ZodOptional<z.ZodString>;
|
|
73
|
+
sessions: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, "strict", z.ZodTypeAny, {
|
|
75
|
+
authenticate?: string | undefined;
|
|
76
|
+
authorize?: string | undefined;
|
|
77
|
+
accessToken?: string | undefined;
|
|
78
|
+
endSession?: string | undefined;
|
|
79
|
+
userInfo?: string | undefined;
|
|
80
|
+
revoke?: string | undefined;
|
|
81
|
+
sessions?: string | undefined;
|
|
82
|
+
}, {
|
|
83
|
+
authenticate?: string | undefined;
|
|
84
|
+
authorize?: string | undefined;
|
|
85
|
+
accessToken?: string | undefined;
|
|
86
|
+
endSession?: string | undefined;
|
|
87
|
+
userInfo?: string | undefined;
|
|
88
|
+
revoke?: string | undefined;
|
|
89
|
+
sessions?: string | undefined;
|
|
90
|
+
}>>;
|
|
91
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
}, "strict", z.ZodTypeAny, {
|
|
93
|
+
baseUrl: string;
|
|
94
|
+
paths?: {
|
|
95
|
+
authenticate?: string | undefined;
|
|
96
|
+
authorize?: string | undefined;
|
|
97
|
+
accessToken?: string | undefined;
|
|
98
|
+
endSession?: string | undefined;
|
|
99
|
+
userInfo?: string | undefined;
|
|
100
|
+
revoke?: string | undefined;
|
|
101
|
+
sessions?: string | undefined;
|
|
102
|
+
} | undefined;
|
|
103
|
+
timeout?: number | undefined;
|
|
104
|
+
}, {
|
|
105
|
+
baseUrl: string;
|
|
106
|
+
paths?: {
|
|
107
|
+
authenticate?: string | undefined;
|
|
108
|
+
authorize?: string | undefined;
|
|
109
|
+
accessToken?: string | undefined;
|
|
110
|
+
endSession?: string | undefined;
|
|
111
|
+
userInfo?: string | undefined;
|
|
112
|
+
revoke?: string | undefined;
|
|
113
|
+
sessions?: string | undefined;
|
|
114
|
+
} | undefined;
|
|
115
|
+
timeout?: number | undefined;
|
|
116
|
+
}>>;
|
|
117
|
+
support: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"legacy">, z.ZodLiteral<"modern">]>>>;
|
|
118
|
+
tokenStore: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
119
|
+
get: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodObject<{
|
|
120
|
+
accessToken: z.ZodString;
|
|
121
|
+
idToken: z.ZodOptional<z.ZodString>;
|
|
122
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
123
|
+
tokenExpiry: z.ZodOptional<z.ZodNumber>;
|
|
124
|
+
}, "strip", z.ZodTypeAny, {
|
|
125
|
+
accessToken: string;
|
|
126
|
+
idToken?: string | undefined;
|
|
127
|
+
refreshToken?: string | undefined;
|
|
128
|
+
tokenExpiry?: number | undefined;
|
|
129
|
+
}, {
|
|
130
|
+
accessToken: string;
|
|
131
|
+
idToken?: string | undefined;
|
|
132
|
+
refreshToken?: string | undefined;
|
|
133
|
+
tokenExpiry?: number | undefined;
|
|
134
|
+
}>>>;
|
|
135
|
+
set: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
|
|
136
|
+
remove: z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodPromise<z.ZodVoid>>;
|
|
137
|
+
}, "strict", z.ZodTypeAny, {
|
|
138
|
+
set: (args_0: string, ...args: unknown[]) => Promise<void>;
|
|
139
|
+
get: (args_0: string, ...args: unknown[]) => Promise<{
|
|
140
|
+
accessToken: string;
|
|
141
|
+
idToken?: string | undefined;
|
|
142
|
+
refreshToken?: string | undefined;
|
|
143
|
+
tokenExpiry?: number | undefined;
|
|
144
|
+
}>;
|
|
145
|
+
remove: (args_0: string, ...args: unknown[]) => Promise<void>;
|
|
146
|
+
}, {
|
|
147
|
+
set: (args_0: string, ...args: unknown[]) => Promise<void>;
|
|
148
|
+
get: (args_0: string, ...args: unknown[]) => Promise<{
|
|
149
|
+
accessToken: string;
|
|
150
|
+
idToken?: string | undefined;
|
|
151
|
+
refreshToken?: string | undefined;
|
|
152
|
+
tokenExpiry?: number | undefined;
|
|
153
|
+
}>;
|
|
154
|
+
remove: (args_0: string, ...args: unknown[]) => Promise<void>;
|
|
155
|
+
}>, z.ZodLiteral<"sessionStorage">, z.ZodLiteral<"localStorage">]>>>;
|
|
156
|
+
tree: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
157
|
+
type: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
158
|
+
oauthThreshold: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
159
|
+
}, "strict", z.ZodTypeAny, {
|
|
160
|
+
callbackFactory?: ((args_0: {
|
|
161
|
+
type: CallbackType;
|
|
162
|
+
output: {
|
|
163
|
+
name: string;
|
|
164
|
+
value?: unknown;
|
|
165
|
+
}[];
|
|
166
|
+
_id?: number | undefined;
|
|
167
|
+
input?: {
|
|
168
|
+
name: string;
|
|
169
|
+
value?: unknown;
|
|
170
|
+
}[] | undefined;
|
|
171
|
+
}, ...args: unknown[]) => FRCallback) | undefined;
|
|
172
|
+
clientId?: string | undefined;
|
|
173
|
+
logLevel?: "error" | "none" | "warn" | "info" | "debug" | undefined;
|
|
174
|
+
middleware?: ((...args: unknown[]) => unknown)[] | undefined;
|
|
175
|
+
realmPath?: string | undefined;
|
|
176
|
+
redirectUri?: string | undefined;
|
|
177
|
+
scope?: string | undefined;
|
|
178
|
+
serverConfig?: {
|
|
179
|
+
baseUrl: string;
|
|
180
|
+
paths?: {
|
|
181
|
+
authenticate?: string | undefined;
|
|
182
|
+
authorize?: string | undefined;
|
|
183
|
+
accessToken?: string | undefined;
|
|
184
|
+
endSession?: string | undefined;
|
|
185
|
+
userInfo?: string | undefined;
|
|
186
|
+
revoke?: string | undefined;
|
|
187
|
+
sessions?: string | undefined;
|
|
188
|
+
} | undefined;
|
|
189
|
+
timeout?: number | undefined;
|
|
190
|
+
} | undefined;
|
|
191
|
+
support?: "legacy" | "modern" | undefined;
|
|
192
|
+
tokenStore?: {
|
|
193
|
+
set: (args_0: string, ...args: unknown[]) => Promise<void>;
|
|
194
|
+
get: (args_0: string, ...args: unknown[]) => Promise<{
|
|
195
|
+
accessToken: string;
|
|
196
|
+
idToken?: string | undefined;
|
|
197
|
+
refreshToken?: string | undefined;
|
|
198
|
+
tokenExpiry?: number | undefined;
|
|
199
|
+
}>;
|
|
200
|
+
remove: (args_0: string, ...args: unknown[]) => Promise<void>;
|
|
201
|
+
} | "sessionStorage" | "localStorage" | undefined;
|
|
202
|
+
tree?: string | undefined;
|
|
203
|
+
type?: string | undefined;
|
|
204
|
+
oauthThreshold?: number | undefined;
|
|
205
|
+
}, {
|
|
206
|
+
callbackFactory?: ((args_0: {
|
|
207
|
+
type: CallbackType;
|
|
208
|
+
output: {
|
|
209
|
+
name: string;
|
|
210
|
+
value?: unknown;
|
|
211
|
+
}[];
|
|
212
|
+
_id?: number | undefined;
|
|
213
|
+
input?: {
|
|
214
|
+
name: string;
|
|
215
|
+
value?: unknown;
|
|
216
|
+
}[] | undefined;
|
|
217
|
+
}, ...args: unknown[]) => FRCallback) | undefined;
|
|
218
|
+
clientId?: string | undefined;
|
|
219
|
+
logLevel?: "error" | "none" | "warn" | "info" | "debug" | undefined;
|
|
220
|
+
middleware?: ((...args: unknown[]) => unknown)[] | undefined;
|
|
221
|
+
realmPath?: string | undefined;
|
|
222
|
+
redirectUri?: string | undefined;
|
|
223
|
+
scope?: string | undefined;
|
|
224
|
+
serverConfig?: {
|
|
225
|
+
baseUrl: string;
|
|
226
|
+
paths?: {
|
|
227
|
+
authenticate?: string | undefined;
|
|
228
|
+
authorize?: string | undefined;
|
|
229
|
+
accessToken?: string | undefined;
|
|
230
|
+
endSession?: string | undefined;
|
|
231
|
+
userInfo?: string | undefined;
|
|
232
|
+
revoke?: string | undefined;
|
|
233
|
+
sessions?: string | undefined;
|
|
234
|
+
} | undefined;
|
|
235
|
+
timeout?: number | undefined;
|
|
236
|
+
} | undefined;
|
|
237
|
+
support?: "legacy" | "modern" | undefined;
|
|
238
|
+
tokenStore?: {
|
|
239
|
+
set: (args_0: string, ...args: unknown[]) => Promise<void>;
|
|
240
|
+
get: (args_0: string, ...args: unknown[]) => Promise<{
|
|
241
|
+
accessToken: string;
|
|
242
|
+
idToken?: string | undefined;
|
|
243
|
+
refreshToken?: string | undefined;
|
|
244
|
+
tokenExpiry?: number | undefined;
|
|
245
|
+
}>;
|
|
246
|
+
remove: (args_0: string, ...args: unknown[]) => Promise<void>;
|
|
247
|
+
} | "sessionStorage" | "localStorage" | undefined;
|
|
248
|
+
tree?: string | undefined;
|
|
249
|
+
type?: string | undefined;
|
|
250
|
+
oauthThreshold?: number | undefined;
|
|
251
|
+
}>;
|
|
252
|
+
/**
|
|
253
|
+
* @function - Sets the configuration for the SDK
|
|
254
|
+
* @param {object} config - The configuration object
|
|
255
|
+
* @returns {void}
|
|
256
|
+
*/
|
|
257
|
+
export default function (config: z.infer<typeof partialConfigSchema>): void;
|
|
@@ -0,0 +1,184 @@
|
|
|
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 logoSchema: z.ZodObject<{
|
|
12
|
+
dark: z.ZodOptional<z.ZodString>;
|
|
13
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
light: z.ZodOptional<z.ZodString>;
|
|
15
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
}, "strict", z.ZodTypeAny, {
|
|
17
|
+
dark?: string | undefined;
|
|
18
|
+
height?: number | undefined;
|
|
19
|
+
light?: string | undefined;
|
|
20
|
+
width?: number | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
dark?: string | undefined;
|
|
23
|
+
height?: number | undefined;
|
|
24
|
+
light?: string | undefined;
|
|
25
|
+
width?: number | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const styleSchema: z.ZodObject<{
|
|
28
|
+
checksAndRadios: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"animated">, z.ZodLiteral<"standard">]>>;
|
|
29
|
+
labels: z.ZodOptional<z.ZodUnion<[z.ZodOptional<z.ZodLiteral<"floating">>, z.ZodLiteral<"stacked">]>>;
|
|
30
|
+
showPassword: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"none">, z.ZodLiteral<"button">, z.ZodLiteral<"checkbox">]>>;
|
|
31
|
+
logo: z.ZodOptional<z.ZodObject<{
|
|
32
|
+
dark: z.ZodOptional<z.ZodString>;
|
|
33
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
light: z.ZodOptional<z.ZodString>;
|
|
35
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
}, "strict", z.ZodTypeAny, {
|
|
37
|
+
dark?: string | undefined;
|
|
38
|
+
height?: number | undefined;
|
|
39
|
+
light?: string | undefined;
|
|
40
|
+
width?: number | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
dark?: string | undefined;
|
|
43
|
+
height?: number | undefined;
|
|
44
|
+
light?: string | undefined;
|
|
45
|
+
width?: number | undefined;
|
|
46
|
+
}>>;
|
|
47
|
+
sections: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
header: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
}, "strict", z.ZodTypeAny, {
|
|
50
|
+
header?: boolean | undefined;
|
|
51
|
+
}, {
|
|
52
|
+
header?: boolean | undefined;
|
|
53
|
+
}>>;
|
|
54
|
+
stage: z.ZodOptional<z.ZodObject<{
|
|
55
|
+
icon: z.ZodOptional<z.ZodBoolean>;
|
|
56
|
+
}, "strict", z.ZodTypeAny, {
|
|
57
|
+
icon?: boolean | undefined;
|
|
58
|
+
}, {
|
|
59
|
+
icon?: boolean | undefined;
|
|
60
|
+
}>>;
|
|
61
|
+
}, "strict", z.ZodTypeAny, {
|
|
62
|
+
checksAndRadios?: "animated" | "standard" | undefined;
|
|
63
|
+
labels?: "floating" | "stacked" | undefined;
|
|
64
|
+
showPassword?: "none" | "button" | "checkbox" | undefined;
|
|
65
|
+
logo?: {
|
|
66
|
+
dark?: string | undefined;
|
|
67
|
+
height?: number | undefined;
|
|
68
|
+
light?: string | undefined;
|
|
69
|
+
width?: number | undefined;
|
|
70
|
+
} | undefined;
|
|
71
|
+
sections?: {
|
|
72
|
+
header?: boolean | undefined;
|
|
73
|
+
} | undefined;
|
|
74
|
+
stage?: {
|
|
75
|
+
icon?: boolean | undefined;
|
|
76
|
+
} | undefined;
|
|
77
|
+
}, {
|
|
78
|
+
checksAndRadios?: "animated" | "standard" | undefined;
|
|
79
|
+
labels?: "floating" | "stacked" | undefined;
|
|
80
|
+
showPassword?: "none" | "button" | "checkbox" | undefined;
|
|
81
|
+
logo?: {
|
|
82
|
+
dark?: string | undefined;
|
|
83
|
+
height?: number | undefined;
|
|
84
|
+
light?: string | undefined;
|
|
85
|
+
width?: number | undefined;
|
|
86
|
+
} | undefined;
|
|
87
|
+
sections?: {
|
|
88
|
+
header?: boolean | undefined;
|
|
89
|
+
} | undefined;
|
|
90
|
+
stage?: {
|
|
91
|
+
icon?: boolean | undefined;
|
|
92
|
+
} | undefined;
|
|
93
|
+
}>;
|
|
94
|
+
export declare const partialStyleSchema: z.ZodObject<{
|
|
95
|
+
checksAndRadios: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"animated">, z.ZodLiteral<"standard">]>>>;
|
|
96
|
+
labels: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodOptional<z.ZodLiteral<"floating">>, z.ZodLiteral<"stacked">]>>>;
|
|
97
|
+
showPassword: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"none">, z.ZodLiteral<"button">, z.ZodLiteral<"checkbox">]>>>;
|
|
98
|
+
logo: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
99
|
+
dark: z.ZodOptional<z.ZodString>;
|
|
100
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
light: z.ZodOptional<z.ZodString>;
|
|
102
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
}, "strict", z.ZodTypeAny, {
|
|
104
|
+
dark?: string | undefined;
|
|
105
|
+
height?: number | undefined;
|
|
106
|
+
light?: string | undefined;
|
|
107
|
+
width?: number | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
dark?: string | undefined;
|
|
110
|
+
height?: number | undefined;
|
|
111
|
+
light?: string | undefined;
|
|
112
|
+
width?: number | undefined;
|
|
113
|
+
}>>>;
|
|
114
|
+
sections: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
115
|
+
header: z.ZodOptional<z.ZodBoolean>;
|
|
116
|
+
}, "strict", z.ZodTypeAny, {
|
|
117
|
+
header?: boolean | undefined;
|
|
118
|
+
}, {
|
|
119
|
+
header?: boolean | undefined;
|
|
120
|
+
}>>>;
|
|
121
|
+
stage: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
122
|
+
icon: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
}, "strict", z.ZodTypeAny, {
|
|
124
|
+
icon?: boolean | undefined;
|
|
125
|
+
}, {
|
|
126
|
+
icon?: boolean | undefined;
|
|
127
|
+
}>>>;
|
|
128
|
+
}, "strict", z.ZodTypeAny, {
|
|
129
|
+
checksAndRadios?: "animated" | "standard" | undefined;
|
|
130
|
+
labels?: "floating" | "stacked" | undefined;
|
|
131
|
+
showPassword?: "none" | "button" | "checkbox" | undefined;
|
|
132
|
+
logo?: {
|
|
133
|
+
dark?: string | undefined;
|
|
134
|
+
height?: number | undefined;
|
|
135
|
+
light?: string | undefined;
|
|
136
|
+
width?: number | undefined;
|
|
137
|
+
} | undefined;
|
|
138
|
+
sections?: {
|
|
139
|
+
header?: boolean | undefined;
|
|
140
|
+
} | undefined;
|
|
141
|
+
stage?: {
|
|
142
|
+
icon?: boolean | undefined;
|
|
143
|
+
} | undefined;
|
|
144
|
+
}, {
|
|
145
|
+
checksAndRadios?: "animated" | "standard" | undefined;
|
|
146
|
+
labels?: "floating" | "stacked" | undefined;
|
|
147
|
+
showPassword?: "none" | "button" | "checkbox" | undefined;
|
|
148
|
+
logo?: {
|
|
149
|
+
dark?: string | undefined;
|
|
150
|
+
height?: number | undefined;
|
|
151
|
+
light?: string | undefined;
|
|
152
|
+
width?: number | undefined;
|
|
153
|
+
} | undefined;
|
|
154
|
+
sections?: {
|
|
155
|
+
header?: boolean | undefined;
|
|
156
|
+
} | undefined;
|
|
157
|
+
stage?: {
|
|
158
|
+
icon?: boolean | undefined;
|
|
159
|
+
} | undefined;
|
|
160
|
+
}>;
|
|
161
|
+
export declare const styleStore: Writable<z.infer<typeof partialStyleSchema>>;
|
|
162
|
+
/**
|
|
163
|
+
* @function initialize - Initialize the style store
|
|
164
|
+
* @param {object} customStyle - An object of custom styles to merge with the default
|
|
165
|
+
* @returns {object} - The style store
|
|
166
|
+
* @example initialize({ checksAndRadios: 'standard' });
|
|
167
|
+
*/
|
|
168
|
+
export declare function initialize(customStyle?: z.infer<typeof partialStyleSchema>): Writable<{
|
|
169
|
+
checksAndRadios?: "animated" | "standard" | undefined;
|
|
170
|
+
labels?: "floating" | "stacked" | undefined;
|
|
171
|
+
showPassword?: "none" | "button" | "checkbox" | undefined;
|
|
172
|
+
logo?: {
|
|
173
|
+
dark?: string | undefined;
|
|
174
|
+
height?: number | undefined;
|
|
175
|
+
light?: string | undefined;
|
|
176
|
+
width?: number | undefined;
|
|
177
|
+
} | undefined;
|
|
178
|
+
sections?: {
|
|
179
|
+
header?: boolean | undefined;
|
|
180
|
+
} | undefined;
|
|
181
|
+
stage?: {
|
|
182
|
+
icon?: boolean | undefined;
|
|
183
|
+
} | undefined;
|
|
184
|
+
}>;
|
|
@@ -0,0 +1,37 @@
|
|
|
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 ConfigOptions } from '@forgerock/javascript-sdk';
|
|
10
|
+
import { type Writable } from 'svelte/store';
|
|
11
|
+
import type { Maybe } from '../interfaces';
|
|
12
|
+
export interface UserStore extends Pick<Writable<UserStoreValue>, 'subscribe'> {
|
|
13
|
+
get: (getOptions?: ConfigOptions) => void;
|
|
14
|
+
reset: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface UserStoreValue {
|
|
17
|
+
completed: boolean;
|
|
18
|
+
error: Maybe<{
|
|
19
|
+
code?: Maybe<number>;
|
|
20
|
+
message: Maybe<string>;
|
|
21
|
+
troubleshoot: Maybe<string>;
|
|
22
|
+
}>;
|
|
23
|
+
loading: boolean;
|
|
24
|
+
successful: boolean;
|
|
25
|
+
response: unknown;
|
|
26
|
+
}
|
|
27
|
+
export declare const userStore: Writable<UserStoreValue>;
|
|
28
|
+
/**
|
|
29
|
+
* @function initialize - Initializes the user store with a get function and a reset function
|
|
30
|
+
* @param {object} initOptions - The options to pass to the UserManager.getCurrentUser function
|
|
31
|
+
* @returns {object} - The user store
|
|
32
|
+
*/
|
|
33
|
+
export declare function initialize(initOptions?: ConfigOptions): {
|
|
34
|
+
get: (getOptions?: ConfigOptions) => Promise<void>;
|
|
35
|
+
reset: () => void;
|
|
36
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<UserStoreValue>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
|
|
37
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import './main.css';
|
|
3
|
+
export declare const configuration: (options?: import("./interfaces").WidgetConfigOptions) => {
|
|
4
|
+
set(setOptions?: import("./interfaces").WidgetConfigOptions): void;
|
|
5
|
+
};
|
|
6
|
+
export declare const journey: (options?: import("./interfaces").JourneyOptions) => {
|
|
7
|
+
change: (changeOptions: import("./interfaces").JourneyOptionsChange) => Promise<unknown>;
|
|
8
|
+
start: (startOptions?: import("./interfaces").JourneyOptionsStart) => Promise<unknown>;
|
|
9
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<{
|
|
10
|
+
journey: import("./core/journey/journey.interfaces").JourneyStoreValue;
|
|
11
|
+
oauth: import("./core/oauth/oauth.store").OAuthTokenStoreValue;
|
|
12
|
+
user: import("./core/user/user.store").UserStoreValue;
|
|
13
|
+
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
|
|
14
|
+
};
|
|
15
|
+
export declare const component: () => {
|
|
16
|
+
close: (args?: {
|
|
17
|
+
reason: "auto" | "external" | "user";
|
|
18
|
+
}) => void;
|
|
19
|
+
open: () => void;
|
|
20
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<Pick<import("./core/component.store").ComponentStoreValue, "error" | "open" | "lastAction" | "mounted" | "reason">>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
|
|
21
|
+
};
|
|
22
|
+
export declare const request: typeof import("@forgerock/javascript-sdk").HttpClient.request;
|
|
23
|
+
export declare const user: {
|
|
24
|
+
info(): {
|
|
25
|
+
get: (options?: import("@forgerock/javascript-sdk").ConfigOptions) => Promise<unknown>;
|
|
26
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<import("./core/user/user.store").UserStoreValue>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
|
|
27
|
+
};
|
|
28
|
+
logout(): Promise<void>;
|
|
29
|
+
tokens(): {
|
|
30
|
+
get: (options?: import("@forgerock/javascript-sdk").ConfigOptions) => Promise<unknown>;
|
|
31
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<import("./core/oauth/oauth.store").OAuthTokenStoreValue>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export declare const protect: {
|
|
35
|
+
start: typeof import("@forgerock/ping-protect").PIProtect.start;
|
|
36
|
+
getData: typeof import("@forgerock/ping-protect").PIProtect.getData;
|
|
37
|
+
pauseBehavioralData: typeof import("@forgerock/ping-protect").PIProtect.pauseBehavioralData;
|
|
38
|
+
resumeBehavioralData: typeof import("@forgerock/ping-protect").PIProtect.resumeBehavioralData;
|
|
39
|
+
};
|
|
40
|
+
declare const __propDef: {
|
|
41
|
+
props: {
|
|
42
|
+
type?: "modal" | "inline";
|
|
43
|
+
};
|
|
44
|
+
events: {
|
|
45
|
+
[evt: string]: CustomEvent<any>;
|
|
46
|
+
};
|
|
47
|
+
slots: {};
|
|
48
|
+
};
|
|
49
|
+
export type IndexProps = typeof __propDef.props;
|
|
50
|
+
export type IndexEvents = typeof __propDef.events;
|
|
51
|
+
export type IndexSlots = typeof __propDef.slots;
|
|
52
|
+
export default class Index extends SvelteComponentTyped<IndexProps, IndexEvents, IndexSlots> {
|
|
53
|
+
}
|
|
54
|
+
export {};
|