@scayle/omnichannel-nuxt 1.1.16

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 (80) hide show
  1. package/CHANGELOG.md +135 -0
  2. package/LICENSE +21 -0
  3. package/README.md +115 -0
  4. package/dist/composables/sharedRef.d.ts +3 -0
  5. package/dist/composables/sharedRef.d.ts.map +1 -0
  6. package/dist/composables/sharedRef.js +16 -0
  7. package/dist/composables/sharedRef.js.map +1 -0
  8. package/dist/composables/useGeocode.d.ts +7 -0
  9. package/dist/composables/useGeocode.d.ts.map +1 -0
  10. package/dist/composables/useGeocode.js +17 -0
  11. package/dist/composables/useGeocode.js.map +1 -0
  12. package/dist/composables/useStoreLocator.d.ts +10 -0
  13. package/dist/composables/useStoreLocator.d.ts.map +1 -0
  14. package/dist/composables/useStoreLocator.js +17 -0
  15. package/dist/composables/useStoreLocator.js.map +1 -0
  16. package/dist/composables/useStoreVariantById.d.ts +6 -0
  17. package/dist/composables/useStoreVariantById.d.ts.map +1 -0
  18. package/dist/composables/useStoreVariantById.js +20 -0
  19. package/dist/composables/useStoreVariantById.js.map +1 -0
  20. package/dist/composables/useStores.d.ts +7 -0
  21. package/dist/composables/useStores.d.ts.map +1 -0
  22. package/dist/composables/useStores.js +17 -0
  23. package/dist/composables/useStores.js.map +1 -0
  24. package/dist/composables/useVariantStores.d.ts +7 -0
  25. package/dist/composables/useVariantStores.d.ts.map +1 -0
  26. package/dist/composables/useVariantStores.js +17 -0
  27. package/dist/composables/useVariantStores.js.map +1 -0
  28. package/dist/constants/index.d.ts +2 -0
  29. package/dist/constants/index.d.ts.map +1 -0
  30. package/dist/constants/index.js +5 -0
  31. package/dist/constants/index.js.map +1 -0
  32. package/dist/constants/omnichannel.d.ts +12 -0
  33. package/dist/constants/omnichannel.d.ts.map +1 -0
  34. package/dist/constants/omnichannel.js +13 -0
  35. package/dist/constants/omnichannel.js.map +1 -0
  36. package/dist/error/errorHandler.d.ts +11 -0
  37. package/dist/error/errorHandler.d.ts.map +1 -0
  38. package/dist/error/errorHandler.js +57 -0
  39. package/dist/error/errorHandler.js.map +1 -0
  40. package/dist/index.d.ts +9 -0
  41. package/dist/index.d.ts.map +1 -0
  42. package/dist/index.js +18 -0
  43. package/dist/index.js.map +1 -0
  44. package/dist/lib/init.d.ts +11 -0
  45. package/dist/lib/init.d.ts.map +1 -0
  46. package/dist/lib/init.js +49 -0
  47. package/dist/lib/init.js.map +1 -0
  48. package/dist/module/createOmnichannelHandler.d.ts +3 -0
  49. package/dist/module/createOmnichannelHandler.d.ts.map +1 -0
  50. package/dist/module/createOmnichannelHandler.js +56 -0
  51. package/dist/module/createOmnichannelHandler.js.map +1 -0
  52. package/dist/module/register.d.ts +6 -0
  53. package/dist/module/register.d.ts.map +1 -0
  54. package/dist/module/register.js +12 -0
  55. package/dist/module/register.js.map +1 -0
  56. package/dist/rpc/geocode.d.ts +23 -0
  57. package/dist/rpc/geocode.d.ts.map +1 -0
  58. package/dist/rpc/geocode.js +46 -0
  59. package/dist/rpc/geocode.js.map +1 -0
  60. package/dist/rpc/index.d.ts +3 -0
  61. package/dist/rpc/index.d.ts.map +1 -0
  62. package/dist/rpc/index.js +6 -0
  63. package/dist/rpc/index.js.map +1 -0
  64. package/dist/rpc/storeLocator.d.ts +31 -0
  65. package/dist/rpc/storeLocator.d.ts.map +1 -0
  66. package/dist/rpc/storeLocator.js +69 -0
  67. package/dist/rpc/storeLocator.js.map +1 -0
  68. package/dist/types/geocode.d.ts +8 -0
  69. package/dist/types/geocode.d.ts.map +1 -0
  70. package/dist/types/geocode.js +3 -0
  71. package/dist/types/geocode.js.map +1 -0
  72. package/dist/types/index.d.ts +3 -0
  73. package/dist/types/index.d.ts.map +1 -0
  74. package/dist/types/index.js +6 -0
  75. package/dist/types/index.js.map +1 -0
  76. package/dist/types/omnichannel.d.ts +145 -0
  77. package/dist/types/omnichannel.d.ts.map +1 -0
  78. package/dist/types/omnichannel.js +3 -0
  79. package/dist/types/omnichannel.js.map +1 -0
  80. package/package.json +62 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,135 @@
