@paroicms/public-server-lib 0.31.2 → 0.32.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paroicms/public-server-lib",
3
- "version": "0.31.2",
3
+ "version": "0.32.0",
4
4
  "description": "Common utilitaries for paroicms plugins (backend side).",
5
5
  "author": "Paroi Team",
6
6
  "repository": {
@@ -21,15 +21,15 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@paroi/data-formatters-lib": "~0.4.0",
24
- "@paroicms/internal-anywhere-lib": "1.27.0",
25
- "@paroicms/public-anywhere-lib": "0.21.0",
24
+ "@paroicms/internal-anywhere-lib": "1.28.0",
25
+ "@paroicms/public-anywhere-lib": "0.22.0",
26
26
  "@types/express": "~4.17.21"
27
27
  },
28
28
  "devDependencies": {
29
- "@types/node": "~22.13.10",
29
+ "@types/node": "~22.14.1",
30
30
  "rimraf": "~6.0.1",
31
- "typescript": "~5.8.2",
32
- "vitest": "~3.0.5"
31
+ "typescript": "~5.8.3",
32
+ "vitest": "~3.1.1"
33
33
  },
34
34
  "files": [
35
35
  "dist",
@@ -23,9 +23,14 @@ export interface PaHttpRequest {
23
23
  /** Contains the path and the query string. */
24
24
  relativeUrl: string;
25
25
  path: string;
26
- query: { [parameterName: string]: string | undefined };
26
+ query: PaUrlQuery;
27
27
  body: object | undefined;
28
28
  file: MulterFile | undefined;
29
+ cookies?: { [key: string]: string };
30
+ }
31
+
32
+ export interface PaUrlQuery {
33
+ [key: string]: undefined | string | PaUrlQuery | (string | PaUrlQuery)[];
29
34
  }
30
35
 
31
36
  export interface MulterFile {
@@ -52,6 +57,12 @@ export interface PaHttpResponse {
52
57
  status(code: number): this;
53
58
  append(field: string, value?: string[] | string): this;
54
59
  send(body?: Buffer | object | string | Stream): this;
60
+ cookie(
61
+ name: string,
62
+ value: string,
63
+ options?: { maxAge?: number; httpOnly?: boolean; secure?: boolean; path?: string },
64
+ ): this;
65
+ clearCookie(name: string, options?: { path?: string }): this;
55
66
  }
56
67
 
57
68
  export interface ParoiCmsPlugin {