@bytescale/sdk
Advanced tools
Comparing version
import { AuthSwConfigDto } from "./AuthSwConfigDto"; | ||
export interface AuthSwSetConfigDto { | ||
config: AuthSwConfigDto; | ||
type: "SET_CONFIG"; | ||
/** | ||
* We use a specific name for this type, since you can only register one service worker per scope, meaning it's | ||
* possible the user will want to use their own service worker, which means we'll need to support having the Bytescale | ||
* Auth Service Worker being a component of the user's service worker. Thus, we use a specific name to avoid conflict | ||
* with the user's events. | ||
*/ | ||
type: "SET_BYTESCALE_AUTH_CONFIG"; | ||
} |
import { BeginAuthSessionParams } from "./AuthManagerInterface"; | ||
import { ServiceWorkerConfig } from "./ServiceWorkerConfig"; | ||
export interface AuthSession { | ||
accessToken: string | undefined; | ||
accessTokenRefreshHandle: number | undefined; | ||
authServiceWorker: ServiceWorker | undefined; | ||
authServiceWorker: ServiceWorkerConfig | undefined; | ||
isActive: boolean; | ||
params: BeginAuthSessionParams; | ||
} |
import { AuthManagerInterface, BeginAuthSessionParams } from "../../private/model/AuthManagerInterface"; | ||
import { ServiceWorkerUtils } from "../../private/ServiceWorkerUtils"; | ||
declare class AuthManagerImpl implements AuthManagerInterface { | ||
private readonly serviceWorkerUtils; | ||
private readonly authSessionMutex; | ||
@@ -11,14 +13,6 @@ private readonly contentType; | ||
private readonly refreshBeforeExpirySeconds; | ||
constructor(); | ||
constructor(serviceWorkerUtils: ServiceWorkerUtils); | ||
isAuthSessionActive(): boolean; | ||
beginAuthSession(params: BeginAuthSessionParams): Promise<void>; | ||
endAuthSession(): Promise<void>; | ||
/** | ||
* Idempotent. | ||
* | ||
* Only returns once the service worker has been activated. | ||
* | ||
* We don't need to unregister it: we just need to clear the config when auth ends. | ||
*/ | ||
private registerAuthServiceWorker; | ||
private refreshAccessToken; | ||
@@ -25,0 +19,0 @@ private isUsingServiceWorker; |
{ | ||
"name": "@bytescale/sdk", | ||
"version": "3.17.0", | ||
"version": "3.18.0", | ||
"description": "Bytescale JavaScript SDK", | ||
@@ -5,0 +5,0 @@ "author": "Bytescale <hello@bytescale.com> (https://www.bytescale.com)", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
999739
1.74%62
3.33%20787
1.4%