@scayle/omnichannel-nuxt 3.0.3 → 4.0.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/README.md +18 -33
  3. package/dist/index.d.mts +2 -27
  4. package/dist/index.d.ts +2 -27
  5. package/dist/index.mjs +1 -93
  6. package/dist/module.d.mts +2 -2
  7. package/dist/module.d.ts +2 -2
  8. package/dist/module.json +5 -1
  9. package/dist/module.mjs +4 -6
  10. package/dist/runtime/composables/index.d.ts +4 -4
  11. package/dist/runtime/composables/index.js +4 -0
  12. package/dist/runtime/composables/useStoreLocator.d.ts +4 -4
  13. package/dist/runtime/composables/{useStoreLocator.mjs → useStoreLocator.js} +3 -3
  14. package/dist/runtime/composables/useStoreVariantById.d.ts +2 -2
  15. package/dist/runtime/composables/useStores.d.ts +2 -2
  16. package/dist/runtime/composables/useVariantStores.d.ts +2 -2
  17. package/dist/runtime/constants/httpStatus.d.ts +4 -4
  18. package/dist/runtime/constants/{httpStatus.mjs → httpStatus.js} +4 -4
  19. package/dist/runtime/error/errorHandler.d.ts +1 -1
  20. package/dist/runtime/error/{errorHandler.mjs → errorHandler.js} +2 -2
  21. package/dist/runtime/handler.d.ts +6 -1
  22. package/dist/runtime/{handler.mjs → handler.js} +3 -3
  23. package/dist/runtime/lib/init.d.ts +2 -2
  24. package/dist/runtime/rpc/storeLocator.d.ts +4 -4
  25. package/dist/runtime/rpc/{storeLocator.mjs → storeLocator.js} +1 -1
  26. package/dist/shared/{omnichannel-nuxt.773770bd.d.mts → omnichannel-nuxt.270bfbda.d.mts} +1 -1
  27. package/dist/shared/{omnichannel-nuxt.773770bd.d.ts → omnichannel-nuxt.270bfbda.d.ts} +1 -1
  28. package/dist/types.d.mts +4 -5
  29. package/dist/types.d.ts +4 -5
  30. package/package.json +20 -36
  31. package/dist/chunks/createOmnichannelHandler.mjs +0 -805
  32. package/dist/runtime/composables/index.mjs +0 -4
  33. /package/dist/runtime/composables/{useStoreVariantById.mjs → useStoreVariantById.js} +0 -0
  34. /package/dist/runtime/composables/{useStores.mjs → useStores.js} +0 -0
  35. /package/dist/runtime/composables/{useVariantStores.mjs → useVariantStores.js} +0 -0
  36. /package/dist/runtime/lib/{init.mjs → init.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @scayle/omnichannel-nuxt
2
2
 
3
+ ## 4.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Update @nuxt/module-builder to 0.8.4
8
+
9
+ ## 4.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - Remove support for Nuxt 2
14
+
3
15
  ## 3.0.3
4
16
 
5
17
  ### Patch Changes
@@ -40,7 +52,7 @@
40
52
  refreshStoreVariant,
41
53
  variantStoresData,
42
54
  refreshVariantStores,
43
- } = useStoreLocator("useStoreLocator", ["openingTimes", "setttings"]);
55
+ } = useStoreLocator('useStoreLocator', ['openingTimes', 'setttings'])
44
56
  ```
45
57
 
46
58
  ## 2.1.4
package/README.md CHANGED
@@ -1,37 +1,13 @@
1
1
  # Omnichannel
2
2
 
3
- This is the basis for setting up a new Omnichannel Add On based on Nuxt.
4
- It provides a reusable composable, that can be used in the actual shop project.
3
+ This is the basis for setting up a new Omnichannel Add-On integration using Nuxt.
4
+ It provides a reusable composables, that can be used in the actual storefront project.
5
5
 
6
6
  ## Getting started
7
7
 
8
8
  To start working with `@scayle/omnichannel-nuxt`, make sure to
9
9
  register it as a module in your nuxt.config.ts file:
10
10
 
11
- Nuxt 2
12
-
13
- ```typescript
14
- import { NuxtConfig } from '@nuxt/types'
15
-
16
- const config: NuxtConfig & { storefront: ModuleOptions } = {
17
- // ...
18
-
19
- modules: [
20
- // ...
21
- [
22
- '@scayle/omnichannel-nuxt/dist/module',
23
- {
24
- host: environment.OMNICHANNEL_API_HOST,
25
- token: environment.OMNICHANNEL_API_TOKEN,
26
- },
27
- ],
28
- ],
29
- // ...
30
- }
31
-
32
- export default config
33
- ```
34
-
35
11
  Nuxt 3
36
12
 
37
13
  ```typescript
@@ -61,10 +37,6 @@ which can be used to call the following methods:
61
37
  When using Nuxt 3, composables are automatically registered and do not need to be imported explicitly.
