@scayle/storefront-nuxt 8.34.0 → 8.34.1
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 +14 -0
- 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/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.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 8.34.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependency `zod@^3.23.8` to `zod@^4.0.0`
|
|
8
|
+
|
|
9
|
+
**Dependencies**
|
|
10
|
+
|
|
11
|
+
- Updated dependency to @scayle/unstorage-compression-driver@1.0.0
|
|
12
|
+
|
|
13
|
+
**@scayle/storefront-core v8.34.1**
|
|
14
|
+
|
|
15
|
+
- No changes in this release.
|
|
16
|
+
|
|
3
17
|
## 8.34.0
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
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
|
}
|
|
@@ -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.
|