@scayle/storefront-nuxt 8.36.0 → 8.38.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 +33 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/api/rpcHandler.d.ts +2 -2
- package/dist/runtime/composables/index.d.ts +1 -0
- package/dist/runtime/composables/index.js +1 -0
- package/dist/runtime/composables/storefront/useCampaign.d.ts +18 -0
- package/dist/runtime/composables/storefront/useCampaign.js +11 -0
- package/dist/test/factories.mjs +3 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 8.38.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Refined the `ContextWithoutSession` type to accurately represent actual data: `wishlistKey`, `basketKey`, and `sessionId` are now typed as `string` instead of `undefined`, since even logged-out users have these values set.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
**Dependencies**
|
|
12
|
+
|
|
13
|
+
**@scayle/storefront-core v8.38.0**
|
|
14
|
+
|
|
15
|
+
- Minor
|
|
16
|
+
- Refined the `ContextWithoutSession` type to accurately represent actual data: `wishlistKey`, `basketKey`, and `sessionId` are now typed as `string` instead of `undefined`, since even logged-out users have these values set.
|
|
17
|
+
- Made `getCheckoutToken` callable by logged-in and not logged-in users. When called by a not logged-in user, the RPC returns only the `checkoutJWT`. For logged-in users, it continues to return both the `checkoutJWT` and a refreshed `accessToken` as before.
|
|
18
|
+
|
|
19
|
+
## 8.37.0
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- Created the composable `useCampaign` which uses the RPC `getCampaign` to fetch the first active campaign
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
**Dependencies**
|
|
28
|
+
|
|
29
|
+
**@scayle/storefront-core v8.37.0**
|
|
30
|
+
|
|
31
|
+
- Minor
|
|
32
|
+
- The `where` parameter for the `getProductsByCategory` and `getProductsCount` RPCs was extended to include the previously missing options `sellableAt`, `hasCampaignReduction`, and `containsSearch`.
|
|
33
|
+
- Patch
|
|
34
|
+
- Added missing export of the RPC `getCampaign`
|
|
35
|
+
|
|
3
36
|
## 8.36.0
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
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 | boolean | void | string[] | import("@scayle/storefront-core").ShopUser | Record<string, string> | 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 | {
|
|
13
|
+
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | boolean | void | string[] | import("@scayle/storefront-api").Campaign | import("@scayle/storefront-core").ShopUser | Record<string, string> | 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 | {
|
|
14
14
|
basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
|
|
15
15
|
} | {
|
|
16
16
|
fromBasketKey: string;
|
|
@@ -38,7 +38,7 @@ declare const _default: import("h3").EventHandler<import("h3").EventHandlerReque
|
|
|
38
38
|
} | import("@scayle/storefront-api").ShopConfiguration | {
|
|
39
39
|
user?: import("@scayle/storefront-core").ShopUser;
|
|
40
40
|
} | import("@scayle/storefront-api").Wishlist | import("@scayle/storefront-core").ShopUserAddress[] | {
|
|
41
|
-
accessToken: string;
|
|
41
|
+
accessToken: string | undefined;
|
|
42
42
|
checkoutJwt: string;
|
|
43
43
|
} | import("@scayle/storefront-api").VariantDetail[] | import("@scayle/storefront-api").NavigationAllEndpointResponseData | import("@scayle/storefront-api").NavigationTree | {
|
|
44
44
|
success: boolean;
|
|
@@ -10,6 +10,7 @@ export * from './core/useUser.js';
|
|
|
10
10
|
export * from './storefront/useBasket.js';
|
|
11
11
|
export * from './storefront/useBrand.js';
|
|
12
12
|
export * from './storefront/useBrands.js';
|
|
13
|
+
export * from './storefront/useCampaign.js';
|
|
13
14
|
export * from './storefront/useCategories.js';
|
|
14
15
|
export * from './storefront/useCategoryById.js';
|
|
15
16
|
export * from './storefront/useCategoryByPath.js';
|
|
@@ -10,6 +10,7 @@ export * from "./core/useUser.js";
|
|
|
10
10
|
export * from "./storefront/useBasket.js";
|
|
11
11
|
export * from "./storefront/useBrand.js";
|
|
12
12
|
export * from "./storefront/useBrands.js";
|
|
13
|
+
export * from "./storefront/useCampaign.js";
|
|
13
14
|
export * from "./storefront/useCategories.js";
|
|
14
15
|
export * from "./storefront/useCategoryById.js";
|
|
15
16
|
export * from "./storefront/useCategoryByPath.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
|
|
2
|
+
/**
|
|
3
|
+
* Retrieves the first active campaign.
|
|
4
|
+
*
|
|
5
|
+
* This function acts as a wrapper around the `useRpc` composable,
|
|
6
|
+
* simplifying the process of fetching data. It internally calls `useRpc`
|
|
7
|
+
* with the provided parameters and options.
|
|
8
|
+
*
|
|
9
|
+
* @param params An object containing parameters and options for the `getCampaign` RPC call.
|
|
10
|
+
* @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
|
|
11
|
+
* @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
|
|
12
|
+
*
|
|
13
|
+
* @returns The result of the `useRpc` call, which includes the fetched campaign data,
|
|
14
|
+
* loading state, and any error information.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useCampaign<DataT = NormalizedRpcResponse<'getCampaign'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ options, }?: Partial<{
|
|
17
|
+
options: UseRpcOptions<'getCampaign', DataT, PickKeys, DefaultT>;
|
|
18
|
+
}>, key?: string): UseRpcReturn<'getCampaign', DataT, PickKeys, DefaultT>;
|
package/dist/test/factories.mjs
CHANGED
|
@@ -84,9 +84,9 @@ const rpcContextFactory = Factory.define(({ transientParams }) => {
|
|
|
84
84
|
updateUser: () => Promise.resolve(),
|
|
85
85
|
updateTokens: () => Promise.resolve()
|
|
86
86
|
} : {
|
|
87
|
-
wishlistKey:
|
|
88
|
-
basketKey:
|
|
89
|
-
sessionId:
|
|
87
|
+
wishlistKey: "logged-out-wishlist-key",
|
|
88
|
+
basketKey: "logged-out-basket-key",
|
|
89
|
+
sessionId: "logged-out-session-id",
|
|
90
90
|
user: void 0,
|
|
91
91
|
accessToken: void 0,
|
|
92
92
|
refreshToken: void 0,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.38.0",
|
|
5
5
|
"description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
|
|
6
6
|
"author": "SCAYLE Commerce Engine",
|
|
7
7
|
"license": "MIT",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"utility-types": "^3.11.0",
|
|
91
91
|
"vue-router": "^4.4.0",
|
|
92
92
|
"zod": "^4.0.0",
|
|
93
|
-
"@scayle/storefront-core": "8.
|
|
93
|
+
"@scayle/storefront-core": "8.38.0",
|
|
94
94
|
"@scayle/unstorage-compression-driver": "1.0.0"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"unbuild": "3.5.0",
|
|
119
119
|
"vitest": "3.2.4",
|
|
120
120
|
"vue-tsc": "3.0.3",
|
|
121
|
-
"@scayle/eslint-config-storefront": "4.
|
|
121
|
+
"@scayle/eslint-config-storefront": "4.7.0",
|
|
122
122
|
"@scayle/eslint-plugin-vue-composable": "0.2.1",
|
|
123
123
|
"@scayle/unstorage-scayle-kv-driver": "1.0.2"
|
|
124
124
|
},
|