62
38
  The Nuxt 3 composables can optionally be imported using the import alias `#omnichannel/composables`.
63
39
 
64
- [note]
65
- When using Nuxt 2, composables can directly be imported from '@scayle/omnichannel-nuxt'.
66
- [/note]
67
-
68
40
  ### [useStoreLocator](./src/composables/useStoreLocator.ts)
69
41
 
70
42
  Getting `storesData` based on a provided address
@@ -72,7 +44,6 @@ Getting `storesData` based on a provided address
72
44
  Example:
73
45
 
74
46
  ```typescript
75
- // import { useStoreLocator } from '@scayle/omnichannel-nuxt' // Nuxt 2
76
47
  import { useStoreLocator } from '#omnichannel/composables'
77
48
 
78
49
  const { storesData, refreshStores } = useStoreLocator('useStoreLocator', [
@@ -87,7 +58,6 @@ Getting `variantStoresData` based on a provided address
87
58
  Example:
88
59
 
89
60
  ```typescript
90
- // import { useStoreLocator } from '@scayle/omnichannel-nuxt' // Nuxt 2
91
61
  import { useStoreLocator } from '#omnichannel/composables'
92
62
 
93
63
  const { variantStoresData, refreshVariantStores } = useStoreLocator(
@@ -104,7 +74,6 @@ Getting `storeVariantData` based on a provided store ID and variant ID
104
74
  Example:
105
75
 
106
76
  ```typescript
107
- // import { useStoreLocator } from '@scayle/omnichannel-nuxt' // Nuxt 2
108
77
  import { useStoreLocator } from '#omnichannel/composables'
109
78
 
110
79
  const { storeVariantData, refreshStoreVariant } = useStoreLocator(
@@ -115,3 +84,19 @@ const variantId = 1
115
84
  const storeId = 12
116
85
  await refreshStoreVariant(variantId, storeId)
117
86
  ```
87
+
88
+ ## What is SCAYLE?
89
+
90
+ [SCAYLE](https://scayle.com) is a full-featured e-commerce software solution that comes with flexible APIs.
91
+ Within SCAYLE, you can manage all aspects of your shop, such as products, stocks, customers, and transactions.
92
+
93
+ Learn more about [SCAYLE’s architecture](https://scayle.dev/en/developer-guide) and commerce modules in the docs.
94
+
95
+ ## Other channels
96
+
97
+ - [LinkedIn](https://www.linkedin.com/company/scaylecommerce/)
98
+ - [Jobs](https://careers.smartrecruiters.com/ABOUTYOUGmbH/scayle)
99
+
100
+ ## License
101
+
102
+ Licensed under the [MIT License](https://opensource.org/license/mit/)
package/dist/index.d.mts CHANGED
@@ -1,30 +1,5 @@
1
- import { S as StoreWithProperty, a as StoreLocationResponse, b as StoreLocatorSearchParams, c as StoreAvailabilityCheck, V as VariantLocation, d as VariantLocatorSearchParams } from './shared/omnichannel-nuxt.773770bd.mjs';
2
- export { u as FetchStoreVariantByIdParams, t as FetchStoresForVariantParams, F as FiltersAddressParams, s as FiltersCoordinatesParams, G as GeoPoint, n as OmnichannelLinks, m as OmnichannelMeta, f as OpeningTimeException, O as OpeningTimeInterval, k as OpeningTimes, l as Store, h as StoreAddress, q as StoreAvailabilityCheckResponse, g as StoreImage, j as StoreItem, i as StoreItemVariant, o as StoreLocation, e as StoreLocatorConfig, p as StoreVariantLocation, r as VariantLocationResponse } from './shared/omnichannel-nuxt.773770bd.mjs';
3
1
  import { ValuesType } from 'utility-types';
4
-
5
- declare const _default$3: (key?: string, withProperties?: StoreWithProperty[]) => {
6
- data: globalThis.ComputedRef<StoreLocationResponse | null>;
7
- getData: (searchParams: StoreLocatorSearchParams) => Promise<void>;
8
- };
9
-
10
- declare const _default$2: (key?: string, withProperties?: StoreWithProperty[]) => {
11
- data: globalThis.ComputedRef<StoreAvailabilityCheck | null>;
12
- getData: (variantId: number, storeId: number) => Promise<void>;
13
- };
14
-
15
- declare const _default$1: (key?: string, withProperties?: StoreWithProperty[]) => {
16
- data: globalThis.ComputedRef<VariantLocation | null>;
17
- getData: (searchParams: VariantLocatorSearchParams) => Promise<void>;
18
- };
19
-
20
- declare const _default: (key?: string) => {
21
- storesData: globalThis.ComputedRef<StoreLocationResponse | null>;
22
- refreshStores: (searchParams: StoreLocatorSearchParams) => Promise<void>;
23
- storeVariantData: globalThis.ComputedRef<StoreAvailabilityCheck | null>;
24
- refreshStoreVariant: (variantId: number, storeId: number) => Promise<void>;
25
- variantStoresData: globalThis.ComputedRef<VariantLocation | null>;
26
- refreshVariantStores: (searchParams: VariantLocatorSearchParams) => Promise<void>;
27
- };
2
+ export { u as FetchStoreVariantByIdParams, t as FetchStoresForVariantParams, F as FiltersAddressParams, q as FiltersCoordinatesParams, G as GeoPoint, j as OmnichannelLinks, i as OmnichannelMeta, a as OpeningTimeException, O as OpeningTimeInterval, f as OpeningTimes, g as Store, c as StoreAddress, n as StoreAvailabilityCheck, o as StoreAvailabilityCheckResponse, b as StoreImage, e as StoreItem, d as StoreItemVariant, k as StoreLocation, l as StoreLocationResponse, S as StoreLocatorConfig, r as StoreLocatorSearchParams, m as StoreVariantLocation, h as StoreWithProperty, V as VariantLocation, p as VariantLocationResponse, s as VariantLocatorSearchParams } from './shared/omnichannel-nuxt.270bfbda.mjs';
28
3
 
29
4
  declare const OpeningTime: {
30
5
  readonly MONDAY: "mon";
@@ -37,4 +12,4 @@ declare const OpeningTime: {
37
12
  };
38
13
  type OpeningTime = ValuesType<typeof OpeningTime>;
39
14
 
40
- export { OpeningTime, StoreAvailabilityCheck, StoreLocationResponse, StoreLocatorSearchParams, StoreWithProperty, VariantLocation, VariantLocatorSearchParams, _default as useStoreLocator, _default$2 as useStoreVariantById, _default$3 as useStores, _default$1 as useVariantStores };
15
+ export { OpeningTime };
package/dist/index.d.ts CHANGED
@@ -1,30 +1,5 @@
1
- import { S as StoreWithProperty, a as StoreLocationResponse, b as StoreLocatorSearchParams, c as StoreAvailabilityCheck, V as VariantLocation, d as VariantLocatorSearchParams } from './shared/omnichannel-nuxt.773770bd.js';
2
- export { u as FetchStoreVariantByIdParams, t as FetchStoresForVariantParams, F as FiltersAddressParams, s as FiltersCoordinatesParams, G as GeoPoint, n as OmnichannelLinks, m as OmnichannelMeta, f as OpeningTimeException, O as OpeningTimeInterval, k as OpeningTimes, l as Store, h as StoreAddress, q as StoreAvailabilityCheckResponse, g as StoreImage, j as StoreItem, i as StoreItemVariant, o as StoreLocation, e as StoreLocatorConfig, p as StoreVariantLocation, r as VariantLocationResponse } from './shared/omnichannel-nuxt.773770bd.js';
3
1
  import { ValuesType } from 'utility-types';
4
-
5
- declare const _default$3: (key?: string, withProperties?: StoreWithProperty[]) => {
6
- data: globalThis.ComputedRef<StoreLocationResponse | null>;
7
- getData: (searchParams: StoreLocatorSearchParams) => Promise<void>;
8
- };
9
-
10
- declare const _default$2: (key?: string, withProperties?: StoreWithProperty[]) => {
11
- data: globalThis.ComputedRef<StoreAvailabilityCheck | null>;
12
- getData: (variantId: number, storeId: number) => Promise<void>;
13
- };
14
-
15
- declare const _default$1: (key?: string, withProperties?: StoreWithProperty[]) => {
16
- data: globalThis.ComputedRef<VariantLocation | null>;
17
- getData: (searchParams: VariantLocatorSearchParams) => Promise<void>;
18
- };
19
-
20
- declare const _default: (key?: string) => {
21
- storesData: globalThis.ComputedRef<StoreLocationResponse | null>;
22
- refreshStores: (searchParams: StoreLocatorSearchParams) => Promise<void>;
23
- storeVariantData: globalThis.ComputedRef<StoreAvailabilityCheck | null>;
24
- refreshStoreVariant: (variantId: number, storeId: number) => Promise<void>;
25
- variantStoresData: globalThis.ComputedRef<VariantLocation | null>;
26
- refreshVariantStores: (searchParams: VariantLocatorSearchParams) => Promise<void>;
27
- };
2
+ export { u as FetchStoreVariantByIdParams, t as FetchStoresForVariantParams, F as FiltersAddressParams, q as FiltersCoordinatesParams, G as GeoPoint, j as OmnichannelLinks, i as OmnichannelMeta, a as OpeningTimeException, O as OpeningTimeInterval, f as OpeningTimes, g as Store, c as StoreAddress, n as StoreAvailabilityCheck, o as StoreAvailabilityCheckResponse, b as StoreImage, e as StoreItem, d as StoreItemVariant, k as StoreLocation, l as StoreLocationResponse, S as StoreLocatorConfig, r as StoreLocatorSearchParams, m as StoreVariantLocation, h as StoreWithProperty, V as VariantLocation, p as VariantLocationResponse, s as VariantLocatorSearchParams } from './shared/omnichannel-nuxt.270bfbda.js';
28
3
 
29
4
  declare const OpeningTime: {
30
5
  readonly MONDAY: "mon";
@@ -37,4 +12,4 @@ declare const OpeningTime: {
37
12
  };
38
13
  type OpeningTime = ValuesType<typeof OpeningTime>;
39
14
 
40
- export { OpeningTime, StoreAvailabilityCheck, StoreLocationResponse, StoreLocatorSearchParams, StoreWithProperty, VariantLocation, VariantLocatorSearchParams, _default as useStoreLocator, _default$2 as useStoreVariantById, _default$3 as useStores, _default$1 as useVariantStores };
15
+ export { OpeningTime };
package/dist/index.mjs CHANGED
@@ -1,95 +1,3 @@
1
- import { useContext, ssrRef, computed } from '@nuxtjs/composition-api';
2
-
3
- function sharedRef(value, key) {
4
- const context = useContext();
5
- const { $sharedRefsMap } = context;
6
- if ($sharedRefsMap.has(key)) {
7
- return $sharedRefsMap.get(key);
8
- }
9
- const newRef = ssrRef(value, key);
10
- $sharedRefsMap.set(key, newRef);
11
- return newRef;
12
- }
13
-
14
- const useStores = (key = "useStores", withProperties = []) => {
15
- const response = sharedRef(null, key);
16
- const getData = async (searchParams) => {
17
- response.value = await fetch("/api/omnichannel/stores", {
18
- body: JSON.stringify({
19
- with: withProperties,
20
- searchParams
21
- }),
22
- method: "POST",
23
- headers: {
24
- "Content-Type": "application/json"
25
- }
26
- }).then(async (res) => await res.json());
27
- };
28
- return {
29
- data: computed(() => response.value),
30
- getData
31
- };
32
- };
33
-
34
- const useStoreVariantById = (key = "useStoreVariantById", withProperties = []) => {
35
- const response = sharedRef(null, key);
36
- const getData = async (variantId, storeId) => {
37
- response.value = (await fetch("/api/omnichannel/storeVariantById", {
38
- body: JSON.stringify({
39
- with: withProperties,
40
- storeId,
41
- variantId
42
- }),
43
- method: "POST",
44
- headers: {
45
- "Content-Type": "application/json"
46
- }
47
- }).then(
48
- async (res) => await res.json()
49
- )).data;
50
- };
51
- return {
52
- data: computed(() => response.value),
53
- getData
54
- };
55
- };
56
-
57
- const useVariantStores = (key = "useVariantStores", withProperties = []) => {
58
- const response = sharedRef(null, key);
59
- const getData = async (searchParams) => {
60
- response.value = (await fetch("/api/omnichannel/variantStores", {
61
- body: JSON.stringify({
62
- with: withProperties,
63
- searchParams
64
- }),
65
- method: "POST",
66
- headers: {
67
- "Content-Type": "application/json"
68
- }
69
- }).then(async (res) => await res.json())).data;
70
- };
71
- return {
72
- data: computed(() => response.value),
73
- getData
74
- };
75
- };
76
-
77
- const useStoreLocator = (key = "useStoreLocator") => {
78
- const { data: storesData, getData: refreshStores } = useStores(
79
- `${key}-stores`
80
- );
81
- const { data: variantStoresData, getData: refreshVariantStores } = useVariantStores(`${key}-variant-stores`);
82
- const { data: storeVariantData, getData: refreshStoreVariant } = useStoreVariantById(`${key}-variant-by-id`);
83
- return {
84
- storesData,
85
- refreshStores,
86
- storeVariantData,
87
- refreshStoreVariant,
88
- variantStoresData,
89
- refreshVariantStores
90
- };
91
- };
92
-
93
1
  const OpeningTime = {
94
2
  MONDAY: "mon",
95
3
  TUESDAY: "tue",
@@ -100,4 +8,4 @@ const OpeningTime = {
100
8
  SUNDAY: "sun"
101
9
  };
102
10
 
103
- export { OpeningTime, useStoreLocator, useStoreVariantById, useStores, useVariantStores };
11
+ export { OpeningTime };
package/dist/module.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
- import { e as StoreLocatorConfig } from './shared/omnichannel-nuxt.773770bd.mjs';
2
+ import { S as StoreLocatorConfig } from './shared/omnichannel-nuxt.270bfbda.mjs';
3
3
 
4
- declare const _default: _nuxt_schema.NuxtModule<StoreLocatorConfig>;
4
+ declare const _default: _nuxt_schema.NuxtModule<StoreLocatorConfig, StoreLocatorConfig, false>;
5
5
 
6
6
  export { _default as default };
package/dist/module.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
- import { e as StoreLocatorConfig } from './shared/omnichannel-nuxt.773770bd.js';
2
+ import { S as StoreLocatorConfig } from './shared/omnichannel-nuxt.270bfbda.js';
3
3
 
4
- declare const _default: _nuxt_schema.NuxtModule<StoreLocatorConfig>;
4
+ declare const _default: _nuxt_schema.NuxtModule<StoreLocatorConfig, StoreLocatorConfig, false>;
5
5
 
6
6
  export { _default as default };
package/dist/module.json CHANGED
@@ -1,4 +1,8 @@
1
1
  {
2
2
  "name": "@scayle/omnichannel-nuxt",
3
- "version": "3.0.2"
3
+ "version": "4.0.1",
4
+ "builder": {
5
+ "@nuxt/module-builder": "0.8.4",
6
+ "unbuild": "2.0.0"
7
+ }
4
8
  }
package/dist/module.mjs CHANGED
@@ -2,13 +2,11 @@ import { defineNuxtModule, isNuxt2, createResolver, addServerHandler, addImports
2
2
 
3
3
  const module = defineNuxtModule({
4
4
  meta: {},
5
- async setup(moduleOptions, nuxt) {
5
+ async setup(_moduleOptions, nuxt) {
6
6
  if (isNuxt2()) {
7
- const createOmnichannelHandler = await import('./chunks/createOmnichannelHandler.mjs');
8
- nuxt.options.serverMiddleware.push({
9
- route: "/api/omnichannel",
10
- handler: createOmnichannelHandler.default(moduleOptions)
11
- });
7
+ throw new Error(
8
+ "Nuxt 2 is not supported in this version of @scayle/omnichannel-nuxt"
9
+ );
12
10
  } else {
13
11
  const { resolve } = createResolver(import.meta.url);
14
12
  addServerHandler({
@@ -1,4 +1,4 @@
1
- export * from './useStoreLocator';
2
- export * from './useStores';
3
- export * from './useStoreVariantById';
4
- export * from './useVariantStores';
1
+ export * from './useStoreLocator.js';
2
+ export * from './useStores.js';
3
+ export * from './useStoreVariantById.js';
4
+ export * from './useVariantStores.js';
@@ -0,0 +1,4 @@
1
+ export * from "./useStoreLocator.js";
2
+ export * from "./useStores.js";
3
+ export * from "./useStoreVariantById.js";
4
+ export * from "./useVariantStores.js";
@@ -1,9 +1,9 @@
1
- import type { StoreWithProperty } from '../../types';
1
+ import type { StoreWithProperty } from '../../types/index.js';
2
2
  export declare function useStoreLocator(key?: string, withProperties?: StoreWithProperty[]): {
3
- storesData: any;
3
+ storesData: import("vue").ComputedRef<import("../../types").StoreLocation[] | undefined>;
4
4
  refreshStores: (searchParams: import("../../types").StoreLocatorSearchParams) => Promise<void>;
5
- storeVariantData: any;
5
+ storeVariantData: import("vue").ComputedRef<import("../../types").StoreAvailabilityCheck | null>;
6
6
  refreshStoreVariant: (variantId: number, storeId: number) => Promise<void>;
7
- variantStoresData: any;
7
+ variantStoresData: import("vue").ComputedRef<import("../../types").VariantLocation | null>;
8
8
  refreshVariantStores: (searchParams: import("../../types").VariantLocatorSearchParams) => Promise<void>;
9
9
  };
@@ -1,6 +1,6 @@
1
- import { useStoreVariantById } from "./useStoreVariantById.mjs";
2
- import { useStores } from "./useStores.mjs";
3
- import { useVariantStores } from "./useVariantStores.mjs";
1
+ import { useStoreVariantById } from "./useStoreVariantById.js";
2
+ import { useStores } from "./useStores.js";
3
+ import { useVariantStores } from "./useVariantStores.js";
4
4
  export function useStoreLocator(key = "useStoreLocator", withProperties = []) {
5
5
  const { data: storesData, getData: refreshStores } = useStores(
6
6
  `${key}-stores`,
@@ -1,5 +1,5 @@
1
- import type { StoreWithProperty } from '../../types';
1
+ import type { StoreAvailabilityCheck, StoreWithProperty } from '../../types/index.js';
2
2
  export declare function useStoreVariantById(key?: string, withProperties?: StoreWithProperty[]): {
3
- data: any;
3
+ data: import("#imports").ComputedRef<StoreAvailabilityCheck | null>;
4
4
  getData: (variantId: number, storeId: number) => Promise<void>;
5
5
  };
@@ -1,5 +1,5 @@
1
- import type { StoreLocatorSearchParams, StoreWithProperty } from '../../types';
1
+ import type { StoreLocatorSearchParams, StoreWithProperty } from '../../types/index.js';
2
2
  export declare function useStores(key?: string, withProperties?: StoreWithProperty[]): {
3
- data: any;
3
+ data: import("#imports").ComputedRef<import("../../types").StoreLocation[] | undefined>;
4
4
  getData: (searchParams: StoreLocatorSearchParams) => Promise<void>;
5
5
  };
@@ -1,5 +1,5 @@
1
- import type { VariantLocatorSearchParams, StoreWithProperty } from '../../types';
1
+ import type { VariantLocatorSearchParams, VariantLocation, StoreWithProperty } from '../../types/index.js';
2
2
  export declare function useVariantStores(key?: string, withProperties?: StoreWithProperty[]): {
3
- data: any;
3
+ data: import("#imports").ComputedRef<VariantLocation | null>;
4
4
  getData: (searchParams: VariantLocatorSearchParams) => Promise<void>;
5
5
  };
@@ -195,7 +195,7 @@ declare const HttpStatusCode: {
195
195
  /**
196
196
  * The request is larger than the server is willing or able to process. Previously called "Request Entity Too Large".
197
197
  */
198
- readonly PAYLOAD_TOO_LARGE: 413;
198
+ readonly CONTENT_TOO_LARGE: 413;
199
199
  /**
200
200
  * The URI provided was too long for the server to process. Often the result of too much data being encoded as a query-string of a GET request,
201
201
  * in which case it should be converted to a POST request.
@@ -230,7 +230,7 @@ declare const HttpStatusCode: {
230
230
  /**
231
231
  * The request was well-formed but was unable to be followed due to semantic errors.
232
232
  */
233
- readonly UNPROCESSABLE_ENTITY: 422;
233
+ readonly UNPROCESSABLE_CONTENT: 422;
234
234
  /**
235
235
  * The resource that is being accessed is locked.
236
236
  */
@@ -509,7 +509,7 @@ declare const HttpStatusMessage: {
509
509
  /**
510
510
  * The request is larger than the server is willing or able to process. Previously called "Request Entity Too Large".
511
511
  */
512
- readonly PAYLOAD_TOO_LARGE: "PAYLOAD TOO LARGE";
512
+ readonly CONTENT_TOO_LARGE: "CONTENT TOO LARGE";
513
513
  /**
514
514
  * The URI provided was too long for the server to process. Often the result of too much data being encoded as a query-string of a GET request,
515
515
  * in which case it should be converted to a POST request.
@@ -544,7 +544,7 @@ declare const HttpStatusMessage: {
544
544
  /**
545
545
  * The request was well-formed but was unable to be followed due to semantic errors.
546
546
  */
547
- readonly UNPROCESSABLE_ENTITY: "UNPROCESSABLE ENTITY";
547
+ readonly UNPROCESSABLE_CONTENT: "UNPROCESSABLE CONTENT";
548
548
  /**
549
549
  * The resource that is being accessed is locked.
550
550
  */
@@ -194,7 +194,7 @@ const HttpStatusCode = {
194
194
  /**
195
195
  * The request is larger than the server is willing or able to process. Previously called "Request Entity Too Large".
196
196
  */
197
- PAYLOAD_TOO_LARGE: 413,
197
+ CONTENT_TOO_LARGE: 413,
198
198
  /**
199
199
  * The URI provided was too long for the server to process. Often the result of too much data being encoded as a query-string of a GET request,
200
200
  * in which case it should be converted to a POST request.
@@ -229,7 +229,7 @@ const HttpStatusCode = {
229
229
  /**
230
230
  * The request was well-formed but was unable to be followed due to semantic errors.
231
231
  */
232
- UNPROCESSABLE_ENTITY: 422,
232
+ UNPROCESSABLE_CONTENT: 422,
233
233
  /**
234
234
  * The resource that is being accessed is locked.
235
235
  */
@@ -508,7 +508,7 @@ const HttpStatusMessage = {
508
508
  /**
509
509
  * The request is larger than the server is willing or able to process. Previously called "Request Entity Too Large".
510
510
  */
511
- PAYLOAD_TOO_LARGE: "PAYLOAD TOO LARGE",
511
+ CONTENT_TOO_LARGE: "CONTENT TOO LARGE",
512
512
  /**
513
513
  * The URI provided was too long for the server to process. Often the result of too much data being encoded as a query-string of a GET request,
514
514
  * in which case it should be converted to a POST request.
@@ -543,7 +543,7 @@ const HttpStatusMessage = {
543
543
  /**
544
544
  * The request was well-formed but was unable to be followed due to semantic errors.
545
545
  */
546
- UNPROCESSABLE_ENTITY: "UNPROCESSABLE ENTITY",
546
+ UNPROCESSABLE_CONTENT: "UNPROCESSABLE CONTENT",
547
547
  /**
548
548
  * The resource that is being accessed is locked.
549
549
  */
@@ -1,4 +1,4 @@
1
- import { HttpStatusCode } from '../constants/httpStatus';
1
+ import { HttpStatusCode } from '../constants/httpStatus.js';
2
2
  declare const parseErrorData: (error: unknown) => {
3
3
  statusCode: HttpStatusCode;
4
4
  message: string;
@@ -1,5 +1,5 @@
1
- import { HttpStatusCode, HttpStatusMessage } from "../constants/httpStatus.mjs";
2
- import { FetchError } from "../lib/init.mjs";
1
+ import { HttpStatusCode, HttpStatusMessage } from "../constants/httpStatus.js";
2
+ import { FetchError } from "../lib/init.js";
3
3
  const parseErrorData = (error) => {
4
4
  if (error instanceof FetchError) {
5
5
  return {
@@ -1,2 +1,7 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
1
+ import { HttpStatusCode } from './constants/httpStatus.js';
2
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<import("../types").StoreAvailabilityCheckResponse | import("./lib/init").PaginatedResponse<import("../types").StoreLocation[]> | import("./lib/init").PaginatedResponse<import("../types").VariantLocationResponse> | {
3
+ statusCode: HttpStatusCode;
4
+ message: string;
5
+ url?: string;
6
+ } | undefined>>;
2
7
  export default _default;
@@ -1,11 +1,11 @@
1
1
  import { defineEventHandler, readBody, setResponseStatus } from "h3";
2
- import { HttpStatusCode } from "./constants/httpStatus.mjs";
2
+ import { HttpStatusCode } from "./constants/httpStatus.js";
3
3
  import {
4
4
  getStores,
5
5
  getStoreVariantById,
6
6
  getStoresForVariant
7
- } from "./rpc/storeLocator.mjs";
8
- import { parseErrorData } from "./error/errorHandler.mjs";
7
+ } from "./rpc/storeLocator.js";
8
+ import { parseErrorData } from "./error/errorHandler.js";
9
9
  import { useRuntimeConfig } from "#imports";
10
10
  export default defineEventHandler(async (event) => {
11
11
  const path = event.path.split("/").reverse()[0];
@@ -1,4 +1,4 @@
1
- import type { StoreLocation, StoreLocatorSearchParams, StoreAvailabilityCheckResponse, VariantLocationResponse, FetchStoresForVariantParams, FetchStoreVariantByIdParams } from '../types';
1
+ import type { StoreLocation, StoreLocatorConfig, StoreLocatorSearchParams, StoreAvailabilityCheckResponse, VariantLocationResponse, FetchStoresForVariantParams, FetchStoreVariantByIdParams } from '../../types/index.js';
2
2
  export interface PaginatedResponse<DataType> {
3
3
  nextPage: null;
4
4
  data: DataType;
@@ -22,4 +22,4 @@ export declare class OmnichannelClient {
22
22
  getStoresForVariant(options: FetchStoresForVariantParams): Promise<PaginatedResponse<VariantLocationResponse>>;
23
23
  getStoreVariantById(options: FetchStoreVariantByIdParams): Promise<StoreAvailabilityCheckResponse>;
24
24
  }
25
- export declare const init: (config?: any) => OmnichannelClient | null;
25
+ export declare const init: (config?: StoreLocatorConfig) => OmnichannelClient | null;
@@ -1,4 +1,4 @@
1
- import type { StoreLocatorConfig, StoreLocatorSearchParams, FetchStoresForVariantParams, FetchStoreVariantByIdParams } from '../../types';
2
- export declare const getStores: (options: StoreLocatorSearchParams, storeLocator: StoreLocatorConfig) => Promise<import("../lib/init").PaginatedResponse<StoreLocation[]>>;
3
- export declare const getStoresForVariant: (options: FetchStoresForVariantParams, storeLocator: StoreLocatorConfig) => Promise<import("../lib/init").PaginatedResponse<VariantLocationResponse>>;
4
- export declare const getStoreVariantById: (options: FetchStoreVariantByIdParams, storeLocator: StoreLocatorConfig) => Promise<StoreAvailabilityCheckResponse>;
1
+ import type { StoreLocatorConfig, StoreLocatorSearchParams, FetchStoresForVariantParams, FetchStoreVariantByIdParams } from '../../types/index.js';
2
+ export declare const getStores: (options: StoreLocatorSearchParams, storeLocator: StoreLocatorConfig) => Promise<import("../lib/init").PaginatedResponse<import("../../types").StoreLocation[]>>;
3
+ export declare const getStoresForVariant: (options: FetchStoresForVariantParams, storeLocator: StoreLocatorConfig) => Promise<import("../lib/init").PaginatedResponse<import("../../types").VariantLocationResponse>>;
4
+ export declare const getStoreVariantById: (options: FetchStoreVariantByIdParams, storeLocator: StoreLocatorConfig) => Promise<import("../../types").StoreAvailabilityCheckResponse>;
@@ -1,4 +1,4 @@
1
- import { init } from "../lib/init.mjs";
1
+ import { init } from "../lib/init.js";
2
2
  const noClientMessage = "Client not configured";
3
3
  export const getStores = async function getStores2(options, storeLocator) {
4
4
  const omnichannelClient = init(storeLocator);
@@ -160,4 +160,4 @@ interface FetchStoreVariantByIdParams {
160
160
  with?: StoreWithProperty[];
161
161
  }
162
162
 
163
- export type { FiltersAddressParams as F, GeoPoint as G, OpeningTimeInterval as O, StoreWithProperty as S, VariantLocation as V, StoreLocationResponse as a, StoreLocatorSearchParams as b, StoreAvailabilityCheck as c, VariantLocatorSearchParams as d, StoreLocatorConfig as e, OpeningTimeException as f, StoreImage as g, StoreAddress as h, StoreItemVariant as i, StoreItem as j, OpeningTimes as k, Store as l, OmnichannelMeta as m, OmnichannelLinks as n, StoreLocation as o, StoreVariantLocation as p, StoreAvailabilityCheckResponse as q, VariantLocationResponse as r, FiltersCoordinatesParams as s, FetchStoresForVariantParams as t, FetchStoreVariantByIdParams as u };
163
+ export type { FiltersAddressParams as F, GeoPoint as G, OpeningTimeInterval as O, StoreLocatorConfig as S, VariantLocation as V, OpeningTimeException as a, StoreImage as b, StoreAddress as c, StoreItemVariant as d, StoreItem as e, OpeningTimes as f, Store as g, StoreWithProperty as h, OmnichannelMeta as i, OmnichannelLinks as j, StoreLocation as k, StoreLocationResponse as l, StoreVariantLocation as m, StoreAvailabilityCheck as n, StoreAvailabilityCheckResponse as o, VariantLocationResponse as p, FiltersCoordinatesParams as q, StoreLocatorSearchParams as r, VariantLocatorSearchParams as s, FetchStoresForVariantParams as t, FetchStoreVariantByIdParams as u };
@@ -160,4 +160,4 @@ interface FetchStoreVariantByIdParams {
160
160
  with?: StoreWithProperty[];
161
161
  }
162
162
 
163
- export type { FiltersAddressParams as F, GeoPoint as G, OpeningTimeInterval as O, StoreWithProperty as S, VariantLocation as V, StoreLocationResponse as a, StoreLocatorSearchParams as b, StoreAvailabilityCheck as c, VariantLocatorSearchParams as d, StoreLocatorConfig as e, OpeningTimeException as f, StoreImage as g, StoreAddress as h, StoreItemVariant as i, StoreItem as j, OpeningTimes as k, Store as l, OmnichannelMeta as m, OmnichannelLinks as n, StoreLocation as o, StoreVariantLocation as p, StoreAvailabilityCheckResponse as q, VariantLocationResponse as r, FiltersCoordinatesParams as s, FetchStoresForVariantParams as t, FetchStoreVariantByIdParams as u };
163
+ export type { FiltersAddressParams as F, GeoPoint as G, OpeningTimeInterval as O, StoreLocatorConfig as S, VariantLocation as V, OpeningTimeException as a, StoreImage as b, StoreAddress as c, StoreItemVariant as d, StoreItem as e, OpeningTimes as f, Store as g, StoreWithProperty as h, OmnichannelMeta as i, OmnichannelLinks as j, StoreLocation as k, StoreLocationResponse as l, StoreVariantLocation as m, StoreAvailabilityCheck as n, StoreAvailabilityCheckResponse as o, VariantLocationResponse as p, FiltersCoordinatesParams as q, StoreLocatorSearchParams as r, VariantLocatorSearchParams as s, FetchStoresForVariantParams as t, FetchStoreVariantByIdParams as u };
package/dist/types.d.mts CHANGED
@@ -1,8 +1,7 @@
1
+ import type { NuxtModule } from '@nuxt/schema'
1
2
 
2
- import type { } from './module.js'
3
+ import type { default as Module } from './module.js'
3
4
 
5
+ export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
4
6
 
5
-
6
-
7
-
8
- export type { default } from './module.js'
7
+ export { default } from './module.js'
package/dist/types.d.ts CHANGED
@@ -1,8 +1,7 @@
1
+ import type { NuxtModule } from '@nuxt/schema'
1
2
 
2
- import type { } from './module'
3
+ import type { default as Module } from './module'
3
4
 
5
+ export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
4
6
 
5
-
6
-
7
-
8
- export type { default } from './module'
7
+ export { default } from './module'