@scayle/storefront-nuxt 7.38.1 → 7.40.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 +19 -0
- package/dist/module.json +1 -1
- package/dist/runtime/api/cacheAuth.d.ts +1 -1
- package/dist/runtime/composables/core/useRpc.d.ts +1 -1
- package/dist/runtime/composables/core/useRpc.mjs +1 -4
- package/dist/runtime/composables/core/useUser.d.ts +1 -1
- package/dist/runtime/composables/storefront/useBasket.d.ts +3 -2
- package/dist/runtime/composables/storefront/useBrand.d.ts +2 -2
- package/dist/runtime/composables/storefront/useBrands.d.ts +2 -2
- package/dist/runtime/composables/storefront/useCategories.d.ts +2 -2
- package/dist/runtime/composables/storefront/useFacet.d.ts +1 -1
- package/dist/runtime/composables/storefront/useFilters.d.ts +2 -2
- package/dist/runtime/composables/storefront/useNavigationTree.d.ts +2 -2
- package/dist/runtime/composables/storefront/useNavigationTrees.d.ts +2 -2
- package/dist/runtime/composables/storefront/useOrder.d.ts +2 -2
- package/dist/runtime/composables/storefront/useOrderConfirmation.d.ts +2 -2
- package/dist/runtime/composables/storefront/useProductsCount.d.ts +2 -2
- package/dist/runtime/composables/storefront/useQueryFilterState.d.ts +1 -1
- package/dist/runtime/composables/storefront/useShopConfiguration.d.ts +1 -1
- package/dist/runtime/composables/storefront/useUserAddresses.d.ts +1 -1
- package/dist/runtime/composables/storefront/useWishlist.d.ts +3 -3
- package/dist/runtime/context.d.ts +2 -2
- package/dist/runtime/context.mjs +1 -3
- package/dist/runtime/handler.d.ts +1 -1
- package/dist/runtime/handler.mjs +1 -3
- package/dist/runtime/server/middleware/bootstrap.d.ts +1 -1
- package/dist/runtime/server/middleware/bootstrap.mjs +1 -4
- package/dist/runtime/server/middleware/cache.d.ts +4 -3
- package/dist/runtime/server/middleware/oauth.d.ts +1 -1
- package/dist/runtime/server/middleware/redirects.d.ts +1 -1
- package/dist/runtime/server/middleware/redirects.mjs +5 -7
- package/dist/runtime/utils/error.d.ts +2 -2
- package/package.json +23 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 7.40.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Update to Nuxt `v3.8.1` (See [Nuxt 3.8 Release Notes](https://github.com/nuxt/nuxt/releases/tag/v3.8.0) and [Nuxt 3.8.1 Release Notes](https://github.com/nuxt/nuxt/releases/tag/v3.8.1) for more details.)
|
|
8
|
+
- Refactored imports to be compatible with TypeScript `verbatimModuleSyntax` option (See [TypeScript 5.0 - verbatimModuleSyntax](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#--verbatimmodulesyntax) for more details.)
|
|
9
|
+
- Update to Vue `v3.3.8` (See [Vue 3.3.8 Release notes](https://github.com/vuejs/core/blob/main/CHANGELOG.md#338-2023-11-06) for more details.)
|
|
10
|
+
|
|
11
|
+
## 7.39.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- Redirects should use the cache provider configured for the shop
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
- @scayle/storefront-core@7.25.1
|
|
21
|
+
|
|
3
22
|
## 7.38.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/module.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RpcContext, RpcMethodName, RpcMethodParameters, RpcMethodReturnType } from '@scayle/storefront-core';
|
|
2
|
-
import { AsyncDataOptions, NuxtError } from 'nuxt/app';
|
|
2
|
+
import type { AsyncDataOptions, NuxtError } from 'nuxt/app';
|
|
3
3
|
type KeysOf<T> = Array<T extends T ? (keyof T extends string ? keyof T : never) : never>;
|
|
4
4
|
export type RpcAsyncDataOptions<TResult> = AsyncDataOptions<TResult, TResult, KeysOf<TResult>, TResult>;
|
|
5
5
|
export interface RpcOptions {
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useNuxtApp,
|
|
3
|
-
useState
|
|
4
|
-
} from "nuxt/app";
|
|
1
|
+
import { useNuxtApp, useState } from "nuxt/app";
|
|
5
2
|
import { useCoreLog } from "../useCoreLog.mjs";
|
|
6
3
|
import { handleError } from "../../utils/error.mjs";
|
|
7
4
|
import { useCurrentShop } from "./useCurrentShop.mjs";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { AddOrUpdateItemType,
|
|
2
|
-
import {
|
|
1
|
+
import type { AddOrUpdateItemType, RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
|
+
import { ExistingItemHandling } from '@scayle/storefront-core';
|
|
3
|
+
import type { RpcOptions } from '../core/useRpc';
|
|
3
4
|
import { type MaybeRefOrGetter } from '#imports';
|
|
4
5
|
type UseBasketOptions = Partial<{
|
|
5
6
|
params: MaybeRefOrGetter<RpcMethodParameters<'getBasket'>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
|
-
import { RpcOptions } from '../core/useRpc';
|
|
1
|
+
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
|
+
import type { RpcOptions } from '../core/useRpc';
|
|
3
3
|
import type { MaybeRefOrGetter } from '#imports';
|
|
4
4
|
type Options = Partial<{
|
|
5
5
|
params: MaybeRefOrGetter<RpcMethodParameters<'getBrandById'>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
|
-
import { RpcOptions } from '../core/useRpc';
|
|
1
|
+
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
|
+
import type { RpcOptions } from '../core/useRpc';
|
|
3
3
|
import type { MaybeRefOrGetter } from '#imports';
|
|
4
4
|
type Options = Partial<{
|
|
5
5
|
params: MaybeRefOrGetter<RpcMethodParameters<'getBrands'>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
|
-
import { RpcOptions } from '../core/useRpc';
|
|
1
|
+
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
|
+
import type { RpcOptions } from '../core/useRpc';
|
|
3
3
|
import type { MaybeRefOrGetter } from '#imports';
|
|
4
4
|
type Options = Partial<{
|
|
5
5
|
params: MaybeRefOrGetter<RpcMethodParameters<'getCategoriesByPath'>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
|
-
import { RpcOptions } from '../core/useRpc';
|
|
1
|
+
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
|
+
import type { RpcOptions } from '../core/useRpc';
|
|
3
3
|
import type { MaybeRefOrGetter } from '#imports';
|
|
4
4
|
type Options = Partial<{
|
|
5
5
|
params: MaybeRefOrGetter<RpcMethodParameters<'getFilters'>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
|
-
import { RpcOptions } from '../core/useRpc';
|
|
1
|
+
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
|
+
import type { RpcOptions } from '../core/useRpc';
|
|
3
3
|
import type { MaybeRefOrGetter } from '#imports';
|
|
4
4
|
type Options = Partial<{
|
|
5
5
|
params: MaybeRefOrGetter<RpcMethodParameters<'fetchNavigationTreeById'>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
|
-
import { RpcOptions } from '../core/useRpc';
|
|
1
|
+
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
|
+
import type { RpcOptions } from '../core/useRpc';
|
|
3
3
|
import type { MaybeRefOrGetter } from '#imports';
|
|
4
4
|
type Options = Partial<{
|
|
5
5
|
params: MaybeRefOrGetter<RpcMethodParameters<'fetchAllNavigationTrees'>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RpcMethodParameters, Order } from '@scayle/storefront-core';
|
|
2
|
-
import { RpcOptions } from '../core/useRpc';
|
|
1
|
+
import type { RpcMethodParameters, Order } from '@scayle/storefront-core';
|
|
2
|
+
import type { RpcOptions } from '../core/useRpc';
|
|
3
3
|
import type { MaybeRefOrGetter } from '#imports';
|
|
4
4
|
type Options = Partial<{
|
|
5
5
|
params: MaybeRefOrGetter<RpcMethodParameters<'getOrderById'>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RpcMethodParameters, Order } from '@scayle/storefront-core';
|
|
2
|
-
import { RpcOptions } from '../core/useRpc';
|
|
1
|
+
import type { RpcMethodParameters, Order } from '@scayle/storefront-core';
|
|
2
|
+
import type { RpcOptions } from '../core/useRpc';
|
|
3
3
|
import type { MaybeRefOrGetter } from '#imports';
|
|
4
4
|
type Options = Partial<{
|
|
5
5
|
params: MaybeRefOrGetter<RpcMethodParameters<'getOrderDataByCbd'>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
|
-
import { RpcOptions } from '../core/useRpc';
|
|
1
|
+
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
|
+
import type { RpcOptions } from '../core/useRpc';
|
|
3
3
|
import type { MaybeRefOrGetter } from '#imports';
|
|
4
4
|
type Options = Partial<{
|
|
5
5
|
params: MaybeRefOrGetter<RpcMethodParameters<'getProductsCount'>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Product, WishlistItem, RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
|
-
import { RpcOptions } from '../core/useRpc';
|
|
3
|
-
import {
|
|
1
|
+
import type { Product, WishlistItem, RpcMethodParameters } from '@scayle/storefront-core';
|
|
2
|
+
import type { RpcOptions } from '../core/useRpc';
|
|
3
|
+
import type { MaybeRefOrGetter } from '#imports';
|
|
4
4
|
type Options = Partial<{
|
|
5
5
|
params: MaybeRefOrGetter<RpcMethodParameters<'getWishlist'>>;
|
|
6
6
|
options: RpcOptions;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Log, RpcContext, Cache as CacheInterface } from '@scayle/storefront-core';
|
|
2
1
|
import type { Session } from '@scayle/h3-session';
|
|
3
2
|
import type { RuntimeConfig } from '@nuxt/schema';
|
|
4
|
-
import {
|
|
3
|
+
import type { Log, RpcContext, Cache as CacheInterface } from '@scayle/storefront-core';
|
|
4
|
+
import type { ShopConfig, StorefrontConfig } from '../module';
|
|
5
5
|
export interface ContextBuilderOptions {
|
|
6
6
|
$cache: CacheInterface;
|
|
7
7
|
$shopConfig: ShopConfig;
|
package/dist/runtime/context.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RpcContext, RpcMethodName, RpcMethodParameters, RpcMethodReturnType } from '@scayle/storefront-core';
|
|
1
|
+
import type { RpcContext, RpcMethodName, RpcMethodParameters, RpcMethodReturnType } from '@scayle/storefront-core';
|
|
2
2
|
/**
|
|
3
3
|
* Handler for RPC methods
|
|
4
4
|
* @param method
|
package/dist/runtime/handler.mjs
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
rpcMethods as coreRpcMethods
|
|
3
|
-
} from "@scayle/storefront-core";
|
|
1
|
+
import { rpcMethods as coreRpcMethods } from "@scayle/storefront-core";
|
|
4
2
|
import * as storefrontRpcMethods from "#rpcMethods";
|
|
5
3
|
export const handler = async (method, payload, rpcContext) => {
|
|
6
4
|
const rpcMethods = {
|
|
@@ -5,10 +5,7 @@ import { randomUUID } from "uncrypto";
|
|
|
5
5
|
import redisDriver from "unstorage/drivers/redis";
|
|
6
6
|
import memoryDriver from "unstorage/drivers/memory";
|
|
7
7
|
import { createStorage } from "unstorage";
|
|
8
|
-
import {
|
|
9
|
-
useSession,
|
|
10
|
-
UnstorageSessionStore
|
|
11
|
-
} from "@scayle/h3-session";
|
|
8
|
+
import { useSession, UnstorageSessionStore } from "@scayle/h3-session";
|
|
12
9
|
import { buildContext } from "../../context.mjs";
|
|
13
10
|
import createLog from "../../createLog.mjs";
|
|
14
11
|
import {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Log } from '@scayle/storefront-core';
|
|
2
|
+
import { UnstorageCache } from '@scayle/storefront-core/dist/cache/providers/unstorage';
|
|
3
|
+
import type { RedisConfig, StorageProvider } from '../../../types/module';
|
|
3
4
|
/**
|
|
4
5
|
* Create an unstorage-backed cache interface
|
|
5
6
|
* @param provider
|
|
@@ -9,4 +10,4 @@ import { RedisConfig, StorageProvider } from '../../../types/module';
|
|
|
9
10
|
*/
|
|
10
11
|
export declare function createCache(provider: StorageProvider, prefix: string, log: Log, options?: {
|
|
11
12
|
redis?: RedisConfig;
|
|
12
|
-
}):
|
|
13
|
+
}): UnstorageCache;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { H3Event } from 'h3';
|
|
1
|
+
import type { H3Event } from 'h3';
|
|
2
2
|
export declare function useRedirects(event: H3Event): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { sendRedirect, getRequestURL } from "h3";
|
|
2
|
+
import { UnstorageCache } from "@scayle/storefront-core/dist/cache/providers/unstorage";
|
|
2
3
|
import { getRedirectLookupUrls, getTargetLocation } from "./redirects.utils.mjs";
|
|
3
|
-
import { createCache } from "./cache.mjs";
|
|
4
4
|
import { useRuntimeConfig } from "#imports";
|
|
5
5
|
const REDIS_REDIRECT_PREFIX = ":REDIRECT";
|
|
6
6
|
const REDIRECT_NOT_SET = "REDIRECT_NOT_SET";
|
|
@@ -46,13 +46,11 @@ export async function useRedirects(event) {
|
|
|
46
46
|
xForwardedProto: true,
|
|
47
47
|
xForwardedHost: true
|
|
48
48
|
});
|
|
49
|
-
const currentShop = event.context.$currentShop;
|
|
50
49
|
const log = event.context.$rpcContext.log.space("sfc").space("redirects");
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
{ redis: $storefrontConfig.redis }
|
|
50
|
+
const shopCache = event.context.$cache;
|
|
51
|
+
const redirectCache = new UnstorageCache(
|
|
52
|
+
shopCache.storage,
|
|
53
|
+
shopCache.prefix + REDIS_REDIRECT_PREFIX
|
|
56
54
|
);
|
|
57
55
|
const bapiClient = event.context.$rpcContext.bapiClient;
|
|
58
56
|
const queryParamWhitelist = new Set(options?.queryParamWhitelist ?? []);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NuxtError } from 'nuxt/app';
|
|
2
|
-
import { FetchError } from 'ofetch';
|
|
1
|
+
import type { NuxtError } from 'nuxt/app';
|
|
2
|
+
import type { FetchError } from 'ofetch';
|
|
3
3
|
import { parseErrorData } from '../error/handler';
|
|
4
4
|
declare const handleError: (error: FetchError | Error | unknown, additionalData?: unknown) => NuxtError;
|
|
5
5
|
export { handleError, parseErrorData };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.40.0",
|
|
5
5
|
"description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
|
|
6
6
|
"author": "SCAYLE Commerce Engine",
|
|
7
7
|
"license": "MIT",
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"test:watch": "vitest watch"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@nuxt/kit": "3.
|
|
63
|
+
"@nuxt/kit": "3.8.1",
|
|
64
64
|
"@scayle/h3-session": "0.3.4",
|
|
65
|
-
"@scayle/storefront-core": "7.25.
|
|
66
|
-
"@vueuse/core": "10.
|
|
65
|
+
"@scayle/storefront-core": "7.25.1",
|
|
66
|
+
"@vueuse/core": "10.6.1",
|
|
67
67
|
"consola": "3.2.3",
|
|
68
68
|
"core-js": "3.33.2",
|
|
69
69
|
"defu": "6.1.3",
|
|
@@ -73,30 +73,42 @@
|
|
|
73
73
|
"radash": "11.0.0",
|
|
74
74
|
"uncrypto": "0.1.3",
|
|
75
75
|
"vue-router": "4.2.5",
|
|
76
|
-
"yn": "
|
|
76
|
+
"yn": "5.0.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@nuxt/module-builder": "0.5.4",
|
|
80
|
-
"@nuxt/schema": "3.
|
|
81
|
-
"@nuxt/test-utils": "3.
|
|
80
|
+
"@nuxt/schema": "3.8.1",
|
|
81
|
+
"@nuxt/test-utils": "3.8.1",
|
|
82
82
|
"@scayle/eslint-config-storefront": "3.2.5",
|
|
83
83
|
"@scayle/prettier-config-storefront": "2.0.2",
|
|
84
84
|
"@types/node": "20.9.0",
|
|
85
85
|
"eslint": "8.53.0",
|
|
86
86
|
"eslint-formatter-gitlab": "5.1.0",
|
|
87
87
|
"node-mocks-http": "1.13.0",
|
|
88
|
-
"nuxt": "3.
|
|
88
|
+
"nuxt": "3.8.1",
|
|
89
89
|
"prettier": "3.0.0",
|
|
90
90
|
"publint": "0.2.5",
|
|
91
|
-
"unstorage": "1.
|
|
91
|
+
"unstorage": "1.10.1",
|
|
92
92
|
"vitest": "0.34.6",
|
|
93
93
|
"vue-tsc": "1.8.22"
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|
|
96
|
-
"nuxt": ">=3.
|
|
97
|
-
"unstorage": ">= 1.
|
|
96
|
+
"nuxt": ">=3.8.1",
|
|
97
|
+
"unstorage": ">= 1.10.1",
|
|
98
98
|
"vue": ">=3.3.0"
|
|
99
99
|
},
|
|
100
|
+
"resolutions": {
|
|
101
|
+
"@vue/compiler-core": "3.3.8",
|
|
102
|
+
"@vue/shared": "3.3.8",
|
|
103
|
+
"@vue/compiler-dom": "3.3.8",
|
|
104
|
+
"@vue/compiler-sfc": "3.3.8",
|
|
105
|
+
"@vue/compiler-ssr": "3.3.8",
|
|
106
|
+
"@vue/reactivity-transform": "3.3.8",
|
|
107
|
+
"@vue/reactivity": "3.3.8",
|
|
108
|
+
"@vue/runtime-core": "3.3.8",
|
|
109
|
+
"@vue/runtime-dom": "3.3.8",
|
|
110
|
+
"@vue/server-renderer": "3.3.8"
|
|
111
|
+
},
|
|
100
112
|
"volta": {
|
|
101
113
|
"node": "20.9.0"
|
|
102
114
|
}
|