@bottlebooks/valid-values 10.3.0 → 10.4.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
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [10.4.0](https://github.com/bottlebooks/bottlebooks/compare/@bottlebooks/valid-values@10.3.0...@bottlebooks/valid-values@10.4.0) (2023-12-12)
7
+
8
+ ### Bug Fixes
9
+
10
+ - add missing product types; ([fe54336](https://github.com/bottlebooks/bottlebooks/commit/fe54336048bd937b29c44392c6cb2d108270cea2))
11
+
12
+ ### Features
13
+
14
+ - enforce autocomplete for product types ([745abba](https://github.com/bottlebooks/bottlebooks/commit/745abba3573f10bf9c6f4e262b29af8edbf8f01b))
15
+
6
16
  # [10.3.0](https://github.com/bottlebooks/bottlebooks/compare/@bottlebooks/valid-values@10.2.0...@bottlebooks/valid-values@10.3.0) (2023-12-12)
7
17
 
8
18
  ### Features
@@ -1,4 +1,5 @@
1
1
  import { ValidValueDefinition } from '../types/ValidValueDefinition';
2
+ import { ProductTypeKey } from '../productType/productType';
2
3
  interface Designation extends ValidValueDefinition {
3
4
  }
4
5
  declare const allDesignations: {
@@ -15,69 +16,9 @@ declare const allDesignations: {
15
16
  readonly semi_sweet: Designation;
16
17
  };
17
18
  export declare type DesignationKey = keyof typeof allDesignations;
18
- export declare const byProductType: {
19
- beer: {};
20
- spirit_absinthe: {};
21
- spirit_anise: {};
22
- spirit_aquavit: {};
23
- spirit_arak: {};
24
- spirit_armagnac: {};
25
- spirit_asianspirit: {};
26
- spirit_bitter: {};
27
- spirit_cachaca: {};
28
- spirit_calvados: {};
29
- spirit_cocktail: {};
30
- spirit_cognac: {};
31
- spirit_fruitspirit: {};
32
- spirit_genever: {};
33
- spirit_gin: {};
34
- spirit_grainspirit: {};
35
- spirit_grapebrandy: {};
36
- spirit_grappa: {};
37
- spirit_liqueur: {};
38
- spirit_marc: {};
39
- spirit_mezcal: {};
40
- spirit_miscspririt: {};
41
- spirit_ouzo: {};
42
- spirit_pastis: {};
43
- spirit_pisco: {};
44
- spirit_raki: {};
45
- spirit_rum: {};
46
- spirit_sambuca: {};
47
- spirit_shochu: {};
48
- spirit_schnaps: {};
49
- spirit_tequila: {};
50
- spirit_vermouth: {};
51
- spirit_vodka: {};
52
- spirit_whisky: {};
53
- wine_fortified: Record<"dry" | "semi" | "sweet", Designation>;
54
- wine_pearlwine: Record<"dry" | "semi" | "sweet", Designation>;
55
- wine_sparkling: Record<"brut" | "demi-sec" | "dry" | "brut_nature" | "extra_brut" | "extra_dry", Designation>;
56
- wine_stillwine: Record<"feinherb" | "lieblich" | "dry" | "semi" | "sweet", Designation>;
57
- wine_aromatised: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
58
- wine_aromatised_wineBasedAperitif: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
59
- wine_aromatised_vermouth: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
60
- wine_aromatised_bitter: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
61
- wine_aromatised_eggBased: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
62
- wine_aromatised_vakevaViiniglogi: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
63
- wine_aromatised_wineBasedDrink: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
64
- wine_aromatised_fortifiedWineBasedDrink: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
65
- wine_aromatised_sangria: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
66
- wine_aromatised_clarea: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
67
- wine_aromatised_zurra: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
68
- wine_aromatised_bitterSoda: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
69
- wine_aromatised_kalteEnte: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
70
- wine_aromatised_gluhwein: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
71
- wine_aromatised_viiniglogiVingloggKarstasVynas: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
72
- wine_aromatised_maiwein: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
73
- wine_aromatised_maitrank: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
74
- wine_aromatised_pelin: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
75
- wine_aromatised_aromatizovanyDezert: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
76
- wine_aromatised_winoZiolowe: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
77
- wine_aromatised_wineBasedCocktail: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
78
- wine_aromatised_wineProductCocktail: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
79
- wine_aromatised_semiSparklingGrapeBasedCocktail: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
80
- wine_aromatised_sparklingWineCocktail: Record<"dry" | "extra_dry" | "semi" | "sweet" | "semi_sweet", Designation>;
19
+ declare type ByProductType = {
20
+ [K in ProductTypeKey]: Record<DesignationKey, Designation> | {};
81
21
  };
22
+ export declare const byProductType: ByProductType;
82
23
  export default allDesignations;
83
24
  //# sourceMappingURL=designation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"designation.d.ts","sourceRoot":"","sources":["../../../src/validValues/designation/designation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,UAAU,WAAY,SAAQ,oBAAoB;CAAG;AAKrD,QAAA,MAAM,eAAe;;;;;;;;;;;;CA8EX,CAAC;AAEX,oBAAY,cAAc,GAAG,MAAM,OAAO,eAAe,CAAC;AAkB1D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsEzB,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"designation.d.ts","sourceRoot":"","sources":["../../../src/validValues/designation/designation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,UAAU,WAAY,SAAQ,oBAAoB;CAAG;AAKrD,QAAA,MAAM,eAAe;;;;;;;;;;;;CA8EX,CAAC;AAEX,oBAAY,cAAc,GAAG,MAAM,OAAO,eAAe,CAAC;AA0B1D,aAAK,aAAa,GAAG;KAClB,CAAC,IAAI,cAAc,GAAG,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC,GAAG,EAAE;CAChE,CAAC;AACF,eAAO,MAAM,aAAa,EAAE,aAqE3B,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -121,9 +121,8 @@ function pick(keys) {
121
121
  }));
122
122
  }
123
123
 
124
- var aromatisedStyles = pick(['extra_dry', 'dry', 'semi', 'semi_sweet', 'sweet']); // TODO Enforce/provide Autocomplete for product types here.
125
- // I think this will only be possible with the `satisfies` keyword coming in TS 4.9.
126
-
124
+ var aromatisedStyles = pick(['extra_dry', 'dry', 'semi', 'semi_sweet', 'sweet']);
125
+ var sparklingStyles = pick(['brut_nature', 'extra_brut', 'brut', 'extra_dry', 'dry', 'demi-sec']);
127
126
  var byProductType = {
128
127
  beer: {},
129
128
  spirit_absinthe: {},
@@ -161,8 +160,14 @@ var byProductType = {
161
160
  spirit_whisky: {},
162
161
  wine_fortified: pick(['dry', 'semi', 'sweet']),
163
162
  wine_pearlwine: pick(['dry', 'semi', 'sweet']),
164
- wine_sparkling: pick(['brut_nature', 'extra_brut', 'brut', 'extra_dry', 'dry', 'demi-sec']),
165
163
  wine_stillwine: pick(['dry', 'feinherb', 'lieblich', 'semi', 'sweet']),
164
+ wine_liqueur: pick(['dry', 'feinherb', 'lieblich', 'semi', 'sweet']),
165
+ wine_sparkling: sparklingStyles,
166
+ wine_qualitysparkling: sparklingStyles,
167
+ wine_qualityaromaticsparkling: sparklingStyles,
168
+ wine_aeratedsparkling: sparklingStyles,
169
+ wine_semisparkling: sparklingStyles,
170
+ wine_aeratedsemisparkling: sparklingStyles,
166
171
  wine_aromatised: aromatisedStyles,
167
172
  wine_aromatised_wineBasedAperitif: aromatisedStyles,
168
173
  wine_aromatised_vermouth: aromatisedStyles,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@bottlebooks/valid-values",
3
3
  "description": "The Bottlebooks lookup values, defined globally.",
4
4
  "private": false,
5
- "version": "10.3.0",
5
+ "version": "10.4.0",
6
6
  "type": "commonjs",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
@@ -34,5 +34,5 @@
34
34
  "dependencies": {
35
35
  "@lingui/core": "3.14.0"
36
36
  },
37
- "gitHead": "b5d626cb5589fb58743304ae5561fd3fefd7e344"
37
+ "gitHead": "d37d23eec9f987193d57ab531af4e7ca114d55f2"
38
38
  }
@@ -1,5 +1,6 @@
1
1
  import { defineMessage } from '@lingui/macro';
2
2
  import { ValidValueDefinition } from '../types/ValidValueDefinition';
3
+ import { ProductTypeKey } from '../productType/productType';
3
4
 
4
5
  interface Designation extends ValidValueDefinition {}
5
6
 
@@ -102,9 +103,20 @@ const aromatisedStyles = pick([
102
103
  'semi_sweet',
103
104
  'sweet',
104
105
  ]);
105
- // TODO Enforce/provide Autocomplete for product types here.
106
- // I think this will only be possible with the `satisfies` keyword coming in TS 4.9.
107
- export const byProductType = {
106
+
107
+ const sparklingStyles = pick([
108
+ 'brut_nature',
109
+ 'extra_brut',
110
+ 'brut',
111
+ 'extra_dry',
112
+ 'dry',
113
+ 'demi-sec',
114
+ ]);
115
+
116
+ type ByProductType = {
117
+ [K in ProductTypeKey]: Record<DesignationKey, Designation> | {};
118
+ };
119
+ export const byProductType: ByProductType = {
108
120
  beer: {},
109
121
  spirit_absinthe: {},
110
122
  spirit_anise: {},
@@ -141,15 +153,14 @@ export const byProductType = {
141
153
  spirit_whisky: {},
142
154
  wine_fortified: pick(['dry', 'semi', 'sweet']),
143
155
  wine_pearlwine: pick(['dry', 'semi', 'sweet']),
144
- wine_sparkling: pick([
145
- 'brut_nature',
146
- 'extra_brut',
147
- 'brut',
148
- 'extra_dry',
149
- 'dry',
150
- 'demi-sec',
151
- ]),
152
156
  wine_stillwine: pick(['dry', 'feinherb', 'lieblich', 'semi', 'sweet']),
157
+ wine_liqueur: pick(['dry', 'feinherb', 'lieblich', 'semi', 'sweet']),
158
+ wine_sparkling: sparklingStyles,
159
+ wine_qualitysparkling: sparklingStyles,
160
+ wine_qualityaromaticsparkling: sparklingStyles,
161
+ wine_aeratedsparkling: sparklingStyles,
162
+ wine_semisparkling: sparklingStyles,
163
+ wine_aeratedsemisparkling: sparklingStyles,
153
164
  wine_aromatised: aromatisedStyles,
154
165
  wine_aromatised_wineBasedAperitif: aromatisedStyles,
155
166
  wine_aromatised_vermouth: aromatisedStyles,