@sitevision/api 2023.3.1-beta.0 → 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.
package/common/router/index.d.ts
CHANGED
|
@@ -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:
|
|
28
|
+
session: Session;
|
|
20
29
|
hostname: string;
|
|
21
30
|
protocol: string;
|
|
22
31
|
secure: boolean;
|
package/package.json
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AppData } from '../appData';
|
|
2
2
|
|
|
3
|
-
export interface GlobalAppData {
|
|
4
|
-
get(key: string): unknown;
|
|
5
|
-
getNode(key: string): Node;
|
|
6
|
-
getArray(key: string): Node[];
|
|
7
|
-
}
|
|
3
|
+
export interface GlobalAppData extends AppData {}
|
|
8
4
|
|
|
9
5
|
declare namespace GlobalAppData {}
|
|
10
6
|
|
package/server/hooks/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
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 {
|