@plentymarkets/shop-core 1.21.2 → 1.21.3

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.2",
4
+ "version": "1.21.3",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -37,6 +37,7 @@ const module$1 = defineNuxtModule({
37
37
  apiUrl: _options.apiUrl,
38
38
  configId: _options.configId,
39
39
  enableSSRMetrics: _options.enableSSRMetrics ?? false,
40
+ middlewareSSRUrl: _options.middlewareSSRUrl,
40
41
  logger: {
41
42
  sdkPlugin: {
42
43
  enabled: _options.logger?.sdkPlugin?.enabled ?? false,
@@ -40,9 +40,15 @@ export default defineNuxtPlugin((nuxtApp) => {
40
40
  ...headers
41
41
  };
42
42
  };
43
+ const getMiddlewareUrl = () => {
44
+ if (import.meta.server && moduleConfig.middlewareSSRUrl) {
45
+ return moduleConfig.middlewareSSRUrl;
46
+ }
47
+ return moduleConfig.apiUrl;
48
+ };
43
49
  const sdkConfig = {
44
50
  plentysystems: buildModule(middlewareModule, {
45
- apiUrl: moduleConfig.apiUrl + "/plentysystems",
51
+ apiUrl: getMiddlewareUrl() + "/plentysystems",
46
52
  httpClient: async (url, params, config) => {
47
53
  return nuxtApp.runWithContext(async () => {
48
54
  logger.log(`\u{1F4E1} making SDK request to ${url}`);
@@ -3,6 +3,7 @@ export interface ModuleOptions {
3
3
  apiEndpoint: string;
4
4
  configId: number;
5
5
  enableSSRMetrics?: boolean;
6
+ middlewareSSRUrl?: string;
6
7
  logger?: {
7
8
  sdkPlugin?: {
8
9
  enabled: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plentymarkets/shop-core",
3
- "version": "1.21.2",
3
+ "version": "1.21.3",
4
4
  "description": "Core module for PlentyONE Shop",
5
5
  "repository": {
6
6
  "type": "git",