@scayle/storefront-nuxt 7.85.8 → 7.85.9
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 +6 -0
- package/dist/index.d.mts +5 -15
- package/dist/index.d.ts +5 -15
- package/dist/index.mjs +2 -16
- package/dist/module.d.mts +4 -4
- package/dist/module.d.ts +4 -4
- package/dist/module.mjs +5 -25
- package/dist/rpc.d.mts +1 -16
- package/dist/rpc.d.ts +1 -16
- package/dist/rpc.mjs +1 -20
- package/dist/runtime/api/rpcHandler.d.ts +55 -1
- package/dist/runtime/api/rpcHandler.mjs +1 -1
- package/dist/runtime/composables/core/useAvailableShops.d.ts +1 -1
- package/dist/runtime/composables/storefront/useFacet.d.ts +28 -24
- package/dist/runtime/composables/storefront/useSearch.d.ts +3 -3
- package/dist/runtime/composables/storefront/useStorefrontSearch.d.ts +2 -2
- package/dist/runtime/context.mjs +1 -1
- package/dist/runtime/error/handler.d.ts +1 -1
- package/dist/runtime/nitro/plugins/cacheRuntimeConfig.d.ts +1 -1
- package/dist/runtime/nitro/plugins/cacheRuntimeConfig.mjs +2 -1
- package/dist/runtime/nitro/plugins/configValidation.d.ts +8 -3
- package/dist/runtime/nitro/plugins/configValidation.mjs +7 -5
- package/dist/runtime/nitro/plugins/nitroLogger.d.ts +1 -1
- package/dist/runtime/nitro/plugins/nitroLogger.mjs +2 -1
- package/dist/runtime/nitro/plugins/nitroRuntimeStorageConfig.d.ts +1 -1
- package/dist/runtime/nitro/plugins/nitroRuntimeStorageConfig.mjs +7 -5
- package/dist/runtime/nitro/plugins/nitroSetXPoweredByHeader.d.ts +1 -1
- package/dist/runtime/nitro/plugins/nitroSetXPoweredByHeader.mjs +1 -1
- package/dist/runtime/server/middleware/bootstrap.mjs +1 -1
- package/dist/runtime/server/middleware/bootstrap.utils.d.ts +6 -2
- package/dist/runtime/server/middleware/bootstrap.utils.mjs +2 -2
- package/dist/runtime/server/tsconfig.json +1 -1
- package/dist/runtime/utils/zodSchema.d.ts +261 -153
- package/dist/runtime/utils/zodSchema.mjs +16 -7
- package/dist/shared/storefront-nuxt.77c99ba5.d.mts +102 -0
- package/dist/shared/storefront-nuxt.77c99ba5.d.ts +102 -0
- package/package.json +11 -11
- package/dist/module.json +0 -8
- package/dist/shared/storefront-nuxt.891170da.d.mts +0 -1205
- package/dist/shared/storefront-nuxt.891170da.d.ts +0 -1205
- package/dist/types.d.mts +0 -14
- package/dist/types.d.ts +0 -14
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,23 +1,13 @@
|
|
|
1
|
-
export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, M as ModuleBaseOptions, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.
|
|
2
|
-
export { rpcCall } from './rpc.
|
|
1
|
+
export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, M as ModuleBaseOptions, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.77c99ba5.mjs';
|
|
2
|
+
export { rpcCall } from './runtime/rpc/rpcCall.ts';
|
|
3
|
+
export { extendPromise } from './runtime/utils/promise.ts';
|
|
3
4
|
export * from '@scayle/storefront-core';
|
|
4
5
|
export { LogLevel } from '@scayle/storefront-core';
|
|
5
6
|
export { unwrap } from '@scayle/storefront-core/dist/utils/response';
|
|
6
7
|
import '@scayle/unstorage-compression-driver';
|
|
7
8
|
import 'unstorage';
|
|
8
|
-
import '
|
|
9
|
+
import './runtime/utils/zodSchema.ts';
|
|
9
10
|
import '@nuxt/schema';
|
|
10
|
-
import 'nuxt/app';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This function accepts a Promise which has the same interface as its resolved value.
|
|
14
|
-
* It returns a new Promise which extends the original Promise and the original Promise's resolve value
|
|
15
|
-
* with all the properties in source.
|
|
16
|
-
* @param promise
|
|
17
|
-
* @param source
|
|
18
|
-
* @returns
|
|
19
|
-
*/
|
|
20
|
-
declare function extendPromise<T extends object, U>(promise: T & Promise<T>, source: U): T & U & Promise<T & U>;
|
|
21
11
|
|
|
22
12
|
interface RpcMethodsStorefront {
|
|
23
13
|
}
|
|
@@ -26,4 +16,4 @@ declare module '@scayle/storefront-core' {
|
|
|
26
16
|
}
|
|
27
17
|
}
|
|
28
18
|
|
|
29
|
-
export {
|
|
19
|
+
export type { RpcMethodsStorefront };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,23 +1,13 @@
|
|
|
1
|
-
export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, M as ModuleBaseOptions, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.
|
|
2
|
-
export { rpcCall } from './rpc.
|
|
1
|
+
export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, M as ModuleBaseOptions, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.77c99ba5.js';
|
|
2
|
+
export { rpcCall } from './runtime/rpc/rpcCall.ts';
|
|
3
|
+
export { extendPromise } from './runtime/utils/promise.ts';
|
|
3
4
|
export * from '@scayle/storefront-core';
|
|
4
5
|
export { LogLevel } from '@scayle/storefront-core';
|
|
5
6
|
export { unwrap } from '@scayle/storefront-core/dist/utils/response';
|
|
6
7
|
import '@scayle/unstorage-compression-driver';
|
|
7
8
|
import 'unstorage';
|
|
8
|
-
import '
|
|
9
|
+
import './runtime/utils/zodSchema.ts';
|
|
9
10
|
import '@nuxt/schema';
|
|
10
|
-
import 'nuxt/app';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This function accepts a Promise which has the same interface as its resolved value.
|
|
14
|
-
* It returns a new Promise which extends the original Promise and the original Promise's resolve value
|
|
15
|
-
* with all the properties in source.
|
|
16
|
-
* @param promise
|
|
17
|
-
* @param source
|
|
18
|
-
* @returns
|
|
19
|
-
*/
|
|
20
|
-
declare function extendPromise<T extends object, U>(promise: T & Promise<T>, source: U): T & U & Promise<T & U>;
|
|
21
11
|
|
|
22
12
|
interface RpcMethodsStorefront {
|
|
23
13
|
}
|
|
@@ -26,4 +16,4 @@ declare module '@scayle/storefront-core' {
|
|
|
26
16
|
}
|
|
27
17
|
}
|
|
28
18
|
|
|
29
|
-
export {
|
|
19
|
+
export type { RpcMethodsStorefront };
|
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
export { rpcCall } from './rpc
|
|
1
|
+
export { rpcCall } from './runtime/rpc/rpcCall';
|
|
2
|
+
export { extendPromise } from './runtime/utils/promise';
|
|
2
3
|
export * from '@scayle/storefront-core';
|
|
3
4
|
export { unwrap } from '@scayle/storefront-core/dist/utils/response';
|
|
4
|
-
|
|
5
|
-
function extendPromise(promise, source) {
|
|
6
|
-
const newPromise = promise.then(
|
|
7
|
-
(result) => Object.assign(result, source)
|
|
8
|
-
);
|
|
9
|
-
const withoutPromise = Object.assign({}, promise);
|
|
10
|
-
for (const key of Object.getOwnPropertyNames(
|
|
11
|
-
Promise.prototype
|
|
12
|
-
)) {
|
|
13
|
-
delete withoutPromise[key];
|
|
14
|
-
}
|
|
15
|
-
return Object.assign(newPromise, Object.assign(withoutPromise, source));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { extendPromise };
|
package/dist/module.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import { M as ModuleBaseOptions } from './shared/storefront-nuxt.
|
|
3
|
-
export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.
|
|
2
|
+
import { M as ModuleBaseOptions } from './shared/storefront-nuxt.77c99ba5.mjs';
|
|
3
|
+
export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.77c99ba5.mjs';
|
|
4
4
|
export { LogLevel } from '@scayle/storefront-core';
|
|
5
5
|
import '@scayle/unstorage-compression-driver';
|
|
6
6
|
import 'unstorage';
|
|
7
|
-
import '
|
|
7
|
+
import './runtime/utils/zodSchema.ts';
|
|
8
8
|
|
|
9
|
-
declare const _default: _nuxt_schema.NuxtModule<
|
|
9
|
+
declare const _default: _nuxt_schema.NuxtModule<ModuleBaseOptions, ModuleBaseOptions, false>;
|
|
10
10
|
|
|
11
11
|
export { ModuleBaseOptions, _default as default };
|
package/dist/module.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import { M as ModuleBaseOptions } from './shared/storefront-nuxt.
|
|
3
|
-
export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.
|
|
2
|
+
import { M as ModuleBaseOptions } from './shared/storefront-nuxt.77c99ba5.js';
|
|
3
|
+
export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.77c99ba5.js';
|
|
4
4
|
export { LogLevel } from '@scayle/storefront-core';
|
|
5
5
|
import '@scayle/unstorage-compression-driver';
|
|
6
6
|
import 'unstorage';
|
|
7
|
-
import '
|
|
7
|
+
import './runtime/utils/zodSchema.ts';
|
|
8
8
|
|
|
9
|
-
declare const _default: _nuxt_schema.NuxtModule<
|
|
9
|
+
declare const _default: _nuxt_schema.NuxtModule<ModuleBaseOptions, ModuleBaseOptions, false>;
|
|
10
10
|
|
|
11
11
|
export { ModuleBaseOptions, _default as default };
|
package/dist/module.mjs
CHANGED
|
@@ -4,30 +4,7 @@ import { defu } from 'defu';
|
|
|
4
4
|
import { genImport, genSafeVariableName } from 'knitwork';
|
|
5
5
|
import { builtinDrivers } from 'unstorage';
|
|
6
6
|
import { createConsola } from 'consola';
|
|
7
|
-
import '
|
|
8
|
-
import { joinURL } from 'ufo';
|
|
9
|
-
|
|
10
|
-
const convertShopsToList = (shops) => {
|
|
11
|
-
if (Array.isArray(shops)) {
|
|
12
|
-
return shops;
|
|
13
|
-
}
|
|
14
|
-
return Object.values(shops);
|
|
15
|
-
};
|
|
16
|
-
function getApiBasePath(storefrontConfig, shop, baseUrl) {
|
|
17
|
-
const path = Array.isArray(shop.path) ? shop.path[0] : shop.path;
|
|
18
|
-
const apiPath = shop.apiBasePath || storefrontConfig.apiBasePath || "/api";
|
|
19
|
-
if (storefrontConfig.shopSelector === "path") {
|
|
20
|
-
const pathElements = [path, apiPath].filter(Boolean);
|
|
21
|
-
return joinURL(baseUrl, ...pathElements);
|
|
22
|
-
} else if (storefrontConfig.shopSelector === "path_or_default") {
|
|
23
|
-
if (shop.isDefault) {
|
|
24
|
-
return joinURL(baseUrl, apiPath);
|
|
25
|
-
}
|
|
26
|
-
const pathElements = [path, apiPath].filter(Boolean);
|
|
27
|
-
return joinURL(baseUrl, ...pathElements);
|
|
28
|
-
}
|
|
29
|
-
return joinURL(baseUrl, apiPath);
|
|
30
|
-
}
|
|
7
|
+
import { convertShopsToList, getApiBasePath } from './runtime/server/middleware/bootstrap.utils';
|
|
31
8
|
|
|
32
9
|
function stringToBoolean(value, defaultValue = false) {
|
|
33
10
|
return value ? value.toLowerCase() === "true" : defaultValue;
|
|
@@ -71,7 +48,7 @@ export default {
|
|
|
71
48
|
}`;
|
|
72
49
|
}
|
|
73
50
|
const PACKAGE_NAME = "@scayle/storefront-nuxt";
|
|
74
|
-
const PACKAGE_VERSION = "7.85.
|
|
51
|
+
const PACKAGE_VERSION = "7.85.9";
|
|
75
52
|
const logger = createConsola({
|
|
76
53
|
fancy: true,
|
|
77
54
|
formatOptions: {
|
|
@@ -81,6 +58,9 @@ const logger = createConsola({
|
|
|
81
58
|
defaults: {
|
|
82
59
|
tag: PACKAGE_NAME
|
|
83
60
|
}
|
|
61
|
+
// At runtime consola/basic will be loaded which supports the fancy option
|
|
62
|
+
// However when typechecking it will resolve to consola/browser which does have the fancy option
|
|
63
|
+
// This assertion avoids the typescript error
|
|
84
64
|
});
|
|
85
65
|
const module = defineNuxtModule({
|
|
86
66
|
meta: {
|
package/dist/rpc.d.mts
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { NuxtApp } from 'nuxt/app';
|
|
3
|
-
import { P as PublicShopConfig } from './shared/storefront-nuxt.891170da.mjs';
|
|
4
|
-
import '@scayle/unstorage-compression-driver';
|
|
5
|
-
import 'unstorage';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import '@nuxt/schema';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* rpcCall can be used to invoke an RPC method either on the client or server
|
|
11
|
-
* It makes an HTTP request on the client and direct call on the server using $fetch
|
|
12
|
-
* https://nuxt.com/docs/api/utils/dollarfetch
|
|
13
|
-
*/
|
|
14
|
-
declare const rpcCall: <N extends RpcMethodName, P extends RpcMethodParameters<N>, TResult extends Exclude<Awaited<RpcMethodReturnType<N>>, Response>, TakesParameters = P extends RpcContext ? undefined : boolean>(nuxtApp: NuxtApp, method: N, shop: PublicShopConfig) => TakesParameters extends undefined ? () => Promise<TResult> : (params: P) => Promise<TResult>;
|
|
15
|
-
|
|
16
|
-
export { rpcCall };
|
|
1
|
+
export { rpcCall } from './runtime/rpc/rpcCall.ts';
|
package/dist/rpc.d.ts
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { NuxtApp } from 'nuxt/app';
|
|
3
|
-
import { P as PublicShopConfig } from './shared/storefront-nuxt.891170da.js';
|
|
4
|
-
import '@scayle/unstorage-compression-driver';
|
|
5
|
-
import 'unstorage';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import '@nuxt/schema';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* rpcCall can be used to invoke an RPC method either on the client or server
|
|
11
|
-
* It makes an HTTP request on the client and direct call on the server using $fetch
|
|
12
|
-
* https://nuxt.com/docs/api/utils/dollarfetch
|
|
13
|
-
*/
|
|
14
|
-
declare const rpcCall: <N extends RpcMethodName, P extends RpcMethodParameters<N>, TResult extends Exclude<Awaited<RpcMethodReturnType<N>>, Response>, TakesParameters = P extends RpcContext ? undefined : boolean>(nuxtApp: NuxtApp, method: N, shop: PublicShopConfig) => TakesParameters extends undefined ? () => Promise<TResult> : (params: P) => Promise<TResult>;
|
|
15
|
-
|
|
16
|
-
export { rpcCall };
|
|
1
|
+
export { rpcCall } from './runtime/rpc/rpcCall.ts';
|
package/dist/rpc.mjs
CHANGED
|
@@ -1,20 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const rpcCall = (nuxtApp, method, shop) => {
|
|
4
|
-
const fetch = nuxtApp.ssrContext?.event.$fetch ?? $fetch;
|
|
5
|
-
return async (params = void 0) => {
|
|
6
|
-
const data = await fetch(`${shop.apiBasePath ?? "/api"}/rpc/${method}`, {
|
|
7
|
-
// @ts-expect-error Type '"POST"' is not assignable to type 'AvailableRouterMethod<`${string}/rpc/${N}`> | Uppercase<AvailableRouterMethod<`${string}/rpc/${N}`>> | undefined'.ts(2322)
|
|
8
|
-
method: "POST",
|
|
9
|
-
body: {
|
|
10
|
-
payload: params
|
|
11
|
-
},
|
|
12
|
-
headers: {
|
|
13
|
-
"x-shop-id": shop.shopId.toString()
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
return await unwrap(data);
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export { rpcCall };
|
|
1
|
+
export { rpcCall } from './runtime/rpc/rpcCall';
|
|
@@ -1,2 +1,56 @@
|
|
|
1
|
-
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<
|
|
1
|
+
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | true | string[] | import("@scayle/storefront-core").ShopUser | import("@scayle/storefront-api").Product | import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant> | {
|
|
2
|
+
type: "failure";
|
|
3
|
+
statusCode: number;
|
|
4
|
+
basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
|
|
5
|
+
} | {
|
|
6
|
+
readonly type: "success";
|
|
7
|
+
readonly basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
|
|
8
|
+
} | {
|
|
9
|
+
readonly type: "failure";
|
|
10
|
+
readonly basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
|
|
11
|
+
readonly errors: import("@scayle/storefront-api").AddOrUpdateItemError[];
|
|
12
|
+
} | import("@scayle/storefront-api").BrandsEndpointResponseData | import("@scayle/storefront-api").Brand | {
|
|
13
|
+
categories: import("@scayle/storefront-api").Category[];
|
|
14
|
+
activeNode: undefined;
|
|
15
|
+
} | import("@scayle/storefront-api").Category | {
|
|
16
|
+
categories: import("@scayle/storefront-api").Category;
|
|
17
|
+
activeNode: import("@scayle/storefront-api").Category;
|
|
18
|
+
} | import("@scayle/storefront-core").Order | {
|
|
19
|
+
category: string | undefined;
|
|
20
|
+
categoryId: number | undefined;
|
|
21
|
+
} | import("@scayle/storefront-api").Product[] | {
|
|
22
|
+
count: number;
|
|
23
|
+
} | {
|
|
24
|
+
filters: import("@scayle/storefront-api").FiltersEndpointResponseData;
|
|
25
|
+
unfilteredCount: number;
|
|
26
|
+
} | {
|
|
27
|
+
products: import("@scayle/storefront-api").Product[];
|
|
28
|
+
pagination: {
|
|
29
|
+
current: number;
|
|
30
|
+
total: number;
|
|
31
|
+
perPage: number;
|
|
32
|
+
page: number;
|
|
33
|
+
first: number;
|
|
34
|
+
prev: number;
|
|
35
|
+
next: number;
|
|
36
|
+
last: number;
|
|
37
|
+
};
|
|
38
|
+
} | import("@scayle/storefront-api").TypeaheadSuggestionsEndpointResponseData | import("@scayle/storefront-api").SearchV2SuggestionsEndpointResponseData | import("@scayle/storefront-api").SearchEntity | import("@scayle/storefront-api").ShopConfiguration | {
|
|
39
|
+
user: import("@scayle/storefront-core").ShopUser | undefined;
|
|
40
|
+
} | import("@scayle/storefront-api").Wishlist | Response | import("@scayle/storefront-core").ShopUserAddress[] | {
|
|
41
|
+
accessToken: string;
|
|
42
|
+
checkoutJwt: string;
|
|
43
|
+
} | import("@scayle/storefront-api").VariantDetail[] | import("@scayle/storefront-api").NavigationAllEndpointResponseData | import("@scayle/storefront-api").NavigationTree | {
|
|
44
|
+
success: true;
|
|
45
|
+
} | {
|
|
46
|
+
success: false;
|
|
47
|
+
} | {
|
|
48
|
+
result: true;
|
|
49
|
+
} | {
|
|
50
|
+
result: false;
|
|
51
|
+
} | import("@scayle/storefront-api").PromotionsEndpointResponseData | {
|
|
52
|
+
[k: string]: string;
|
|
53
|
+
} | {
|
|
54
|
+
message: string;
|
|
55
|
+
} | null | undefined>>;
|
|
2
56
|
export default _default;
|
|
@@ -3,7 +3,7 @@ import { purifySensitiveData } from "@scayle/storefront-core";
|
|
|
3
3
|
import { trace, SpanStatusCode } from "@opentelemetry/api";
|
|
4
4
|
import { handler } from "../handler.mjs";
|
|
5
5
|
import { resolveError } from "../error/handler.mjs";
|
|
6
|
-
import { useNitroApp } from "
|
|
6
|
+
import { useNitroApp } from "nitropack/runtime";
|
|
7
7
|
const tracer = trace.getTracer(
|
|
8
8
|
"storefront-nuxt",
|
|
9
9
|
"__sfc_version"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { PublicShopConfig } from '../../../module';
|
|
2
|
-
export declare function useAvailableShops(): import("vue").Ref<PublicShopConfig[]>;
|
|
2
|
+
export declare function useAvailableShops(): import("vue").Ref<PublicShopConfig[], PublicShopConfig[]>;
|
|
@@ -16,17 +16,19 @@ type Options = Partial<{
|
|
|
16
16
|
}>;
|
|
17
17
|
export declare function useFacet({ key: optionsKey, params, }?: Options, _key?: string): {
|
|
18
18
|
filters: import("vue").ComputedRef<import("@scayle/storefront-api").FiltersEndpointResponseData | undefined>;
|
|
19
|
-
filtersFetching: import("vue").Ref<boolean>;
|
|
19
|
+
filtersFetching: import("vue").Ref<boolean, boolean>;
|
|
20
20
|
unfilteredCount: import("vue").ComputedRef<number | undefined>;
|
|
21
|
-
filterStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus>;
|
|
22
|
-
filterError: import("vue").Ref<
|
|
21
|
+
filterStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
|
|
22
|
+
filterError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | null, import("nuxt/app").NuxtError<unknown> | null>;
|
|
23
23
|
productCountData: import("vue").Ref<{
|
|
24
24
|
count: number;
|
|
25
|
+
} | null, {
|
|
26
|
+
count: number;
|
|
25
27
|
} | null>;
|
|
26
28
|
refreshProductCount: ({ where, }?: FilterParams) => Promise<void>;
|
|
27
|
-
productCountFetching: import("vue").Ref<boolean>;
|
|
28
|
-
productCountError: import("vue").Ref<
|
|
29
|
-
productCountStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus>;
|
|
29
|
+
productCountFetching: import("vue").Ref<boolean, boolean>;
|
|
30
|
+
productCountError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | null, import("nuxt/app").NuxtError<unknown> | null>;
|
|
31
|
+
productCountStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
|
|
30
32
|
products: import("vue").ComputedRef<import("@scayle/storefront-api").Product[] | undefined>;
|
|
31
33
|
pagination: import("vue").ComputedRef<{
|
|
32
34
|
current: number;
|
|
@@ -38,15 +40,15 @@ export declare function useFacet({ key: optionsKey, params, }?: Options, _key?:
|
|
|
38
40
|
next: number;
|
|
39
41
|
last: number;
|
|
40
42
|
} | undefined>;
|
|
41
|
-
productsFetching: import("vue").Ref<boolean>;
|
|
43
|
+
productsFetching: import("vue").Ref<boolean, boolean>;
|
|
42
44
|
filterProducts: ({ where, page, sort, orFiltersOperator, }: FilterParams) => Promise<void>;
|
|
43
|
-
productError: import("vue").Ref<
|
|
44
|
-
productStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus>;
|
|
45
|
+
productError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | null, import("nuxt/app").NuxtError<unknown> | null>;
|
|
46
|
+
productStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
|
|
45
47
|
categories: import("vue").ComputedRef<import("@scayle/storefront-api").Category | import("@scayle/storefront-api").Category[] | undefined>;
|
|
46
48
|
selectedCategory: import("vue").ComputedRef<import("@scayle/storefront-api").Category | undefined>;
|
|
47
|
-
categoriesFetching: import("vue").Ref<boolean>;
|
|
48
|
-
categoriesError: import("vue").Ref<
|
|
49
|
-
categoriesStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus>;
|
|
49
|
+
categoriesFetching: import("vue").Ref<boolean, boolean>;
|
|
50
|
+
categoriesError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | null, import("nuxt/app").NuxtError<unknown> | null>;
|
|
51
|
+
categoriesStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
|
|
50
52
|
fetchProducts: ({ path, page, perPage, where, sort, pricePromotionKey, cache, orFiltersOperator, }: FilterParams & {
|
|
51
53
|
path: string;
|
|
52
54
|
pricePromotionKey?: string;
|
|
@@ -55,17 +57,19 @@ export declare function useFacet({ key: optionsKey, params, }?: Options, _key?:
|
|
|
55
57
|
fetchPage: (pageToFetch: number) => Promise<void>;
|
|
56
58
|
} & Promise<{
|
|
57
59
|
filters: import("vue").ComputedRef<import("@scayle/storefront-api").FiltersEndpointResponseData | undefined>;
|
|
58
|
-
filtersFetching: import("vue").Ref<boolean>;
|
|
60
|
+
filtersFetching: import("vue").Ref<boolean, boolean>;
|
|
59
61
|
unfilteredCount: import("vue").ComputedRef<number | undefined>;
|
|
60
|
-
filterStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus>;
|
|
61
|
-
filterError: import("vue").Ref<
|
|
62
|
+
filterStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
|
|
63
|
+
filterError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | null, import("nuxt/app").NuxtError<unknown> | null>;
|
|
62
64
|
productCountData: import("vue").Ref<{
|
|
63
65
|
count: number;
|
|
66
|
+
} | null, {
|
|
67
|
+
count: number;
|
|
64
68
|
} | null>;
|
|
65
69
|
refreshProductCount: ({ where, }?: FilterParams) => Promise<void>;
|
|
66
|
-
productCountFetching: import("vue").Ref<boolean>;
|
|
67
|
-
productCountError: import("vue").Ref<
|
|
68
|
-
productCountStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus>;
|
|
70
|
+
productCountFetching: import("vue").Ref<boolean, boolean>;
|
|
71
|
+
productCountError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | null, import("nuxt/app").NuxtError<unknown> | null>;
|
|
72
|
+
productCountStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
|
|
69
73
|
products: import("vue").ComputedRef<import("@scayle/storefront-api").Product[] | undefined>;
|
|
70
74
|
pagination: import("vue").ComputedRef<{
|
|
71
75
|
current: number;
|
|
@@ -77,15 +81,15 @@ export declare function useFacet({ key: optionsKey, params, }?: Options, _key?:
|
|
|
77
81
|
next: number;
|
|
78
82
|
last: number;
|
|
79
83
|
} | undefined>;
|
|
80
|
-
productsFetching: import("vue").Ref<boolean>;
|
|
84
|
+
productsFetching: import("vue").Ref<boolean, boolean>;
|
|
81
85
|
filterProducts: ({ where, page, sort, orFiltersOperator, }: FilterParams) => Promise<void>;
|
|
82
|
-
productError: import("vue").Ref<
|
|
83
|
-
productStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus>;
|
|
86
|
+
productError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | null, import("nuxt/app").NuxtError<unknown> | null>;
|
|
87
|
+
productStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
|
|
84
88
|
categories: import("vue").ComputedRef<import("@scayle/storefront-api").Category | import("@scayle/storefront-api").Category[] | undefined>;
|
|
85
89
|
selectedCategory: import("vue").ComputedRef<import("@scayle/storefront-api").Category | undefined>;
|
|
86
|
-
categoriesFetching: import("vue").Ref<boolean>;
|
|
87
|
-
categoriesError: import("vue").Ref<
|
|
88
|
-
categoriesStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus>;
|
|
90
|
+
categoriesFetching: import("vue").Ref<boolean, boolean>;
|
|
91
|
+
categoriesError: import("vue").Ref<import("nuxt/app").NuxtError<unknown> | null, import("nuxt/app").NuxtError<unknown> | null>;
|
|
92
|
+
categoriesStatus: import("vue").Ref<import("nuxt/app").AsyncDataRequestStatus, import("nuxt/app").AsyncDataRequestStatus>;
|
|
89
93
|
fetchProducts: ({ path, page, perPage, where, sort, pricePromotionKey, cache, orFiltersOperator, }: FilterParams & {
|
|
90
94
|
path: string;
|
|
91
95
|
pricePromotionKey?: string;
|
|
@@ -5,9 +5,9 @@ type Options = Partial<{
|
|
|
5
5
|
}>;
|
|
6
6
|
/** @deprecated `useSearch` is deprecated. Please, use `useSearchSuggestions` or `useSearchResolve` */
|
|
7
7
|
export declare function useSearch({ params, key }?: Options): {
|
|
8
|
-
data: import("vue").Ref<TypeaheadSuggestionsEndpointResponseData | undefined>;
|
|
9
|
-
pending: import("vue").Ref<boolean>;
|
|
10
|
-
searchQuery: import("vue").Ref<string>;
|
|
8
|
+
data: import("vue").Ref<TypeaheadSuggestionsEndpointResponseData | undefined, TypeaheadSuggestionsEndpointResponseData | undefined>;
|
|
9
|
+
pending: import("vue").Ref<boolean, boolean>;
|
|
10
|
+
searchQuery: import("vue").Ref<string, string>;
|
|
11
11
|
resetSearch: () => void;
|
|
12
12
|
search: ({ term, slug, productLimit }: SearchInput) => Promise<void>;
|
|
13
13
|
};
|
|
@@ -8,8 +8,8 @@ export type SearchOptions = Partial<{
|
|
|
8
8
|
key: string;
|
|
9
9
|
}>;
|
|
10
10
|
export declare function useStorefrontSearch(searchQuery: Ref<string>, { params, key }?: SearchOptions): {
|
|
11
|
-
data:
|
|
12
|
-
pending:
|
|
11
|
+
data: Ref<SearchV2SuggestionsEndpointResponseData | undefined, SearchV2SuggestionsEndpointResponseData | undefined>;
|
|
12
|
+
pending: Ref<boolean, boolean>;
|
|
13
13
|
resetSearch: () => void;
|
|
14
14
|
getSearchSuggestions: () => Promise<void>;
|
|
15
15
|
resolveSearch: () => Promise<import("@scayle/storefront-api").SearchEntity | null | undefined>;
|
package/dist/runtime/context.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
generateBasketKey,
|
|
9
9
|
generateWishlistKey
|
|
10
10
|
} from "@scayle/storefront-core/dist/utils/keys";
|
|
11
|
-
import { useNitroApp } from "
|
|
11
|
+
import { useNitroApp } from "nitropack/runtime";
|
|
12
12
|
import { fetchCampaignKey } from "./campaignKey.mjs";
|
|
13
13
|
async function getWishlistKey(appKeys, session, $log, $shopConfig) {
|
|
14
14
|
return session.data.user ? await generateWishlistKey({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const resolveError: (error: Error | unknown) => {
|
|
2
|
-
statusCode: 100 | 101 | 102 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 506 | 507 | 508 | 510 | 511
|
|
2
|
+
statusCode: 100 | 101 | 102 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
|
|
3
3
|
statusMessage: string;
|
|
4
4
|
name: string;
|
|
5
5
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("nitropack").NitroAppPlugin;
|
|
2
2
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineNitroPlugin
|
|
1
|
+
import { defineNitroPlugin } from "nitropack/runtime/plugin";
|
|
2
|
+
import { useRuntimeConfig } from "#imports";
|
|
2
3
|
export default defineNitroPlugin((nitroApp) => {
|
|
3
4
|
const runtimeConfig = useRuntimeConfig();
|
|
4
5
|
nitroApp.hooks.hook("request", (event) => {
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { RuntimeConfig } from '@nuxt/schema';
|
|
2
2
|
import type { ZodIssue } from 'zod';
|
|
3
3
|
export declare const sensitiveKeys: string[];
|
|
4
|
-
export declare const getValue: (object:
|
|
5
|
-
export declare const formatZodError: (issues: Array<ZodIssue>, runtimeConfig: RuntimeConfig) =>
|
|
6
|
-
|
|
4
|
+
export declare const getValue: (object: Record<string | number, unknown>, pathArray: (string | number)[]) => string;
|
|
5
|
+
export declare const formatZodError: (issues: Array<ZodIssue>, runtimeConfig: RuntimeConfig) => (ZodIssue | {
|
|
6
|
+
code: string;
|
|
7
|
+
path: string;
|
|
8
|
+
message: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
})[];
|
|
11
|
+
declare const _default: import("nitropack").NitroAppPlugin;
|
|
7
12
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineNitroPlugin
|
|
1
|
+
import { defineNitroPlugin } from "nitropack/runtime/plugin";
|
|
2
|
+
import { useRuntimeConfig } from "#imports";
|
|
2
3
|
import { RuntimeConfigSchema } from "../../utils/zodSchema.mjs";
|
|
3
4
|
import { purifySensitiveValue } from "@scayle/storefront-core";
|
|
4
5
|
export const sensitiveKeys = [
|
|
@@ -9,9 +10,10 @@ export const sensitiveKeys = [
|
|
|
9
10
|
"secret"
|
|
10
11
|
];
|
|
11
12
|
export const getValue = (object, pathArray) => {
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
return JSON.stringify(pathArray.reduce(
|
|
14
|
+
(acc, key) => typeof acc === "object" ? acc[key] : void 0,
|
|
15
|
+
object
|
|
16
|
+
));
|
|
15
17
|
};
|
|
16
18
|
export const formatZodError = (issues, runtimeConfig) => {
|
|
17
19
|
const errorMessages = [];
|
|
@@ -22,7 +24,7 @@ export const formatZodError = (issues, runtimeConfig) => {
|
|
|
22
24
|
});
|
|
23
25
|
}
|
|
24
26
|
const key = issue.path[issue.path.length - 1];
|
|
25
|
-
let value;
|
|
27
|
+
let value = "";
|
|
26
28
|
if (sensitiveKeys.includes(key)) {
|
|
27
29
|
value = purifySensitiveValue(getValue(runtimeConfig, issue.path), true);
|
|
28
30
|
} else if (issue.code !== "too_small") {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createConsola } from "consola";
|
|
2
|
+
import { defineNitroPlugin } from "nitropack/runtime/plugin";
|
|
3
|
+
import { useRuntimeConfig } from "#imports";
|
|
2
4
|
import createLog from "../../createLog.mjs";
|
|
3
|
-
import { defineNitroPlugin, useRuntimeConfig } from "#imports";
|
|
4
5
|
export default defineNitroPlugin((nitroApp) => {
|
|
5
6
|
const config = useRuntimeConfig();
|
|
6
7
|
const logConfig = config.public.storefront.log;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("nitropack").NitroAppPlugin;
|
|
2
2
|
export default _default;
|
|
@@ -5,7 +5,9 @@ import {
|
|
|
5
5
|
} from "../../server/utils/cacheStorage.mjs";
|
|
6
6
|
import createLog from "../../createLog.mjs";
|
|
7
7
|
import drivers from "#virtual/storage-drivers";
|
|
8
|
-
import { defineNitroPlugin
|
|
8
|
+
import { defineNitroPlugin } from "nitropack/runtime/plugin";
|
|
9
|
+
import { useStorage } from "nitropack/runtime/storage";
|
|
10
|
+
import { useRuntimeConfig } from "#imports";
|
|
9
11
|
function createMountDriver(options) {
|
|
10
12
|
if (options?.driver) {
|
|
11
13
|
const compression = options?.compression;
|
|
@@ -50,7 +52,7 @@ function getCacheConfig(config, log) {
|
|
|
50
52
|
log.error(
|
|
51
53
|
`Failed to initialize global cache storage configuration. Neither new 'storefront.storage.cache' option nor legacy 'storefront.cache.provider' is set.`
|
|
52
54
|
);
|
|
53
|
-
return
|
|
55
|
+
return void 0;
|
|
54
56
|
}
|
|
55
57
|
return transformLegacyConfig(
|
|
56
58
|
config.storefront.cache?.provider,
|
|
@@ -67,7 +69,7 @@ function getSessionConfig(config, log) {
|
|
|
67
69
|
log.error(
|
|
68
70
|
`Failed to initialize global session storage configuration. Neither new 'storefront.storage.session' option nor legacy 'storefront.session.provider' is set.`
|
|
69
71
|
);
|
|
70
|
-
return
|
|
72
|
+
return void 0;
|
|
71
73
|
}
|
|
72
74
|
return transformLegacyConfig(
|
|
73
75
|
config.storefront.session?.provider,
|
|
@@ -87,7 +89,7 @@ function getShopCacheConfig(config, shop, log) {
|
|
|
87
89
|
log.error(
|
|
88
90
|
`Failed to initialize shop ${shop.shopId} cache storage configuration. Neither new 'storefront.storage.session' option nor legacy 'storefront.session.provider' is set.`
|
|
89
91
|
);
|
|
90
|
-
return
|
|
92
|
+
return void 0;
|
|
91
93
|
}
|
|
92
94
|
return transformLegacyConfig(
|
|
93
95
|
cacheProvider,
|
|
@@ -108,7 +110,7 @@ function getShopSessionConfig(config, shop, log) {
|
|
|
108
110
|
log.error(
|
|
109
111
|
`Failed to initialize shop ${shop.shopId} session storage configuration. Neither new 'storefront.storage.session' option nor legacy 'storefront.session.provider' is set.`
|
|
110
112
|
);
|
|
111
|
-
return
|
|
113
|
+
return void 0;
|
|
112
114
|
}
|
|
113
115
|
return transformLegacyConfig(
|
|
114
116
|
sessionProvider,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("nitropack").NitroAppPlugin;
|
|
2
2
|
export default _default;
|