@plentymarkets/shop-core 1.21.10 → 1.21.12

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@plentymarkets/shop-core",
3
3
  "configKey": "shopCore",
4
- "version": "1.21.10",
4
+ "version": "1.21.12",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -37,8 +37,7 @@ const module$1 = defineNuxtModule({
37
37
  apiUrl: _options.apiUrl,
38
38
  configId: _options.configId,
39
39
  experimental: {
40
- enableSSRMetrics: _options.experimental?.enableSSRMetrics ?? false,
41
- enableSSRWithoutSessionCookie: _options.experimental?.enableSSRWithoutSessionCookie ?? false
40
+ enableSSRMetrics: _options.experimental?.enableSSRMetrics ?? false
42
41
  },
43
42
  middlewareSSRUrl: _options.middlewareSSRUrl,
44
43
  logger: {
@@ -17,6 +17,7 @@ export default defineNuxtPlugin((nuxtApp) => {
17
17
  );
18
18
  const noCache = runtimeConfig.public.noCache || nuxtApp.$router.currentRoute.value.query?.noCache?.toString() || "";
19
19
  const referrerId = nuxtApp.$router.currentRoute.value.query?.ReferrerID?.toString() ?? "";
20
+ const shouldSkipCookiesSSR = nuxtApp.$router.currentRoute.value.meta?.skipCookiesSSR ?? false;
20
21
  const { token: csrfToken } = useCsrfToken();
21
22
  const ssrCookie = ref([]);
22
23
  logger.log("\u{1F680} initializing SDK plugin");
@@ -33,7 +34,8 @@ export default defineNuxtPlugin((nuxtApp) => {
33
34
  referrerId,
34
35
  noCache,
35
36
  requestHeaders,
36
- ssrCookie: ssrCookie.value
37
+ ssrCookie: ssrCookie.value,
38
+ shouldSkipCookiesSSR
37
39
  });
38
40
  logger.verbose(`\u{1F4EC} prepared headers: `, JSON.stringify(headers));
39
41
  return {
@@ -6,6 +6,10 @@ declare module '#app' {
6
6
  config: ShopCoreConfig;
7
7
  };
8
8
  }
9
+ interface PageMeta {
10
+ /** When true, the x-without-session-cookie header is sent for all SDK requests on this page during SSR. */
11
+ skipCookiesSSR?: boolean;
12
+ }
9
13
  }
10
14
 
11
15
  declare module '@plentymarkets/shop-core' {
@@ -4,7 +4,6 @@ export interface ModuleOptions {
4
4
  configId: number;
5
5
  experimental?: {
6
6
  enableSSRMetrics?: boolean;
7
- enableSSRWithoutSessionCookie?: boolean;
8
7
  };
9
8
  middlewareSSRUrl?: string;
10
9
  logger?: {
@@ -47,7 +47,7 @@ export const getI18nLocale = (nuxtApp) => {
47
47
  return i18nLocale;
48
48
  };
49
49
  const addExperimentalHeaders = (headers, context) => {
50
- if (isServer() && context.moduleConfig?.experimental?.enableSSRWithoutSessionCookie) {
50
+ if (isServer() && context.shouldSkipCookiesSSR) {
51
51
  headers["x-without-session-cookie"] = "true";
52
52
  }
53
53
  };
@@ -1,6 +1,5 @@
1
1
  import type { NuxtSSRContext } from '#app';
2
2
  import type { Ref } from '#imports';
3
- import type { ModuleOptions } from '../../types/index.js';
4
3
  import type { createSdkLogger } from './sdk.logger.js';
5
4
  export interface SdkHeaderContext {
6
5
  configId?: string;
@@ -11,7 +10,7 @@ export interface SdkHeaderContext {
11
10
  noCache?: string;
12
11
  requestHeaders?: Record<string, string>;
13
12
  ssrCookie?: string[];
14
- moduleConfig?: ModuleOptions;
13
+ shouldSkipCookiesSSR?: boolean;
15
14
  }
16
15
  export interface HandleSdkResponseContext {
17
16
  response: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plentymarkets/shop-core",
3
- "version": "1.21.10",
3
+ "version": "1.21.12",
4
4
  "description": "Core module for PlentyONE Shop",
5
5
  "repository": {
6
6
  "type": "git",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@noble/hashes": "^2.0.1",
53
- "@plentymarkets/shop-api": "^0.156.0",
53
+ "@plentymarkets/shop-api": "^0.158.0",
54
54
  "@vue-storefront/sdk": "^3.4.1",
55
55
  "cookie-es": "^2.0.0",
56
56
  "knitwork": "^1.3.0",