@scayle/storefront-nuxt 7.36.3

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.
Files changed (135) hide show
  1. package/CHANGELOG.md +598 -0
  2. package/LICENSE +21 -0
  3. package/README.md +67 -0
  4. package/dist/index.d.mts +13 -0
  5. package/dist/index.d.ts +13 -0
  6. package/dist/index.mjs +2 -0
  7. package/dist/module.cjs +5 -0
  8. package/dist/module.d.mts +8 -0
  9. package/dist/module.d.ts +8 -0
  10. package/dist/module.json +8 -0
  11. package/dist/module.mjs +173 -0
  12. package/dist/rpc.d.mts +12 -0
  13. package/dist/rpc.d.ts +12 -0
  14. package/dist/rpc.mjs +18 -0
  15. package/dist/runtime/api/cacheAuth.d.ts +12 -0
  16. package/dist/runtime/api/cacheAuth.mjs +40 -0
  17. package/dist/runtime/api/purgeAll.d.ts +2 -0
  18. package/dist/runtime/api/purgeAll.mjs +14 -0
  19. package/dist/runtime/api/purgeTags.d.ts +2 -0
  20. package/dist/runtime/api/purgeTags.mjs +19 -0
  21. package/dist/runtime/api/rpcHandler.d.ts +2 -0
  22. package/dist/runtime/api/rpcHandler.mjs +15 -0
  23. package/dist/runtime/api/up.d.ts +4 -0
  24. package/dist/runtime/api/up.mjs +4 -0
  25. package/dist/runtime/composables/core/useAvailableShops.d.ts +2 -0
  26. package/dist/runtime/composables/core/useAvailableShops.mjs +4 -0
  27. package/dist/runtime/composables/core/useCurrentShop.d.ts +3 -0
  28. package/dist/runtime/composables/core/useCurrentShop.mjs +8 -0
  29. package/dist/runtime/composables/core/useEventListener.d.ts +2 -0
  30. package/dist/runtime/composables/core/useEventListener.mjs +2 -0
  31. package/dist/runtime/composables/core/useLog.d.ts +1 -0
  32. package/dist/runtime/composables/core/useLog.mjs +8 -0
  33. package/dist/runtime/composables/core/useRpc.d.ts +17 -0
  34. package/dist/runtime/composables/core/useRpc.mjs +56 -0
  35. package/dist/runtime/composables/core/useSession.d.ts +21 -0
  36. package/dist/runtime/composables/core/useSession.mjs +21 -0
  37. package/dist/runtime/composables/core/useUser.d.ts +16 -0
  38. package/dist/runtime/composables/core/useUser.mjs +68 -0
  39. package/dist/runtime/composables/storefront/useBasket.d.ts +54 -0
  40. package/dist/runtime/composables/storefront/useBasket.mjs +165 -0
  41. package/dist/runtime/composables/storefront/useBrand.d.ts +16 -0
  42. package/dist/runtime/composables/storefront/useBrand.mjs +20 -0
  43. package/dist/runtime/composables/storefront/useBrands.d.ts +16 -0
  44. package/dist/runtime/composables/storefront/useBrands.mjs +20 -0
  45. package/dist/runtime/composables/storefront/useCategories.d.ts +20 -0
  46. package/dist/runtime/composables/storefront/useCategories.mjs +30 -0
  47. package/dist/runtime/composables/storefront/useCurrentPromotions.d.ts +16 -0
  48. package/dist/runtime/composables/storefront/useCurrentPromotions.mjs +20 -0
  49. package/dist/runtime/composables/storefront/useFacet.d.ts +48 -0
  50. package/dist/runtime/composables/storefront/useFacet.mjs +193 -0
  51. package/dist/runtime/composables/storefront/useFilters.d.ts +16 -0
  52. package/dist/runtime/composables/storefront/useFilters.mjs +20 -0
  53. package/dist/runtime/composables/storefront/useNavigationTree.d.ts +16 -0
  54. package/dist/runtime/composables/storefront/useNavigationTree.mjs +20 -0
  55. package/dist/runtime/composables/storefront/useNavigationTrees.d.ts +16 -0
  56. package/dist/runtime/composables/storefront/useNavigationTrees.mjs +20 -0
  57. package/dist/runtime/composables/storefront/useOrder.d.ts +89 -0
  58. package/dist/runtime/composables/storefront/useOrder.mjs +17 -0
  59. package/dist/runtime/composables/storefront/useOrderConfirmation.d.ts +89 -0
  60. package/dist/runtime/composables/storefront/useOrderConfirmation.mjs +17 -0
  61. package/dist/runtime/composables/storefront/useProduct.d.ts +16 -0
  62. package/dist/runtime/composables/storefront/useProduct.mjs +20 -0
  63. package/dist/runtime/composables/storefront/useProducts.d.ts +20 -0
  64. package/dist/runtime/composables/storefront/useProducts.mjs +20 -0
  65. package/dist/runtime/composables/storefront/useProductsByIds.d.ts +16 -0
  66. package/dist/runtime/composables/storefront/useProductsByIds.mjs +20 -0
  67. package/dist/runtime/composables/storefront/useProductsCount.d.ts +16 -0
  68. package/dist/runtime/composables/storefront/useProductsCount.mjs +20 -0
  69. package/dist/runtime/composables/storefront/usePromotions.d.ts +16 -0
  70. package/dist/runtime/composables/storefront/usePromotions.mjs +20 -0
  71. package/dist/runtime/composables/storefront/usePromotionsByIds.d.ts +16 -0
  72. package/dist/runtime/composables/storefront/usePromotionsByIds.mjs +20 -0
  73. package/dist/runtime/composables/storefront/useQueryFilterState.d.ts +12 -0
  74. package/dist/runtime/composables/storefront/useQueryFilterState.mjs +66 -0
  75. package/dist/runtime/composables/storefront/useSearch.d.ts +13 -0
  76. package/dist/runtime/composables/storefront/useSearch.mjs +49 -0
  77. package/dist/runtime/composables/storefront/useShopConfiguration.d.ts +13 -0
  78. package/dist/runtime/composables/storefront/useShopConfiguration.mjs +19 -0
  79. package/dist/runtime/composables/storefront/useUserAddresses.d.ts +13 -0
  80. package/dist/runtime/composables/storefront/useUserAddresses.mjs +19 -0
  81. package/dist/runtime/composables/storefront/useVariant.d.ts +16 -0
  82. package/dist/runtime/composables/storefront/useVariant.mjs +20 -0
  83. package/dist/runtime/composables/storefront/useWishlist.d.ts +48 -0
  84. package/dist/runtime/composables/storefront/useWishlist.mjs +119 -0
  85. package/dist/runtime/composables/useCoreLog.d.ts +1 -0
  86. package/dist/runtime/composables/useCoreLog.mjs +4 -0
  87. package/dist/runtime/context.d.ts +12 -0
  88. package/dist/runtime/context.mjs +98 -0
  89. package/dist/runtime/createLog.d.ts +3 -0
  90. package/dist/runtime/createLog.mjs +39 -0
  91. package/dist/runtime/error/handler.d.ts +14 -0
  92. package/dist/runtime/error/handler.mjs +53 -0
  93. package/dist/runtime/handler.d.ts +8 -0
  94. package/dist/runtime/handler.mjs +26 -0
  95. package/dist/runtime/log.d.ts +38 -0
  96. package/dist/runtime/log.mjs +68 -0
  97. package/dist/runtime/plugin/log.client.d.ts +8 -0
  98. package/dist/runtime/plugin/log.client.mjs +24 -0
  99. package/dist/runtime/plugin/log.server.d.ts +2 -0
  100. package/dist/runtime/plugin/log.server.mjs +11 -0
  101. package/dist/runtime/plugin/shop.d.ts +8 -0
  102. package/dist/runtime/plugin/shop.mjs +17 -0
  103. package/dist/runtime/rpc/rpcCall.d.ts +9 -0
  104. package/dist/runtime/rpc/rpcCall.mjs +16 -0
  105. package/dist/runtime/server/middleware/bootstrap.d.ts +12 -0
  106. package/dist/runtime/server/middleware/bootstrap.mjs +188 -0
  107. package/dist/runtime/server/middleware/bootstrap.test.d.ts +6 -0
  108. package/dist/runtime/server/middleware/bootstrap.test.mjs +277 -0
  109. package/dist/runtime/server/middleware/bootstrap.utils.d.ts +7 -0
  110. package/dist/runtime/server/middleware/bootstrap.utils.mjs +59 -0
  111. package/dist/runtime/server/middleware/cache.d.ts +12 -0
  112. package/dist/runtime/server/middleware/cache.mjs +44 -0
  113. package/dist/runtime/server/middleware/oauth.d.ts +3 -0
  114. package/dist/runtime/server/middleware/oauth.mjs +123 -0
  115. package/dist/runtime/server/middleware/redirects.d.ts +2 -0
  116. package/dist/runtime/server/middleware/redirects.mjs +86 -0
  117. package/dist/runtime/server/middleware/redirects.test.d.ts +1 -0
  118. package/dist/runtime/server/middleware/redirects.test.mjs +66 -0
  119. package/dist/runtime/server/middleware/redirects.utils.d.ts +18 -0
  120. package/dist/runtime/server/middleware/redirects.utils.mjs +28 -0
  121. package/dist/runtime/utils/error.d.ts +5 -0
  122. package/dist/runtime/utils/error.mjs +7 -0
  123. package/dist/runtime/utils/price.d.ts +11 -0
  124. package/dist/runtime/utils/price.mjs +32 -0
  125. package/dist/runtime/utils/price.test.d.ts +1 -0
  126. package/dist/runtime/utils/price.test.mjs +83 -0
  127. package/dist/runtime/utils/route.d.ts +2 -0
  128. package/dist/runtime/utils/route.mjs +3 -0
  129. package/dist/runtime/utils/route.test.d.ts +1 -0
  130. package/dist/runtime/utils/route.test.mjs +15 -0
  131. package/dist/shared/storefront-nuxt.9548700f.d.mts +161 -0
  132. package/dist/shared/storefront-nuxt.9548700f.d.ts +161 -0
  133. package/dist/types.d.mts +15 -0
  134. package/dist/types.d.ts +15 -0
  135. package/package.json +103 -0
