@forgerock/login-widget 1.0.0-beta.5 → 1.0.0-beta.7
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 +96 -87
- package/{modal.cjs → index.cjs} +1650 -1546
- package/{modal.cjs.map → index.cjs.map} +1 -1
- package/{inline.d.ts → index.d.ts} +349 -196
- package/{inline.cjs → index.js} +3029 -2225
- package/{inline.cjs.map → index.js.map} +1 -1
- package/package.json +7 -13
- package/inline.js.map +0 -1
- package/modal.d.ts +0 -2157
- package/modal.js.map +0 -1
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
interface StringDict<T> {
|
|
2
|
-
[name: string]: T;
|
|
3
|
-
}
|
|
4
|
-
interface Tokens {
|
|
5
|
-
accessToken: string;
|
|
6
|
-
idToken?: string;
|
|
7
|
-
refreshToken?: string;
|
|
8
|
-
tokenExpiry?: number;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
1
|
declare enum ActionTypes {
|
|
12
2
|
Authenticate = "AUTHENTICATE",
|
|
13
3
|
Authorize = "AUTHORIZE",
|
|
@@ -21,6 +11,16 @@ declare enum ActionTypes {
|
|
|
21
11
|
UserInfo = "USER_INFO"
|
|
22
12
|
}
|
|
23
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
24
|
/**
|
|
25
25
|
* Types of callbacks directly supported by the SDK.
|
|
26
26
|
*/
|
|
@@ -225,19 +225,44 @@ interface TokenStoreObject {
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
/**
|
|
228
|
-
*
|
|
228
|
+
* An event-handling function.
|
|
229
229
|
*/
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
refreshToken?: string;
|
|
234
|
-
tokenExpiry?: number;
|
|
230
|
+
declare type Listener = (e: FREvent) => void;
|
|
231
|
+
interface FREvent {
|
|
232
|
+
type: string;
|
|
235
233
|
}
|
|
236
234
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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;
|
|
241
266
|
}
|
|
242
267
|
|
|
243
268
|
/**
|
|
@@ -336,70 +361,38 @@ interface HttpClientRequestOptions {
|
|
|
336
361
|
*/
|
|
337
362
|
declare type RequiresNewTokenFn = (res: Response) => boolean;
|
|
338
363
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
getCode(): number;
|
|
363
|
-
/**
|
|
364
|
-
* Gets the failure details.
|
|
365
|
-
*/
|
|
366
|
-
getDetail(): FailureDetail | undefined;
|
|
367
|
-
/**
|
|
368
|
-
* Gets the failure message.
|
|
369
|
-
*/
|
|
370
|
-
getMessage(): string | undefined;
|
|
371
|
-
/**
|
|
372
|
-
* Gets processed failure message.
|
|
373
|
-
*/
|
|
374
|
-
getProcessedMessage(messageCreator?: MessageCreator): ProcessedPropertyError[];
|
|
375
|
-
/**
|
|
376
|
-
* Gets the failure reason.
|
|
377
|
-
*/
|
|
378
|
-
getReason(): string | undefined;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
declare class FRLoginSuccess implements AuthResponse {
|
|
382
|
-
payload: Step;
|
|
383
|
-
/**
|
|
384
|
-
* The type of step.
|
|
385
|
-
*/
|
|
386
|
-
readonly type = StepType.LoginSuccess;
|
|
387
|
-
/**
|
|
388
|
-
* @param payload The raw payload returned by OpenAM
|
|
389
|
-
*/
|
|
390
|
-
constructor(payload: Step);
|
|
391
|
-
/**
|
|
392
|
-
* Gets the step's realm.
|
|
393
|
-
*/
|
|
394
|
-
getRealm(): string | undefined;
|
|
395
|
-
/**
|
|
396
|
-
* Gets the step's session token.
|
|
397
|
-
*/
|
|
398
|
-
getSessionToken(): string | undefined;
|
|
364
|
+
/**
|
|
365
|
+
* HTTP client that includes bearer token injection and refresh.
|
|
366
|
+
* This module also supports authorization for policy protected endpoints.
|
|
367
|
+
*
|
|
368
|
+
* Example:
|
|
369
|
+
*
|
|
370
|
+
* ```js
|
|
371
|
+
* return forgerock.HttpClient.request({
|
|
372
|
+
* url: `https://example.com/protected/resource`,
|
|
373
|
+
* init: {
|
|
374
|
+
* method: 'GET',
|
|
375
|
+
* credentials: 'include',
|
|
376
|
+
* },
|
|
377
|
+
* authorization: {
|
|
378
|
+
* handleStep: async (step) => {
|
|
379
|
+
* step.getCallbackOfType('PasswordCallback').setPassword(pw);
|
|
380
|
+
* return Promise.resolve(step);
|
|
381
|
+
* },
|
|
382
|
+
* },
|
|
383
|
+
* });
|
|
384
|
+
* ```
|
|
385
|
+
*/
|
|
386
|
+
declare abstract class HttpClient extends Dispatcher {
|
|
399
387
|
/**
|
|
400
|
-
*
|
|
388
|
+
* Makes a request using the specified options.
|
|
389
|
+
*
|
|
390
|
+
* @param options The options to use when making the request
|
|
401
391
|
*/
|
|
402
|
-
|
|
392
|
+
static request(options: HttpClientRequestOptions): Promise<Response>;
|
|
393
|
+
private static setAuthHeaders;
|
|
394
|
+
private static stepIterator;
|
|
395
|
+
private static _request;
|
|
403
396
|
}
|
|
404
397
|
|
|
405
398
|
declare function noop(): void;
|
|
@@ -559,8 +552,151 @@ declare class SvelteComponentTyped<Props extends Record<string, any> = any, Even
|
|
|
559
552
|
constructor(options: ComponentConstructorOptions<Props>);
|
|
560
553
|
}
|
|
561
554
|
|
|
555
|
+
/** Callback to inform of a value updates. */
|
|
556
|
+
declare type Subscriber<T> = (value: T) => void;
|
|
557
|
+
/** Unsubscribes from value updates. */
|
|
558
|
+
declare type Unsubscriber = () => void;
|
|
559
|
+
/** Callback to update a value. */
|
|
560
|
+
declare type Updater<T> = (value: T) => T;
|
|
561
|
+
/** Cleanup logic callback. */
|
|
562
|
+
declare type Invalidator<T> = (value?: T) => void;
|
|
563
|
+
/** Readable interface for subscribing. */
|
|
564
|
+
interface Readable<T> {
|
|
565
|
+
/**
|
|
566
|
+
* Subscribe on value changes.
|
|
567
|
+
* @param run subscription callback
|
|
568
|
+
* @param invalidate cleanup callback
|
|
569
|
+
*/
|
|
570
|
+
subscribe(this: void, run: Subscriber<T>, invalidate?: Invalidator<T>): Unsubscriber;
|
|
571
|
+
}
|
|
572
|
+
/** Writable interface for both updating and subscribing. */
|
|
573
|
+
interface Writable<T> extends Readable<T> {
|
|
574
|
+
/**
|
|
575
|
+
* Set value and inform subscribers.
|
|
576
|
+
* @param value to set
|
|
577
|
+
*/
|
|
578
|
+
set(this: void, value: T): void;
|
|
579
|
+
/**
|
|
580
|
+
* Update value using callback and inform subscribers.
|
|
581
|
+
* @param updater callback
|
|
582
|
+
*/
|
|
583
|
+
update(this: void, updater: Updater<T>): void;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
interface MessageCreator {
|
|
587
|
+
[key: string]: (propertyName: string, params?: {
|
|
588
|
+
[key: string]: unknown;
|
|
589
|
+
}) => string;
|
|
590
|
+
}
|
|
591
|
+
interface ProcessedPropertyError {
|
|
592
|
+
detail: FailedPolicyRequirement;
|
|
593
|
+
messages: string[];
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
declare class FRLoginFailure implements AuthResponse {
|
|
597
|
+
payload: Step;
|
|
598
|
+
/**
|
|
599
|
+
* The type of step.
|
|
600
|
+
*/
|
|
601
|
+
readonly type = StepType.LoginFailure;
|
|
602
|
+
/**
|
|
603
|
+
* @param payload The raw payload returned by OpenAM
|
|
604
|
+
*/
|
|
605
|
+
constructor(payload: Step);
|
|
606
|
+
/**
|
|
607
|
+
* Gets the error code.
|
|
608
|
+
*/
|
|
609
|
+
getCode(): number;
|
|
610
|
+
/**
|
|
611
|
+
* Gets the failure details.
|
|
612
|
+
*/
|
|
613
|
+
getDetail(): FailureDetail | undefined;
|
|
614
|
+
/**
|
|
615
|
+
* Gets the failure message.
|
|
616
|
+
*/
|
|
617
|
+
getMessage(): string | undefined;
|
|
618
|
+
/**
|
|
619
|
+
* Gets processed failure message.
|
|
620
|
+
*/
|
|
621
|
+
getProcessedMessage(messageCreator?: MessageCreator): ProcessedPropertyError[];
|
|
622
|
+
/**
|
|
623
|
+
* Gets the failure reason.
|
|
624
|
+
*/
|
|
625
|
+
getReason(): string | undefined;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
declare class FRLoginSuccess implements AuthResponse {
|
|
629
|
+
payload: Step;
|
|
630
|
+
/**
|
|
631
|
+
* The type of step.
|
|
632
|
+
*/
|
|
633
|
+
readonly type = StepType.LoginSuccess;
|
|
634
|
+
/**
|
|
635
|
+
* @param payload The raw payload returned by OpenAM
|
|
636
|
+
*/
|
|
637
|
+
constructor(payload: Step);
|
|
638
|
+
/**
|
|
639
|
+
* Gets the step's realm.
|
|
640
|
+
*/
|
|
641
|
+
getRealm(): string | undefined;
|
|
642
|
+
/**
|
|
643
|
+
* Gets the step's session token.
|
|
644
|
+
*/
|
|
645
|
+
getSessionToken(): string | undefined;
|
|
646
|
+
/**
|
|
647
|
+
* Gets the step's success URL.
|
|
648
|
+
*/
|
|
649
|
+
getSuccessUrl(): string | undefined;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* Tokens returned after successful authentication.
|
|
654
|
+
*/
|
|
655
|
+
interface OAuth2Tokens {
|
|
656
|
+
accessToken: string;
|
|
657
|
+
idToken?: string;
|
|
658
|
+
refreshToken?: string;
|
|
659
|
+
tokenExpiry?: number;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
interface GetTokensOptions extends ConfigOptions {
|
|
663
|
+
forceRenew?: boolean;
|
|
664
|
+
login?: 'embedded' | 'redirect' | undefined;
|
|
665
|
+
query?: StringDict<string>;
|
|
666
|
+
}
|
|
667
|
+
|
|
562
668
|
type Maybe<T> = T | null | undefined;
|
|
563
669
|
|
|
670
|
+
interface UserStore extends Pick<Writable<UserStoreValue>, 'subscribe'> {
|
|
671
|
+
get: (getOptions?: ConfigOptions) => void;
|
|
672
|
+
reset: () => void;
|
|
673
|
+
}
|
|
674
|
+
interface UserStoreValue {
|
|
675
|
+
completed: boolean;
|
|
676
|
+
error: Maybe<{
|
|
677
|
+
code?: Maybe<number>;
|
|
678
|
+
message: Maybe<string>;
|
|
679
|
+
}>;
|
|
680
|
+
loading: boolean;
|
|
681
|
+
successful: boolean;
|
|
682
|
+
response: unknown;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
interface OAuthStore extends Pick<Writable<OAuthTokenStoreValue>, 'subscribe'> {
|
|
686
|
+
get: (getOptions?: GetTokensOptions) => void;
|
|
687
|
+
reset: () => void;
|
|
688
|
+
}
|
|
689
|
+
interface OAuthTokenStoreValue {
|
|
690
|
+
completed: boolean;
|
|
691
|
+
error: Maybe<{
|
|
692
|
+
code?: Maybe<number>;
|
|
693
|
+
message: Maybe<string>;
|
|
694
|
+
}>;
|
|
695
|
+
loading: boolean;
|
|
696
|
+
successful: boolean;
|
|
697
|
+
response: Maybe<OAuth2Tokens> | void;
|
|
698
|
+
}
|
|
699
|
+
|
|
564
700
|
interface CallbackMetadata {
|
|
565
701
|
derived: {
|
|
566
702
|
canForceUserInputOptionality: boolean;
|
|
@@ -572,6 +708,14 @@ interface CallbackMetadata {
|
|
|
572
708
|
idx: number;
|
|
573
709
|
platform?: Record<string, unknown>;
|
|
574
710
|
}
|
|
711
|
+
interface JourneyStore extends Pick<Writable<JourneyStoreValue>, 'subscribe'> {
|
|
712
|
+
next: (prevStep?: StepTypes, nextOptions?: StepOptions) => void;
|
|
713
|
+
pop: () => void;
|
|
714
|
+
push: (changeOptions: StepOptions) => void;
|
|
715
|
+
reset: () => void;
|
|
716
|
+
resume: (url: string, resumeOptions?: StepOptions) => void;
|
|
717
|
+
start: (startOptions?: StepOptions) => void;
|
|
718
|
+
}
|
|
575
719
|
interface JourneyStoreValue {
|
|
576
720
|
completed: boolean;
|
|
577
721
|
error: Maybe<{
|
|
@@ -600,42 +744,6 @@ interface StepMetadata {
|
|
|
600
744
|
}
|
|
601
745
|
type StepTypes = FRStep | FRLoginSuccess | FRLoginFailure | null;
|
|
602
746
|
|
|
603
|
-
interface OAuthTokenStoreValue {
|
|
604
|
-
completed: boolean;
|
|
605
|
-
error: Maybe<{
|
|
606
|
-
code?: Maybe<number>;
|
|
607
|
-
message: Maybe<string>;
|
|
608
|
-
}>;
|
|
609
|
-
loading: boolean;
|
|
610
|
-
successful: boolean;
|
|
611
|
-
response: Maybe<OAuth2Tokens> | void;
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
interface UserStoreValue {
|
|
615
|
-
completed: boolean;
|
|
616
|
-
error: Maybe<{
|
|
617
|
-
code?: Maybe<number>;
|
|
618
|
-
message: Maybe<string>;
|
|
619
|
-
}>;
|
|
620
|
-
loading: boolean;
|
|
621
|
-
successful: boolean;
|
|
622
|
-
response: unknown;
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
interface JourneyOptions {
|
|
626
|
-
config?: StepOptions;
|
|
627
|
-
journey?: string;
|
|
628
|
-
oauth?: boolean;
|
|
629
|
-
resumeUrl?: string;
|
|
630
|
-
user?: boolean;
|
|
631
|
-
}
|
|
632
|
-
interface Response$1 {
|
|
633
|
-
journey?: JourneyStoreValue;
|
|
634
|
-
oauth?: OAuthTokenStoreValue;
|
|
635
|
-
user?: UserStoreValue;
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
|
|
639
747
|
declare type Primitive = string | number | bigint | boolean | null | undefined;
|
|
640
748
|
|
|
641
749
|
declare namespace util {
|
|
@@ -1473,14 +1581,6 @@ declare enum ZodFirstPartyTypeKind {
|
|
|
1473
1581
|
ZodBranded = "ZodBranded"
|
|
1474
1582
|
}
|
|
1475
1583
|
|
|
1476
|
-
declare const partialLinksSchema: ZodObject<{
|
|
1477
|
-
termsAndConditions: ZodOptional<ZodString>;
|
|
1478
|
-
}, "strict", ZodTypeAny, {
|
|
1479
|
-
termsAndConditions?: string | undefined;
|
|
1480
|
-
}, {
|
|
1481
|
-
termsAndConditions?: string | undefined;
|
|
1482
|
-
}>;
|
|
1483
|
-
|
|
1484
1584
|
declare const partialConfigSchema: ZodObject<{
|
|
1485
1585
|
callbackFactory: ZodOptional<ZodOptional<ZodFunction<ZodTuple<[ZodObject<{
|
|
1486
1586
|
_id: ZodOptional<ZodNumber>;
|
|
@@ -1797,6 +1897,14 @@ declare const journeyConfigSchema: ZodObject<{
|
|
|
1797
1897
|
};
|
|
1798
1898
|
}>;
|
|
1799
1899
|
|
|
1900
|
+
declare const partialLinksSchema: ZodObject<{
|
|
1901
|
+
termsAndConditions: ZodOptional<ZodString>;
|
|
1902
|
+
}, "strict", ZodTypeAny, {
|
|
1903
|
+
termsAndConditions?: string | undefined;
|
|
1904
|
+
}, {
|
|
1905
|
+
termsAndConditions?: string | undefined;
|
|
1906
|
+
}>;
|
|
1907
|
+
|
|
1800
1908
|
declare const partialStringsSchema: ZodObject<{
|
|
1801
1909
|
alreadyHaveAnAccount: ZodOptional<ZodString>;
|
|
1802
1910
|
backToDefault: ZodOptional<ZodString>;
|
|
@@ -2071,89 +2179,134 @@ declare const partialStyleSchema: ZodObject<{
|
|
|
2071
2179
|
} | undefined;
|
|
2072
2180
|
}>;
|
|
2073
2181
|
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2182
|
+
interface JourneyOptions {
|
|
2183
|
+
oauth?: boolean;
|
|
2184
|
+
user?: boolean;
|
|
2185
|
+
}
|
|
2186
|
+
interface JourneyOptionsStart {
|
|
2187
|
+
config?: StepOptions;
|
|
2188
|
+
journey?: string;
|
|
2189
|
+
resumeUrl?: string;
|
|
2190
|
+
}
|
|
2191
|
+
interface WidgetConfigOptions {
|
|
2192
|
+
config?: TypeOf<typeof partialConfigSchema>;
|
|
2193
|
+
content?: TypeOf<typeof partialStringsSchema>;
|
|
2194
|
+
journeys?: TypeOf<typeof journeyConfigSchema>;
|
|
2195
|
+
links?: TypeOf<typeof partialLinksSchema>;
|
|
2196
|
+
style?: TypeOf<typeof partialStyleSchema>;
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
|
|
2200
|
+
interface ComponentStoreValue {
|
|
2201
|
+
error: {
|
|
2202
|
+
code: string;
|
|
2203
|
+
message: string;
|
|
2204
|
+
} | null;
|
|
2205
|
+
modal: {
|
|
2206
|
+
component: SvelteComponentDev$1;
|
|
2207
|
+
element: HTMLDialogElement;
|
|
2208
|
+
} | null;
|
|
2209
|
+
mounted: boolean;
|
|
2210
|
+
open: boolean | null;
|
|
2211
|
+
reason: 'auto' | 'external' | 'user' | null;
|
|
2212
|
+
type: 'inline' | 'modal' | null;
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2215
|
+
declare const api: {
|
|
2216
|
+
component: {
|
|
2217
|
+
close: (args?: {
|
|
2218
|
+
reason: "auto" | "external" | "user";
|
|
2219
|
+
} | undefined) => void;
|
|
2220
|
+
mount: (component: SvelteComponentDev$1, element: HTMLDialogElement) => void;
|
|
2221
|
+
open: () => void;
|
|
2222
|
+
subscribe: (this: void, run: Subscriber<ComponentStoreValue>, invalidate?: ((value?: ComponentStoreValue | undefined) => void) | undefined) => Unsubscriber;
|
|
2223
|
+
};
|
|
2224
|
+
configuration: (options?: WidgetConfigOptions | undefined) => {
|
|
2225
|
+
set(setOptions?: WidgetConfigOptions | undefined): void;
|
|
2226
|
+
};
|
|
2227
|
+
getStores: () => {
|
|
2228
|
+
journeyStore: JourneyStore;
|
|
2229
|
+
oauthStore: OAuthStore;
|
|
2230
|
+
userStore: UserStore;
|
|
2231
|
+
};
|
|
2232
|
+
journey: (options?: JourneyOptions | undefined) => {
|
|
2233
|
+
start: (startOptions?: JourneyOptionsStart | undefined) => Promise<unknown>;
|
|
2234
|
+
subscribe: (this: void, run: Subscriber<{
|
|
2235
|
+
journey: JourneyStoreValue;
|
|
2236
|
+
oauth: OAuthTokenStoreValue;
|
|
2237
|
+
user: UserStoreValue;
|
|
2238
|
+
}>, invalidate?: ((value?: {
|
|
2239
|
+
journey: JourneyStoreValue;
|
|
2240
|
+
oauth: OAuthTokenStoreValue;
|
|
2241
|
+
user: UserStoreValue;
|
|
2242
|
+
} | undefined) => void) | undefined) => Unsubscriber;
|
|
2243
|
+
};
|
|
2244
|
+
request: typeof HttpClient.request;
|
|
2245
|
+
user: {
|
|
2246
|
+
info(): {
|
|
2247
|
+
get: (options?: ConfigOptions | undefined) => Promise<unknown>;
|
|
2248
|
+
subscribe: (this: void, run: Subscriber<UserStoreValue>, invalidate?: ((value?: UserStoreValue | undefined) => void) | undefined) => Unsubscriber;
|
|
2249
|
+
};
|
|
2250
|
+
logout(): Promise<void>;
|
|
2251
|
+
tokens(): {
|
|
2252
|
+
get: (options?: ConfigOptions | undefined) => Promise<unknown>;
|
|
2253
|
+
subscribe: (this: void, run: Subscriber<OAuthTokenStoreValue>, invalidate?: ((value?: OAuthTokenStoreValue | undefined) => void) | undefined) => Unsubscriber;
|
|
2254
|
+
};
|
|
2255
|
+
};
|
|
2256
|
+
};
|
|
2257
|
+
declare const configuration: (options?: WidgetConfigOptions | undefined) => {
|
|
2258
|
+
set(setOptions?: WidgetConfigOptions | undefined): void;
|
|
2121
2259
|
};
|
|
2122
|
-
declare const
|
|
2123
|
-
|
|
2260
|
+
declare const journey: (options?: JourneyOptions | undefined) => {
|
|
2261
|
+
start: (startOptions?: JourneyOptionsStart | undefined) => Promise<unknown>;
|
|
2262
|
+
subscribe: (this: void, run: Subscriber<{
|
|
2263
|
+
journey: JourneyStoreValue;
|
|
2264
|
+
oauth: OAuthTokenStoreValue;
|
|
2265
|
+
user: UserStoreValue;
|
|
2266
|
+
}>, invalidate?: ((value?: {
|
|
2267
|
+
journey: JourneyStoreValue;
|
|
2268
|
+
oauth: OAuthTokenStoreValue;
|
|
2269
|
+
user: UserStoreValue;
|
|
2270
|
+
} | undefined) => void) | undefined) => Unsubscriber;
|
|
2124
2271
|
};
|
|
2125
|
-
declare const
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2272
|
+
declare const component: () => {
|
|
2273
|
+
close: (args?: {
|
|
2274
|
+
reason: "auto" | "external" | "user";
|
|
2275
|
+
} | undefined) => void;
|
|
2276
|
+
mount: (component: SvelteComponentDev$1, element: HTMLDialogElement) => void;
|
|
2277
|
+
open: () => void;
|
|
2278
|
+
subscribe: (this: void, run: Subscriber<ComponentStoreValue>, invalidate?: ((value?: ComponentStoreValue | undefined) => void) | undefined) => Unsubscriber;
|
|
2129
2279
|
};
|
|
2130
|
-
declare const request:
|
|
2280
|
+
declare const request: typeof HttpClient.request;
|
|
2131
2281
|
declare const user: {
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2282
|
+
info(): {
|
|
2283
|
+
get: (options?: ConfigOptions | undefined) => Promise<unknown>;
|
|
2284
|
+
subscribe: (this: void, run: Subscriber<UserStoreValue>, invalidate?: ((value?: UserStoreValue | undefined) => void) | undefined) => Unsubscriber;
|
|
2285
|
+
};
|
|
2286
|
+
logout(): Promise<void>;
|
|
2287
|
+
tokens(): {
|
|
2288
|
+
get: (options?: ConfigOptions | undefined) => Promise<unknown>;
|
|
2289
|
+
subscribe: (this: void, run: Subscriber<OAuthTokenStoreValue>, invalidate?: ((value?: OAuthTokenStoreValue | undefined) => void) | undefined) => Unsubscriber;
|
|
2290
|
+
};
|
|
2136
2291
|
};
|
|
2292
|
+
type ConfigurationApi = ReturnType<typeof api.configuration>;
|
|
2293
|
+
type JourneyApi = ReturnType<typeof api.journey>;
|
|
2294
|
+
type UserInfoApi = ReturnType<typeof api.user.info>;
|
|
2295
|
+
type UserTokensApi = ReturnType<typeof api.user.tokens>;
|
|
2137
2296
|
|
|
2138
2297
|
declare const __propDef: {
|
|
2139
2298
|
props: {
|
|
2140
|
-
|
|
2141
|
-
content?: TypeOf<typeof partialStringsSchema> | undefined;
|
|
2142
|
-
journeys?: TypeOf<typeof journeyConfigSchema> | undefined;
|
|
2143
|
-
links?: TypeOf<typeof partialLinksSchema> | undefined;
|
|
2144
|
-
style?: TypeOf<typeof partialStyleSchema> | undefined;
|
|
2299
|
+
type?: "inline" | "modal" | undefined;
|
|
2145
2300
|
};
|
|
2146
2301
|
events: {
|
|
2147
|
-
'form-mount': CustomEvent<any>;
|
|
2148
|
-
} & {
|
|
2149
2302
|
[evt: string]: CustomEvent<any>;
|
|
2150
2303
|
};
|
|
2151
2304
|
slots: {};
|
|
2152
2305
|
};
|
|
2153
|
-
type
|
|
2154
|
-
type
|
|
2155
|
-
type
|
|
2156
|
-
declare class
|
|
2306
|
+
type IndexProps = typeof __propDef.props;
|
|
2307
|
+
type IndexEvents = typeof __propDef.events;
|
|
2308
|
+
type IndexSlots = typeof __propDef.slots;
|
|
2309
|
+
declare class Index extends SvelteComponentTyped<IndexProps, IndexEvents, IndexSlots> {
|
|
2157
2310
|
}
|
|
2158
2311
|
|
|
2159
|
-
export {
|
|
2312
|
+
export { ConfigurationApi, IndexEvents, IndexProps, IndexSlots, JourneyApi, UserInfoApi, UserTokensApi, component, configuration, Index as default, journey, request, user };
|