@scayle/storefront-nuxt 8.12.4 → 8.15.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/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 8.15.0
4
+
5
+ ### Patch Changes
6
+
7
+ **@scayle/storefront-core v8.15.0**
8
+
9
+ - Minor
10
+ - Filter out orders from `user.orderSummary` that are not associated with the current shop ID.
11
+
12
+ **Dependencies**
13
+
14
+ ## 8.14.4
15
+
16
+ ### Patch Changes
17
+
18
+ **@scayle/storefront-core v8.14.4**
19
+
20
+ **Dependencies**
21
+
3
22
  ## 8.12.4
4
23
 
5
24
  ### Patch Changes
@@ -406,28 +425,28 @@
406
425
  **rpc-methods.ts**
407
426
 
408
427
  ```typescript
409
- import type { RpcContext, RpcHandler } from '@scayle/storefront-nuxt'
428
+ import type { RpcContext, RpcHandler } from "@scayle/storefront-nuxt";
410
429
 
411
430
  export const foo: RpcHandler<string, number> = function testing(
412
431
  param: string,
413
- _: RpcContext,
432
+ _: RpcContext
414
433
  ) {
415
- return param.length
416
- }
434
+ return param.length;
435
+ };
417
436
  ```
418
437
 
419
438
  **module.ts**
420
439
 
421
440
  ```typescript
422
441
  function setup() {
423
- const resolver = createResolver(import.meta.url)
442
+ const resolver = createResolver(import.meta.url);
424
443
 
425
- nuxt.hook('storefront:custom-rpc:extend', (customRpcImports) => {
444
+ nuxt.hook("storefront:custom-rpc:extend", (customRpcImports) => {
426
445
  customRpcImports.push({
427
- source: resolver.resolve('./rpc-methods.ts'),
428
- names: ['foo'],
429
- })
430
- })
446
+ source: resolver.resolve("./rpc-methods.ts"),
447
+ names: ["foo"],
448
+ });
449
+ });
431
450
  }
432
451
  ```
433
452
 
@@ -649,23 +668,23 @@
649
668
  storefront: {
650
669
  // ...
651
670
  redis: {
652
- host: 'localhost',
671
+ host: "localhost",
653
672
  port: 6379,
654
- prefix: '',
655
- user: '',
656
- password: '',
673
+ prefix: "",
674
+ user: "",
675
+ password: "",
657
676
  sslTransit: false,
658
677
  },
659
678
  // ...
660
679
  session: {
661
680
  // ...
662
- provider: 'redis',
681
+ provider: "redis",
663
682
  },
664
683
  },
665
684
  // ...
666
685
  },
667
686
  // ...
668
- })
687
+ });
669
688
  ```
670
689
 
671
690
  - _Current Unified Storage Approach (`nuxt.config.ts`):_
@@ -679,13 +698,13 @@
679
698
  // ...
680
699
  storage: {
681
700
  cache: {
682
- driver: 'redis',
683
- host: 'localhost',
701
+ driver: "redis",
702
+ host: "localhost",
684
703
  port: 6379,
685
704
  },
686
705
  session: {
687
- driver: 'redis',
688
- host: 'localhost',
706
+ driver: "redis",
707
+ host: "localhost",
689
708
  port: 6379,
690
709
  },
691
710
  // ...
@@ -695,7 +714,7 @@
695
714
  // ...
696
715
  },
697
716
  // ...
698
- })
717
+ });
699
718
  ```
700
719
 
701
720
  - **\[💥 BREAKING\]** The composable `useSearch` has been replaced by `useStorefrontSearch`, consolidating and transitioning to SCAYLE Search v2.
@@ -762,9 +781,9 @@
762
781
 
763
782
  ```ts
764
783
  const { activeFilters, applyFilters, resetFilterUrl, productConditions } =
765
- useQueryFilterState()
784
+ useQueryFilterState();
766
785
 
767
- applyFilters({ brand: 23, sale: true, maxPrice: 100, minPrice: 0 })
786
+ applyFilters({ brand: 23, sale: true, maxPrice: 100, minPrice: 0 });
768
787
  ```
