@scayle/storefront-nuxt 7.94.7 → 7.95.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.
@@ -0,0 +1,25 @@
1
+ import { Factory } from 'fishery';
2
+ import { M as ModuleBaseOptions, f as ShopConfig } from '../shared/storefront-nuxt.80aa5060.mjs';
3
+ import { RpcContext } from '@scayle/storefront-core';
4
+ import { RouteLocationNormalizedLoadedGeneric } from 'vue-router';
5
+ export * from '@scayle/storefront-core/dist/test/factories';
6
+ import '@scayle/unstorage-compression-driver';
7
+ import 'unstorage';
8
+ import '../../dist/runtime/utils/zodSchema.js';
9
+ import '@nuxt/schema';
10
+
11
+ interface ModuleOptionsFactoryParams {
12
+ shops: ShopConfig[];
13
+ }
14
+ declare const moduleOptionsFactory: Factory<ModuleBaseOptions, ModuleOptionsFactoryParams, ModuleBaseOptions>;
15
+
16
+ declare const shopConfigFactory: Factory<ShopConfig, any, ShopConfig>;
17
+
18
+ interface RpcContextFactoryParams {
19
+ isLoggedIn: boolean;
20
+ }
21
+ declare const rpcContextFactory: Factory<RpcContext, RpcContextFactoryParams, RpcContext>;
22
+
23
+ declare const routeFactory: Factory<RouteLocationNormalizedLoadedGeneric, any, RouteLocationNormalizedLoadedGeneric>;
24
+
25
+ export { moduleOptionsFactory, routeFactory, rpcContextFactory, shopConfigFactory };
@@ -0,0 +1,25 @@
1
+ import { Factory } from 'fishery';
2
+ import { M as ModuleBaseOptions, f as ShopConfig } from '../shared/storefront-nuxt.80aa5060.js';
3
+ import { RpcContext } from '@scayle/storefront-core';
4
+ import { RouteLocationNormalizedLoadedGeneric } from 'vue-router';
5
+ export * from '@scayle/storefront-core/dist/test/factories';
6
+ import '@scayle/unstorage-compression-driver';
7
+ import 'unstorage';
8
+ import '../../dist/runtime/utils/zodSchema.js';
9
+ import '@nuxt/schema';
10
+
11
+ interface ModuleOptionsFactoryParams {
12
+ shops: ShopConfig[];
13
+ }
14
+ declare const moduleOptionsFactory: Factory<ModuleBaseOptions, ModuleOptionsFactoryParams, ModuleBaseOptions>;
15
+
16
+ declare const shopConfigFactory: Factory<ShopConfig, any, ShopConfig>;
17
+
18
+ interface RpcContextFactoryParams {
19
+ isLoggedIn: boolean;
20
+ }
21
+ declare const rpcContextFactory: Factory<RpcContext, RpcContextFactoryParams, RpcContext>;
22
+
23
+ declare const routeFactory: Factory<RouteLocationNormalizedLoadedGeneric, any, RouteLocationNormalizedLoadedGeneric>;
24
+
25
+ export { moduleOptionsFactory, routeFactory, rpcContextFactory, shopConfigFactory };
@@ -0,0 +1,116 @@
1
+ import { Factory } from 'fishery';
2
+ import { HashAlgorithm, StorefrontAPIClient, Log } from '@scayle/storefront-core';
3
+ export * from '@scayle/storefront-core/dist/test/factories';
4
+
5
+ const moduleOptionsFactory = Factory.define(({ transientParams }) => {
6
+ return {
7
+ sapi: {
8
+ host: "sapiHost",
9
+ token: "sapiToken"
10
+ },
11
+ oauth: {
12
+ apiHost: "oauthHost",
13
+ clientId: "clientId",
14
+ clientSecret: "clientSecret"
15
+ },
16
+ appKeys: {
17
+ basketKey: "basketKey",
18
+ wishlistKey: "wishlistKey",
19
+ hashAlgorithm: HashAlgorithm.MD5
20
+ },
21
+ shopSelector: "path",
22
+ shops: (transientParams?.shops || []).reduce((acc, curr) => {
23
+ return {
24
+ [curr.shopId]: curr,
25
+ ...acc
26
+ };
27
+ }, {})
28
+ };
29
+ });
30
+
31
+ const shopConfigFactory = Factory.define(() => {
32
+ return {
33
+ shopId: 1,
34
+ domain: "localhost",
35
+ locale: "en-US",
36
+ currency: "USD",
37
+ checkout: {
38
+ host: "checkoutHost",
39
+ secret: "checkoutSecret",
40
+ token: "checkoutToken",
41
+ user: "checkoutUser"
42
+ },
43
+ auth: {
44
+ resetPasswordUrl: "resetPasswordUrl"
45
+ },
46
+ paymentProviders: []
47
+ };
48
+ });
49
+
50
+ const rpcContextFactory = Factory.define(({ transientParams }) => {
51
+ return {
52
+ locale: "de",
53
+ checkout: {
54
+ url: "",
55
+ token: "",
56
+ secret: "",
57
+ user: ""
58
+ },
59
+ bapiClient: new StorefrontAPIClient({ host: "", shopId: 1001 }),
60
+ sapiClient: new StorefrontAPIClient({ host: "", shopId: 1001 }),
61
+ cached: (fn, _options) => {
62
+ return async (...args) => {
63
+ return await fn(...args);
64
+ };
65
+ },
66
+ isCmsPreview: false,
67
+ shopId: 1001,
68
+ domain: "localhost",
69
+ destroySessionsForUserId: () => Promise.resolve(),
70
+ generateBasketKeyForUserId: (userId) => Promise.resolve(`basket-${userId}`),
71
+ generateWishlistKeyForUserId: (userId) => Promise.resolve(`wishlist-${userId}`),
72
+ log: new Log(),
73
+ auth: {},
74
+ runtimeConfiguration: {},
75
+ headers: new Headers(),
76
+ ...transientParams.isLoggedIn ? {
77
+ wishlistKey: "wishlistKey",
78
+ basketKey: "basketKey",
79
+ sessionId: "sessionId",
80
+ user: void 0,
81
+ accessToken: void 0,
82
+ refreshToken: void 0,
83
+ destroySession: () => Promise.resolve(),
84
+ createUserBoundSession: () => Promise.resolve(),
85
+ updateUser: () => Promise.resolve(),
86
+ updateTokens: () => Promise.resolve()
87
+ } : {
88
+ wishlistKey: void 0,
89
+ basketKey: void 0,
90
+ sessionId: void 0,
91
+ user: void 0,
92
+ accessToken: void 0,
93
+ refreshToken: void 0,
94
+ destroySession: void 0,
95
+ createUserBoundSession: void 0,
96
+ updateUser: void 0,
97
+ updateTokens: void 0
98
+ }
99
+ };
100
+ });
101
+
102
+ const routeFactory = Factory.define(
103
+ () => ({
104
+ name: "test",
105
+ params: {},
106
+ matched: [],
107
+ path: "/test",
108
+ fullPath: "/test",
109
+ redirectedFrom: void 0,
110
+ hash: "",
111
+ meta: { test: "" },
112
+ query: {}
113
+ })
114
+ );
115
+
116
+ export { moduleOptionsFactory, routeFactory, rpcContextFactory, shopConfigFactory };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "7.94.7",
4
+ "version": "7.95.1",
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,14 @@
29
29
  "types": "./dist/runtime/composables/index.d.ts",
