@scayle/storefront-nuxt 8.34.0 → 8.35.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-V7.md +1 -1
- package/CHANGELOG.md +31 -3
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/cached.d.ts +1 -1
- package/dist/runtime/composables/core/useIDP.d.ts +1 -1
- package/dist/runtime/composables/core/useRpc.d.ts +3 -2
- package/dist/runtime/composables/core/useRpc.js +1 -4
- package/dist/runtime/composables/core/useUser.d.ts +2 -2
- package/dist/runtime/composables/storefront/useBasket.d.ts +2 -2
- package/dist/runtime/composables/storefront/useBasket.js +2 -7
- package/dist/runtime/composables/storefront/useCategoryTree.d.ts +1 -1
- package/dist/runtime/composables/storefront/useCategoryTree.js +1 -3
- package/dist/runtime/composables/storefront/useOrder.d.ts +1 -1
- package/dist/runtime/composables/storefront/useWishlist.d.ts +2 -2
- package/dist/runtime/composables/storefront/useWishlist.js +1 -5
- package/dist/runtime/context.d.ts +1 -1
- package/dist/runtime/nitro/plugins/configValidation.d.ts +4 -3
- package/dist/runtime/nitro/plugins/configValidation.js +3 -3
- package/dist/runtime/nitro/plugins/internalFetch.d.ts +1 -1
- package/dist/runtime/server/middleware/bootstrap-utils.d.ts +1 -1
- package/dist/runtime/server/middleware/bootstrap-utils.js +1 -5
- package/dist/runtime/server/middleware/bootstrap.js +1 -4
- package/dist/runtime/server/utils/cacheStorage.d.ts +1 -1
- package/dist/runtime/utils/rpc.d.ts +1 -1
- package/dist/runtime/utils/rpc.js +1 -3
- package/dist/runtime/utils/zodSchema.d.ts +985 -2470
- package/dist/runtime/utils/zodSchema.js +76 -69
- package/package.json +10 -9
package/CHANGELOG-V7.md
CHANGED
|
@@ -1184,7 +1184,7 @@ For more details on `useAsyncData` usage check out the [Nuxt Docs](https://nuxt.
|
|
|
1184
1184
|
|
|
1185
1185
|
### Patch Changes
|
|
1186
1186
|
|
|
1187
|
-
- Fix the type of
|
|
1187
|
+
- Fix the type of uninitialized data in `useBasket` and `useWishlist`
|
|
1188
1188
|
|
|
1189
1189
|
When the request for the basket/wishlist has not completed or has failed, the `data` property is `undefined`. In the previous release this was inadvertently changed to `null`. Now it is once again `undefined`.
|
|
1190
1190
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 8.35.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
**Dependencies**
|
|
8
|
+
|
|
9
|
+
**@scayle/storefront-core v8.35.0**
|
|
10
|
+
|
|
11
|
+
- Minor
|
|
12
|
+
- Removed optional key `fbook` from `ShopUser` interface
|
|
13
|
+
- Renamed incorrectly formatted function `getBackurlFromBreadcrumbs` to `getBackURLFromBreadcrumbs`
|
|
14
|
+
- Patch
|
|
15
|
+
- Renamed interface incorrectly named `IdenfitierFilterItemWithValues` to `IdentifierFilterItemWithValues`
|
|
16
|
+
|
|
17
|
+
## 8.34.1
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependency `zod@^3.23.8` to `zod@^4.0.0`
|
|
22
|
+
|
|
23
|
+
**Dependencies**
|
|
24
|
+
|
|
25
|
+
- Updated dependency to @scayle/unstorage-compression-driver@1.0.0
|
|
26
|
+
|
|
27
|
+
**@scayle/storefront-core v8.34.1**
|
|
28
|
+
|
|
29
|
+
- No changes in this release.
|
|
30
|
+
|
|
3
31
|
## 8.34.0
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
|
@@ -609,7 +637,7 @@
|
|
|
609
637
|
- `FilterItemWithValues`
|
|
610
638
|
- `BooleanFilterItemWithValues`
|
|
611
639
|
- `RangeFilterItemWithValues`
|
|
612
|
-
- `
|
|
640
|
+
- `IdentifierFilterItemWithValues`
|
|
613
641
|
- `AttributesFilterValue`
|
|
614
642
|
|
|
615
643
|
## 8.20.1
|
|
@@ -1314,7 +1342,7 @@
|
|
|
1314
1342
|
### Patch Changes
|
|
1315
1343
|
|
|
1316
1344
|
- Removed dependency `@nuxt/kit@^3.12.2`
|
|
1317
|
-
- Fixed misspelling of interface `
|
|
1345
|
+
- Fixed misspelling of interface `BasketItemDisplayDataItem` to `BasketItemDisplayDataItem`
|
|
1318
1346
|
|
|
1319
1347
|
**Dependencies**
|
|
1320
1348
|
|
|
@@ -1625,7 +1653,7 @@
|
|
|
1625
1653
|
}
|
|
1626
1654
|
```
|
|
1627
1655
|
|
|
1628
|
-
- **\[💥 BREAKING\]** The `store` option in the module configuration has been removed.
|
|
1656
|
+
- **\[💥 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.
|
|
1629
1657
|
|
|
1630
1658
|
- For more information, please refer to the [documentation](https://scayle.dev/en/storefront-guide/developer-guide/basic-setup/introduction#shops).
|
|
1631
1659
|
- **NOTE:** These changes might impact your environment variables used for deployments. Please check your infrastructure and deployment setup and adapt accordingly!
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
package/dist/runtime/cached.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MaybeRefOrGetter } from 'vue';
|
|
2
2
|
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
3
|
-
import {
|
|
3
|
+
import type { UseRpcReturn } from '../core/useRpc.js';
|
|
4
4
|
/**
|
|
5
5
|
* The shape of the data returned by the `getExternalIdpRedirect` RPC call.
|
|
6
6
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { RpcContext, RpcMethodName, RpcMethodParameters, RpcMethodReturnType } from '@scayle/storefront-core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useAsyncData } from 'nuxt/app';
|
|
3
|
+
import type { AsyncDataOptions } from 'nuxt/app';
|
|
4
|
+
import type { MaybeRefOrGetter } from 'vue';
|
|
4
5
|
/**
|
|
5
6
|
* Extracts keys from a type `T` as an array of strings.
|
|
6
7
|
*
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { unwrap } from "@scayle/storefront-core/dist/utils/response";
|
|
2
|
-
import {
|
|
3
|
-
useNuxtApp,
|
|
4
|
-
useAsyncData
|
|
5
|
-
} from "nuxt/app";
|
|
2
|
+
import { useNuxtApp, useAsyncData } from "nuxt/app";
|
|
6
3
|
import { useCoreLog } from "../useCoreLog.js";
|
|
7
4
|
import { useCurrentShop } from "./useCurrentShop.js";
|
|
8
5
|
import { toValue, isRef } from "vue";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ShopUser, UpdatePasswordParams } from '@scayle/storefront-core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { UseRpcReturn } from './useRpc.js';
|
|
3
|
+
import type { ComputedRef } from 'vue';
|
|
4
4
|
/**
|
|
5
5
|
* Extended parameters for the `useUser` composable.
|
|
6
6
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { generateBasketKey } from '@scayle/storefront-core/dist/utils/keys';
|
|
2
2
|
import type { AddOrUpdateItemType, RpcMethodParameters, BasketResponseData, BasketItem, Product, BasketTotalPrice } from '@scayle/storefront-core';
|
|
3
3
|
import { ExistingItemHandling } from '@scayle/storefront-core';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import type { NormalizedRpcResponse, UseRpcReturn } from '../core/useRpc.js';
|
|
5
|
+
import type { MaybeRefOrGetter, ComputedRef, Ref } from 'vue';
|
|
6
6
|
import type { BasketKey, BasketPackageInformation } from '@scayle/storefront-api';
|
|
7
7
|
import type { BasketItemUpdateData } from '@scayle/storefront-core/dist/rpc/methods/index';
|
|
8
8
|
/**
|
|
@@ -8,14 +8,9 @@ import {
|
|
|
8
8
|
wasAddedWithReducedQuantity
|
|
9
9
|
} from "@scayle/storefront-core/dist/utils/basket";
|
|
10
10
|
import { extendPromise } from "../../utils/promise.js";
|
|
11
|
-
import {
|
|
12
|
-
useRpc
|
|
13
|
-
} from "../core/useRpc.js";
|
|
11
|
+
import { useRpc } from "../core/useRpc.js";
|
|
14
12
|
import { useRpcCall } from "../core/useRpcCall.js";
|
|
15
|
-
import {
|
|
16
|
-
toValue,
|
|
17
|
-
computed
|
|
18
|
-
} from "vue";
|
|
13
|
+
import { toValue, computed } from "vue";
|
|
19
14
|
import { FetchError } from "ofetch";
|
|
20
15
|
export function useBasket({
|
|
21
16
|
params
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MaybeRefOrGetter } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import type { KeysOf, NormalizedRpcResponse, UseRpcOptions, UseRpcReturn } from '../core/useRpc.js';
|
|
3
3
|
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
4
4
|
type UseCategoriesBaseReturn<DataT, PickKeys extends KeysOf<DataT>, DefaultT> = Awaited<UseRpcReturn<'getCategoryTree', DataT, PickKeys, DefaultT>> & Promise<Awaited<UseRpcReturn<'getCategoryTree', DataT, PickKeys, DefaultT>>>;
|
|
5
5
|
export declare function useCategoryTree<DataT = NormalizedRpcResponse<'getCategoryTree'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RpcMethodParameters, Order } from '@scayle/storefront-core';
|
|
2
2
|
import type { AsyncDataOptions } from 'nuxt/app';
|
|
3
|
-
import {
|
|
3
|
+
import type { KeysOf, ExtendedAsyncData } from '../core/useRpc.js';
|
|
4
4
|
import type { MaybeRefOrGetter } from 'vue';
|
|
5
5
|
/**
|
|
6
6
|
* Retrieves order data by ID using the `getOrderById` RPC method.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Product, WishlistItem, RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { UseRpcReturn } from '../core/useRpc.js';
|
|
3
|
+
import type { MaybeRefOrGetter, ComputedRef } from 'vue';
|
|
4
4
|
/**
|
|
5
5
|
* Representation of options for configuring the `useWishlist` composable.
|
|
6
6
|
*/
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { useNuxtApp } from "nuxt/app";
|
|
2
2
|
import { useRpc } from "../core/useRpc.js";
|
|
3
3
|
import { extendPromise } from "../../utils/promise.js";
|
|
4
|
-
import {
|
|
5
|
-
computed,
|
|
6
|
-
toValue,
|
|
7
|
-
toRef
|
|
8
|
-
} from "vue";
|
|
4
|
+
import { computed, toValue, toRef } from "vue";
|
|
9
5
|
import { useRpcCall } from "../core/useRpcCall.js";
|
|
10
6
|
export function useWishlist({
|
|
11
7
|
params
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Session } from '@scayle/h3-session';
|
|
2
2
|
import type { RuntimeConfig } from '@nuxt/schema';
|
|
3
|
-
import {
|
|
3
|
+
import type { H3Event } from 'h3';
|
|
4
4
|
import type { Log, RpcContext, Cache as CacheInterface } from '@scayle/storefront-core';
|
|
5
5
|
import { StorefrontAPIClient } from '@scayle/storefront-core';
|
|
6
6
|
import type { ShopConfig, StorefrontConfig } from '../module.js';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { RuntimeConfig } from '@nuxt/schema';
|
|
2
|
-
import type {
|
|
2
|
+
import type { z } from 'zod/mini';
|
|
3
3
|
/**
|
|
4
4
|
* List of keys considered sensitive.
|
|
5
5
|
* These keys will have their values redacted in logs.
|
|
6
6
|
*/
|
|
7
7
|
export declare const sensitiveKeys: string[];
|
|
8
|
+
type ZodIssue = z.core.$ZodIssue;
|
|
8
9
|
/**
|
|
9
10
|
* Gets a value from a nested object using a path array.
|
|
10
11
|
*
|
|
@@ -13,7 +14,7 @@ export declare const sensitiveKeys: string[];
|
|
|
13
14
|
*
|
|
14
15
|
* @returns The value at the specified path, stringified.
|
|
15
16
|
*/
|
|
16
|
-
export declare const getValue: (object: Record<string | number, unknown>, pathArray:
|
|
17
|
+
export declare const getValue: (object: Record<string | number, unknown>, pathArray: PropertyKey[]) => string;
|
|
17
18
|
/**
|
|
18
19
|
* Formats Zod errors for display, redacting sensitive values.
|
|
19
20
|
*
|
|
@@ -28,7 +29,7 @@ export declare const getValue: (object: Record<string | number, unknown>, pathAr
|
|
|
28
29
|
*
|
|
29
30
|
* @returns An array of formatted error messages.
|
|
30
31
|
*/
|
|
31
|
-
export declare const formatZodError: (issues: Array<ZodIssue>, runtimeConfig: RuntimeConfig) => (ZodIssue | {
|
|
32
|
+
export declare const formatZodError: (issues: Array<ZodIssue>, runtimeConfig: RuntimeConfig) => (z.core.$ZodIssue | {
|
|
32
33
|
code: string;
|
|
33
34
|
path: string;
|
|
34
35
|
message: string;
|
|
@@ -20,8 +20,8 @@ export const formatZodError = (issues, runtimeConfig) => {
|
|
|
20
20
|
const errorMessages = [];
|
|
21
21
|
issues.forEach((issue) => {
|
|
22
22
|
if (issue.code === "invalid_union") {
|
|
23
|
-
return issue.
|
|
24
|
-
errorMessages.push(...formatZodError(unionError
|
|
23
|
+
return issue.errors.forEach((unionError) => {
|
|
24
|
+
errorMessages.push(...formatZodError(unionError, runtimeConfig));
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
const key = issue.path[issue.path.length - 1];
|
|
@@ -47,7 +47,7 @@ export default defineNitroPlugin(() => {
|
|
|
47
47
|
const runtimeConfig = useRuntimeConfig();
|
|
48
48
|
const { success, error } = RuntimeConfigSchema.safeParse(runtimeConfig);
|
|
49
49
|
if (!success) {
|
|
50
|
-
const errorMessages = formatZodError(error.
|
|
50
|
+
const errorMessages = formatZodError(error.issues, runtimeConfig);
|
|
51
51
|
consola.error("[storefront-nuxt] configValidation:", errorMessages);
|
|
52
52
|
throw Error("[storefront-nuxt] configValidation: Runtime config invalid");
|
|
53
53
|
}
|
|
@@ -9,7 +9,7 @@ declare module 'h3' {
|
|
|
9
9
|
* Nitro includes an `event.$fetch` function for internal fetch requests to allow sharing the headers and
|
|
10
10
|
* context across requests. However, as of 2.11.7, the context is no longer shared, just the headers. As our
|
|
11
11
|
* bootstrapping depends on this behavior, we create a custom function with the pre-2.11.7 behavior. This enables
|
|
12
|
-
*
|
|
12
|
+
* compatibility with 2.11.7 as well as earlier versions.
|
|
13
13
|
*
|
|
14
14
|
* @see https://nitro.build/guide/plugins
|
|
15
15
|
*
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getRequestHeaders,
|
|
3
|
-
getRequestHost,
|
|
4
|
-
getRequestURL
|
|
5
|
-
} from "h3";
|
|
1
|
+
import { getRequestHeaders, getRequestHost, getRequestURL } from "h3";
|
|
6
2
|
import { joinURL } from "ufo";
|
|
7
3
|
export function getBootstrapPath(url, baseUrl) {
|
|
8
4
|
const queryUrl = url.searchParams.get("url");
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { defineEventHandler, getCookie, deleteCookie, getRequestURL } from "h3";
|
|
2
2
|
import { decodeJwt } from "jose";
|
|
3
3
|
import { randomUUID } from "uncrypto";
|
|
4
|
-
import {
|
|
5
|
-
useSession,
|
|
6
|
-
unsignCookie
|
|
7
|
-
} from "@scayle/h3-session";
|
|
4
|
+
import { useSession, unsignCookie } from "@scayle/h3-session";
|
|
8
5
|
import { trace, SpanStatusCode } from "@opentelemetry/api";
|
|
9
6
|
import { joinURL } from "ufo";
|
|
10
7
|
import { buildContext } from "../../context.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Log } from '@scayle/storefront-core';
|
|
2
2
|
import { UnstorageCache } from '@scayle/storefront-core/dist/cache/providers/unstorage';
|
|
3
|
-
import {
|
|
3
|
+
import type { SessionStore } from '@scayle/h3-session';
|
|
4
4
|
import type { SessionConfig } from '../../../index.js';
|
|
5
5
|
export declare const STORAGE_MOUNT_BASE = "storefront";
|
|
6
6
|
export declare const STORAGE_MOUNT_CACHE = "storefront-cache";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RpcMethods, RpcMethodName, RpcHandler } from '@scayle/storefront-core';
|
|
2
2
|
/**
|
|
3
3
|
* Normalizes a rpc handler function that are not defined with `defineRpcHandler`.
|
|
4
4
|
* Normalization sets the `rpcType` property to `WithParam` or `NoParam` based on the number of parameters the handler function takes.
|