@scayle/storefront-nuxt 7.88.1 → 7.90.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.
@@ -0,0 +1,3 @@
1
+ import type { Category } from '@scayle/storefront-core';
2
+ import { Factory } from 'fishery';
3
+ export declare const categoryFactory: Factory<Category, any, Category>;
@@ -0,0 +1,18 @@
1
+ import { Factory } from "fishery";
2
+ export const categoryFactory = Factory.define(() => {
3
+ return {
4
+ id: 1,
5
+ path: "/women",
6
+ name: "women",
7
+ slug: "test",
8
+ parentId: 2048,
9
+ rootlineIds: [2045, 2048, 2058],
10
+ childrenIds: [],
11
+ properties: [],
12
+ isHidden: false,
13
+ depth: 3,
14
+ supportedFilter: ["color", "brand", "size"],
15
+ shopLevelCustomData: {},
16
+ countryLevelCustomData: {}
17
+ };
18
+ });
@@ -0,0 +1,4 @@
1
+ export * from './category';
2
+ export * from './moduleOptions';
3
+ export * from './shopConfig';
4
+ export * from './rpcContext';
@@ -0,0 +1,4 @@
1
+ export * from "./category.mjs";
2
+ export * from "./moduleOptions.mjs";
3
+ export * from "./shopConfig.mjs";
4
+ export * from "./rpcContext.mjs";
@@ -0,0 +1,7 @@
1
+ import { Factory } from 'fishery';
2
+ import type { ModuleBaseOptions, ShopConfig } from '../../src/module';
3
+ interface ModuleOptionsFactoryParams {
4
+ shops: ShopConfig[];
5
+ }
6
+ export declare const moduleOptionsFactory: Factory<ModuleBaseOptions, ModuleOptionsFactoryParams, ModuleBaseOptions>;
7
+ export {};
@@ -0,0 +1,27 @@
1
+ import { Factory } from "fishery";
2
+ import { HashAlgorithm } from "@scayle/storefront-core";
3
+ export const moduleOptionsFactory = Factory.define(({ transientParams }) => {
4
+ return {
5
+ sapi: {
6
+ host: "sapiHost",
7
+ token: "sapiToken"
8
+ },
9
+ oauth: {
10
+ apiHost: "oauthHost",
11
+ clientId: "clientId",
12
+ clientSecret: "clientSecret"
13
+ },
14
+ appKeys: {
15
+ basketKey: "basketKey",
16
+ wishlistKey: "wishlistKey",
17
+ hashAlgorithm: HashAlgorithm.MD5
18
+ },
19
+ shopSelector: "path",
20
+ shops: (transientParams?.shops || []).reduce((acc, curr) => {
21
+ return {
22
+ [curr.shopId]: curr,
23
+ ...acc
24
+ };
25
+ }, {})
26
+ };
27
+ });
@@ -0,0 +1,7 @@
1
+ import { Factory } from 'fishery';
2
+ import { type RpcContext } from '@scayle/storefront-core';
3
+ interface RpcContextFactoryParams {
4
+ isLoggedIn: boolean;
5
+ }
6
+ export declare const rpcContextFactory: Factory<RpcContext, RpcContextFactoryParams, RpcContext>;
7
+ export {};
@@ -0,0 +1,57 @@
1
+ import { Factory } from "fishery";
2
+ import { vi } from "vitest";
3
+ import {
4
+ StorefrontAPIClient
5
+ } from "@scayle/storefront-core";
6
+ import { Log } from "../../src";
7
+ export const rpcContextFactory = Factory.define(({ transientParams }) => {
8
+ return {
9
+ locale: "de",
10
+ checkout: {
11
+ url: "",
12
+ token: "",
13
+ secret: "",
14
+ user: ""
15
+ },
16
+ bapiClient: new StorefrontAPIClient({ host: "", shopId: 1001 }),
17
+ sapiClient: new StorefrontAPIClient({ host: "", shopId: 1001 }),
18
+ cached: (fn, _options) => {
19
+ return async (...args) => {
20
+ return await fn(...args);
21
+ };
22
+ },
23
+ isCmsPreview: false,
24
+ shopId: 1001,
25
+ domain: "localhost",
26
+ destroySessionsForUserId: vi.fn(),
27
+ generateBasketKeyForUserId: (userId) => Promise.resolve(`basket-${userId}`),
28
+ generateWishlistKeyForUserId: (userId) => Promise.resolve(`wishlist-${userId}`),
29
+ log: new Log(),
30
+ auth: {},
31
+ runtimeConfiguration: {},
32
+ headers: new Headers(),
33
+ ...transientParams.isLoggedIn ? {
34
+ wishlistKey: "wishlistKey",
35
+ basketKey: "basketKey",
36
+ sessionId: "sessionId",
37
+ user: void 0,
38
+ accessToken: void 0,
39
+ refreshToken: void 0,
40
+ destroySession: vi.fn(),
41
+ createUserBoundSession: vi.fn(),
42
+ updateUser: vi.fn(),
43
+ updateTokens: vi.fn()
44
+ } : {
45
+ wishlistKey: void 0,
46
+ basketKey: void 0,
47
+ sessionId: void 0,
48
+ user: void 0,
49
+ accessToken: void 0,
50
+ refreshToken: void 0,
51
+ destroySession: void 0,
52
+ createUserBoundSession: void 0,
53
+ updateUser: void 0,
54
+ updateTokens: void 0
55
+ }
56
+ };
57
+ });
@@ -0,0 +1,3 @@
1
+ import { Factory } from 'fishery';
2
+ import type { ShopConfig } from '../../src/module';
3
+ export declare const shopConfigFactory: Factory<ShopConfig, any, ShopConfig>;
@@ -0,0 +1,19 @@
1
+ import { Factory } from "fishery";
2
+ export const shopConfigFactory = Factory.define(() => {
3
+ return {
4
+ shopId: 1,
5
+ domain: "localhost",
6
+ locale: "en-US",
7
+ currency: "USD",
8
+ checkout: {
9
+ host: "checkoutHost",
10
+ secret: "checkoutSecret",
11
+ token: "checkoutToken",
12
+ user: "checkoutUser"
13
+ },
14
+ auth: {
15
+ resetPasswordUrl: "resetPasswordUrl"
16
+ },
17
+ paymentProviders: []
18
+ };
19
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "7.88.1",
4
+ "version": "7.90.0",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -29,6 +29,10 @@
29
29
  "types": "./dist/runtime/composables/index.d.ts",
30
30
  "import": "./dist/runtime/composables/index.js"
31
31
  },
32
+ "./test-factories": {
33
+ "types": "./dist/test-factories/index.d.ts",
34
+ "default": "./dist/test-factories/index.mjs"
35
+ },
32
36
  ".": {
33
37
  "types": "./dist/index.d.ts",
34
38
  "default": "./dist/index.mjs"
@@ -66,7 +70,7 @@
66
70
  "@opentelemetry/api": "^1.9.0",
67
71
  "@scayle/h3-session": "^0.4.1",
68
72
  "@scayle/storefront-core": "7.66.1",
69
- "@scayle/unstorage-compression-driver": "^0.1.4",
73
+ "@scayle/unstorage-compression-driver": "^0.1.5",
70
74
  "@vueuse/core": "11.2.0",
71
75
  "consola": "^3.2.3",
72
76
  "core-js": "^3.37.1",
@@ -76,11 +80,12 @@
76
80
  "knitwork": "^1.1.0",
77
81
  "nitropack": "^2.9.7",
78
82
  "ofetch": "^1.3.4",
79
- "ufo": "^1.5.3",
83
+ "ufo": "^1.5.4",
80
84
  "uncrypto": "^0.1.3",
81
85
  "unstorage": "^1.10.2",
82
86
  "vue-router": "^4.4.0",
83
- "zod": "^3.23.8"
87
+ "zod": "^3.23.8",
88
+ "schema-dts": "1.1.2"
84
89
  },
85
90
  "devDependencies": {
86
91
  "@nuxt/eslint": "0.6.1",
@@ -89,9 +94,9 @@
89
94
  "@nuxt/test-utils": "3.14.4",
90
95
  "@scayle/eslint-config-storefront": "4.3.2",
91
96
  "@scayle/eslint-plugin-vue-composable": "0.2.1",
92
- "@types/node": "22.8.5",
97
+ "@types/node": "22.8.7",
93
98
  "dprint": "0.47.5",
94
- "eslint": "9.13.0",
99
+ "eslint": "9.14.0",
95
100
  "eslint-formatter-gitlab": "5.1.0",
96
101
  "fishery": "2.2.2",
97
102
  "h3": "1.13.0",
@@ -106,7 +111,8 @@
106
111
  "h3": "^1.10.0",
107
112
  "nuxt": ">=3.10.0",
108
113
  "unstorage": ">= 1.10.1",
109
- "vue": ">=3.4.0"
114
+ "vue": ">=3.4.0",
115
+ "fishery": "^2.2.2"
110
116
  },
111
117
  "resolutions": {
112
118
  "h3": "1.13.0",
@@ -115,6 +121,6 @@
115
121
  "@nuxt/schema": "3.13.2"
116
122
  },
117
123
  "volta": {
118
- "node": "22.10.0"
124
+ "node": "22.11.0"
119
125
  }
120
126
  }