@uxf/core 11.68.2 → 11.70.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/cookie/index.d.ts CHANGED
@@ -1,7 +1,10 @@
1
1
  interface CookieOptions {
2
- secure?: boolean;
2
+ domain?: string;
3
3
  httpOnly?: boolean;
4
+ partitioned?: boolean;
4
5
  path?: string;
6
+ sameSite?: "Strict" | "Lax" | "None";
7
+ secure?: boolean;
5
8
  }
6
9
  export declare class Cookie {
7
10
  private ctx;
package/cookie/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Cookie = void 0;
4
4
  const is_not_empty_1 = require("../utils/is-not-empty");
5
+ const is_not_nil_1 = require("../utils/is-not-nil");
5
6
  class Cookie {
6
7
  constructor(ctx = null) {
7
8
  this.ctx = ctx;
@@ -16,6 +17,15 @@ class Cookie {
16
17
  const date = new Date();
17
18
  date.setTime(date.getTime() + ttl * 1000);
18
19
  const cookieParts = [`${name}=${encodeURIComponent(value)}`, `expires=${date.toUTCString()}`];
20
+ if ((0, is_not_nil_1.isNotNil)(options.domain) && (0, is_not_empty_1.isNotEmpty)(options.domain)) {
21
+ cookieParts.push(`domain=${options.domain}`);
22
+ }
23
+ if ((0, is_not_nil_1.isNotNil)(options.domain)) {
24
+ cookieParts.push(`samesite=${options.sameSite}`);
25
+ }
26
+ if (options.partitioned) {
27
+ cookieParts.push("partitioned");
28
+ }
19
29
  if (options.httpOnly) {
20
30
  cookieParts.push("httponly");
21
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/core",
3
- "version": "11.68.2",
3
+ "version": "11.70.0",
4
4
  "description": "UXF Core",
5
5
  "author": "Petr Vejvoda <vejvoda@uxf.cz>",
6
6
  "homepage": "https://gitlab.com/uxf-npm/core#readme",