@schibsted/account-sdk-browser 6.0.0-alpha.14 → 6.0.0-alpha.16
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/dist/account.d.ts +9 -6
- package/dist/identity.d.ts +4 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +144 -142
- package/dist/index.js.map +1 -1
- package/dist/types/account.d.ts +9 -4
- package/dist/types/common.d.ts +17 -2
- package/dist/types/identity.d.ts +12 -10
- package/dist/types/login.d.ts +14 -12
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/account.ts +12 -6
- package/src/identity.ts +11 -4
- package/src/index.ts +9 -2
- package/src/types/account.ts +9 -8
- package/src/types/common.ts +19 -2
- package/src/types/identity.ts +12 -11
- package/src/types/login.ts +14 -12
- package/src/version.ts +1 -1
package/dist/account.d.ts
CHANGED
|
@@ -102,10 +102,11 @@ export declare class Account {
|
|
|
102
102
|
* Call this from a user gesture when `preferPopup` is enabled, otherwise browser popup blockers
|
|
103
103
|
* may block the popup and the SDK will fall back to redirect navigation.
|
|
104
104
|
*
|
|
105
|
-
* @param options - Login URL parameters.
|
|
105
|
+
* @param options - Login URL parameters. When `state` is omitted, the configured
|
|
106
|
+
* `generateState` function provides it.
|
|
106
107
|
* @returns A popup window reference when a popup is opened; otherwise `null`.
|
|
107
108
|
*/
|
|
108
|
-
login(options
|
|
109
|
+
login(options?: LoginOptions): Window | null;
|
|
109
110
|
/**
|
|
110
111
|
* Logs the user out from the brand Session Service session and redirects the browser.
|
|
111
112
|
*
|
|
@@ -115,9 +116,10 @@ export declare class Account {
|
|
|
115
116
|
/**
|
|
116
117
|
* Builds the login URL without navigating the browser.
|
|
117
118
|
*
|
|
118
|
-
* @param options - Login URL parameters.
|
|
119
|
+
* @param options - Login URL parameters. When `state` is omitted, the configured
|
|
120
|
+
* `generateState` function provides it.
|
|
119
121
|
*/
|
|
120
|
-
loginUrl(options
|
|
122
|
+
loginUrl(options?: LoginOptions): string;
|
|
121
123
|
/**
|
|
122
124
|
* Builds the logout URL without navigating the browser.
|
|
123
125
|
*
|
|
@@ -134,13 +136,14 @@ export declare class Account {
|
|
|
134
136
|
* Loads and displays the simplified login widget when user context is available.
|
|
135
137
|
*
|
|
136
138
|
* Your application decides how often to call this method. The `state` field in `loginParams`
|
|
137
|
-
* may be a string or a function that resolves to a string.
|
|
139
|
+
* may be a string or a function that resolves to a string. When omitted, the configured
|
|
140
|
+
* `generateState` function provides it.
|
|
138
141
|
* Widget open and cancel events can be observed with `on()`.
|
|
139
142
|
*
|
|
140
143
|
* @returns `true` when the widget was displayed.
|
|
141
144
|
* @throws {SDKError} If user context data is missing or the widget script cannot be loaded.
|
|
142
145
|
*/
|
|
143
|
-
showSimplifiedLoginWidget(loginParams
|
|
146
|
+
showSimplifiedLoginWidget(loginParams?: SimplifiedLoginWidgetLoginOptions, options?: SimplifiedLoginWidgetOptions): Promise<boolean>;
|
|
144
147
|
/**
|
|
145
148
|
* Enables or disables caching for subsequent session lookups.
|
|
146
149
|
*
|
package/dist/identity.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare class Identity {
|
|
|
19
19
|
private readonly log?;
|
|
20
20
|
private readonly callbackBeforeRedirect;
|
|
21
21
|
private readonly getConsents;
|
|
22
|
+
private readonly generateState?;
|
|
22
23
|
private readonly sessionStorageCache;
|
|
23
24
|
private readonly localStorageCache;
|
|
24
25
|
private enableSessionCaching;
|
|
@@ -50,9 +51,10 @@ export declare class Identity {
|
|
|
50
51
|
* @param options.callbackBeforeRedirect - callback triggered before session refresh redirect happen
|
|
51
52
|
* @param options.getConsents - reads consents forwarded in login URLs.
|
|
52
53
|
* Defaults to the Schibsted Sourcepoint integration
|
|
54
|
+
* @param options.generateState - generates the OAuth state when login options do not provide one
|
|
53
55
|
* @throws {SDKError} - If any of options are invalid
|
|
54
56
|
*/
|
|
55
|
-
constructor({ clientId, redirectUri, sessionDomain, env, log, window, callbackBeforeRedirect, getConsents, }: IdentityOptions);
|
|
57
|
+
constructor({ clientId, redirectUri, sessionDomain, env, log, window, callbackBeforeRedirect, getConsents, generateState, }: IdentityOptions);
|
|
56
58
|
/** @internal */
|
|
57
59
|
enableLoginLinkRefresh(): void;
|
|
58
60
|
addEventListener(type: AccountEventName, listener: EventListener): void;
|
|
@@ -261,7 +263,7 @@ export declare class Identity {
|
|
|
261
263
|
/**
|
|
262
264
|
* Generates the link to the new login page that'll be used in the popup or redirect flow
|
|
263
265
|
* @param options
|
|
264
|
-
* @param options.state
|
|
266
|
+
* @param options.state - defaults to the value returned by `generateState`
|
|
265
267
|
* @param options.acrValues
|
|
266
268
|
* @param options.scope
|
|
267
269
|
* @param options.redirectUri
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export { default as SDKError } from './sdk-error.js';
|
|
|
5
5
|
/** session response type guards */
|
|
6
6
|
export { isConnectedSessionResponse, isConnectedSessionWithUserIdResponse, isSessionFailureResponse, isSessionSuccessResponse, } from './session-response.js';
|
|
7
7
|
export type { AccountConfig, AccountEventListener, AccountEventMap, AccountEventName, LoginRequestedEventDetail, LogoutRequestedEventDetail, } from './types/account.js';
|
|
8
|
-
export type { AccountEnvironment, LogFunction } from './types/common.js';
|
|
9
|
-
export type {
|
|
8
|
+
export type { AccountBaseConfig, AccountEnvironment, ConsentReader, LogFunction, StateGenerator, } from './types/common.js';
|
|
9
|
+
export type { IdentityBeforeRedirectCallback, VarnishCookieOptions } from './types/identity.js';
|
|
10
10
|
export type { LoginOptions, SimplifiedLoginData, SimplifiedLoginWidgetLoginOptions, SimplifiedLoginWidgetOptions, } from './types/login.js';
|
|
11
11
|
export type { HasAccessResult } from './types/monetization.js';
|
|
12
|
-
export type { ConnectedSessionResponse, ConnectedSessionWithUserIdResponse, RedirectSessionResponse, SessionFailureResponse, SessionResponse, SessionSuccessResponse, SessionUserId, } from './types/session.js';
|
|
12
|
+
export type { ConnectedSessionResponse, ConnectedSessionWithUserIdResponse, RedirectSessionResponse, SessionFailureResponse, SessionResponse, SessionSuccessResponse, SessionUserId, UnrecognizedSessionResponse, } from './types/session.js';
|