vinmonopolet-ts 5.2.7 → 5.2.8
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 +6 -0
- package/dist/cjs/constants.js +1 -1
- package/dist/cjs/retrievers/getStore/index.js +1 -1
- package/dist/cjs/retrievers/getStores/index.js +1 -1
- package/dist/esm/constants.js +1 -1
- package/dist/esm/retrievers/getStore/index.js +1 -1
- package/dist/esm/retrievers/getStores/index.js +1 -1
- package/dist/types/constants.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/cjs/constants.js
CHANGED
|
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VINMONOPOLET_STORE_URL = exports.VINMONOPOLET_PRODUCT_URL = exports.VINMONOPOLET_SEARCH_URL = void 0;
|
|
4
4
|
exports.VINMONOPOLET_SEARCH_URL = "https://www.vinmonopolet.no/vmpws/v2/vmp/products/search";
|
|
5
5
|
exports.VINMONOPOLET_PRODUCT_URL = "https://www.vinmonopolet.no/vmpws/v3/vmp/products/";
|
|
6
|
-
exports.VINMONOPOLET_STORE_URL = "https://www.vinmonopolet.no/vmpws/v2/vmp/stores
|
|
6
|
+
exports.VINMONOPOLET_STORE_URL = "https://www.vinmonopolet.no/vmpws/v2/vmp/stores";
|
|
@@ -4,7 +4,7 @@ const constants_1 = require("../../constants");
|
|
|
4
4
|
const mapper_1 = require("../../models/store/mapper");
|
|
5
5
|
const GET_1 = require("../../util/GET");
|
|
6
6
|
const getStore = async (store_id) => {
|
|
7
|
-
const response = await (0, GET_1.GET)(`${constants_1.VINMONOPOLET_STORE_URL}
|
|
7
|
+
const response = await (0, GET_1.GET)(`${constants_1.VINMONOPOLET_STORE_URL}/${store_id}`, new URLSearchParams({ fields: "FULL" }));
|
|
8
8
|
return (0, mapper_1.toPopulatedStore)(response);
|
|
9
9
|
};
|
|
10
10
|
exports.default = getStore;
|
|
@@ -22,7 +22,7 @@ function searchStores(opts) {
|
|
|
22
22
|
}
|
|
23
23
|
exports.searchStores = searchStores;
|
|
24
24
|
async function searchByQuery(querystring) {
|
|
25
|
-
const response = await (0, GET_1.GET)(`${constants_1.VINMONOPOLET_STORE_URL}autocomplete`, new URLSearchParams({ query: querystring }));
|
|
25
|
+
const response = await (0, GET_1.GET)(`${constants_1.VINMONOPOLET_STORE_URL}/autocomplete`, new URLSearchParams({ query: querystring }));
|
|
26
26
|
return { stores: response.stores.map(toBaseStore) };
|
|
27
27
|
}
|
|
28
28
|
async function searchByLocation(lat, lon, currentPage = 1, pageSize = 10) {
|
package/dist/esm/constants.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export const VINMONOPOLET_SEARCH_URL = "https://www.vinmonopolet.no/vmpws/v2/vmp/products/search";
|
|
2
2
|
export const VINMONOPOLET_PRODUCT_URL = "https://www.vinmonopolet.no/vmpws/v3/vmp/products/";
|
|
3
|
-
export const VINMONOPOLET_STORE_URL = "https://www.vinmonopolet.no/vmpws/v2/vmp/stores
|
|
3
|
+
export const VINMONOPOLET_STORE_URL = "https://www.vinmonopolet.no/vmpws/v2/vmp/stores";
|
|
@@ -2,7 +2,7 @@ import { VINMONOPOLET_STORE_URL } from "../../constants";
|
|
|
2
2
|
import { toPopulatedStore } from "../../models/store/mapper";
|
|
3
3
|
import { GET } from "../../util/GET";
|
|
4
4
|
const getStore = async (store_id) => {
|
|
5
|
-
const response = await GET(`${VINMONOPOLET_STORE_URL}
|
|
5
|
+
const response = await GET(`${VINMONOPOLET_STORE_URL}/${store_id}`, new URLSearchParams({ fields: "FULL" }));
|
|
6
6
|
return toPopulatedStore(response);
|
|
7
7
|
};
|
|
8
8
|
export default getStore;
|
|
@@ -15,7 +15,7 @@ export function searchStores(opts) {
|
|
|
15
15
|
return searchByLocation(lat, lon, opts?.page, opts?.pageSize);
|
|
16
16
|
}
|
|
17
17
|
async function searchByQuery(querystring) {
|
|
18
|
-
const response = await GET(`${VINMONOPOLET_STORE_URL}autocomplete`, new URLSearchParams({ query: querystring }));
|
|
18
|
+
const response = await GET(`${VINMONOPOLET_STORE_URL}/autocomplete`, new URLSearchParams({ query: querystring }));
|
|
19
19
|
return { stores: response.stores.map(toBaseStore) };
|
|
20
20
|
}
|
|
21
21
|
async function searchByLocation(lat, lon, currentPage = 1, pageSize = 10) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const VINMONOPOLET_SEARCH_URL = "https://www.vinmonopolet.no/vmpws/v2/vmp/products/search";
|
|
2
2
|
export declare const VINMONOPOLET_PRODUCT_URL = "https://www.vinmonopolet.no/vmpws/v3/vmp/products/";
|
|
3
|
-
export declare const VINMONOPOLET_STORE_URL = "https://www.vinmonopolet.no/vmpws/v2/vmp/stores
|
|
3
|
+
export declare const VINMONOPOLET_STORE_URL = "https://www.vinmonopolet.no/vmpws/v2/vmp/stores";
|