769
788
 
770
789
  - _Current Usage of `useFilter` and `useAppliedFilters`:_
@@ -777,20 +796,20 @@
777
796
  resetFilters,
778
797
  resetPriceFilter,
779
798
  resetFilter,
780
- } = useFilter()
799
+ } = useFilter();
781
800
 
782
- applyPriceFilter([0, 100])
783
- applyBooleanFilter('sale', true)
784
- applyAttributeFilter('brand', 23)
801
+ applyPriceFilter([0, 100]);
802
+ applyBooleanFilter("sale", true);
803
+ applyAttributeFilter("brand", 23);
785
804
 
786
- const route = useRoute()
805
+ const route = useRoute();
787
806
  const {
788
807
  appliedFilter,
789
808
  appliedFiltersCount,
790
809
  appliedAttributeValues,
791
810
  appliedBooleanValues,
792
811
  areFiltersApplied,
793
- } = useAppliedFilters(route)
812
+ } = useAppliedFilters(route);
794
813
  ```
795
814
 
796
815
  - **\[💥 BREAKING\]** The `getBadgeLabel` helper function has been removed, giving you more control over badge label display.
@@ -800,43 +819,43 @@
800
819
 
801
820
  ```ts
802
821
  const BadgeLabel = {
803
- NEW: 'new',
804
- SOLD_OUT: 'sold_out',
805
- ONLINE_EXCLUSIVE: 'online_exclusive',
806
- SUSTAINABLE: 'sustainable',
807
- PREMIUM: 'premium',
808
- DEFAULT: '',
809
- } as const
822
+ NEW: "new",
823
+ SOLD_OUT: "sold_out",
824
+ ONLINE_EXCLUSIVE: "online_exclusive",
825
+ SUSTAINABLE: "sustainable",
826
+ PREMIUM: "premium",
827
+ DEFAULT: "",
828
+ } as const;
810
829
 
811
830
  type BadgeLabelParamsKeys =
812
- | 'isNew'
813
- | 'isSoldOut'
814
- | 'isOnlineOnly'
815
- | 'isSustainable'
816
- | 'isPremium'
817
- type BadgeLabelParams = Partial<Record<BadgeLabelParamsKeys, boolean>>
831
+ | "isNew"
832
+ | "isSoldOut"
833
+ | "isOnlineOnly"
834
+ | "isSustainable"
835
+ | "isPremium";
836
+ type BadgeLabelParams = Partial<Record<BadgeLabelParamsKeys, boolean>>;
818
837
 
819
838
  const getBadgeLabel = (params: BadgeLabelParams = {}): string => {
820
839
  if (!params) {
821
- return BadgeLabel.DEFAULT
840
+ return BadgeLabel.DEFAULT;
822
841
  }
823
842
  const { isNew, isSoldOut, isOnlineOnly, isSustainable, isPremium } =
824
- params
843
+ params;
825
844
 
826
845
  if (isNew) {
827
- return BadgeLabel.NEW
846
+ return BadgeLabel.NEW;
828
847
  } else if (isSoldOut) {
829
- return BadgeLabel.SOLD_OUT
848
+ return BadgeLabel.SOLD_OUT;
830
849
  } else if (isOnlineOnly) {
831
- return BadgeLabel.ONLINE_EXCLUSIVE
850
+ return BadgeLabel.ONLINE_EXCLUSIVE;
832
851
  } else if (isSustainable) {
833
- return BadgeLabel.SUSTAINABLE
852
+ return BadgeLabel.SUSTAINABLE;
834
853
  } else if (isPremium) {
835
- return BadgeLabel.PREMIUM
854
+ return BadgeLabel.PREMIUM;
836
855
  } else {
837
- return BadgeLabel.DEFAULT
856
+ return BadgeLabel.DEFAULT;
838
857
  }
839
- }
858
+ };
840
859
  ```
841
860
 
842
861
  - **\[💥 BREAKING\]** The `store` option in the module configuration has been removed. `œscayle/storefront-nuxt@7.84.0` introduced the `shops` option as a replacement, but maintained backward compatibility with the `store` option. Going forward, configuring shops must be done using the `shops` keyword.
@@ -860,7 +879,7 @@
860
879
  // ...
861
880
  },
862
881
  // ...
863
- })
882
+ });
864
883
  ```
