@scayle/storefront-nuxt 7.39.0 → 7.40.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 +15 -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/useSession.d.ts +6 -12
- 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 +2 -2
- package/dist/runtime/server/middleware/oauth.d.ts +1 -1
- package/dist/runtime/server/middleware/oauth.mjs +6 -7
- package/dist/runtime/server/middleware/redirects.d.ts +1 -1
- package/dist/runtime/utils/error.d.ts +2 -2
- package/package.json +21 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 7.40.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @scayle/storefront-core@7.26.0
|
|
9
|
+
|
|
10
|
+
## 7.40.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- 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.)
|
|
15
|
+
- 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.)
|
|
16
|
+
- 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.)
|
|
17
|
+
|
|
3
18
|
## 7.39.0
|
|
4
19
|
|
|
5
20
|
### Minor 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,21 +1,15 @@
|
|
|
1
1
|
export declare function useSession(): {
|
|
2
|
-
login: (params: import("@scayle/storefront-core").LoginRequest) => Promise<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}>;
|
|
8
|
-
guestLogin: (params: import("@scayle/storefront-core").GuestRequest) => Promise<{
|
|
9
|
-
oauth: import("@scayle/storefront-core").Oauth | null;
|
|
2
|
+
login: (params: import("@scayle/storefront-core").LoginRequest) => Promise<undefined>;
|
|
3
|
+
register: (params: import("@scayle/storefront-core").RegisterRequest) => Promise<undefined>;
|
|
4
|
+
guestLogin: (params: import("@scayle/storefront-core").GuestRequest) => Promise<undefined>;
|
|
5
|
+
refreshToken: () => Promise<{
|
|
6
|
+
success: boolean;
|
|
10
7
|
}>;
|
|
11
|
-
refreshToken: () => Promise<import("@scayle/storefront-core").Oauth | null>;
|
|
12
8
|
revokeToken: () => Promise<{
|
|
13
9
|
result: boolean;
|
|
14
10
|
}>;
|
|
15
11
|
forgetPassword: (params: import("@scayle/storefront-core").SendResetPasswordEmailRequest) => Promise<{
|
|
16
12
|
success: boolean;
|
|
17
13
|
}>;
|
|
18
|
-
resetPasswordByHash: (params: import("@scayle/storefront-core").UpdatePasswordByHashRequest) => Promise<
|
|
19
|
-
oauth: import("@scayle/storefront-core").Oauth | null;
|
|
20
|
-
}>;
|
|
14
|
+
resetPasswordByHash: (params: import("@scayle/storefront-core").UpdatePasswordByHashRequest) => Promise<undefined>;
|
|
21
15
|
};
|
|
@@ -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,6 +1,6 @@
|
|
|
1
|
-
import { Log } from '@scayle/storefront-core';
|
|
1
|
+
import type { Log } from '@scayle/storefront-core';
|
|
2
2
|
import { UnstorageCache } from '@scayle/storefront-core/dist/cache/providers/unstorage';
|
|
3
|
-
import { RedisConfig, StorageProvider } from '../../../types/module';
|
|
3
|
+
import type { RedisConfig, StorageProvider } from '../../../types/module';
|
|
4
4
|
/**
|
|
5
5
|
* Create an unstorage-backed cache interface
|
|
6
6
|
* @param provider
|
|
@@ -5,19 +5,18 @@ async function updateSession(event, data) {
|
|
|
5
5
|
Object.assign(session.data, data);
|
|
6
6
|
await session.save();
|
|
7
7
|
}
|
|
8
|
-
const updateUser = async (event
|
|
8
|
+
const updateUser = async (event) => {
|
|
9
|
+
const session = event.context.session;
|
|
9
10
|
const checkoutUrl = event.context.$rpcContext.checkout.url;
|
|
10
11
|
const shopId = event.context.$currentShop.shopId;
|
|
11
12
|
const user = await rpcMethods.fetchUser(
|
|
12
|
-
{ accessToken:
|
|
13
|
+
{ accessToken: session.data.accessToken, callback: "" },
|
|
13
14
|
{
|
|
14
15
|
checkoutUrl,
|
|
15
16
|
shopId
|
|
16
17
|
}
|
|
17
18
|
);
|
|
18
19
|
await updateSession(event, {
|
|
19
|
-
accessToken: tokens.access_token,
|
|
20
|
-
refreshToken: tokens.refresh_token,
|
|
21
20
|
user
|
|
22
21
|
});
|
|
23
22
|
};
|
|
@@ -27,13 +26,13 @@ const updateAccessTokenWithRefreshToken = async (event, sessionData, log) => {
|
|
|
27
26
|
}
|
|
28
27
|
try {
|
|
29
28
|
const context = event.context.$rpcContext;
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
29
|
+
const { success } = await rpcMethods.refreshAccessToken(context);
|
|
30
|
+
if (!success) {
|
|
32
31
|
await revokeTokensAndDestroySession(event, log);
|
|
33
32
|
return true;
|
|
34
33
|
}
|
|
35
34
|
try {
|
|
36
|
-
await updateUser(event
|
|
35
|
+
await updateUser(event);
|
|
37
36
|
return true;
|
|
38
37
|
} catch (e) {
|
|
39
38
|
log.error("api/oauth/me", {
|
|
@@ -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,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.1",
|
|
5
5
|
"description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
|
|
6
6
|
"author": "SCAYLE Commerce Engine",
|
|
7
7
|
"license": "MIT",
|
|
@@ -60,9 +60,9 @@
|
|
|
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.
|
|
65
|
+
"@scayle/storefront-core": "7.26.0",
|
|
66
66
|
"@vueuse/core": "10.6.1",
|
|
67
67
|
"consola": "3.2.3",
|
|
68
68
|
"core-js": "3.33.2",
|
|
@@ -73,19 +73,19 @@
|
|
|
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
91
|
"unstorage": "1.10.1",
|
|
@@ -93,10 +93,22 @@
|
|
|
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
|
}
|