@@ -0,0 +1,161 @@
1
+ import { HashAlgorithm, WithParams, ShopUser } from '@scayle/storefront-core';
2
+
3
+ type StorageProvider = 'memory' | 'redis';
4
+ type CheckoutShopConfig = {
5
+ host: string;
6
+ token: string;
7
+ secret: string;
8
+ user: string;
9
+ /**
10
+ * The number of seconds that a CBD token should be considered valid since issued
11
+ */
12
+ cbdExpiration?: number;
13
+ };
14
+ /**
15
+ * Options to configure how the storefront core manages sessions
16
+ */
17
+ type SessionConfig = Partial<{
18
+ /**
19
+ * The name used for the session cookie
20
+ */
21
+ cookieName: string;
22
+ /**
23
+ * The sameSite policy to use for the session cookie
24
+ */
25
+ sameSite: 'none' | 'lax' | 'strict';
26
+ /**
27
+ * The default maxAge (in seconds) set on the session cookie and default TTL for session store
28
+ */
29
+ maxAge: number;
30
+ /**
31
+ * The secret used for signing session cookies. If an array is passed, the last
32
+ * value is used for signing new cookies, but all values are used to verify cookies.
33
+ */
34
+ secret: string | string[];
35
+ /**
36
+ * Controls the domain option on the session cookie
37
+ */
38
+ domain: string;
39
+ /**
40
+ * The provider to use for the persistent storage.
41
+ */
42
+ provider: StorageProvider;
43
+ }>;
44
+ interface CacheConfig {
45
+ provider?: StorageProvider;
46
+ auth?: {
47
+ username: string;
48
+ password: string;
49
+ };
50
+ ssr?: {};
51
+ enabled?: boolean;
52
+ }
53
+ type RedisConfig = {
54
+ port?: number;
55
+ host?: string;
56
+ prefix?: string;
57
+ sslTransit?: boolean;
58
+ } | {
59
+ port?: number;
60
+ host?: string;
61
+ prefix?: string;
62
+ sslTransit?: boolean;
63
+ user: string;
64
+ password: string;
65
+ };
66
+ interface BapiConfig {
67
+ host: string;
68
+ token: string;
69
+ }
70
+ interface AppKeys {
71
+ wishlistKey: string;
72
+ basketKey: string;
73
+ hashAlgorithm: HashAlgorithm;
74
+ }
75
+ interface RedirectsConfig {
76
+ enabled: boolean;
77
+ queryParamWhitelist?: string[];
78
+ }
79
+ interface OauthConfig {
80
+ apiHost: string;
81
+ clientId: string;
82
+ clientSecret: string;
83
+ }
84
+ type AuthenticationConfig = {
85
+ redirect: {
86
+ home: string;
87
+ logout: string;
88
+ };
89
+ };
90
+ interface AdditionalShopConfig {
91
+ }
92
+ interface ShopConfig extends AdditionalShopConfig {
93
+ shopId: number;
94
+ domain: string;
95
+ path?: string;
96
+ locale: string;
97
+ apiBasePath?: string;
98
+ currency: string;
99
+ currencyFractionDigits?: number;
100
+ storeCampaignKeyword?: string;
101
+ isEnabled?: boolean;
102
+ checkout: CheckoutShopConfig;
103
+ sessionConfig?: SessionConfig;
104
+ auth: {
105
+ resetPasswordUrl: string;
106
+ };
107
+ redis?: RedisConfig;
108
+ bapi?: BapiConfig;
109
+ appKeys?: AppKeys;
110
+ }
111
+ type ShopConfigIndexed = Record<string, ShopConfig>;
112
+ interface PublicShopConfig extends Pick<ShopConfig, 'shopId' | 'domain' | 'path' | 'locale' | 'currency' | 'currencyFractionDigits'> {
113
+ checkout: Pick<CheckoutShopConfig, 'host'>;
114
+ apiBasePath: string;
115
+ }
116
+ interface StorefrontConfig {
117
+ session?: SessionConfig;
118
+ bapi: BapiConfig;
119
+ redis: RedisConfig;
120
+ auth: AuthenticationConfig;
121
+ oauth: OauthConfig;
122
+ appKeys: AppKeys;
123
+ apiBasePath?: string;
124
+ cache?: CacheConfig;
125
+ publicShopData?: (keyof AdditionalShopConfig)[];
126
+ withParams?: WithParams;
127
+ }
128
+ type ModuleOptions = StorefrontConfig & {
129
+ shopSelector: 'domain' | 'path';
130
+ stores: ShopConfigIndexed;
131
+ rpcDir?: string;
132
+ rpcMethodNames?: string[];
133
+ log: {
134
+ name: string;
135
+ };
136
+ redirects?: RedirectsConfig;
137
+ };
138
+ interface CheckoutEvent {
139
+ action?: 'authenticated';
140
+ type?: 'tracking';
141
+ user: ShopUser;
142
+ accessToken: string;
143
+ event?: {
144
+ event: 'login' | 'add_to_cart' | 'remove_from_cart';
145
+ status: 'successful' | 'error';
146
+ };
147
+ }
148
+ declare module '@nuxt/schema' {
149
+ interface RuntimeConfig {
150
+ storefront: ModuleOptions;
151
+ }
152
+ interface PublicRuntimeConfig {
153
+ imageBaseUrl: string;
154
+ log: {
155
+ name: string;
156
+ };
157
+ auth: AuthenticationConfig;
158
+ }
159
+ }
160
+
161
+ export type { AppKeys as A, BapiConfig as B, CheckoutShopConfig as C, ModuleOptions as M, OauthConfig as O, PublicShopConfig as P, RedisConfig as R, StorageProvider as S, SessionConfig as a, CacheConfig as b, RedirectsConfig as c, AuthenticationConfig as d, AdditionalShopConfig as e, ShopConfig as f, ShopConfigIndexed as g, StorefrontConfig as h, CheckoutEvent as i };
@@ -0,0 +1,15 @@
1
+
2
+ import { ModuleOptions } from './module'
3
+
4
+ declare module '@nuxt/schema' {
5
+ interface NuxtConfig { ['storefront']?: Partial<ModuleOptions> }
6
+ interface NuxtOptions { ['storefront']?: ModuleOptions }
7
+ }
8
+
9
+ declare module 'nuxt/schema' {
10
+ interface NuxtConfig { ['storefront']?: Partial<ModuleOptions> }
11
+ interface NuxtOptions { ['storefront']?: ModuleOptions }
12
+ }
13
+
14
+
15
+ export { AdditionalShopConfig, AppKeys, AuthenticationConfig, BapiConfig, CacheConfig, CheckoutEvent, CheckoutShopConfig, OauthConfig, PublicShopConfig, RedirectsConfig, RedisConfig, SessionConfig, ShopConfig, ShopConfigIndexed, StorageProvider, StorefrontConfig } from './module'
@@ -0,0 +1,15 @@
1
+
2
+ import { ModuleOptions } from './module'
3
+
4
+ declare module '@nuxt/schema' {
5
+ interface NuxtConfig { ['storefront']?: Partial<ModuleOptions> }
6
+ interface NuxtOptions { ['storefront']?: ModuleOptions }
7
+ }
8
+
9
+ declare module 'nuxt/schema' {
10
+ interface NuxtConfig { ['storefront']?: Partial<ModuleOptions> }
11
+ interface NuxtOptions { ['storefront']?: ModuleOptions }
12
+ }
13
+
14
+
15
+ export { AdditionalShopConfig, AppKeys, AuthenticationConfig, BapiConfig, CacheConfig, CheckoutEvent, CheckoutShopConfig, OauthConfig, PublicShopConfig, RedirectsConfig, RedisConfig, SessionConfig, ShopConfig, ShopConfigIndexed, StorageProvider, StorefrontConfig } from './module'
package/package.json ADDED
@@ -0,0 +1,103 @@
1
+ {
2
+ "name": "@scayle/storefront-nuxt",
3
+ "type": "module",
4
+ "version": "7.36.3",
5
+ "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
+ "author": "SCAYLE Commerce Engine",
7
+ "license": "MIT",
8
+ "publishConfig": {
9
+ "access": "public",
10
+ "registry": "https://registry.npmjs.org/"
11
+ },
12
+ "sideEffects": false,
13
+ "exports": {
14
+ "./rpc": {
15
+ "types": "./dist/rpc.d.ts",
16
+ "import": "./dist/rpc.mjs"
17
+ },
18
+ "./dist/rpc": {
19
+ "types": "./dist/rpc.d.ts",
20
+ "import": "./dist/rpc.mjs"
21
+ },
22
+ "./module": {
23
+ "types": "./dist/types.d.ts",
24
+ "require": "./dist/module.cjs",
25
+ "import": "./dist/module.mjs"
26
+ },
27
+ ".": {
28
+ "types": "./dist/index.d.ts",
29
+ "default": "./dist/index.mjs"
30
+ }
31
+ },
32
+ "main": "./dist/index.mjs",
33
+ "types": "./dist/index.d.ts",
34
+ "files": [
35
+ "CHANGELOG.md",
36
+ "dist"
37
+ ],
38
+ "engines": {
39
+ "node": ">= 20.7.0"
40
+ },
41
+ "build": {
42
+ "entries": [
43
+ "./src/rpc",
44
+ "./src/index"
45
+ ]
46
+ },
47
+ "scripts": {
48
+ "build": "nuxt-module-build build",
49
+ "dev": "nuxi dev playground",
50
+ "dev:build": "nuxi build playground",
51
+ "prep": "nuxi prepare playground",
52
+ "format": "prettier --ignore-unknown --log-level warn --check .",
53
+ "format:fix": "prettier --ignore-unknown --log-level warn --write .",
54
+ "lint": "eslint . --format gitlab",
55
+ "lint:fix": "eslint . --fix",
56
+ "typecheck": "vue-tsc --noEmit -p tsconfig.check.json",
57
+ "package:lint": "publint",
58
+ "test": "vitest run",
59
+ "test:ci": "vitest run",
60
+ "test:watch": "vitest watch"
61
+ },
62
+ "dependencies": {
63
+ "@nuxt/kit": "3.7.4",
64
+ "@scayle/h3-session": "0.3.4",
65
+ "@scayle/storefront-core": "7.22.1",
66
+ "@vueuse/core": "10.5.0",
67
+ "consola": "3.2.3",
68
+ "core-js": "3.33.2",
69
+ "defu": "6.1.3",
70
+ "h3": "1.8.2",
71
+ "jose": "4.15.4",
72
+ "ofetch": "1.3.3",
73
+ "radash": "11.0.0",
74
+ "uncrypto": "0.1.3",
75
+ "vue-router": "4.2.5",
76
+ "yn": "^5.0.0"
77
+ },
78
+ "devDependencies": {
79
+ "@nuxt/module-builder": "0.5.2",
80
+ "@nuxt/schema": "3.7.4",
81
+ "@nuxt/test-utils": "3.7.4",
82
+ "@scayle/eslint-config-storefront": "3.2.5",
83
+ "@scayle/prettier-config-storefront": "2.0.2",
84
+ "@types/node": "20.8.10",
85
+ "eslint": "8.52.0",
86
+ "eslint-formatter-gitlab": "5.0.0",
87
+ "node-mocks-http": "1.13.0",
88
+ "nuxt": "3.7.4",
89
+ "prettier": "3.0.0",
90
+ "publint": "0.2.5",
91
+ "unstorage": "1.9.0",
92
+ "vitest": "0.34.6",
93
+ "vue-tsc": "1.8.22"
94
+ },
95
+ "peerDependencies": {
96
+ "nuxt": ">=3.7.3",
97
+ "unstorage": ">= 1.9.0",
98
+ "vue": ">=3.3.0"
99
+ },
100
+ "volta": {
101
+ "node": "20.9.0"
102
+ }
103
+ }