1
+ # @scayle/omnichannel-nuxt
2
+
3
+ ## 1.1.16
4
+
5
+ ### Patch Changes
6
+
7
+ - Add license file
8
+ - Updated dependencies
9
+ - @scayle/storefront-core@7.22.1
10
+
11
+ ## 1.1.15
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+ - @scayle/storefront-core@7.22.0
17
+
18
+ ## 1.1.14
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies
23
+ - @scayle/storefront-core@7.21.0
24
+
25
+ ## 1.1.13
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies
30
+ - @scayle/storefront-core@7.20.0
31
+
32
+ ## 1.1.12
33
+
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies
37
+ - @scayle/storefront-core@7.19.1
38
+
39
+ ## 1.1.11
40
+
41
+ ### Patch Changes
42
+
43
+ - Updated dependencies
44
+ - @scayle/storefront-core@7.19.0
45
+
46
+ ## 1.1.10
47
+
48
+ ### Patch Changes
49
+
50
+ - Updated dependencies
51
+ - @scayle/storefront-core@7.18.0
52
+
53
+ ## 1.1.9
54
+
55
+ ### Patch Changes
56
+
57
+ - Updated dependencies
58
+ - @scayle/storefront-core@7.17.0
59
+
60
+ ## 1.1.8
61
+
62
+ ### Patch Changes
63
+
64
+ - Add useGeocode composable
65
+ Allow latitude and longitude coordinates to seach in store locator and variant locator
66
+ - Updated dependencies
67
+ - @scayle/storefront-core@7.16.0
68
+
69
+ ## 1.1.7
70
+
71
+ ### Patch Changes
72
+
73
+ - Updated dependencies
74
+ - @scayle/storefront-core@7.15.1
75
+
76
+ ## 1.1.6
77
+
78
+ ### Patch Changes
79
+
80
+ - Updated dependencies
81
+ - @scayle/storefront-core@7.15.0
82
+
83
+ ## 1.1.5
84
+
85
+ ### Patch Changes
86
+
87
+ - Updated dependencies
88
+ - @scayle/storefront-core@7.14.3
89
+
90
+ ## 1.1.4
91
+
92
+ ### Patch Changes
93
+
94
+ - Updated dependencies
95
+ - @scayle/storefront-core@7.14.2
96
+
97
+ ## 1.1.3
98
+
99
+ ### Patch Changes
100
+
101
+ - Updated dependencies
102
+ - @scayle/storefront-core@7.14.1
103
+
104
+ ## 1.1.2
105
+
106
+ ### Patch Changes
107
+
108
+ - Updated dependencies
109
+ - @scayle/storefront-core@7.14.0
110
+
111
+ ## 1.1.1
112
+
113
+ ### Patch Changes
114
+
115
+ - Updated dependencies
116
+ - @scayle/storefront-core@7.13.0
117
+
118
+ ## 1.1.0
119
+
120
+ ### Minor Changes
121
+
122
+ - Added constant export
123
+
124
+ ## 1.0.1
125
+
126
+ ### Patch Changes
127
+
128
+ - Updated dependencies
129
+ - @scayle/storefront-core@7.12.2
130
+
131
+ ## 1.0.0
132
+
133
+ ### Major Changes
134
+
135
+ - Provide Omnichannel add-on integration into Storefront-Core for Nuxt 2
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 SCAYLE GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,115 @@
1
+ # Omnichannel
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.
5
+
6
+ ## Getting started
7
+
8
+ To start working with `omnichannel-nuxt`, make sure to
9
+ register it as a module in your nuxt.config.ts file:
10
+
11
+ ```typescript
12
+ import { NuxtConfig } from '@nuxt/types'
13
+
14
+ const config: NuxtConfig & { storefront: ModuleOptions } = {
15
+ // ...
16
+
17
+ modules: [
18
+ // ...
19
+ [
20
+ '@scayle/omnichannel-nuxt/dist/module/register',
21
+ {
22
+ host: environment.OMNICHANNEL_API_HOST,
23
+ token: environment.OMNICHANNEL_API_TOKEN,
24
+ googleApiKey: environment.OMNICHANNEL_GOOGLE_API_KEY,
25
+ },
26
+ ],
27
+ ],
28
+
29
+ // ...
30
+ }
31
+
32
+ export default config
33
+ ```
34
+
35
+ ## Architecture
36
+
37
+ The Omnichannel Add-On package provides `useStoreLocator` composable,
38
+ which can be used to call the following methods:
39
+
40
+ - `refreshStores` to get `storesData` based on provided address
41
+ - `refreshVariantStores` to get `variantStoresData` based on provided store ID
42
+ - `refreshStoreVariant` to get `storeVariantData` based on provided store ID and variant ID
43
+
44
+ The Omnichannel Add-On package provides also `useGeocode` composable,
45
+ which can be used to call `getData` to get city location based on given params
46
+
47
+ ## List of composables
48
+
49
+ ### [useStoreLocator](./src/composables/useStoreLocator.ts)
50
+
51
+ Getting `storesData` based on provided address
52
+
53
+ Example:
54
+
55
+ ```typescript
56
+ import { useStoreLocator } from '@scayle/omnichannel-nuxt'
57
+
58
+ const { storesData, refreshStores } = useStoreLocator()
59
+ const address = 'Hamburg'
60
+ await refreshStores(address)
61
+ ```
62
+
63
+ Getting `variantStoresData` based on provided address
64
+
65
+ Example:
66
+
67
+ ```typescript
68
+ import { useStoreLocator } from '@scayle/omnichannel-nuxt'
69
+
70
+ const { variantStoresData, refreshVariantStores } = useStoreLocator()
71
+ const address = 'Hamburg'
72
+ const storeId = 12
73
+ await refreshStores(storeId, { address: address })
74
+ ```
75
+
76
+ Getting `storeVariantData` based on provided store ID and variant ID
77
+
78
+ Example:
79
+
80
+ ```typescript
81
+ import { useStoreLocator } from '@scayle/omnichannel-nuxt'
82
+
83
+ const { storeVariantData, refreshStoreVariant } = useStoreLocator()
84
+ const variantId = 1
85
+ const storeId = 12
86
+ await refreshStores(variantId, storeId)
87
+ ```
88
+
89
+ ### [useGeocode](./src/composables/useGeocode.ts)
90
+
91
+ Getting `data` (city) based on provided params
92
+
93
+ - latitude and longitude OR
94
+ - address, zipcode
95
+
96
+ Example 1:
97
+
98
+ ```typescript
99
+ import { useGeocode } from '@scayle/omnichannel-nuxt'
100
+
101
+ const { data, getData } = useGeocode()
102
+ const address = 'Berlin'
103
+ await getData(address)
104
+ ```
105
+
106
+ Example 2:
107
+
108
+ ```typescript
109
+ import { useGeocode } from '@scayle/omnichannel-nuxt'
110
+
111
+ const { data, getData } = useGeocode()
112
+ const lat = 52.520006
113
+ const lng = 13.404954
114
+ await getData({ lat, lng })
115
+ ```
@@ -0,0 +1,3 @@
1
+ import { Ref } from '@nuxtjs/composition-api';
2
+ export declare function sharedRef<T>(value: T, key: string): Ref<T>;
3
+ //# sourceMappingURL=sharedRef.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedRef.d.ts","sourceRoot":"","sources":["../../src/composables/sharedRef.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAsB,MAAM,yBAAyB,CAAA;AAEjE,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAa1D"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sharedRef = void 0;
4
+ const composition_api_1 = require("@nuxtjs/composition-api");
5
+ function sharedRef(value, key) {
6
+ const context = (0, composition_api_1.useContext)();
7
+ const { $sharedRefsMap } = context;
8
+ if ($sharedRefsMap.has(key)) {
9
+ return $sharedRefsMap.get(key);
10
+ }
11
+ const newRef = (0, composition_api_1.ssrRef)(value, key);
12
+ $sharedRefsMap.set(key, newRef);
13
+ return newRef;
14
+ }
15
+ exports.sharedRef = sharedRef;
16
+ //# sourceMappingURL=sharedRef.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedRef.js","sourceRoot":"","sources":["../../src/composables/sharedRef.ts"],"names":[],"mappings":";;;AAAA,6DAAiE;AAEjE,SAAgB,SAAS,CAAI,KAAQ,EAAE,GAAW;IAChD,MAAM,OAAO,GAAQ,IAAA,4BAAU,GAAE,CAAA;IACjC,MAAM,EAAE,cAAc,EAAE,GAAG,OAAc,CAAA;IAEzC,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QAC3B,OAAO,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;KAC/B;IAED,MAAM,MAAM,GAAG,IAAA,wBAAM,EAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IAEjC,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;IAE/B,OAAO,MAAM,CAAA;AACf,CAAC;AAbD,8BAaC"}
@@ -0,0 +1,7 @@
1
+ import { GeocodeSearchParams, GeocodeCoordinatesParams } from '../types';
2
+ declare const _default: (key?: string) => {
3
+ data: import("@nuxtjs/composition-api").ComputedRef<any>;
4
+ getData: (searchParams: GeocodeSearchParams | GeocodeCoordinatesParams) => Promise<void>;
5
+ };
6
+ export default _default;
7
+ //# sourceMappingURL=useGeocode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGeocode.d.ts","sourceRoot":"","sources":["../../src/composables/useGeocode.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAA;;;4BAOtD,mBAAmB,GAAG,wBAAwB;;AAJhE,wBAaC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const axios_1 = tslib_1.__importDefault(require("axios"));
5
+ const composition_api_1 = require("@nuxtjs/composition-api");
6
+ const sharedRef_1 = require("./sharedRef");
7
+ exports.default = (key = 'useGeocode') => {
8
+ const response = (0, sharedRef_1.sharedRef)(null, key);
9
+ const getData = async (searchParams) => {
10
+ response.value = await axios_1.default.post('/api/omnichannel/geocode', searchParams);
11
+ };
12
+ return {
13
+ data: (0, composition_api_1.computed)(() => { var _a; return (_a = response.value) === null || _a === void 0 ? void 0 : _a.data; }),
14
+ getData,
15
+ };
16
+ };
17
+ //# sourceMappingURL=useGeocode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGeocode.js","sourceRoot":"","sources":["../../src/composables/useGeocode.ts"],"names":[],"mappings":";;;AAAA,0DAA4C;AAC5C,6DAAkD;AAElD,2CAAuC;AAEvC,kBAAe,CAAC,GAAG,GAAG,YAAY,EAAE,EAAE;IACpC,MAAM,QAAQ,GAAG,IAAA,qBAAS,EAAuB,IAAI,EAAE,GAAG,CAAC,CAAA;IAE3D,MAAM,OAAO,GAAG,KAAK,EACnB,YAA4D,EAC5D,EAAE;QACF,QAAQ,CAAC,KAAK,GAAG,MAAM,eAAK,CAAC,IAAI,CAAC,0BAA0B,EAAE,YAAY,CAAC,CAAA;IAC7E,CAAC,CAAA;IAED,OAAO;QACL,IAAI,EAAE,IAAA,0BAAQ,EAAC,GAAG,EAAE,WAAC,OAAA,MAAA,QAAQ,CAAC,KAAK,0CAAE,IAAI,CAAA,EAAA,CAAC;QAC1C,OAAO;KACR,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,10 @@
1
+ declare const _default: (key?: string) => {
2
+ storesData: import("vue").ComputedRef<any>;
3
+ refreshStores: (searchParams: import("../index").StoreLocatorSearchParams) => Promise<void>;
4
+ storeVariantData: import("vue").ComputedRef<any>;
5
+ refreshStoreVariant: (variantId: number, storeId: number) => Promise<void>;
6
+ variantStoresData: import("vue").ComputedRef<any>;
7
+ refreshVariantStores: (searchParams: import("../index").VariantLocatorSearchParams) => Promise<void>;
8
+ };
9
+ export default _default;
10
+ //# sourceMappingURL=useStoreLocator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStoreLocator.d.ts","sourceRoot":"","sources":["../../src/composables/useStoreLocator.ts"],"names":[],"mappings":"+BAEqB,MAAM;;;;;;;;AAA3B,wBAmBC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const index_1 = require("../index");
4
+ exports.default = (key = 'useStoreLocator') => {
5
+ const { data: storesData, getData: refreshStores } = (0, index_1.useStores)(`${key}-stores`);
6
+ const { data: variantStoresData, getData: refreshVariantStores } = (0, index_1.useVariantStores)(`${key}-variant-stores`);
7
+ const { data: storeVariantData, getData: refreshStoreVariant } = (0, index_1.useStoreVariantById)(`${key}-variant-by-id`);
8
+ return {
9
+ storesData,
10
+ refreshStores,
11
+ storeVariantData,
12
+ refreshStoreVariant,
13
+ variantStoresData,
14
+ refreshVariantStores,
15
+ };
16
+ };
17
+ //# sourceMappingURL=useStoreLocator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStoreLocator.js","sourceRoot":"","sources":["../../src/composables/useStoreLocator.ts"],"names":[],"mappings":";;AAAA,oCAA2E;AAE3E,kBAAe,CAAC,MAAc,iBAAiB,EAAE,EAAE;IACjD,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,IAAA,iBAAS,EAC5D,GAAG,GAAG,SAAS,CAChB,CAAA;IAED,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,oBAAoB,EAAE,GAC9D,IAAA,wBAAgB,EAAC,GAAG,GAAG,iBAAiB,CAAC,CAAA;IAE3C,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,mBAAmB,EAAE,GAC5D,IAAA,2BAAmB,EAAC,GAAG,GAAG,gBAAgB,CAAC,CAAA;IAE7C,OAAO;QACL,UAAU;QACV,aAAa;QACb,gBAAgB;QAChB,mBAAmB;QACnB,iBAAiB;QACjB,oBAAoB;KACrB,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ declare const _default: (key?: string) => {
2
+ data: import("@nuxtjs/composition-api").ComputedRef<any>;
3
+ getData: (variantId: number, storeId: number) => Promise<void>;
4
+ };
5
+ export default _default;
6
+ //# sourceMappingURL=useStoreVariantById.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStoreVariantById.d.ts","sourceRoot":"","sources":["../../src/composables/useStoreVariantById.ts"],"names":[],"mappings":"+BAGqB,MAAM;;yBAGS,MAAM,WAAW,MAAM;;AAH3D,wBAcC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const axios_1 = tslib_1.__importDefault(require("axios"));
5
+ const composition_api_1 = require("@nuxtjs/composition-api");
6
+ const sharedRef_1 = require("./sharedRef");
7
+ exports.default = (key = 'useStoreVariantById') => {
8
+ const response = (0, sharedRef_1.sharedRef)(null, key);
9
+ const getData = async (variantId, storeId) => {
10
+ response.value = await axios_1.default.post('/api/omnichannel/storeVariantById', {
11
+ storeId,
12
+ variantId,
13
+ });
14
+ };
15
+ return {
16
+ data: (0, composition_api_1.computed)(() => { var _a; return (_a = response.value) === null || _a === void 0 ? void 0 : _a.data; }),
17
+ getData,
18
+ };
19
+ };
20
+ //# sourceMappingURL=useStoreVariantById.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStoreVariantById.js","sourceRoot":"","sources":["../../src/composables/useStoreVariantById.ts"],"names":[],"mappings":";;;AAAA,0DAA4C;AAC5C,6DAAkD;AAClD,2CAAuC;AACvC,kBAAe,CAAC,MAAc,qBAAqB,EAAE,EAAE;IACrD,MAAM,QAAQ,GAAG,IAAA,qBAAS,EAAuB,IAAI,EAAE,GAAG,CAAC,CAAA;IAE3D,MAAM,OAAO,GAAG,KAAK,EAAE,SAAiB,EAAE,OAAe,EAAE,EAAE;QAC3D,QAAQ,CAAC,KAAK,GAAG,MAAM,eAAK,CAAC,IAAI,CAAC,mCAAmC,EAAE;YACrE,OAAO;YACP,SAAS;SACV,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,OAAO;QACL,IAAI,EAAE,IAAA,0BAAQ,EAAC,GAAG,EAAE,WAAC,OAAA,MAAA,QAAQ,CAAC,KAAK,0CAAE,IAAI,CAAA,EAAA,CAAC;QAC1C,OAAO;KACR,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { StoreLocatorSearchParams } from '../types';
2
+ declare const _default: (key?: string) => {
3
+ data: import("@nuxtjs/composition-api").ComputedRef<any>;
4
+ getData: (searchParams: StoreLocatorSearchParams) => Promise<void>;
5
+ };
6
+ export default _default;
7
+ //# sourceMappingURL=useStores.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStores.d.ts","sourceRoot":"","sources":["../../src/composables/useStores.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAA;+BAG9B,MAAM;;4BAGY,wBAAwB;;AAH/D,wBAWC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const axios_1 = tslib_1.__importDefault(require("axios"));
5
+ const composition_api_1 = require("@nuxtjs/composition-api");
6
+ const sharedRef_1 = require("./sharedRef");
7
+ exports.default = (key = 'useStores') => {
8
+ const response = (0, sharedRef_1.sharedRef)(null, key);
9
+ const getData = async (searchParams) => {
10
+ response.value = await axios_1.default.post('/api/omnichannel/stores', searchParams);
11
+ };
12
+ return {
13
+ data: (0, composition_api_1.computed)(() => { var _a; return (_a = response.value) === null || _a === void 0 ? void 0 : _a.data; }),
14
+ getData,
15
+ };
16
+ };
17
+ //# sourceMappingURL=useStores.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStores.js","sourceRoot":"","sources":["../../src/composables/useStores.ts"],"names":[],"mappings":";;;AAAA,0DAA4C;AAC5C,6DAAkD;AAElD,2CAAuC;AAEvC,kBAAe,CAAC,MAAc,WAAW,EAAE,EAAE;IAC3C,MAAM,QAAQ,GAAG,IAAA,qBAAS,EAAuB,IAAI,EAAE,GAAG,CAAC,CAAA;IAE3D,MAAM,OAAO,GAAG,KAAK,EAAE,YAAsC,EAAE,EAAE;QAC/D,QAAQ,CAAC,KAAK,GAAG,MAAM,eAAK,CAAC,IAAI,CAAC,yBAAyB,EAAE,YAAY,CAAC,CAAA;IAC5E,CAAC,CAAA;IAED,OAAO;QACL,IAAI,EAAE,IAAA,0BAAQ,EAAC,GAAG,EAAE,WAAC,OAAA,MAAA,QAAQ,CAAC,KAAK,0CAAE,IAAI,CAAA,EAAA,CAAC;QAC1C,OAAO;KACR,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { VariantLocatorSearchParams } from '../types';
2
+ declare const _default: (key?: string) => {
3
+ data: import("@nuxtjs/composition-api").ComputedRef<any>;
4
+ getData: (searchParams: VariantLocatorSearchParams) => Promise<void>;
5
+ };
6
+ export default _default;
7
+ //# sourceMappingURL=useVariantStores.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVariantStores.d.ts","sourceRoot":"","sources":["../../src/composables/useVariantStores.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;+BAEhC,MAAM;;4BAGY,0BAA0B;;AAHjE,wBAcC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const axios_1 = tslib_1.__importDefault(require("axios"));
5
+ const composition_api_1 = require("@nuxtjs/composition-api");
6
+ const sharedRef_1 = require("./sharedRef");
7
+ exports.default = (key = 'useVariantStores') => {
8
+ const response = (0, sharedRef_1.sharedRef)(null, key);
9
+ const getData = async (searchParams) => {
10
+ response.value = await axios_1.default.post('/api/omnichannel/variantStores', searchParams);
11
+ };
12
+ return {
13
+ data: (0, composition_api_1.computed)(() => { var _a; return (_a = response.value) === null || _a === void 0 ? void 0 : _a.data; }),
14
+ getData,
15
+ };
16
+ };
17
+ //# sourceMappingURL=useVariantStores.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVariantStores.js","sourceRoot":"","sources":["../../src/composables/useVariantStores.ts"],"names":[],"mappings":";;;AAAA,0DAA4C;AAC5C,6DAAkD;AAElD,2CAAuC;AACvC,kBAAe,CAAC,MAAc,kBAAkB,EAAE,EAAE;IAClD,MAAM,QAAQ,GAAG,IAAA,qBAAS,EAAuB,IAAI,EAAE,GAAG,CAAC,CAAA;IAE3D,MAAM,OAAO,GAAG,KAAK,EAAE,YAAwC,EAAE,EAAE;QACjE,QAAQ,CAAC,KAAK,GAAG,MAAM,eAAK,CAAC,IAAI,CAC/B,gCAAgC,EAChC,YAAY,CACb,CAAA;IACH,CAAC,CAAA;IAED,OAAO;QACL,IAAI,EAAE,IAAA,0BAAQ,EAAC,GAAG,EAAE,WAAC,OAAA,MAAA,QAAQ,CAAC,KAAK,0CAAE,IAAI,CAAA,EAAA,CAAC;QAC1C,OAAO;KACR,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './omnichannel';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./omnichannel"), exports);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":";;;AAAA,wDAA6B"}
@@ -0,0 +1,12 @@
1
+ import { ValuesType } from 'utility-types';
2
+ export declare const OpeningTime: {
3
+ readonly MONDAY: "mon";
4
+ readonly TUESDAY: "tue";
5
+ readonly WEDNESDAY: "wed";
6
+ readonly THURSDAY: "thu";
7
+ readonly FRIDAY: "fri";
8
+ readonly SATURDAY: "sat";
9
+ readonly SUNDAY: "sun";
10
+ };
11
+ export type OpeningTime = ValuesType<typeof OpeningTime>;
12
+ //# sourceMappingURL=omnichannel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omnichannel.d.ts","sourceRoot":"","sources":["../../src/constants/omnichannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,eAAO,MAAM,WAAW;;;;;;;;CAQd,CAAA;AAGV,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpeningTime = void 0;
4
+ exports.OpeningTime = {
5
+ MONDAY: 'mon',
6
+ TUESDAY: 'tue',
7
+ WEDNESDAY: 'wed',
8
+ THURSDAY: 'thu',
9
+ FRIDAY: 'fri',
10
+ SATURDAY: 'sat',
11
+ SUNDAY: 'sun',
12
+ };
13
+ //# sourceMappingURL=omnichannel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"omnichannel.js","sourceRoot":"","sources":["../../src/constants/omnichannel.ts"],"names":[],"mappings":";;;AAEa,QAAA,WAAW,GAAG;IACzB,MAAM,EAAE,KAAK;IACb,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,KAAK;IAChB,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,KAAK;CACL,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { BAPIError, BaseError, HttpStatusCode } from '@scayle/storefront-core';
2
+ import { AxiosError } from 'axios';
3
+ declare const parseErrorData: (error: unknown) => {
4
+ statusCode: HttpStatusCode;
5
+ message: string;
6
+ url?: string;
7
+ };
8
+ type AsyncError = BaseError | BAPIError;
9
+ declare const handleError: (error: AxiosError | Error | unknown) => AsyncError;
10
+ export { handleError, parseErrorData };
11
+ //# sourceMappingURL=errorHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorHandler.d.ts","sourceRoot":"","sources":["../../src/error/errorHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,SAAS,EACT,cAAc,EAEf,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAElC,QAAA,MAAM,cAAc,UACX,OAAO,KACb;IAAE,UAAU,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CA+B7D,CAAA;AAED,KAAK,UAAU,GAAG,SAAS,GAAG,SAAS,CAAA;AAEvC,QAAA,MAAM,WAAW,UAAW,UAAU,GAAG,KAAK,GAAG,OAAO,KAAG,UAkB1D,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,CAAA"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseErrorData = exports.handleError = void 0;
4
+ const storefront_core_1 = require("@scayle/storefront-core");
5
+ const axios_1 = require("axios");
6
+ const parseErrorData = (error) => {
7
+ var _a, _b;
8
+ if (error instanceof axios_1.AxiosError) {
9
+ return {
10
+ statusCode: ((_a = error.response) === null || _a === void 0 ? void 0 : _a.data.code) || storefront_core_1.HttpStatusCode.INTERNAL_SERVER_ERROR,
11
+ message: ((_b = error.response) === null || _b === void 0 ? void 0 : _b.data.message) || storefront_core_1.HttpStatusMessage.INTERNAL_SERVER_ERROR,
12
+ url: error.config.url,
13
+ };
14
+ }
15
+ else if (error instanceof storefront_core_1.BAPIError) {
16
+ return {
17
+ statusCode: error.statusCode || storefront_core_1.HttpStatusCode.INTERNAL_SERVER_ERROR,
18
+ message: error.message || storefront_core_1.HttpStatusMessage.INTERNAL_SERVER_ERROR,
19
+ url: error.url,
20
+ };
21
+ }
22
+ else if (error instanceof storefront_core_1.BaseError) {
23
+ return {
24
+ statusCode: error.statusCode || storefront_core_1.HttpStatusCode.INTERNAL_SERVER_ERROR,
25
+ message: error.message || storefront_core_1.HttpStatusMessage.INTERNAL_SERVER_ERROR,
26
+ };
27
+ }
28
+ else if (error instanceof Error) {
29
+ return {
30
+ statusCode: storefront_core_1.HttpStatusCode.INTERNAL_SERVER_ERROR,
31
+ message: error.message || storefront_core_1.HttpStatusMessage.INTERNAL_SERVER_ERROR,
32
+ };
33
+ }
34
+ return {
35
+ statusCode: storefront_core_1.HttpStatusCode.INTERNAL_SERVER_ERROR,
36
+ message: storefront_core_1.HttpStatusMessage.INTERNAL_SERVER_ERROR,
37
+ };
38
+ };
39
+ exports.parseErrorData = parseErrorData;
40
+ const handleError = (error) => {
41
+ const { statusCode, message } = parseErrorData(error);
42
+ if (statusCode === storefront_core_1.HttpStatusCode.NOT_FOUND) {
43
+ return new storefront_core_1.BAPIError(storefront_core_1.HttpStatusMessage.NOT_FOUND, statusCode, message);
44
+ }
45
+ if (statusCode === storefront_core_1.HttpStatusCode.UNAUTHORIZED) {
46
+ return new storefront_core_1.BAPIError(storefront_core_1.HttpStatusMessage.UNAUTHORIZED, statusCode, message);
47
+ }
48
+ const [key] = Object.entries(storefront_core_1.HttpStatusCode).find(([_, code]) => code === statusCode) ||
49
+ [];
50
+ const statusCodeKey = key;
51
+ const name = statusCodeKey
52
+ ? storefront_core_1.HttpStatusMessage[statusCodeKey]
53
+ : storefront_core_1.HttpStatusMessage.INTERNAL_SERVER_ERROR;
54
+ return new storefront_core_1.BaseError(name, statusCode, message);
55
+ };
56
+ exports.handleError = handleError;
57
+ //# sourceMappingURL=errorHandler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errorHandler.js","sourceRoot":"","sources":["../../src/error/errorHandler.ts"],"names":[],"mappings":";;;AAAA,6DAKgC;AAChC,iCAAkC;AAElC,MAAM,cAAc,GAAG,CACrB,KAAc,EACiD,EAAE;;IACjE,IAAI,KAAK,YAAY,kBAAU,EAAE;QAC/B,OAAO;YACL,UAAU,EACR,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,CAAC,IAAI,KAAI,gCAAc,CAAC,qBAAqB;YACnE,OAAO,EACL,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,CAAC,OAAO,KAAI,mCAAiB,CAAC,qBAAqB;YACzE,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;SACtB,CAAA;KACF;SAAM,IAAI,KAAK,YAAY,2BAAS,EAAE;QACrC,OAAO;YACL,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,gCAAc,CAAC,qBAAqB;YACpE,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,mCAAiB,CAAC,qBAAqB;YACjE,GAAG,EAAE,KAAK,CAAC,GAAG;SACf,CAAA;KACF;SAAM,IAAI,KAAK,YAAY,2BAAS,EAAE;QACrC,OAAO;YACL,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,gCAAc,CAAC,qBAAqB;YACpE,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,mCAAiB,CAAC,qBAAqB;SAClE,CAAA;KACF;SAAM,IAAI,KAAK,YAAY,KAAK,EAAE;QACjC,OAAO;YACL,UAAU,EAAE,gCAAc,CAAC,qBAAqB;YAChD,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,mCAAiB,CAAC,qBAAqB;SAClE,CAAA;KACF;IAED,OAAO;QACL,UAAU,EAAE,gCAAc,CAAC,qBAAqB;QAChD,OAAO,EAAE,mCAAiB,CAAC,qBAAqB;KACjD,CAAA;AACH,CAAC,CAAA;AAwBqB,wCAAc;AApBpC,MAAM,WAAW,GAAG,CAAC,KAAmC,EAAc,EAAE;IACtE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,cAAc,CAAC,KAAK,CAAC,CAAA;IAErD,IAAI,UAAU,KAAK,gCAAc,CAAC,SAAS,EAAE;QAC3C,OAAO,IAAI,2BAAS,CAAC,mCAAiB,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;KACvE;IACD,IAAI,UAAU,KAAK,gCAAc,CAAC,YAAY,EAAE;QAC9C,OAAO,IAAI,2BAAS,CAAC,mCAAiB,CAAC,YAAY,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;KAC1E;IACD,MAAM,CAAC,GAAG,CAAC,GACT,MAAM,CAAC,OAAO,CAAC,gCAAc,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,UAAU,CAAC;QACvE,EAAE,CAAA;IACJ,MAAM,aAAa,GAAG,GAAqC,CAAA;IAC3D,MAAM,IAAI,GAAG,aAAa;QACxB,CAAC,CAAE,mCAAiB,CAAC,aAAa,CAAY;QAC9C,CAAC,CAAC,mCAAiB,CAAC,qBAAqB,CAAA;IAE3C,OAAO,IAAI,2BAAS,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;AACjD,CAAC,CAAA;AAEQ,kCAAW"}
@@ -0,0 +1,9 @@
1
+ export { default as useStores } from './composables/useStores';
2
+ export { default as useStoreVariantById } from './composables/useStoreVariantById';
3
+ export { default as useVariantStores } from './composables/useVariantStores';
4
+ export { default as useStoreLocator } from './composables/useStoreLocator';
5
+ export { default as useGeocode } from './composables/useGeocode';
6
+ export * from './constants/index';
7
+ export * from './rpc/index';
8
+ export * from './types/index';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAC5E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC1E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAEhE,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA"}