@tramvai/module-cookie 2.56.2 → 2.59.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/lib/browser.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from 'tslib';
2
- import { Module, Scope } from '@tramvai/core';
2
+ import { Module, provide, Scope } from '@tramvai/core';
3
3
  import { ClientHintsModule, USER_AGENT_TOKEN } from '@tramvai/module-client-hints';
4
4
  import { Cookies } from '@tinkoff/browser-cookies';
5
5
  import { COOKIE_MANAGER_TOKEN } from '@tramvai/tokens-cookie';
@@ -101,7 +101,7 @@ CookieModule = __decorate([
101
101
  Module({
102
102
  imports: [ClientHintsModule],
103
103
  providers: [
104
- {
104
+ provide({
105
105
  // Управление куками в приложении
106
106
  provide: COOKIE_MANAGER_TOKEN,
107
107
  useClass: CookieManager,
@@ -116,7 +116,7 @@ CookieModule = __decorate([
116
116
  },
117
117
  userAgent: USER_AGENT_TOKEN,
118
118
  },
119
- },
119
+ }),
120
120
  ],
121
121
  })
122
122
  ], CookieModule);
@@ -8,7 +8,7 @@ export declare class CookieManager implements Interface {
8
8
  cookieOptions?: CookieOptions;
9
9
  userAgent: typeof USER_AGENT_TOKEN;
10
10
  });
11
- get(name: string): string;
11
+ get(name: string): string | undefined;
12
12
  set({ name, value, ...options }: CookieSetOptions): void;
13
13
  all(): {
14
14
  [key: string]: string;
@@ -11,7 +11,7 @@ export declare class CookieManager implements Interface {
11
11
  responseManager: typeof RESPONSE_MANAGER_TOKEN;
12
12
  userAgent: typeof USER_AGENT_TOKEN;
13
13
  });
14
- get(name: any): string;
14
+ get(name: string): string;
15
15
  set({ name, value, ...options }: CookieSetOptions): void;
16
16
  all(): Record<string, string>;
17
17
  remove(name: string, options?: CookieOptions): void;
package/lib/server.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from 'tslib';
2
- import { Module, Scope } from '@tramvai/core';
2
+ import { Module, provide, Scope } from '@tramvai/core';
3
3
  import { REQUEST_MANAGER_TOKEN, RESPONSE_MANAGER_TOKEN } from '@tramvai/tokens-common';
4
4
  import { ClientHintsModule, USER_AGENT_TOKEN } from '@tramvai/module-client-hints';
5
5
  import { serialize } from 'cookie';
@@ -70,7 +70,7 @@ CookieModule = __decorate([
70
70
  Module({
71
71
  imports: [ClientHintsModule],
72
72
  providers: [
73
- {
73
+ provide({
74
74
  // Управление куками в приложении
75
75
  provide: COOKIE_MANAGER_TOKEN,
76
76
  useClass: CookieManager,
@@ -80,7 +80,7 @@ CookieModule = __decorate([
80
80
  responseManager: RESPONSE_MANAGER_TOKEN,
81
81
  userAgent: USER_AGENT_TOKEN,
82
82
  },
83
- },
83
+ }),
84
84
  ],
85
85
  })
86
86
  ], CookieModule);
package/lib/server.js CHANGED
@@ -73,7 +73,7 @@ exports.CookieModule = tslib.__decorate([
73
73
  core.Module({
74
74
  imports: [moduleClientHints.ClientHintsModule],
75
75
  providers: [
76
- {
76
+ core.provide({
77
77
  // Управление куками в приложении
78
78
  provide: tokensCookie.COOKIE_MANAGER_TOKEN,
79
79
  useClass: CookieManager,
@@ -83,7 +83,7 @@ exports.CookieModule = tslib.__decorate([
83
83
  responseManager: tokensCommon.RESPONSE_MANAGER_TOKEN,
84
84
  userAgent: moduleClientHints.USER_AGENT_TOKEN,
85
85
  },
86
- },
86
+ }),
87
87
  ],
88
88
  })
89
89
  ], exports.CookieModule);
package/lib/utils.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { USER_AGENT_TOKEN } from '@tramvai/module-client-hints';
2
2
  import type { CookieOptions } from './tokens';
3
- export declare const calculateExpires: (expires?: number | string | Date) => Date;
3
+ export declare const calculateExpires: (expires?: number | string | Date) => Date | undefined;
4
4
  export declare const trimSubdomains: (host: string) => string;
5
5
  type PrepareOptions = {
6
6
  userAgent: typeof USER_AGENT_TOKEN;
@@ -8,11 +8,11 @@ type PrepareOptions = {
8
8
  secureProtocol: boolean;
9
9
  };
10
10
  export declare const prepareCookieOptions: ({ userAgent: { sameSiteNoneCompatible }, defaultHost, secureProtocol }: PrepareOptions, { sameSite, noSubdomains, ...options }: CookieOptions) => {
11
- expires: Date;
12
- domain: string;
13
- secure?: boolean;
14
- sameSite?: boolean | "lax" | "strict" | "none";
15
- path?: string;
16
- httpOnly?: boolean;
11
+ expires: Date | undefined;
12
+ domain: string | undefined;
13
+ secure?: boolean | undefined;
14
+ sameSite?: boolean | "lax" | "strict" | "none" | undefined;
15
+ path?: string | undefined;
16
+ httpOnly?: boolean | undefined;
17
17
  };
18
18
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/module-cookie",
3
- "version": "2.56.2",
3
+ "version": "2.59.0",
4
4
  "description": "",
5
5
  "browser": "lib/browser.js",
6
6
  "main": "lib/server.js",
@@ -19,17 +19,17 @@
19
19
  "build-for-publish": "true"
20
20
  },
21
21
  "dependencies": {
22
- "@tinkoff/browser-cookies": "2.0.4",
23
- "@tramvai/tokens-cookie": "2.56.2",
24
- "@tramvai/module-client-hints": "2.56.2",
22
+ "@tinkoff/browser-cookies": "2.0.5",
23
+ "@tramvai/tokens-cookie": "2.59.0",
24
+ "@tramvai/module-client-hints": "2.59.0",
25
25
  "cookie": "^0.4.0"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@tinkoff/utils": "^2.1.2",
29
- "@tramvai/core": "2.56.2",
30
- "@tramvai/state": "2.56.2",
31
- "@tramvai/tokens-common": "2.56.2",
32
- "@tinkoff/dippy": "0.8.10",
29
+ "@tramvai/core": "2.59.0",
30
+ "@tramvai/state": "2.59.0",
31
+ "@tramvai/tokens-common": "2.59.0",
32
+ "@tinkoff/dippy": "0.8.11",
33
33
  "tslib": "^2.4.0"
34
34
  },
35
35
  "devDependencies": {