@scayle/omnichannel-nuxt 4.0.1 → 4.0.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @scayle/omnichannel-nuxt
2
2
 
3
+ ## 4.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Support internal access header
8
+
3
9
  ## 4.0.1
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { ValuesType } from 'utility-types';
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';
3
2
 
4
3
  declare const OpeningTime: {
5
4
  readonly MONDAY: "mon";
@@ -12,4 +11,167 @@ declare const OpeningTime: {
12
11
  };
13
12
  type OpeningTime = ValuesType<typeof OpeningTime>;
14
13
 
15
- export { OpeningTime };
14
+ interface StoreLocatorConfig {
15
+ token: string;
16
+ host: string;
17
+ companyId?: number;
18
+ googleApiKey?: string;
19
+ additionalHeaders?: HeadersInit;
20
+ }
21
+ interface GeoPoint {
22
+ lat: number;
23
+ lng: number;
24
+ }
25
+ interface OpeningTimeInterval {
26
+ timeFrom: string;
27
+ timeUntil: string;
28
+ }
29
+ interface OpeningTimeException {
30
+ exceptionDate: string;
31
+ exceptionName: string;
32
+ exceptionType: 'open' | 'closed';
33
+ timeFrom: string;
34
+ timeUntil: string;
35
+ }
36
+ interface StoreImage {
37
+ id: number;
38
+ name: string;
39
+ damKey: string;
40
+ url: string;
41
+ customData: object;
42
+ }
43
+ interface StoreAddress {
44
+ street: string;
45
+ houseNumber: string;
46
+ zipCode: string;
47
+ city: string;
48
+ countryCode: string;
49
+ }
50
+ interface StoreItemVariant {
51
+ variantId: number;
52
+ variantReferenceKey: string;
53
+ quantity: number;
54
+ }
55
+ interface StoreItem {
56
+ productId: number;
57
+ productReferenceKey: string;
58
+ name: object;
59
+ image: string;
60
+ variants: StoreItemVariant[];
61
+ }
62
+ interface OpeningTimes {
63
+ mon: OpeningTimeInterval[];
64
+ tue: OpeningTimeInterval[];
65
+ wed: OpeningTimeInterval[];
66
+ thu: OpeningTimeInterval[];
67
+ fri: OpeningTimeInterval[];
68
+ sat: OpeningTimeInterval[];
69
+ sun: OpeningTimeInterval[];
70
+ exceptions: OpeningTimeException[];
71
+ currentlyOpen: boolean;
72
+ minutesUntilClosed: number;
73
+ }
74
+ interface Store {
75
+ id: number;
76
+ referenceKey: string;
77
+ name: string;
78
+ email: string;
79
+ address: StoreAddress;
80
+ openingTimes?: OpeningTimes;
81
+ geoPoint: GeoPoint;
82
+ customData?: object;
83
+ settings?: {
84
+ shipFromStore: boolean;
85
+ clickAndCollect: boolean;
86
+ };
87
+ isActive: boolean;
88
+ images?: StoreImage;
89
+ }
90
+ type StoreWithProperty = 'openingTimes' | 'customData' | 'images' | 'settings';
91
+ interface OmnichannelMeta {
92
+ path: string;
93
+ currentPage: number;
94
+ lastPage: number;
95
+ from: number;
96
+ to: number;
97
+ perPage: number;
98
+ total: number;
99
+ firstPageUrl: string;
100
+ lastPageUrl: string;
101
+ prevPageUrl: string | null;
102
+ nextPageUrl: string | null;
103
+ }
104
+ interface OmnichannelLinks {
105
+ first: string | null;
106
+ last: string | null;
107
+ prev: string | null;
108
+ next: string | null;
109
+ }
110
+ interface StoreLocation extends Store {
111
+ distance: number;
112
+ }
113
+ interface StoreLocationResponse {
114
+ data: StoreLocation[];
115
+ meta: {
116
+ searchAddress: GeoPoint;
117
+ };
118
+ }
119
+ interface StoreVariantLocation extends StoreLocation {
120
+ quantity: number;
121
+ }
122
+ interface StoreAvailabilityCheck extends Store {
123
+ items: StoreItem[];
124
+ }
125
+ interface StoreAvailabilityCheckResponse {
126
+ data: StoreAvailabilityCheck;
127
+ meta: OmnichannelMeta;
128
+ }
129
+ interface VariantLocation {
130
+ name: object;
131
+ productId: number;
132
+ variantId: number;
133
+ productReferenceKey: string;
134
+ variantReferenceKey: string;
135
+ image: string;
136
+ additionalData: object;
137
+ stores: StoreVariantLocation[];
138
+ }
139
+ interface VariantLocationResponse {
140
+ data: VariantLocation;
141
+ meta: OmnichannelMeta;
142
+ }
143
+ interface FiltersAddressParams {
144
+ address: string;
145
+ radius: number;
146
+ }
147
+ interface FiltersCoordinatesParams {
148
+ geoPoint: GeoPoint;
149
+ radius: number;
150
+ }
151
+ interface StoreLocatorSearchParams {
152
+ filters: FiltersAddressParams | FiltersCoordinatesParams;
153
+ perPage?: number;
154
+ with?: StoreWithProperty[];
155
+ }
156
+ interface VariantLocatorSearchParams {
157
+ variantId: number;
158
+ filters: FiltersAddressParams | FiltersCoordinatesParams;
159
+ perPage?: number;
160
+ with?: StoreWithProperty[];
161
+ }
162
+ interface FetchStoresForVariantParams {
163
+ variantId: number;
164
+ filters: {
165
+ address: string;
166
+ radius: number;
167
+ };
168
+ perPage?: number;
169
+ with?: StoreWithProperty[];
170
+ }
171
+ interface FetchStoreVariantByIdParams {
172
+ storeId: number;
173
+ variantId: number;
174
+ with?: StoreWithProperty[];
175
+ }
176
+
177
+ export { type FetchStoreVariantByIdParams, type FetchStoresForVariantParams, type FiltersAddressParams, type FiltersCoordinatesParams, type GeoPoint, type OmnichannelLinks, type OmnichannelMeta, OpeningTime, type OpeningTimeException, type OpeningTimeInterval, type OpeningTimes, type Store, type StoreAddress, type StoreAvailabilityCheck, type StoreAvailabilityCheckResponse, type StoreImage, type StoreItem, type StoreItemVariant, type StoreLocation, type StoreLocationResponse, type StoreLocatorConfig, type StoreLocatorSearchParams, type StoreVariantLocation, type StoreWithProperty, type VariantLocation, type VariantLocationResponse, type VariantLocatorSearchParams };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { ValuesType } from 'utility-types';
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';
3
2
 
4
3
  declare const OpeningTime: {
5
4
  readonly MONDAY: "mon";
@@ -12,4 +11,167 @@ declare const OpeningTime: {
12
11
  };
13
12
  type OpeningTime = ValuesType<typeof OpeningTime>;
14
13
 
15
- export { OpeningTime };
14
+ interface StoreLocatorConfig {
15
+ token: string;
16
+ host: string;
17
+ companyId?: number;
18
+ googleApiKey?: string;
19
+ additionalHeaders?: HeadersInit;
20
+ }
21
+ interface GeoPoint {
22
+ lat: number;
23
+ lng: number;
24
+ }
25
+ interface OpeningTimeInterval {
26
+ timeFrom: string;
27
+ timeUntil: string;
28
+ }
29
+ interface OpeningTimeException {
30
+ exceptionDate: string;
31
+ exceptionName: string;
32
+ exceptionType: 'open' | 'closed';
33
+ timeFrom: string;
34
+ timeUntil: string;
35
+ }
36
+ interface StoreImage {
37
+ id: number;
38
+ name: string;
39
+ damKey: string;
40
+ url: string;
41
+ customData: object;
42
+ }
43
+ interface StoreAddress {
44
+ street: string;
45
+ houseNumber: string;
46
+ zipCode: string;
47
+ city: string;
48
+ countryCode: string;
49
+ }
50
+ interface StoreItemVariant {
51
+ variantId: number;
52
+ variantReferenceKey: string;
53
+ quantity: number;
54
+ }
55
+ interface StoreItem {
56
+ productId: number;
57
+ productReferenceKey: string;
58
+ name: object;
59
+ image: string;
60
+ variants: StoreItemVariant[];
61
+ }
62
+ interface OpeningTimes {
63
+ mon: OpeningTimeInterval[];
64
+ tue: OpeningTimeInterval[];
65
+ wed: OpeningTimeInterval[];
66
+ thu: OpeningTimeInterval[];
67
+ fri: OpeningTimeInterval[];
68
+ sat: OpeningTimeInterval[];
69
+ sun: OpeningTimeInterval[];
70
+ exceptions: OpeningTimeException[];
71
+ currentlyOpen: boolean;
72
+ minutesUntilClosed: number;
73
+ }
74
+ interface Store {
75
+ id: number;
76
+ referenceKey: string;
77
+ name: string;
78
+ email: string;
79
+ address: StoreAddress;
80
+ openingTimes?: OpeningTimes;
81
+ geoPoint: GeoPoint;
82
+ customData?: object;
83
+ settings?: {
84
+ shipFromStore: boolean;
85
+ clickAndCollect: boolean;
86
+ };
87
+ isActive: boolean;
88
+ images?: StoreImage;
89
+ }
90
+ type StoreWithProperty = 'openingTimes' | 'customData' | 'images' | 'settings';
91
+ interface OmnichannelMeta {
92
+ path: string;
93
+ currentPage: number;
94
+ lastPage: number;
95
+ from: number;
96
+ to: number;
97
+ perPage: number;
98
+ total: number;
99
+ firstPageUrl: string;
100
+ lastPageUrl: string;
101
+ prevPageUrl: string | null;
102
+ nextPageUrl: string | null;
103
+ }
104
+ interface OmnichannelLinks {
105
+ first: string | null;
106
+ last: string | null;
107
+ prev: string | null;
108
+ next: string | null;
109
+ }
110
+ interface StoreLocation extends Store {
111
+ distance: number;
112
+ }
113
+ interface StoreLocationResponse {
114
+ data: StoreLocation[];
115
+ meta: {
116
+ searchAddress: GeoPoint;
117
+ };
118
+ }
119
+ interface StoreVariantLocation extends StoreLocation {
120
+ quantity: number;
121
+ }
122
+ interface StoreAvailabilityCheck extends Store {
123
+ items: StoreItem[];
124
+ }
125
+ interface StoreAvailabilityCheckResponse {
126
+ data: StoreAvailabilityCheck;
127
+ meta: OmnichannelMeta;
128
+ }
129
+ interface VariantLocation {
130
+ name: object;
131
+ productId: number;
132
+ variantId: number;
133
+ productReferenceKey: string;
134
+ variantReferenceKey: string;
135
+ image: string;
136
+ additionalData: object;
137
+ stores: StoreVariantLocation[];
138
+ }
139
+ interface VariantLocationResponse {
140
+ data: VariantLocation;
141
+ meta: OmnichannelMeta;
142
+ }
143
+ interface FiltersAddressParams {
144
+ address: string;
145
+ radius: number;
146
+ }
147
+ interface FiltersCoordinatesParams {
148
+ geoPoint: GeoPoint;
149
+ radius: number;
150
+ }
151
+ interface StoreLocatorSearchParams {
152
+ filters: FiltersAddressParams | FiltersCoordinatesParams;
153
+ perPage?: number;
154
+ with?: StoreWithProperty[];
155
+ }
156
+ interface VariantLocatorSearchParams {
157
+ variantId: number;
158
+ filters: FiltersAddressParams | FiltersCoordinatesParams;
159
+ perPage?: number;
160
+ with?: StoreWithProperty[];
161
+ }
162
+ interface FetchStoresForVariantParams {
163
+ variantId: number;
164
+ filters: {
165
+ address: string;
166
+ radius: number;
167
+ };
168
+ perPage?: number;
169
+ with?: StoreWithProperty[];
170
+ }
171
+ interface FetchStoreVariantByIdParams {
172
+ storeId: number;
173
+ variantId: number;
174
+ with?: StoreWithProperty[];
175
+ }
176
+
177
+ export { type FetchStoreVariantByIdParams, type FetchStoresForVariantParams, type FiltersAddressParams, type FiltersCoordinatesParams, type GeoPoint, type OmnichannelLinks, type OmnichannelMeta, OpeningTime, type OpeningTimeException, type OpeningTimeInterval, type OpeningTimes, type Store, type StoreAddress, type StoreAvailabilityCheck, type StoreAvailabilityCheckResponse, type StoreImage, type StoreItem, type StoreItemVariant, type StoreLocation, type StoreLocationResponse, type StoreLocatorConfig, type StoreLocatorSearchParams, type StoreVariantLocation, type StoreWithProperty, type VariantLocation, type VariantLocationResponse, type VariantLocatorSearchParams };
package/dist/module.d.mts CHANGED
@@ -1,6 +1,10 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
- import { S as StoreLocatorConfig } from './shared/omnichannel-nuxt.270bfbda.mjs';
3
2
 
4
- declare const _default: _nuxt_schema.NuxtModule<StoreLocatorConfig, StoreLocatorConfig, false>;
3
+ type ModuleOptions = {
4
+ token: string;
5
+ host: string;
6
+ internalAccessHeader?: string | undefined;
7
+ };
8
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
5
9
 
6
10
  export { _default as default };
package/dist/module.d.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
- import { S as StoreLocatorConfig } from './shared/omnichannel-nuxt.270bfbda.js';
3
2
 
4
- declare const _default: _nuxt_schema.NuxtModule<StoreLocatorConfig, StoreLocatorConfig, false>;
3
+ type ModuleOptions = {
4
+ token: string;
5
+ host: string;
6
+ internalAccessHeader?: string | undefined;
7
+ };
8
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
5
9
 
6
10
  export { _default as default };
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/omnichannel-nuxt",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "builder": {
5
5
  "@nuxt/module-builder": "0.8.4",
6
6
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -2,13 +2,18 @@ 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
7
  throw new Error(
8
8
  "Nuxt 2 is not supported in this version of @scayle/omnichannel-nuxt"
9
9
  );
10
10
  } else {
11
11
  const { resolve } = createResolver(import.meta.url);
12
+ nuxt.options.runtimeConfig.omnichannel = {
13
+ apiToken: moduleOptions.token ?? "",
14
+ apiHost: moduleOptions.host ?? "",
15
+ internalAccessHeader: moduleOptions.internalAccessHeader ?? ""
16
+ };
12
17
  addServerHandler({
13
18
  route: `/api/omnichannel/**`,
14
19
  handler: resolve("./runtime/handler"),
@@ -24,7 +24,10 @@ export default defineEventHandler(async (event) => {
24
24
  }
25
25
  const options = {
26
26
  host: config.apiHost,
27
- token: config.apiToken
27
+ token: config.apiToken,
28
+ additionalHeaders: config.internalAccessHeader ? {
29
+ "x-internal-access": config.internalAccessHeader
30
+ } : {}
28
31
  };
29
32
  try {
30
33
  switch (path) {
@@ -15,7 +15,8 @@ export declare class FetchError extends Error {
15
15
  export declare class OmnichannelClient {
16
16
  private readonly host;
17
17
  private readonly token;
18
- constructor(host: string, token: string);
18
+ private readonly additionalHeaders;
19
+ constructor(host: string, token: string, additionalHeaders?: HeadersInit);
19
20
  get headers(): HeadersInit;
20
21
  private handleResponse;
21
22
  getStores(options: StoreLocatorSearchParams): Promise<PaginatedResponse<StoreLocation[]>>;
@@ -15,15 +15,18 @@ export class FetchError extends Error {
15
15
  export class OmnichannelClient {
16
16
  host;
17
17
  token;
18
- constructor(host, token) {
18
+ additionalHeaders;
19
+ constructor(host, token, additionalHeaders) {
19
20
  this.host = host;
20
21
  this.token = token;
22
+ this.additionalHeaders = additionalHeaders;
21
23
  }
22
24
  get headers() {
23
25
  return {
24
26
  Authorization: `Bearer ${this.token}`,
25
27
  Accept: "application/json",
26
- "Content-Type": "application/json"
28
+ "Content-Type": "application/json",
29
+ ...this.additionalHeaders
27
30
  };
28
31
  }
29
32
  async handleResponse(response) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/omnichannel-nuxt",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "description": "Collection of essential utilities to work with omnichannel",
5
5
  "author": "SCAYLE Commerce Engine",
6
6
  "license": "MIT",
@@ -57,22 +57,22 @@
57
57
  "utility-types": "^3.11.0"
58
58
  },
59
59
  "devDependencies": {
60
- "@nuxt/eslint": "0.5.7",
60
+ "@nuxt/eslint": "0.6.0",
61
61
  "@nuxt/module-builder": "0.8.4",
62
62
  "@nuxt/schema": "3.13.2",
63
- "@scayle/eslint-config-storefront": "4.3.0",
64
- "@types/node": "20.16.10",
63
+ "@scayle/eslint-config-storefront": "4.3.2",
64
+ "@types/node": "20.16.11",
65
65
  "@types/qs": "6.9.16",
66
66
  "dprint": "0.47.2",
67
- "eslint": "9.11.1",
67
+ "eslint": "9.12.0",
68
68
  "eslint-formatter-gitlab": "5.1.0",
69
- "h3": "1.12.0",
69
+ "h3": "1.13.0",
70
70
  "nuxi": "3.14.0",
71
71
  "nuxt": "3.13.2",
72
- "typescript": "5.6.2",
73
- "vitest": "2.1.1"
72
+ "typescript": "5.6.3",
73
+ "vitest": "2.1.3"
74
74
  },
75
75
  "volta": {
76
- "node": "20.17.0"
76
+ "node": "20.18.0"
77
77
  }
78
78
  }
@@ -1,163 +0,0 @@
1
- interface StoreLocatorConfig {
2
- token: string;
3
- host: string;
4
- companyId?: number;
5
- googleApiKey?: string;
6
- }
7
- interface GeoPoint {
8
- lat: number;
9
- lng: number;
10
- }
11
- interface OpeningTimeInterval {
12
- timeFrom: string;
13
- timeUntil: string;
14
- }
15
- interface OpeningTimeException {
16
- exceptionDate: string;
17
- exceptionName: string;
18
- exceptionType: 'open' | 'closed';
19
- timeFrom: string;
20
- timeUntil: string;
21
- }
22
- interface StoreImage {
23
- id: number;
24
- name: string;
25
- damKey: string;
26
- url: string;
27
- customData: object;
28
- }
29
- interface StoreAddress {
30
- street: string;
31
- houseNumber: string;
32
- zipCode: string;
33
- city: string;
34
- countryCode: string;
35
- }
36
- interface StoreItemVariant {
37
- variantId: number;
38
- variantReferenceKey: string;
39
- quantity: number;
40
- }
41
- interface StoreItem {
42
- productId: number;
43
- productReferenceKey: string;
44
- name: object;
45
- image: string;
46
- variants: StoreItemVariant[];
47
- }
48
- interface OpeningTimes {
49
- mon: OpeningTimeInterval[];
50
- tue: OpeningTimeInterval[];
51
- wed: OpeningTimeInterval[];
52
- thu: OpeningTimeInterval[];
53
- fri: OpeningTimeInterval[];
54
- sat: OpeningTimeInterval[];
55
- sun: OpeningTimeInterval[];
56
- exceptions: OpeningTimeException[];
57
- currentlyOpen: boolean;
58
- minutesUntilClosed: number;
59
- }
60
- interface Store {
61
- id: number;
62
- referenceKey: string;
63
- name: string;
64
- email: string;
65
- address: StoreAddress;
66
- openingTimes?: OpeningTimes;
67
- geoPoint: GeoPoint;
68
- customData?: object;
69
- settings?: {
70
- shipFromStore: boolean;
71
- clickAndCollect: boolean;
72
- };
73
- isActive: boolean;
74
- images?: StoreImage;
75
- }
76
- type StoreWithProperty = 'openingTimes' | 'customData' | 'images' | 'settings';
77
- interface OmnichannelMeta {
78
- path: string;
79
- currentPage: number;
80
- lastPage: number;
81
- from: number;
82
- to: number;
83
- perPage: number;
84
- total: number;
85
- firstPageUrl: string;
86
- lastPageUrl: string;
87
- prevPageUrl: string | null;
88
- nextPageUrl: string | null;
89
- }
90
- interface OmnichannelLinks {
91
- first: string | null;
92
- last: string | null;
93
- prev: string | null;
94
- next: string | null;
95
- }
96
- interface StoreLocation extends Store {
97
- distance: number;
98
- }
99
- interface StoreLocationResponse {
100
- data: StoreLocation[];
101
- meta: {
102
- searchAddress: GeoPoint;
103
- };
104
- }
105
- interface StoreVariantLocation extends StoreLocation {
106
- quantity: number;
107
- }
108
- interface StoreAvailabilityCheck extends Store {
109
- items: StoreItem[];
110
- }
111
- interface StoreAvailabilityCheckResponse {
112
- data: StoreAvailabilityCheck;
113
- meta: OmnichannelMeta;
114
- }
115
- interface VariantLocation {
116
- name: object;
117
- productId: number;
118
- variantId: number;
119
- productReferenceKey: string;
120
- variantReferenceKey: string;
121
- image: string;
122
- additionalData: object;
123
- stores: StoreVariantLocation[];
124
- }
125
- interface VariantLocationResponse {
126
- data: VariantLocation;
127
- meta: OmnichannelMeta;
128
- }
129
- interface FiltersAddressParams {
130
- address: string;
131
- radius: number;
132
- }
133
- interface FiltersCoordinatesParams {
134
- geoPoint: GeoPoint;
135
- radius: number;
136
- }
137
- interface StoreLocatorSearchParams {
138
- filters: FiltersAddressParams | FiltersCoordinatesParams;
139
- perPage?: number;
140
- with?: StoreWithProperty[];
141
- }
142
- interface VariantLocatorSearchParams {
143
- variantId: number;
144
- filters: FiltersAddressParams | FiltersCoordinatesParams;
145
- perPage?: number;
146
- with?: StoreWithProperty[];
147
- }
148
- interface FetchStoresForVariantParams {
149
- variantId: number;
150
- filters: {
151
- address: string;
152
- radius: number;
153
- };
154
- perPage?: number;
155
- with?: StoreWithProperty[];
156
- }
157
- interface FetchStoreVariantByIdParams {
158
- storeId: number;
159
- variantId: number;
160
- with?: StoreWithProperty[];
161
- }
162
-
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 };
@@ -1,163 +0,0 @@
1
- interface StoreLocatorConfig {
2
- token: string;
3
- host: string;
4
- companyId?: number;
5
- googleApiKey?: string;
6
- }
7
- interface GeoPoint {
8
- lat: number;
9
- lng: number;
10
- }
11
- interface OpeningTimeInterval {
12
- timeFrom: string;
13
- timeUntil: string;
14
- }
15
- interface OpeningTimeException {
16
- exceptionDate: string;
17
- exceptionName: string;
18
- exceptionType: 'open' | 'closed';
19
- timeFrom: string;
20
- timeUntil: string;
21
- }
22
- interface StoreImage {
23
- id: number;
24
- name: string;
25
- damKey: string;
26
- url: string;
27
- customData: object;
28
- }
29
- interface StoreAddress {
30
- street: string;
31
- houseNumber: string;
32
- zipCode: string;
33
- city: string;
34
- countryCode: string;
35
- }
36
- interface StoreItemVariant {
37
- variantId: number;
38
- variantReferenceKey: string;
39
- quantity: number;
40
- }
41
- interface StoreItem {
42
- productId: number;
43
- productReferenceKey: string;
44
- name: object;
45
- image: string;
46
- variants: StoreItemVariant[];
47
- }
48
- interface OpeningTimes {
49
- mon: OpeningTimeInterval[];
50
- tue: OpeningTimeInterval[];
51
- wed: OpeningTimeInterval[];
52
- thu: OpeningTimeInterval[];
53
- fri: OpeningTimeInterval[];
54
- sat: OpeningTimeInterval[];
55
- sun: OpeningTimeInterval[];
56
- exceptions: OpeningTimeException[];
57
- currentlyOpen: boolean;
58
- minutesUntilClosed: number;
59
- }
60
- interface Store {
61
- id: number;
62
- referenceKey: string;
63
- name: string;
64
- email: string;
65
- address: StoreAddress;
66
- openingTimes?: OpeningTimes;
67
- geoPoint: GeoPoint;
68
- customData?: object;
69
- settings?: {
70
- shipFromStore: boolean;
71
- clickAndCollect: boolean;
72
- };
73
- isActive: boolean;
74
- images?: StoreImage;
75
- }
76
- type StoreWithProperty = 'openingTimes' | 'customData' | 'images' | 'settings';
77
- interface OmnichannelMeta {
78
- path: string;
79
- currentPage: number;
80
- lastPage: number;
81
- from: number;
82
- to: number;
83
- perPage: number;
84
- total: number;
85
- firstPageUrl: string;
86
- lastPageUrl: string;
87
- prevPageUrl: string | null;
88
- nextPageUrl: string | null;
89
- }
90
- interface OmnichannelLinks {
91
- first: string | null;
92
- last: string | null;
93
- prev: string | null;
94
- next: string | null;
95
- }
96
- interface StoreLocation extends Store {
97
- distance: number;
98
- }
99
- interface StoreLocationResponse {
100
- data: StoreLocation[];
101
- meta: {
102
- searchAddress: GeoPoint;
103
- };
104
- }
105
- interface StoreVariantLocation extends StoreLocation {
106
- quantity: number;
107
- }
108
- interface StoreAvailabilityCheck extends Store {
109
- items: StoreItem[];
110
- }
111
- interface StoreAvailabilityCheckResponse {
112
- data: StoreAvailabilityCheck;
113
- meta: OmnichannelMeta;
114
- }
115
- interface VariantLocation {
116
- name: object;
117
- productId: number;
118
- variantId: number;
119
- productReferenceKey: string;
120
- variantReferenceKey: string;
121
- image: string;
122
- additionalData: object;
123
- stores: StoreVariantLocation[];
124
- }
125
- interface VariantLocationResponse {
126
- data: VariantLocation;
127
- meta: OmnichannelMeta;
128
- }
129
- interface FiltersAddressParams {
130
- address: string;
131
- radius: number;
132
- }
133
- interface FiltersCoordinatesParams {
134
- geoPoint: GeoPoint;
135
- radius: number;
136
- }
137
- interface StoreLocatorSearchParams {
138
- filters: FiltersAddressParams | FiltersCoordinatesParams;
139
- perPage?: number;
140
- with?: StoreWithProperty[];
141
- }
142
- interface VariantLocatorSearchParams {
143
- variantId: number;
144
- filters: FiltersAddressParams | FiltersCoordinatesParams;
145
- perPage?: number;
146
- with?: StoreWithProperty[];
147
- }
148
- interface FetchStoresForVariantParams {
149
- variantId: number;
150
- filters: {
151
- address: string;
152
- radius: number;
153
- };
154
- perPage?: number;
155
- with?: StoreWithProperty[];
156
- }
157
- interface FetchStoreVariantByIdParams {
158
- storeId: number;
159
- variantId: number;
160
- with?: StoreWithProperty[];
161
- }
162
-
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 };