@sitevision/api 2023.3.1-beta.1 → 2023.3.1-beta.2

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.
@@ -9,14 +9,23 @@ export interface Cookie {
9
9
  sameSite?: 'Strict' | 'Lax' | 'None' | undefined;
10
10
  }
11
11
 
12
+ export type Session = {
13
+ [key: string]: any;
14
+ };
15
+
12
16
  export interface Request {
13
17
  invalidateSession(): void;
18
+ /**
19
+ * Synchronizes local session state with the shared app session state.
20
+ * @since Sitevision 2023.03.1
21
+ */
22
+ updateSession(): Session;
14
23
  header(headerName: string): string | null;
15
24
  file(fileParameterName: string): Node;
16
25
  params: { [key: string]: string };
17
26
  cookies: { [key: string]: string };
18
27
  xhr: boolean;
19
- session: any;
28
+ session: Session;
20
29
  hostname: string;
21
30
  protocol: string;
22
31
  secure: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitevision/api",
3
- "version": "2023.3.1-beta.1",
3
+ "version": "2023.3.1-beta.2",
4
4
  "author": "Sitevision AB",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -4,7 +4,12 @@ export interface HooksResponse {
4
4
  set(name: string, value: string): void;
5
5
  cookie(cookie: Cookie): void;
6
6
  clearCookie(name: string);
7
- redirect(url: string);
7
+ /**
8
+ * Redirect the user to another URL
9
+ * @param url The URL to redirect to
10
+ * @param statusCode The HTTP status code to use for the redirect. Defaults to 302. Introduced in Sitevision 2023.03.1.
11
+ */
12
+ redirect(url: string, statusCode?: 301 | 302);
8
13
  }
9
14
 
10
15
  export interface Hooks {