865
884
 
866
885
  - _Previous Environment Variables for Store Configuration:_
@@ -889,7 +908,7 @@
889
908
  // ...
890
909
  },
891
910
  // ...
892
- })
911
+ });
893
912
  ```
894
913
 
895
914
  - _Current Environment Variables for Shops Configuration:_
@@ -909,8 +928,8 @@
909
928
  ```ts
910
929
  useProduct({
911
930
  // ...
912
- key: 'productKey',
913
- })
931
+ key: "productKey",
932
+ });
914
933
  ```
915
934
 
916
935
  - _Current `key` as dedicated composables argument:_
@@ -920,8 +939,8 @@
920
939
  {
921
940
  // ...
922
941
  },
923
- 'productKey',
924
- )
942
+ "productKey"
943
+ );
925
944
  ```
926
945
 
927
946
  - **\[💥 BREAKING\]** Introducing a new feature flag `storefront.legacy.enableSessionMigration` to control the automatic migration of legacy session data, set to `false` by default. Starting with `@scayle/storefront-nuxt@7.68.0` Storefront uses unique session cookie names for each shop, simplifying implementation and enhancing stability.
@@ -938,27 +957,27 @@
938
957
  - _Previous Usage of `handleIDPLoginCallback`:_
939
958
 
940
959
  ```ts
941
- const { handleIDPLoginCallback } = await useIDP()
960
+ const { handleIDPLoginCallback } = await useIDP();
942
961
 
943
962
  watch(
944
963
  () => route.query,
945
964
  async (query) => {
946
965
  if (query.code && isString(query.code)) {
947
- await handleIDPLoginCallback(query.code)
966
+ await handleIDPLoginCallback(query.code);
948
967
  }
949
968
  },
950
- { immediate: true },
951
- )
969
+ { immediate: true }
970
+ );
952
971
  ```
953
972
 
954
973
  - _Current Usage of `loginIDP`:_
955
974
 
956
975
  ```ts
957
- const { loginIDP } = useAuthentication('login')
976
+ const { loginIDP } = useAuthentication("login");
958
977
 
959
978
  onMounted(async () => {
960
- await loginIDP(props.code)
961
- })
979
+ await loginIDP(props.code);
980
+ });
962
981
  ```
963
982
 
964
983
  - **\[🧹 NON-BREAKING\]** Addressed various type resolution errors that were present when using the `@scayle/storefront-nuxt` package with different Node.js versions and module systems. These errors manifested as internal resolution errors or ESM dynamic import only warnings. With this fix, the package now more consistently resolves types correctly across Node.js 16 (CJS and ESM), and bundlers, ensuring a smoother developer experience.
@@ -968,17 +987,17 @@
968
987
  - _Previous `useRpc` with `autoFetch`:_
969
988
 
970
989
  ```ts
971
- useRpc('rpcMethod', key, params, { autoFetch: true })
990
+ useRpc("rpcMethod", key, params, { autoFetch: true });
972
991
 
973
- useUser({ autoFetch: true })
992
+ useUser({ autoFetch: true });
974
993
  ```
975
994
 
976
995
  - _Current `useRpc` with `immediate`:_
977
996
 
978
997
  ```ts
979
- useRpc('rpcMethod', key, params, { immediate: true })
998
+ useRpc("rpcMethod", key, params, { immediate: true });
980
999
 
981
- useUser({ immediate: true })
1000
+ useUser({ immediate: true });
982
1001
  ```
983
1002
 
