@akinon/next 1.103.0-rc.80 → 1.103.0-snapshot-ZERO-3648-20250930133222

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +46 -1319
  2. package/__tests__/next-config.test.ts +10 -1
  3. package/api/virtual-try-on.ts +254 -0
  4. package/bin/pz-prebuild.js +0 -1
  5. package/components/accordion.tsx +5 -20
  6. package/components/file-input.tsx +3 -65
  7. package/components/input.tsx +0 -2
  8. package/components/link.tsx +12 -16
  9. package/components/modal.tsx +16 -32
  10. package/components/plugin-module.tsx +6 -29
  11. package/data/client/checkout.ts +3 -5
  12. package/data/server/category.ts +24 -44
  13. package/data/server/flatpage.ts +12 -16
  14. package/data/server/landingpage.ts +12 -16
  15. package/data/server/list.ts +13 -23
  16. package/data/server/special-page.ts +12 -16
  17. package/data/urls.ts +2 -6
  18. package/hocs/server/with-segment-defaults.tsx +2 -5
  19. package/hooks/use-localization.ts +3 -2
  20. package/middlewares/complete-gpay.ts +1 -2
  21. package/middlewares/complete-masterpass.ts +1 -2
  22. package/middlewares/default.ts +0 -50
  23. package/middlewares/locale.ts +1 -9
  24. package/middlewares/redirection-payment.ts +1 -2
  25. package/middlewares/saved-card-redirection.ts +1 -2
  26. package/middlewares/three-d-redirection.ts +2 -2
  27. package/middlewares/url-redirection.ts +14 -8
  28. package/package.json +2 -2
  29. package/plugins.d.ts +5 -8
  30. package/plugins.js +1 -2
  31. package/redux/middlewares/checkout.ts +2 -6
  32. package/types/commerce/order.ts +0 -1
  33. package/types/index.ts +1 -34
  34. package/utils/app-fetch.ts +2 -7
  35. package/utils/redirect.ts +3 -22
  36. package/with-pz-config.js +5 -1
  37. package/__tests__/redirect.test.ts +0 -319
  38. package/api/form.ts +0 -84
  39. package/api/image-proxy.ts +0 -75
  40. package/api/similar-product-list.ts +0 -84
  41. package/api/similar-products.ts +0 -120
  42. package/data/server/basket.ts +0 -72
  43. package/utils/redirect-ignore.ts +0 -35
@@ -5,6 +5,7 @@ import { category, product } from '../urls';
5
5
  import { Cache, CacheKey } from '../../lib/cache';
6
6
  import { parse } from 'lossless-json';
7
7
  import logger from '../../utils/log';
8
+ import { headers as nHeaders } from 'next/headers';
8
9
  import { ServerVariables } from '../../utils/server-variables';
9
10
 
