@forgerock/login-widget 1.1.0 → 1.2.0-beta.2
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/CHANGELOG.md +21 -0
- package/index.cjs +2735 -8809
- package/index.cjs.map +1 -1
- package/index.d.ts +23 -65
- package/index.js +2735 -8809
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +23 -65
- package/widget.css +165 -163
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -1,44 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An event-handling function.
|
|
3
|
-
*/
|
|
4
|
-
declare type Listener = (e: FREvent) => void;
|
|
5
|
-
interface FREvent {
|
|
6
|
-
type: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Event dispatcher for subscribing and publishing categorized events.
|
|
11
|
-
*/
|
|
12
|
-
declare class Dispatcher {
|
|
13
|
-
private callbacks;
|
|
14
|
-
/**
|
|
15
|
-
* Subscribes to an event type.
|
|
16
|
-
*
|
|
17
|
-
* @param type The event type
|
|
18
|
-
* @param listener The function to subscribe to events of this type
|
|
19
|
-
*/
|
|
20
|
-
addEventListener(type: string, listener: Listener): void;
|
|
21
|
-
/**
|
|
22
|
-
* Unsubscribes from an event type.
|
|
23
|
-
*
|
|
24
|
-
* @param type The event type
|
|
25
|
-
* @param listener The function to unsubscribe from events of this type
|
|
26
|
-
*/
|
|
27
|
-
removeEventListener(type: string, listener: Listener): void;
|
|
28
|
-
/**
|
|
29
|
-
* Unsubscribes all listener functions to a single event type or all event types.
|
|
30
|
-
*
|
|
31
|
-
* @param type The event type, or all event types if not specified
|
|
32
|
-
*/
|
|
33
|
-
clearEventListeners(type?: string): void;
|
|
34
|
-
/**
|
|
35
|
-
* Publishes an event.
|
|
36
|
-
*
|
|
37
|
-
* @param event The event object to publish
|
|
38
|
-
*/
|
|
39
|
-
dispatchEvent<T extends FREvent>(event: T): void;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
1
|
declare enum ActionTypes {
|
|
43
2
|
Authenticate = "AUTHENTICATE",
|
|
44
3
|
Authorize = "AUTHORIZE",
|
|
@@ -52,16 +11,6 @@ declare enum ActionTypes {
|
|
|
52
11
|
UserInfo = "USER_INFO"
|
|
53
12
|
}
|
|
54
13
|
|
|
55
|
-
interface StringDict<T> {
|
|
56
|
-
[name: string]: T;
|
|
57
|
-
}
|
|
58
|
-
interface Tokens {
|
|
59
|
-
accessToken: string;
|
|
60
|
-
idToken?: string;
|
|
61
|
-
refreshToken?: string;
|
|
62
|
-
tokenExpiry?: number;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
14
|
/**
|
|
66
15
|
* Types of callbacks directly supported by the SDK.
|
|
67
16
|
*/
|
|
@@ -89,6 +38,16 @@ declare enum CallbackType {
|
|
|
89
38
|
ValidatedCreateUsernameCallback = "ValidatedCreateUsernameCallback"
|
|
90
39
|
}
|
|
91
40
|
|
|
41
|
+
interface StringDict<T> {
|
|
42
|
+
[name: string]: T;
|
|
43
|
+
}
|
|
44
|
+
interface Tokens {
|
|
45
|
+
accessToken: string;
|
|
46
|
+
idToken?: string;
|
|
47
|
+
refreshToken?: string;
|
|
48
|
+
tokenExpiry?: number;
|
|
49
|
+
}
|
|
50
|
+
|
|
92
51
|
/**
|
|
93
52
|
* Represents the authentication tree API payload schema.
|
|
94
53
|
*/
|
|
@@ -176,7 +135,7 @@ declare class FRCallback {
|
|
|
176
135
|
/**
|
|
177
136
|
* Gets the name of this callback type.
|
|
178
137
|
*/
|
|
179
|
-
getType():
|
|
138
|
+
getType(): CallbackType;
|
|
180
139
|
/**
|
|
181
140
|
* Gets the value of the specified input element, or the first element if `selector` is not
|
|
182
141
|
* provided.
|
|
@@ -208,7 +167,7 @@ declare class FRCallback {
|
|
|
208
167
|
private getArrayElement;
|
|
209
168
|
}
|
|
210
169
|
|
|
211
|
-
|
|
170
|
+
type FRCallbackFactory = (callback: Callback) => FRCallback;
|
|
212
171
|
|
|
213
172
|
interface Action {
|
|
214
173
|
type: ActionTypes;
|
|
@@ -225,8 +184,7 @@ interface ConfigOptions$1 {
|
|
|
225
184
|
redirectUri?: string;
|
|
226
185
|
scope?: string;
|
|
227
186
|
serverConfig?: ServerConfig;
|
|
228
|
-
|
|
229
|
-
tokenStore?: TokenStoreObject | 'indexedDB' | 'sessionStorage' | 'localStorage';
|
|
187
|
+
tokenStore?: TokenStoreObject | 'sessionStorage' | 'localStorage';
|
|
230
188
|
tree?: string;
|
|
231
189
|
type?: string;
|
|
232
190
|
oauthThreshold?: number;
|
|
@@ -243,7 +201,7 @@ interface CustomPathConfig {
|
|
|
243
201
|
revoke?: string;
|
|
244
202
|
sessions?: string;
|
|
245
203
|
}
|
|
246
|
-
|
|
204
|
+
type RequestMiddleware = (req: RequestObj, action: Action, next: () => RequestObj) => void;
|
|
247
205
|
interface RequestObj {
|
|
248
206
|
url: URL;
|
|
249
207
|
init: RequestInit;
|
|
@@ -254,7 +212,7 @@ interface RequestObj {
|
|
|
254
212
|
interface ServerConfig {
|
|
255
213
|
baseUrl: string;
|
|
256
214
|
paths?: CustomPathConfig;
|
|
257
|
-
timeout
|
|
215
|
+
timeout?: number;
|
|
258
216
|
}
|
|
259
217
|
/**
|
|
260
218
|
* API for implementing a custom token store
|
|
@@ -359,7 +317,7 @@ interface HttpClientRequestOptions {
|
|
|
359
317
|
/**
|
|
360
318
|
* A function that determines whether a new token is required based on a HTTP response.
|
|
361
319
|
*/
|
|
362
|
-
|
|
320
|
+
type RequiresNewTokenFn = (res: Response) => boolean;
|
|
363
321
|
|
|
364
322
|
/**
|
|
365
323
|
* HTTP client that includes bearer token injection and refresh.
|
|
@@ -383,7 +341,7 @@ declare type RequiresNewTokenFn = (res: Response) => boolean;
|
|
|
383
341
|
* });
|
|
384
342
|
* ```
|
|
385
343
|
*/
|
|
386
|
-
declare abstract class HttpClient
|
|
344
|
+
declare abstract class HttpClient {
|
|
387
345
|
/**
|
|
388
346
|
* Makes a request using the specified options.
|
|
389
347
|
*
|
|
@@ -447,7 +405,7 @@ declare class SvelteComponent {
|
|
|
447
405
|
|
|
448
406
|
declare type Props = Record<string, any>;
|
|
449
407
|
interface ComponentConstructorOptions<Props extends Record<string, any> = Record<string, any>> {
|
|
450
|
-
target: Element | ShadowRoot;
|
|
408
|
+
target: Element | Document | ShadowRoot;
|
|
451
409
|
anchor?: Element;
|
|
452
410
|
props?: Props;
|
|
453
411
|
context?: Map<any, any>;
|
|
@@ -1819,7 +1777,7 @@ declare const partialConfigSchema: ZodObject<{
|
|
|
1819
1777
|
refreshToken?: string | undefined;
|
|
1820
1778
|
tokenExpiry?: number | undefined;
|
|
1821
1779
|
}>;
|
|
1822
|
-
}>, ZodLiteral<"
|
|
1780
|
+
}>, ZodLiteral<"sessionStorage">, ZodLiteral<"localStorage">]>>>;
|
|
1823
1781
|
tree: ZodOptional<ZodOptional<ZodString>>;
|
|
1824
1782
|
type: ZodOptional<ZodOptional<ZodString>>;
|
|
1825
1783
|
oauthThreshold: ZodOptional<ZodOptional<ZodNumber>>;
|
|
@@ -1854,8 +1812,8 @@ declare const partialConfigSchema: ZodObject<{
|
|
|
1854
1812
|
sessions: string;
|
|
1855
1813
|
} | undefined;
|
|
1856
1814
|
} | undefined;
|
|
1857
|
-
support?: "
|
|
1858
|
-
tokenStore?: "localStorage" | "
|
|
1815
|
+
support?: "legacy" | "modern" | undefined;
|
|
1816
|
+
tokenStore?: "localStorage" | "sessionStorage" | {
|
|
1859
1817
|
set: (args_0: string, ...args_1: unknown[]) => Promise<void>;
|
|
1860
1818
|
remove: (args_0: string, ...args_1: unknown[]) => Promise<void>;
|
|
1861
1819
|
get: (args_0: string, ...args_1: unknown[]) => Promise<{
|
|
@@ -1899,8 +1857,8 @@ declare const partialConfigSchema: ZodObject<{
|
|
|
1899
1857
|
sessions: string;
|
|
1900
1858
|
} | undefined;
|
|
1901
1859
|
} | undefined;
|
|
1902
|
-
support?: "
|
|
1903
|
-
tokenStore?: "localStorage" | "
|
|
1860
|
+
support?: "legacy" | "modern" | undefined;
|
|
1861
|
+
tokenStore?: "localStorage" | "sessionStorage" | {
|
|
1904
1862
|
set: (args_0: string, ...args_1: unknown[]) => Promise<void>;
|
|
1905
1863
|
remove: (args_0: string, ...args_1: unknown[]) => Promise<void>;
|
|
1906
1864
|
get: (args_0: string, ...args_1: unknown[]) => Promise<{
|