vinmonopolet-ts 3.0.0 → 4.0.0
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,17 @@
|
|
|
1
1
|
#Changelog
|
|
2
2
|
|
|
3
|
+
## [4.0.0]
|
|
4
|
+
|
|
5
|
+
### Breaking changes
|
|
6
|
+
|
|
7
|
+
- Availability is renamed to ProductAvailability to match changes in the Vinmonopolet API.
|
|
8
|
+
|
|
9
|
+
## [3.1.0]
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Adjusted product availability to match changes in the Vinmonopolet api.
|
|
14
|
+
|
|
3
15
|
## [3.0.0]
|
|
4
16
|
|
|
5
17
|
### Changed
|
|
@@ -43,8 +43,8 @@ const class_transformer_1 = require("class-transformer");
|
|
|
43
43
|
const Volume_1 = require("./Volume");
|
|
44
44
|
const defaultCategory = { code: null, name: null, url: null };
|
|
45
45
|
const defaultAvailability = {
|
|
46
|
-
deliveryAvailability: {
|
|
47
|
-
|
|
46
|
+
deliveryAvailability: { availableForPurchase: true, infos: [] },
|
|
47
|
+
storesAvailability: { availableForPurchase: true, infos: [] },
|
|
48
48
|
};
|
|
49
49
|
const mapFromStreamObject = (prod, product) => {
|
|
50
50
|
Object.keys(product).forEach((key) => {
|
|
@@ -148,7 +148,7 @@ class BaseProduct {
|
|
|
148
148
|
/**
|
|
149
149
|
* information regarding the product availability either in stores or through mail.
|
|
150
150
|
*/
|
|
151
|
-
this.
|
|
151
|
+
this.productAvailability = defaultAvailability;
|
|
152
152
|
/**
|
|
153
153
|
* A boolean representing if the product is currently buyable.
|
|
154
154
|
*/
|
|
@@ -14,8 +14,8 @@ import { Type } from "class-transformer";
|
|
|
14
14
|
import { Volume } from "./Volume";
|
|
15
15
|
const defaultCategory = { code: null, name: null, url: null };
|
|
16
16
|
const defaultAvailability = {
|
|
17
|
-
deliveryAvailability: {
|
|
18
|
-
|
|
17
|
+
deliveryAvailability: { availableForPurchase: true, infos: [] },
|
|
18
|
+
storesAvailability: { availableForPurchase: true, infos: [] },
|
|
19
19
|
};
|
|
20
20
|
const mapFromStreamObject = (prod, product) => {
|
|
21
21
|
Object.keys(product).forEach((key) => {
|
|
@@ -120,7 +120,7 @@ class BaseProduct {
|
|
|
120
120
|
/**
|
|
121
121
|
* information regarding the product availability either in stores or through mail.
|
|
122
122
|
*/
|
|
123
|
-
|
|
123
|
+
productAvailability = defaultAvailability;
|
|
124
124
|
/**
|
|
125
125
|
* A boolean representing if the product is currently buyable.
|
|
126
126
|
*/
|
|
@@ -5,12 +5,18 @@ import RawMaterial from "./RawMaterial";
|
|
|
5
5
|
import { Volume } from "./Volume";
|
|
6
6
|
interface IAvailability {
|
|
7
7
|
deliveryAvailability: {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
availableForPurchase: boolean;
|
|
9
|
+
infos: {
|
|
10
|
+
availability: string;
|
|
11
|
+
readableValue: string;
|
|
12
|
+
}[];
|
|
10
13
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
storesAvailability: {
|
|
15
|
+
availableForPurchase: boolean;
|
|
16
|
+
infos: {
|
|
17
|
+
availability: string;
|
|
18
|
+
readableValue: string;
|
|
19
|
+
}[];
|
|
14
20
|
};
|
|
15
21
|
}
|
|
16
22
|
export declare class StreamProduct {
|
|
@@ -83,7 +89,7 @@ declare class BaseProduct {
|
|
|
83
89
|
/**
|
|
84
90
|
* information regarding the product availability either in stores or through mail.
|
|
85
91
|
*/
|
|
86
|
-
|
|
92
|
+
productAvailability: IAvailability;
|
|
87
93
|
/**
|
|
88
94
|
* A boolean representing if the product is currently buyable.
|
|
89
95
|
*/
|