984
1003
  - **\[💥 BREAKING\]** The attribute `isCmsPreview` has been removed from `RpcContext`.
@@ -998,18 +1017,18 @@
998
1017
  getSearchSuggestions,
999
1018
  fetching,
1000
1019
  ...searchData
1001
- } = useStorefrontSearch(searchQuery, { key })
1020
+ } = useStorefrontSearch(searchQuery, { key });
1002
1021
 
1003
- fetching.value // true or false
1022
+ fetching.value; // true or false
1004
1023
  ```
1005
1024
 
1006
1025
  - _Current `useStorefrontSearch` returning `status`:_
1007
1026
 
1008
1027
  ```ts
1009
1028
  const { data, resolveSearch, getSearchSuggestions, status, ...searchData } =
1010
- useStorefrontSearch(searchQuery, {}, key)
1029
+ useStorefrontSearch(searchQuery, {}, key);
1011
1030
 
1012
- status.value // 'idle', 'pending', 'error' or 'success'
1031
+ status.value; // 'idle', 'pending', 'error' or 'success'
1013
1032
  ```
1014
1033
 
1015
1034
  - **\[💥 BREAKING\]** We've simplified composable caching and clarified the control you have over shared state behavior. The configuration option `disableDefaultGetCachedDataOverride` has been replaced with `legacy.enableDefaultGetCachedDataOverride`, and its logic has been reversed. Now, when `legacy.enableDefaultGetCachedDataOverride` is not set or set to `false`, the default behavior maintains the shared state functionality of `useRpc`, where multiple calls with the same key use the same cached data. Setting the option to `true` bypasses this shared caching, providing data isolation between calls. To maintain your existing caching behavior, simply change the value of `disableDefaultGetCachedDataOverride` to its opposite in your `nuxt.config.ts` file.
@@ -1034,7 +1053,7 @@
1034
1053
  // ...
1035
1054
  },
1036
1055
  // ...
1037
- })
1056
+ });
1038
1057
  ```
1039
1058
 
1040
1059
  - _Current `enableDefaultGetCachedDataOverride`in `nuxt.config.ts`:_
@@ -1059,7 +1078,7 @@
1059
1078
  // ...
1060
1079
  },
1061
1080
  // ...
1062
- })
1081
+ });
1063
1082
  ```
1064
1083
 
1065
1084
  - **\[💥 BREAKING\]** The `useRpc` composable has been updated to provide a more modern and robust data fetching experience, aligning its interface with the current and underlying [Nuxt 3 `useAsyncData`.](https://nuxt.com/docs/api/composables/use-async-data#return-values).
@@ -1081,7 +1100,7 @@
1081
1100
  function myCustomRpc() {
1082
1101
  // ...
1083
1102
 
1084
- throw new BaseError(404)
1103
+ throw new BaseError(404);
1085
1104
  }
1086
1105
  ```
1087
1106
 
@@ -1091,7 +1110,7 @@
1091
1110
  function myCustomRpc() {
1092
1111
  // ...
1093
1112
 
1094
- return new Response(null, { status: 404 })
1113
+ return new Response(null, { status: 404 });
1095
1114
  }
1096
1115
  ```
1097
1116
 
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
- "version": "8.12.4",
3
+ "version": "8.15.0",
4
4
  "configKey": "storefront",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.9.0"
package/dist/module.mjs CHANGED
@@ -53,7 +53,7 @@ export default {
53
53
  }`;
54
54
  }
55
55
  const PACKAGE_NAME = "@scayle/storefront-nuxt";