10
11
  function getCategoryDataHandler(
@@ -17,30 +18,19 @@ function getCategoryDataHandler(
17
18
  return async function () {
18
19
  const params = generateCommerceSearchParams(searchParams);
19
20
 
20
- let rawData: string;
21
-
22
- try {
23
- rawData = await appFetch<string>({
24
- url: `${category.getCategoryByPk(pk)}${params ? params : ''}`,
25
- locale,
26
- currency,
27
- init: {
28
- headers: {
29
- Accept: 'application/json',
30
- 'Content-Type': 'application/json',
31
- ...(headers ?? {})
32
- }
33
- },
34
- responseType: FetchResponseType.TEXT
35
- });
36
- } catch (error) {
37
- logger.error('Failed to fetch category data', {
38
- handler: 'getCategoryDataHandler',
39
- pk,
40
- error: error.message
41
- });
42
- return null;
43
- }
21
+ const rawData = await appFetch<string>({
22
+ url: `${category.getCategoryByPk(pk)}${params ? params : ''}`,
23
+ locale,
24
+ currency,
25
+ init: {
26
+ headers: {
27
+ Accept: 'application/json',
28
+ 'Content-Type': 'application/json',
29
+ ...(headers ?? {})
30
+ }
31
+ },
32
+ responseType: FetchResponseType.TEXT
33
+ });
44
34
 
45
35
  let data: GetCategoryResponse;
46
36
 
@@ -74,27 +64,17 @@ function getCategoryDataHandler(
74
64
  return { data, breadcrumbData: undefined };
75
65
  }
76
66
 
77
- let breadcrumbData: { menu?: unknown } = {};
78
-
79
- try {
80
- breadcrumbData = await appFetch<{ menu?: unknown }>({
81
- url: product.breadcrumbUrl(menuItemModel),
82
- locale,
83
- currency,
84
- init: {
85
- headers: {
86
- Accept: 'application/json',
87
- 'Content-Type': 'application/json'
88
- }
67
+ const breadcrumbData = await appFetch<any>({
68
+ url: product.breadcrumbUrl(menuItemModel),
69
+ locale,
70
+ currency,
71
+ init: {
72
+ headers: {
73
+ Accept: 'application/json',
74
+ 'Content-Type': 'application/json'
89
75
  }
90
- });
91
- } catch (error) {
92
- logger.warn('Failed to fetch breadcrumb data', {
93
- handler: 'getCategoryDataHandler',
94
- pk,
95
- error: error.message
96
- });
97
- }
76
+ }
77
+ });
98
78
 
99
79
  return { data, breadcrumbData: breadcrumbData?.menu };
100
80
  };
@@ -11,24 +11,20 @@ const getFlatPageDataHandler = (
11
11
  headers?: Record<string, string>
12
12
  ) => {
13
13
  return async function () {
14
- try {
15
- const data = await appFetch<FlatPage>({
16
- url: flatpage.getFlatPageByPk(pk),
17
- locale,
18
- currency,
19
- init: {
20
- headers: {
21
- Accept: 'application/json',
22
- 'Content-Type': 'application/json',
23
- ...(headers ?? {})
24
- }
14
+ const data = await appFetch<FlatPage>({
15
+ url: flatpage.getFlatPageByPk(pk),
16
+ locale,
17
+ currency,
18
+ init: {
19
+ headers: {
20
+ Accept: 'application/json',
21
+ 'Content-Type': 'application/json',
22
+ ...(headers ?? {})
25
23
  }
26
- });
24
+ }
25
+ });
27
26
 
28
- return data;
29
- } catch (error) {
30
- return null;
31
- }
27
+ return data;
32
28
  };
33
29
  };
34
30
 
@@ -11,24 +11,20 @@ const getLandingPageHandler = (
11
11
  headers?: Record<string, string>
12
12
  ) => {
13
13
  return async function () {
14
- try {
15
- const data = await appFetch<LandingPage>({
16
- url: landingpage.getLandingPageByPk(pk),
17
- locale,
18
- currency,
19
- init: {
20
- headers: {
21
- Accept: 'application/json',
22
- 'Content-Type': 'application/json',
23
- ...(headers ?? {})
24
- }
14
+ const data = await appFetch<LandingPage>({
15
+ url: landingpage.getLandingPageByPk(pk),
16
+ locale,
17
+ currency,
18
+ init: {
19
+ headers: {
20
+ Accept: 'application/json',
21
+ 'Content-Type': 'application/json',
22
+ ...(headers ?? {})
25
23
  }
26
- });
24
+ }
25
+ });
27
26
 
28
- return data;
29
- } catch (error) {
30
- return null;
31
- }
27
+ return data;
32
28
  };
33
29
  };
34
30
 
@@ -16,29 +16,19 @@ const getListDataHandler = (
16
16
  return async function () {
17
17
  const params = generateCommerceSearchParams(searchParams);
18
18
 
19
- let rawData: string;
20
-
21
- try {
22
- rawData = await appFetch<string>({
23
- url: `${category.list}${params}`,
24
- locale,
25
- currency,
26
- init: {
27
- headers: {
28
- Accept: 'application/json',
29
- 'Content-Type': 'application/json',
30
- ...(headers ?? {})
31
- }
32
- },
33
- responseType: FetchResponseType.TEXT
34
- });
35
- } catch (error) {
36
- logger.error('Failed to fetch list data', {
37
- handler: 'getListDataHandler',
38
- error: error.message
39
- });
40
- return null;
41
- }
19
+ const rawData = await appFetch<string>({
20
+ url: `${category.list}${params}`,
21
+ locale,
22
+ currency,
23
+ init: {
24
+ headers: {
25
+ Accept: 'application/json',
26
+ 'Content-Type': 'application/json',
27
+ ...(headers ?? {})
28
+ }
29
+ },
30
+ responseType: FetchResponseType.TEXT
31
+ });
42
32
 
43
33
  let data: GetCategoryResponse;
44
34
 
@@ -15,24 +15,20 @@ const getSpecialPageDataHandler = (
15
15
  return async function () {
16
16
  const params = generateCommerceSearchParams(searchParams);
17
17
 
18
- try {
19
- const data: GetCategoryResponse = await appFetch({
20
- url: `${category.getSpecialPageByPk(pk)}${params}`,
21
- locale,
22
- currency,
23
- init: {
24
- headers: {
25
- Accept: 'application/json',
26
- 'Content-Type': 'application/json',
27
- ...(headers ?? {})
28
- }
18
+ const data: GetCategoryResponse = await appFetch({
19
+ url: `${category.getSpecialPageByPk(pk)}${params}`,
20
+ locale,
21
+ currency,
22
+ init: {
23
+ headers: {
24
+ Accept: 'application/json',
25
+ 'Content-Type': 'application/json',
26
+ ...(headers ?? {})
29
27
  }
30
- });
28
+ }
29
+ });
31
30
 
32
- return data;
33
- } catch (error) {
34
- return null;
35
- }
31
+ return data;
36
32
  };
37
33
  };
38
34
 
package/data/urls.ts CHANGED
@@ -183,11 +183,7 @@ export const product = {
183
183
  breadcrumbUrl: (menuitemmodel: string) =>
184
184
  `/menus/generate_breadcrumb/?item=${menuitemmodel}&generator_name=menu_item`,
185
185
  bundleProduct: (productPk: string, queryString: string) =>
186
- `/bundle-product/${productPk}/?${queryString}`,
187
- similarProducts: (params?: string) =>
188
- `/similar-products${params ? `?${params}` : ''}`,
189
- similarProductsList: (params?: string) =>
190
- `/similar-product-list${params ? `?${params}` : ''}`
186
+ `/bundle-product/${productPk}/?${queryString}`
191
187
  };
192
188
 
193
189
  export const wishlist = {
@@ -251,7 +247,7 @@ export const widgets = {
251
247
  };
252
248
 
253
249
  export const form = {
254
- getForm: (pk: number) => `/forms/${pk}/generate`
250
+ getForm: (pk: number) => `/forms/${pk}/generate/`
255
251
  };
256
252
 
257
253
  const URLS = {
@@ -72,13 +72,10 @@ const addRootLayoutProps = async (componentProps: RootLayoutProps) => {
72
72
  const checkRedisVariables = () => {
73
73
  const requiredVariableValues = [
74
74
  process.env.CACHE_HOST,
75
- process.env.CACHE_PORT
75
+ process.env.CACHE_PORT,
76
+ process.env.CACHE_SECRET
76
77
  ];
77
78
 
78
- if (!settings.usePrettyUrlRoute) {
79
- requiredVariableValues.push(process.env.CACHE_SECRET);
80
- }
81
-
82
79
  if (
83
80
  !requiredVariableValues.every((v) => v) &&
84
81
  process.env.NODE_ENV === 'production'
@@ -4,6 +4,7 @@ import { LocalizationContext } from '../localization/provider';
4
4
  import { useContext } from 'react';
5
5
  import { setCookie, urlLocaleMatcherRegex } from '../utils';
6
6
  import { LocaleUrlStrategy } from '../localization';
7
+ import { useRouter } from 'next/navigation';
7
8
 
8
9
  export const useLocalization = () => {
9
10
  const {
@@ -17,6 +18,8 @@ export const useLocalization = () => {
17
18
  localeUrlStrategy
18
19
  } = useContext(LocalizationContext);
19
20
 
21
+ const router = useRouter();
22
+
20
23
  /**
21
24
  * Sets the locale in the URL.
22
25
  * @param locale Locale value defined in the settings.
@@ -27,8 +30,6 @@ export const useLocalization = () => {
27
30
 
28
31
  let targetUrl;
29
32
 
30
- setCookie('pz-locale', locale);
31
-
32
33
  if (localeUrlStrategy === LocaleUrlStrategy.Subdomain) {
33
34
  const hostParts = hostname.split('.');
34
35
  const subDomain = hostParts[0];
@@ -148,8 +148,7 @@ const withCompleteGpay =
148
148
  logger.info('Redirecting to order success page', {
149
149
  middleware: 'complete-gpay',
150
150
  redirectUrlWithLocale,
151
- ip,
152
- setCookie: request.headers.get('set-cookie')
151
+ ip
153
152
  });
154
153
 
155
154
  // Using POST method while redirecting causes an error,
@@ -149,8 +149,7 @@ const withCompleteMasterpass =
149
149
  logger.info('Redirecting to order success page', {
150
150
  middleware: 'complete-masterpass',
151
151
  redirectUrlWithLocale,
152
- ip,
153
- setCookie: request.headers.get('set-cookie')
152
+ ip
154
153
  });
155
154
 
156
155
  // Using POST method while redirecting causes an error,
@@ -338,24 +338,6 @@ const withPzDefault =
338
338
  middlewareResult = NextResponse.rewrite(url);
339
339
  }
340
340
 
341
- if (
342
- !req.middlewareParams.found &&
343
- Settings.customNotFoundEnabled
344
- ) {
345
- const pathSegments = url.pathname
346
- .replace(/\/+$/, '')
347
- .split('/');
348
- if (pathSegments.length >= 3) {
349
- url.pathname = `/${pathSegments[1]}/${pathSegments[2]}/pz-not-found`;
350
- } else {
351
- url.pathname = '/pz-not-found';
352
- }
353
-
354
- middlewareResult = NextResponse.rewrite(url, {
355
- status: 404
356
- });
357
- }
358
-
359
341
  const { localeUrlStrategy } =
360
342
  Settings.localization;
361
343
 
@@ -405,38 +387,6 @@ const withPzDefault =
405
387
  }
406
388
  );
407
389
 
408
- if (
409
- !url.pathname.startsWith(
410
- `/${currency}/orders`
411
- )
412
- ) {
413
- const currentCookieLocale =
414
- req.cookies.get('pz-locale')?.value;
415
-
416
- const urlHasExplicitLocale =
417
- url.pathname.match(urlLocaleMatcherRegex);
418
- const shouldUpdateCookie =
419
- !currentCookieLocale ||
420
- urlHasExplicitLocale;
421
-
422
- if (shouldUpdateCookie) {
423
- middlewareResult.cookies.set(
424
- 'pz-locale',
425
- locale?.length > 0
426
- ? locale
427
- : defaultLocaleValue,
428
- {
429
- domain: rootHostname,
430
- sameSite: 'none',
431
- secure: true,
432
- expires: new Date(
433
- Date.now() + 1000 * 60 * 60 * 24 * 7
434
- ) // 7 days
435
- }
436
- );
437
- }
438
- }
439
-
440
390
  if (
441
391
  req.cookies.get('pz-locale') &&
442
392
  req.cookies.get('pz-locale').value !== locale
@@ -23,15 +23,7 @@ const getMatchedLocale = (pathname: string, req: PzNextRequest) => {
23
23
  );
24
24
 
25
25
  if (subDomainLocaleMatched && subDomainLocaleMatched[0]) {
26
- const subdomainLocale = subDomainLocaleMatched[0].slice(1);
27
-
28
- const isValidSubdomainLocale = settings.localization.locales.find(
29
- (l) => l.value === subdomainLocale
30
- );
31
-
32
- if (isValidSubdomainLocale) {
33
- matchedLocale = subdomainLocale;
34
- }
26
+ matchedLocale = subDomainLocaleMatched[0].slice(1);
35
27
  }
36
28
  }
37
29
  }
@@ -149,8 +149,7 @@ const withRedirectionPayment =
149
149
  logger.info('Redirecting to order success page', {
150
150
  middleware: 'redirection-payment',
151
151
  redirectUrlWithLocale,
152
- ip,
153
- setCookie: request.headers.get('set-cookie')
152
+ ip
154
153
  });
155
154
 
156
155
  // Using POST method while redirecting causes an error,
@@ -149,8 +149,7 @@ const withSavedCardRedirection =
149
149
  logger.info('Redirecting to order success page', {
150
150
  middleware: 'saved-card-redirection',
151
151
  redirectUrlWithLocale,
152
- ip,
153
- setCookie: request.headers.get('set-cookie')
152
+ ip
154
153
  });
155
154
 
156
155
  // Using POST method while redirecting causes an error,
@@ -4,6 +4,7 @@ import { Buffer } from 'buffer';
4
4
  import logger from '../utils/log';
5
5
  import { getUrlPathWithLocale } from '../utils/localization';
6
6
  import { PzNextRequest } from '.';
7
+ import { ServerVariables } from '../utils/server-variables';
7
8
 
8
9
  const streamToString = async (stream: ReadableStream<Uint8Array> | null) => {
9
10
  if (stream) {
@@ -148,8 +149,7 @@ const withThreeDRedirection =
148
149
  logger.info('Redirecting to order success page', {
149
150
  middleware: 'three-d-redirection',
150
151
  redirectUrlWithLocale,
151
- ip,
152
- setCookie: request.headers.get('set-cookie')
152
+ ip
153
153
  });
154
154
 
155
155
  // Using POST method while redirecting causes an error,
@@ -4,7 +4,6 @@ import { PzNextRequest } from '.';
4
4
  import logger from '../utils/log';
5
5
  import { urlLocaleMatcherRegex } from '../utils';
6
6
  import { getUrlPathWithLocale } from '../utils/localization';
7
- import { shouldIgnoreRedirect } from '../utils/redirect-ignore';
8
7
  import { ROUTES } from 'routes';
9
8
 
10
9
  // This middleware is used to handle url redirections set in Omnitron
@@ -61,13 +60,20 @@ const withUrlRedirection =
61
60
 
62
61
  const setCookies = request.headers.getSetCookie();
63
62
 
64
- if (
65
- shouldIgnoreRedirect(
66
- url.pathname,
67
- req.middlewareParams.rewrites.locale
68
- )
69
- ) {
70
- return middleware(req, event);
63
+ if (settings.commerceRedirectionIgnoreList) {
64
+ const shouldIgnoreRedirect =
65
+ settings.commerceRedirectionIgnoreList.some((ignorePath) =>
66
+ redirectUrl.pathname.startsWith(
67
+ getUrlPathWithLocale(
68
+ ignorePath,
69
+ req.middlewareParams.rewrites.locale
70
+ )
71
+ )
72
+ );
73
+
74
+ if (shouldIgnoreRedirect) {
75
+ return middleware(req, event);
76
+ }
71
77
  }
72
78
 
73
79
  const response = NextResponse.redirect(redirectUrl.toString(), {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@akinon/next",
3
3
  "description": "Core package for Project Zero Next",
4
- "version": "1.103.0-rc.80",
4
+ "version": "1.103.0-snapshot-ZERO-3648-20250930133222",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -35,7 +35,7 @@
35
35
  "set-cookie-parser": "2.6.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@akinon/eslint-plugin-projectzero": "1.103.0-rc.80",
38
+ "@akinon/eslint-plugin-projectzero": "1.103.0-snapshot-ZERO-3648-20250930133222",
39
39
  "@babel/core": "7.26.10",
40
40
  "@babel/preset-env": "7.26.9",
41
41
  "@babel/preset-typescript": "7.27.0",
package/plugins.d.ts CHANGED
@@ -31,14 +31,11 @@ declare module '@akinon/pz-saved-card' {
31
31
  export const SavedCardOption: any;
32
32
  }
33
33
 
34
+ declare module '@akinon/pz-iyzico-saved-card' {
35
+ export const iyzicoSavedCardReducer: any;
36
+ export const iyzicoSavedCardMiddleware: any;
37
+ }
38
+
34
39
  declare module '@akinon/pz-apple-pay' {}
35
40
 
36
41
  declare module '@akinon/pz-flow-payment' {}
37
-
38
- declare module '@akinon/pz-similar-products' {
39
- export const SimilarProductsModal: any;
40
- export const SimilarProductsFilterSidebar: any;
41
- export const SimilarProductsResultsGrid: any;
42
- export const SimilarProductsPlugin: any;
43
- export const SimilarProductsButtonPlugin: any;
44
- }
package/plugins.js CHANGED
@@ -16,7 +16,6 @@ module.exports = [
16
16
  'pz-tabby-extension',
17
17
  'pz-apple-pay',
18
18
  'pz-tamara-extension',
19
- 'pz-hepsipay',
20
19
  'pz-flow-payment',
21
- 'pz-similar-products'
20
+ 'pz-virtual-try-on'
22
21
  ];
@@ -51,11 +51,7 @@ export const errorMiddleware: Middleware = ({ dispatch }: MiddlewareParams) => {
51
51
  const result: CheckoutResult = next(action);
52
52
  const errors = result?.payload?.errors;
53
53
 
54
- if (
55
- !!errors &&
56
- ((typeof errors === 'object' && Object.keys(errors).length > 0) ||
57
- (Array.isArray(errors) && errors.length > 0))
58
- ) {
54
+ if (errors) {
59
55
  dispatch(setErrors(errors));
60
56
  }
61
57
 
@@ -102,7 +98,7 @@ export const contextListMiddleware: Middleware = ({
102
98
  if (result?.payload?.context_list) {
103
99
  result.payload.context_list.forEach((context) => {
104
100
  const redirectUrl = context.page_context.redirect_url;
105
- const isIframe = context.page_context.is_iframe ?? false;
101
+ const isIframe = context.page_context.is_frame ?? false;
106
102
 
107
103
  if (redirectUrl) {
108
104
  const currentLocale = getCookie('pz-locale');
@@ -114,7 +114,6 @@ export interface Order {
114
114
  pk: number;
115
115
  name: string;
116
116
  slug: string;
117
- logo: string;
118
117
  [key: string]: any;
119
118
  };
120
119
  }
package/types/index.ts CHANGED
@@ -83,12 +83,6 @@ export interface Settings {
83
83
  };
84
84
  usePrettyUrlRoute?: boolean;
85
85
  commerceUrl: string;
86
- /**
87
- * This option allows you to track Sentry events on the client side, in addition to server and edge environments.
88
- *
89
- * It overrides process.env.NEXT_PUBLIC_SENTRY_DSN and process.env.SENTRY_DSN.
90
- */
91
- sentryDsn?: string;
92
86
  redis: {
93
87
  defaultExpirationTime: number;
94
88
  };
@@ -298,13 +292,7 @@ export interface ButtonProps
298
292
  target?: '_blank' | '_self' | '_parent' | '_top';
299
293
  }
300
294
 
301
- export interface FileInputProps extends React.HTMLProps<HTMLInputElement> {
302
- fileClassName?: string;
303
- fileNameWrapperClassName?: string;
304
- fileInputClassName?: string;
305
- onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
306
- buttonClassName?: string;
307
- }
295
+ export type FileInputProps = React.HTMLProps<HTMLInputElement>;
308
296
 
309
297
  export interface PriceProps {
310
298
  currencyCode?: string;
@@ -325,19 +313,15 @@ export interface InputProps extends React.HTMLProps<HTMLInputElement> {
325
313
 
326
314
  export interface AccordionProps {
327
315
  isCollapse?: boolean;
328
- collapseClassName?: string;
329
316
  title?: string;
330
317
  subTitle?: string;
331
318
  icons?: string[];
332
319
  iconSize?: number;
333
320
  iconColor?: string;
334
321
  children?: ReactNode;
335
- headerClassName?: string;
336
322
  className?: string;
337
323
  titleClassName?: string;
338
- subTitleClassName?: string;
339
324
  dataTestId?: string;
340
- contentClassName?: string;
341
325
  }
342
326
 
343
327
  export interface PluginModuleComponentProps {
@@ -362,20 +346,3 @@ export interface PaginationProps {
362
346
  direction?: 'next' | 'prev';
363
347
  isLoading?: boolean;
364
348
  }
365
-
366
- export interface ModalProps {
367
- portalId: string;
368
- children?: React.ReactNode;
369
- open?: boolean;
370
- setOpen?: (open: boolean) => void;
371
- title?: React.ReactNode;
372
- showCloseButton?: React.ReactNode;
373
- className?: string;
374
- overlayClassName?: string;
375
- headerWrapperClassName?: string;
376
- titleClassName?: string;
377
- closeButtonClassName?: string;
378
- iconName?: string;
379
- iconSize?: number;
380
- iconClassName?: string;
381
- }
@@ -43,12 +43,12 @@ const appFetch = async <T>({
43
43
  const requestURL = `${decodeURIComponent(commerceUrl)}${url}`;
44
44
 
45
45
  init.headers = {
46
- cookie: nextCookies.toString(),
47
46
  ...(init.headers ?? {}),
48
47
  ...(ServerVariables.globalHeaders ?? {}),
49
48
  'Accept-Language': currentLocale.apiValue,
50
49
  'x-currency': currency,
51
- 'x-forwarded-for': ip
50
+ 'x-forwarded-for': ip,
51
+ cookie: nextCookies.toString()
52
52
  };
53
53
 
54
54
  init.next = {
@@ -60,11 +60,6 @@ const appFetch = async <T>({
60
60
  status = req.status;
61
61
  logger.debug(`FETCH END ${url}`, { status: req.status, ip });
62
62
 
63
- if (!req.ok) {
64
- const errorMessage = `HTTP ${req.status}: ${req.statusText}`;
65
- throw new Error(errorMessage);
66
- }
67
-
68
63
  if (responseType === FetchResponseType.JSON) {
69
64
  response = (await req.json()) as T;
70
65
  } else {