@forgerock/login-widget 1.1.0-beta.2 → 1.2.0-beta.1
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 +22 -0
- package/index.cjs +2318 -8666
- package/index.cjs.map +1 -1
- package/index.d.ts +23 -65
- package/index.js +2318 -8666
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +23 -65
- package/widget.css +165 -163
package/index.d.ts
CHANGED
|
@@ -11,16 +11,6 @@ declare enum ActionTypes {
|
|
|
11
11
|
UserInfo = "USER_INFO"
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
interface StringDict<T> {
|
|
15
|
-
[name: string]: T;
|
|
16
|
-
}
|
|
17
|
-
interface Tokens {
|
|
18
|
-
accessToken: string;
|
|
19
|
-
idToken?: string;
|
|
20
|
-
refreshToken?: string;
|
|
21
|
-
tokenExpiry?: number;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
14
|
/**
|
|
25
15
|
* Types of callbacks directly supported by the SDK.
|
|
26
16
|
*/
|
|
@@ -48,6 +38,16 @@ declare enum CallbackType {
|
|
|
48
38
|
ValidatedCreateUsernameCallback = "ValidatedCreateUsernameCallback"
|
|
49
39
|
}
|
|
50
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
|
+
|
|
51
51
|
/**
|
|
52
52
|
* Represents the authentication tree API payload schema.
|
|
53
53
|
*/
|
|
@@ -135,7 +135,7 @@ declare class FRCallback {
|
|
|
135
135
|
/**
|
|
136
136
|
* Gets the name of this callback type.
|
|
137
137
|
*/
|
|
138
|
-
getType():
|
|
138
|
+
getType(): CallbackType;
|
|
139
139
|
/**
|
|
140
140
|
* Gets the value of the specified input element, or the first element if `selector` is not
|
|
141
141
|
* provided.
|
|
@@ -167,7 +167,7 @@ declare class FRCallback {
|
|
|
167
167
|
private getArrayElement;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
type FRCallbackFactory = (callback: Callback) => FRCallback;
|
|
171
171
|
|
|
172
172
|
interface Action {
|
|
173
173
|
type: ActionTypes;
|
|
@@ -184,8 +184,7 @@ interface ConfigOptions {
|
|
|
184
184
|
redirectUri?: string;
|
|
185
185
|
scope?: string;
|
|
186
186
|
serverConfig?: ServerConfig;
|
|
187
|
-
|
|
188
|
-
tokenStore?: TokenStoreObject | 'indexedDB' | 'sessionStorage' | 'localStorage';
|
|
187
|
+
tokenStore?: TokenStoreObject | 'sessionStorage' | 'localStorage';
|
|
189
188
|
tree?: string;
|
|
190
189
|
type?: string;
|
|
191
190
|
oauthThreshold?: number;
|
|
@@ -202,7 +201,7 @@ interface CustomPathConfig {
|
|
|
202
201
|
revoke?: string;
|
|
203
202
|
sessions?: string;
|
|
204
203
|
}
|
|
205
|
-
|
|
204
|
+
type RequestMiddleware = (req: RequestObj, action: Action, next: () => RequestObj) => void;
|
|
206
205
|
interface RequestObj {
|
|
207
206
|
url: URL;
|
|
208
207
|
init: RequestInit;
|
|
@@ -213,7 +212,7 @@ interface RequestObj {
|
|
|
213
212
|
interface ServerConfig {
|
|
214
213
|
baseUrl: string;
|
|
215
214
|
paths?: CustomPathConfig;
|
|
216
|
-
timeout
|
|
215
|
+
timeout?: number;
|
|
217
216
|
}
|
|
218
217
|
/**
|
|
219
218
|
* API for implementing a custom token store
|
|
@@ -224,47 +223,6 @@ interface TokenStoreObject {
|
|
|
224
223
|
remove: (clientId: string) => Promise<void>;
|
|
225
224
|
}
|
|
226
225
|
|
|
227
|
-
/**
|
|
228
|
-
* An event-handling function.
|
|
229
|
-
*/
|
|
230
|
-
declare type Listener = (e: FREvent) => void;
|
|
231
|
-
interface FREvent {
|
|
232
|
-
type: string;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* Event dispatcher for subscribing and publishing categorized events.
|
|
237
|
-
*/
|
|
238
|
-
declare class Dispatcher {
|
|
239
|
-
private callbacks;
|
|
240
|
-
/**
|
|
241
|
-
* Subscribes to an event type.
|
|
242
|
-
*
|
|
243
|
-
* @param type The event type
|
|
244
|
-
* @param listener The function to subscribe to events of this type
|
|
245
|
-
*/
|
|
246
|
-
addEventListener(type: string, listener: Listener): void;
|
|
247
|
-
/**
|
|
248
|
-
* Unsubscribes from an event type.
|
|
249
|
-
*
|
|
250
|
-
* @param type The event type
|
|
251
|
-
* @param listener The function to unsubscribe from events of this type
|
|
252
|
-
*/
|
|
253
|
-
removeEventListener(type: string, listener: Listener): void;
|
|
254
|
-
/**
|
|
255
|
-
* Unsubscribes all listener functions to a single event type or all event types.
|
|
256
|
-
*
|
|
257
|
-
* @param type The event type, or all event types if not specified
|
|
258
|
-
*/
|
|
259
|
-
clearEventListeners(type?: string): void;
|
|
260
|
-
/**
|
|
261
|
-
* Publishes an event.
|
|
262
|
-
*
|
|
263
|
-
* @param event The event object to publish
|
|
264
|
-
*/
|
|
265
|
-
dispatchEvent<T extends FREvent>(event: T): void;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
226
|
/**
|
|
269
227
|
* Types of steps returned by the authentication tree.
|
|
270
228
|
*/
|
|
@@ -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>;
|
|
@@ -1832,7 +1790,7 @@ declare const partialConfigSchema: ZodObject<{
|
|
|
1832
1790
|
refreshToken?: string | undefined;
|
|
1833
1791
|
tokenExpiry?: number | undefined;
|
|
1834
1792
|
}>;
|
|
1835
|
-
}>, ZodLiteral<"
|
|
1793
|
+
}>, ZodLiteral<"sessionStorage">, ZodLiteral<"localStorage">]>>>;
|
|
1836
1794
|
tree: ZodOptional<ZodOptional<ZodString>>;
|
|
1837
1795
|
type: ZodOptional<ZodOptional<ZodString>>;
|
|
1838
1796
|
oauthThreshold: ZodOptional<ZodOptional<ZodNumber>>;
|
|
@@ -1867,8 +1825,8 @@ declare const partialConfigSchema: ZodObject<{
|
|
|
1867
1825
|
sessions: string;
|
|
1868
1826
|
} | undefined;
|
|
1869
1827
|
} | undefined;
|
|
1870
|
-
support?: "
|
|
1871
|
-
tokenStore?: "localStorage" | "
|
|
1828
|
+
support?: "legacy" | "modern" | undefined;
|
|
1829
|
+
tokenStore?: "localStorage" | "sessionStorage" | {
|
|
1872
1830
|
set: (args_0: string, ...args_1: unknown[]) => Promise<void>;
|
|
1873
1831
|
remove: (args_0: string, ...args_1: unknown[]) => Promise<void>;
|
|
1874
1832
|
get: (args_0: string, ...args_1: unknown[]) => Promise<{
|
|
@@ -1912,8 +1870,8 @@ declare const partialConfigSchema: ZodObject<{
|
|
|
1912
1870
|
sessions: string;
|
|
1913
1871
|
} | undefined;
|
|
1914
1872
|
} | undefined;
|
|
1915
|
-
support?: "
|
|
1916
|
-
tokenStore?: "localStorage" | "
|
|
1873
|
+
support?: "legacy" | "modern" | undefined;
|
|
1874
|
+
tokenStore?: "localStorage" | "sessionStorage" | {
|
|
1917
1875
|
set: (args_0: string, ...args_1: unknown[]) => Promise<void>;
|
|
1918
1876
|
remove: (args_0: string, ...args_1: unknown[]) => Promise<void>;
|
|
1919
1877
|
get: (args_0: string, ...args_1: unknown[]) => Promise<{
|