@storyblok/app-extension-auth
Advanced tools
Comparing version 2.0.0-beta.1 to 2.0.0-beta.2
@@ -1,3 +0,3 @@ | ||
export * from './cookieAdapter'; | ||
export * from './createCookieAdapter'; | ||
export * from './publicAdapter'; | ||
export * from './internalAdapter'; |
@@ -29,3 +29,3 @@ import http from 'http'; | ||
type CreateInternalAdapter = ({ params, req, res, adapter, }: { | ||
params: Pick<AuthHandlerParams, 'clientId' | 'clientSecret' | 'sessionKey'>; | ||
params: Pick<AuthHandlerParams, 'clientId' | 'clientSecret'>; | ||
req: http.IncomingMessage; | ||
@@ -32,0 +32,0 @@ res: http.ServerResponse; |
import { IncomingMessage, ServerResponse } from 'node:http'; | ||
import { AppSession } from '../session'; | ||
export type MaybePromise<T> = T | Promise<T>; | ||
export type Adapter = { | ||
getItem: (params: { | ||
req: IncomingMessage; | ||
res: ServerResponse; | ||
clientId: string; | ||
spaceId: string; | ||
userId: string; | ||
key: string; | ||
}) => MaybePromise<string | undefined>; | ||
setItem: (params: { | ||
req: IncomingMessage; | ||
res: ServerResponse; | ||
clientId: string; | ||
spaceId: string; | ||
userId: string; | ||
key: string; | ||
value: string; | ||
}) => MaybePromise<boolean>; | ||
removeItem: (params: { | ||
req: IncomingMessage; | ||
res: ServerResponse; | ||
clientId: string; | ||
spaceId: string; | ||
userId: string; | ||
key: string; | ||
}) => MaybePromise<boolean>; | ||
hasItem: (params: { | ||
req: IncomingMessage; | ||
res: ServerResponse; | ||
clientId: string; | ||
spaceId: string; | ||
userId: string; | ||
key: string; | ||
}) => MaybePromise<boolean>; | ||
getSession: GetSession; | ||
setSession: SetSession; | ||
removeSession: RemoveSession; | ||
hasSession: HasSession; | ||
}; | ||
type BaseSessionParams = { | ||
req: IncomingMessage; | ||
res: ServerResponse; | ||
clientId: string; | ||
spaceId: string; | ||
userId: string; | ||
}; | ||
type GetSession = (params: BaseSessionParams) => MaybePromise<AppSession | undefined>; | ||
type SetSession = (params: BaseSessionParams & { | ||
session: AppSession; | ||
}) => MaybePromise<boolean>; | ||
type RemoveSession = (params: BaseSessionParams) => MaybePromise<boolean>; | ||
type HasSession = (params: BaseSessionParams) => MaybePromise<boolean>; | ||
export {}; |
/** | ||
* This object describes an HTTP response in a framework-agnostic way. | ||
* The idea is to create one function that parses an incoming HTTP message into a `ResponseElement`. | ||
* This `ResponseElement` is then fed into a _reconciler_ that writes the required changes into an HTTP response. | ||
*/ | ||
@@ -6,0 +5,0 @@ export type ResponseElement = { |
{ | ||
"name": "@storyblok/app-extension-auth", | ||
"description": "A typed JavaScript library for handling authentication with Storyblok apps.", | ||
"version": "2.0.0-beta.1", | ||
"version": "2.0.0-beta.2", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Johannes Lindgren", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3115046
94
29336