30
30
  "import": "./dist/runtime/composables/index.js"
31
31
  },
32
+ "./dist/test/factories": {
33
+ "types": "./dist/test/factories.d.ts",
34
+ "import": "./dist/test/factories.mjs"
35
+ },
36
+ "./test/factories": {
37
+ "types": "./dist/test/factories.d.ts",
38
+ "import": "./dist/test/factories.mjs"
39
+ },
32
40
  ".": {
33
41
  "types": "./dist/index.d.ts",
34
42
  "default": "./dist/index.mjs"
@@ -65,7 +73,7 @@
65
73
  "@nuxt/kit": "^3.12.2",
66
74
  "@opentelemetry/api": "^1.9.0",
67
75
  "@scayle/h3-session": "^0.4.1",
68
- "@scayle/storefront-core": "7.68.0",
76
+ "@scayle/storefront-core": "7.69.1",
69
77
  "@scayle/unstorage-compression-driver": "^0.1.5",
70
78
  "@vueuse/core": "11.2.0",
71
79
  "consola": "^3.2.3",
@@ -83,7 +91,7 @@
83
91
  "schema-dts": "1.1.2"
84
92
  },
85
93
  "devDependencies": {
86
- "@nuxt/eslint": "0.6.1",
94
+ "@nuxt/eslint": "0.7.0",
87
95
  "@nuxt/module-builder": "0.8.4",
88
96
  "@nuxt/schema": "3.13.2",
89
97
  "@nuxt/test-utils": "3.14.4",
@@ -101,7 +109,7 @@
101
109
  "nuxt": "3.13.2",
102
110
  "publint": "0.2.12",
103
111
  "vue-tsc": "2.1.10",
104
- "vitest": "2.1.4"
112
+ "vitest": "2.1.5"
105
113
  },
106
114
  "peerDependencies": {
107
115
  "fishery": "^2.2.2",
@@ -113,7 +121,7 @@
113
121
  },
114
122
  "resolutions": {
115
123
  "h3": "1.13.0",
116
- "vue": "3.5.12",
124
+ "vue": "3.5.13",
117
125
  "@nuxt/kit": "3.13.2",
118
126
  "@nuxt/schema": "3.13.2"
119
127
  },