56
- const PACKAGE_VERSION = "8.12.4";
56
+ const PACKAGE_VERSION = "8.15.0";
57
57
  const logger = createConsola({
58
58
  fancy: true,
59
59
  formatOptions: {
@@ -10,37 +10,5 @@
10
10
  *
11
11
  * @returns The result of the RPC call or a `Response` object with an error status.
12
12
  */
13
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | true | string[] | import("@scayle/storefront-core").ShopUser | Response | import("@scayle/storefront-api").Product | import("@scayle/storefront-api").Product[] | import("@scayle/storefront-core").FetchProductsCountResponse | import("@scayle/storefront-core").FetchFiltersResponse | import("@scayle/storefront-core").FetchProductsByCategoryResponse | import("@scayle/storefront-api").Wishlist | {
14
- accessToken: string;
15
- checkoutJwt: string;
16
- } | import("@scayle/storefront-api").VariantDetail[] | {
17
- basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
18
- } | {
19
- readonly type: "success";
20
- readonly basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
21
- } | {
22
- readonly type: "failure";
23
- readonly basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
24
- readonly errors: import("@scayle/storefront-api").AddOrUpdateItemError[];
25
- } | import("@scayle/storefront-api").BrandsEndpointResponseData | import("@scayle/storefront-api").Brand | {
26
- categories: import("@scayle/storefront-api").Category[];
27
- activeNode: undefined;
28
- } | import("@scayle/storefront-api").Category | {
29
- categories: import("@scayle/storefront-api").Category;
30
- activeNode: import("@scayle/storefront-api").Category;
31
- } | import("@scayle/storefront-core").Order<Record<string, unknown>, Record<string, unknown>> | import("@scayle/storefront-api").SearchV2SuggestionsEndpointResponseData | import("@scayle/storefront-api").SearchEntity | import("@scayle/storefront-api").ShopConfiguration | {
32
- user: import("@scayle/storefront-core").ShopUser | undefined;
33
- } | import("@scayle/storefront-core").ShopUserAddress[] | import("@scayle/storefront-api").NavigationAllEndpointResponseData | import("@scayle/storefront-api").NavigationTree | {
34
- success: true;
35
- } | {
36
- success: false;
37
- } | {
38
- result: true;
39
- } | {
40
- result: false;
41
- } | import("@scayle/storefront-api").PromotionsEndpointResponseData | {
42
- [k: string]: string;
43
- } | {
44
- message: string;
45
- } | null | undefined>>;
13
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
46
14
  export default _default;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "8.12.4",
4
+ "version": "8.15.0",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -81,7 +81,7 @@
81
81
  "dependencies": {
82
82
  "@opentelemetry/api": "^1.9.0",
83
83
  "@scayle/h3-session": "0.6.0",
84
- "@scayle/storefront-core": "8.14.3",
84
+ "@scayle/storefront-core": "8.15.0",
85
85
  "@scayle/unstorage-compression-driver": "^0.2.4",
86
86
  "@vercel/nft": "0.29.2",
87
87
  "@vueuse/core": "13.0.0",
@@ -101,7 +101,7 @@
101
101
  },
102
102
  "devDependencies": {
103
103
  "@eslint/eslintrc": "3.3.1",
104
- "@nuxt/eslint": "1.2.0",
104
+ "@nuxt/eslint": "1.3.0",
105
105
  "@nuxt/kit": "3.15.4",
106
106
  "@nuxt/module-builder": "0.8.4",
107
107
  "@nuxt/schema": "3.15.4",
@@ -109,7 +109,7 @@
109
109
  "@scayle/eslint-config-storefront": "4.5.0",
110
110
  "@scayle/eslint-plugin-vue-composable": "0.2.1",
111
111
  "@scayle/unstorage-scayle-kv-driver": "0.1.1",
112
- "@types/node": "22.13.14",
112
+ "@types/node": "22.13.16",
113
113
  "dprint": "0.49.1",
114
114
  "eslint-formatter-gitlab": "5.1.0",
115
115
  "eslint": "9.23.0",
@@ -117,7 +117,7 @@
117
117
  "h3": "1.15.0",
118
118
  "nitropack": "2.10.4",
119
119
  "node-mocks-http": "1.16.2",
120
- "nuxi": "3.23.1",
120
+ "nuxi": "3.24.0",
121
121
  "nuxt": "3.15.4",
122
122
  "publint": "0.2.12",
123
123
  "typescript": "5.8.2",