@la-main-verte/shared-types 1.0.88 → 1.0.89

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/src/plant.d.ts CHANGED
@@ -1,200 +1,201 @@
1
- import type { TaxonFamilyI } from './taxonFamily'
2
- import type { SeedingInfoI } from './pages.api'
3
- import type { PlantFilterI } from './plantFilters'
4
- import type { RotationGroup } from './rotationGroup'
5
- /**
6
- * Range filter value for min/max filters
7
- */
8
- export interface RangeFilterValueI {
9
- min: number
10
- max: number
11
- }
12
-
13
- /**
14
- * Plant filter value types
15
- * Represents the possible values for a single filter
16
- */
17
- export type PlantFilterValueI = string | string[] | number | boolean | RangeFilterValueI
18
-
19
- /**
20
- * Plant attributes for filtering
21
- * Used in JSONB field and as query parameters
22
- * Supports multiple value types for different filter types
23
- */
24
- /**
25
- * A group of related attribute values, used for nested attribute objects.
26
- * Ex: { growth: { type: 'déterminée' }}
27
- */
28
- export type PlantAttributeGroupI = Record<string, PlantFilterValueI>
29
-
30
- /**
31
- * Plant attributes for filtering
32
- * Used in JSONB field and as query parameters
33
- * Supports flat values and one level of nested groups.
34
- */
35
- export type PlantAttributesI = Record<string, PlantFilterValueI | PlantAttributeGroupI>
36
-
37
- export interface PlantI {
38
- id: number
39
- name: string
40
- slug: string
41
- description: string
42
- descriptionSource?: string
43
- female: boolean
44
- family?: string | null
45
- taxonFamilyId?: number | null
46
- spaceBetweenSeedMin: number
47
- spaceBetweenSeedMax: number
48
- spaceBetweenAlleyMin: number
49
- spaceBetweenAlleyMax: number
50
- weeksInTransplant: number
51
- weeksDuringWhichYouCanSeedOutdoor: number
52
- weeksToMaturity: number
53
- daysToMaturity: number | null
54
- weeksToWaitAfterFreezingDate: number
55
- weeksToHarvest: number
56
- indoorSeeding: boolean
57
- outdoorSeeding: boolean
58
- azoteNeedsKgPerHa: number
59
- hibernate: boolean
60
- germinationTemperature: number | null
61
- minGerminationTemperature: number | null
62
- germinationNumberOfDays: string | null
63
- germinationSeedDepth: string | null
64
- cultivationInfo: string | null
65
- parentId: number | null
66
- memberId?: number
67
- memberFirstName?: string | null
68
- shared: boolean
69
- hexColor: string | null
70
- sunRequirements: 'partialShade' | 'fullSun' | 'fullShade' | null
71
- isHardy: boolean | null
72
- quantityForFiveInJardinVivrier?: number | null
73
- imageURL: string
74
- /**
75
- * Filename of the plant's 3D mesh asset stored on S3.
76
- * - Ideally a `.webp` file (e.g. `ail.webp`).
77
- * - Stored in S3 under the `images/meshes/` folder.
78
- * - By default named after the `Plant.slug` (e.g. `ail.webp` for the garlic plant).
79
- * - Only the filename is persisted; the public URL is exposed through the
80
- * virtual `meshURL` field.
81
- */
82
- meshFilename: string | null
83
- /**
84
- * Public ImageKit URL to the plant's 3D mesh asset.
85
- * Virtual field computed from `meshFilename`. The underlying file is
86
- * stored on S3 at `images/meshes/{meshFilename}` and rewritten to
87
- * ImageKit for CDN delivery and transformations.
88
- *
89
- * Falls back to `imageURL` when `meshFilename` is not set.
90
- *
91
- * Example: `https://ik.imagekit.io/lamainverte/meshes/ail.webp`
92
- */
93
- meshURL: string
94
- totalWeeksToMaturity: number
95
- hasNoInformation: boolean
96
- createdAt: Date
97
- updatedAt: Date
98
- translatedSunRequirements: 'Plein soleil' | 'Mi-ombre' | 'Ombre' | null
99
- parent?: PlantI
100
- children?: PlantI[]
101
- PlantInventories?: PlantInventoryI[]
102
- taggedItems?: TaggedItemI[]
103
- /**
104
- * List of selections that the plant is in.
105
- * --------------------------------------
106
- * Tends to be used for featured selections
107
- */
108
- Selections?: SelectionI[]
109
- tasks?: TaskI[]
110
- Images?: ImageI[]
111
- Member?: Partial<MemberI>
112
- notes?: NoteI[]
113
- /**
114
- * Nitrogen-derived rotation group enum (virtual field on the Plant model).
115
- * Source of truth for rotation classification derived from
116
- * `azoteNeedsKgPerHa` plus the regenerative override on `taxonFamily`.
117
- */
118
- rotationGroup?: RotationGroup | null
119
- /**
120
- * French label of `rotationGroup`, ready for display.
121
- */
122
- translatedRotationGroup?: string | null
123
- taxonFamily?: TaxonFamilyI
124
- seedingInfo: SeedingInfoI
125
- /**
126
- * Contextual search text for recommended plants
127
- * Provides additional context when suggesting plants for specific garden zones
128
- */
129
- contextualSearchText?: string
130
- }
131
-
132
- interface PlantInventoryI {
133
- id: number
134
- plantId: number
135
- supplierName: string
136
- plantName: string
137
- supplierURL: string
138
- imageLocation: string
139
- description: string
140
- inStock: boolean
141
- }
142
-
143
- export type AvailableGrowingConditionsI = Record<string, string[]>
144
-
145
- /**
146
- * For each attribute filter key (e.g. "fruit.color"), the list of values that
147
- * still yield at least one match under the current search + active filters.
148
- * Consumed by the frontend to mark filter tags as "unavailable".
149
- */
150
- export type AvailableAttributesI = Record<string, string[]>
151
-
152
- /**
153
- * Which filter surface the frontend should render for the current search.
154
- * - `specific`: family-specific filters (e.g. tomate attributes)
155
- * - `general`: global growing-conditions filters
156
- *
157
- * Mutually exclusive by design — the two sets never appear together.
158
- */
159
- export type PlantFiltersModeI = 'specific' | 'general'
160
-
161
- /**
162
- * Backend-driven description of the filter UI for a given search response.
163
- * The frontend is a dumb renderer: it shows the filters listed here with the
164
- * given mode and marks tags whose value is not in `availability` as unavailable.
165
- */
166
- export interface PlantFiltersUII {
167
- mode: PlantFiltersModeI
168
- filters: PlantFilterI[]
169
- availability: Record<string, string[]>
170
- }
171
-
172
- export interface GrowingConditionsConfigI {
173
- filters: PlantFilterI[]
174
- }
175
-
176
- export interface GrowingConditionsFiltersI {
177
- sunRequirements?: 'partialShade' | 'fullShade'
178
- rotationGroup?: 'regenerative' | 'demanding' | 'moderately_demanding' | 'less_demanding'
179
- }
180
-
181
- export interface PlantSearchResultI {
182
- plants: PlantModelI[]
183
- selections: SelectionModelI[]
184
- total?: number
185
- familyName?: string
186
- filtersUI?: PlantFiltersUII
187
- }
188
-
189
- /**
190
- * Response shape for `GET /selections/:slug/gardenZones/:id/rotation-suggestions`.
191
- * - `advice`: short user-facing sentence explaining the recommendation
192
- * - `Plants`: parent plants matching the recommended rotation group, with
193
- * the avoided taxon families excluded. Empty when the zone has no usable
194
- * history yet.
195
- */
196
- export interface PlantRotationSuggestionsI {
197
- targetYear: number
198
- advice: string
199
- Plants: PlantI[]
200
- }
1
+ import type { TaxonFamilyI } from './taxonFamily'
2
+ import type { SeedingInfoI } from './pages.api'
3
+ import type { PlantFilterI } from './plantFilters'
4
+ import type { RotationGroup } from './rotationGroup'
5
+ /**
6
+ * Range filter value for min/max filters
7
+ */
8
+ export interface RangeFilterValueI {
9
+ min: number
10
+ max: number
11
+ }
12
+
13
+ /**
14
+ * Plant filter value types
15
+ * Represents the possible values for a single filter
16
+ */
17
+ export type PlantFilterValueI = string | string[] | number | boolean | RangeFilterValueI
18
+
19
+ /**
20
+ * Plant attributes for filtering
21
+ * Used in JSONB field and as query parameters
22
+ * Supports multiple value types for different filter types
23
+ */
24
+ /**
25
+ * A group of related attribute values, used for nested attribute objects.
26
+ * Ex: { growth: { type: 'déterminée' }}
27
+ */
28
+ export type PlantAttributeGroupI = Record<string, PlantFilterValueI>
29
+
30
+ /**
31
+ * Plant attributes for filtering
32
+ * Used in JSONB field and as query parameters
33
+ * Supports flat values and one level of nested groups.
34
+ */
35
+ export type PlantAttributesI = Record<string, PlantFilterValueI | PlantAttributeGroupI>
36
+
37
+ export interface PlantI {
38
+ id: number
39
+ name: string
40
+ slug: string
41
+ description: string
42
+ descriptionSource?: string
43
+ female: boolean
44
+ family?: string | null
45
+ isFamily: boolean
46
+ taxonFamilyId?: number | null
47
+ spaceBetweenSeedMin: number
48
+ spaceBetweenSeedMax: number
49
+ spaceBetweenAlleyMin: number
50
+ spaceBetweenAlleyMax: number
51
+ weeksInTransplant: number
52
+ weeksDuringWhichYouCanSeedOutdoor: number
53
+ weeksToMaturity: number
54
+ daysToMaturity: number | null
55
+ weeksToWaitAfterFreezingDate: number
56
+ weeksToHarvest: number
57
+ indoorSeeding: boolean
58
+ outdoorSeeding: boolean
59
+ azoteNeedsKgPerHa: number
60
+ hibernate: boolean
61
+ germinationTemperature: number | null
62
+ minGerminationTemperature: number | null
63
+ germinationNumberOfDays: string | null
64
+ germinationSeedDepth: string | null
65
+ cultivationInfo: string | null
66
+ parentId: number | null
67
+ memberId?: number
68
+ memberFirstName?: string | null
69
+ shared: boolean
70
+ hexColor: string | null
71
+ sunRequirements: 'partialShade' | 'fullSun' | 'fullShade' | null
72
+ isHardy: boolean | null
73
+ quantityForFiveInJardinVivrier?: number | null
74
+ imageURL: string
75
+ /**
76
+ * Filename of the plant's 3D mesh asset stored on S3.
77
+ * - Ideally a `.webp` file (e.g. `ail.webp`).
78
+ * - Stored in S3 under the `images/meshes/` folder.
79
+ * - By default named after the `Plant.slug` (e.g. `ail.webp` for the garlic plant).
80
+ * - Only the filename is persisted; the public URL is exposed through the
81
+ * virtual `meshURL` field.
82
+ */
83
+ meshFilename: string | null
84
+ /**
85
+ * Public ImageKit URL to the plant's 3D mesh asset.
86
+ * Virtual field computed from `meshFilename`. The underlying file is
87
+ * stored on S3 at `images/meshes/{meshFilename}` and rewritten to
88
+ * ImageKit for CDN delivery and transformations.
89
+ *
90
+ * Falls back to `imageURL` when `meshFilename` is not set.
91
+ *
92
+ * Example: `https://ik.imagekit.io/lamainverte/meshes/ail.webp`
93
+ */
94
+ meshURL: string
95
+ totalWeeksToMaturity: number
96
+ hasNoInformation: boolean
97
+ createdAt: Date
98
+ updatedAt: Date
99
+ translatedSunRequirements: 'Plein soleil' | 'Mi-ombre' | 'Ombre' | null
100
+ parent?: PlantI
101
+ children?: PlantI[]
102
+ PlantInventories?: PlantInventoryI[]
103
+ taggedItems?: TaggedItemI[]
104
+ /**
105
+ * List of selections that the plant is in.
106
+ * --------------------------------------
107
+ * Tends to be used for featured selections
108
+ */
109
+ Selections?: SelectionI[]
110
+ tasks?: TaskI[]
111
+ Images?: ImageI[]
112
+ Member?: Partial<MemberI>
113
+ notes?: NoteI[]
114
+ /**
115
+ * Nitrogen-derived rotation group enum (virtual field on the Plant model).
116
+ * Source of truth for rotation classification — derived from
117
+ * `azoteNeedsKgPerHa` plus the regenerative override on `taxonFamily`.
118
+ */
119
+ rotationGroup?: RotationGroup | null
120
+ /**
121
+ * French label of `rotationGroup`, ready for display.
122
+ */
123
+ translatedRotationGroup?: string | null
124
+ taxonFamily?: TaxonFamilyI
125
+ seedingInfo: SeedingInfoI
126
+ /**
127
+ * Contextual search text for recommended plants
128
+ * Provides additional context when suggesting plants for specific garden zones
129
+ */
130
+ contextualSearchText?: string
131
+ }
132
+
133
+ interface PlantInventoryI {
134
+ id: number
135
+ plantId: number
136
+ supplierName: string
137
+ plantName: string
138
+ supplierURL: string
139
+ imageLocation: string
140
+ description: string
141
+ inStock: boolean
142
+ }
143
+
144
+ export type AvailableGrowingConditionsI = Record<string, string[]>
145
+
146
+ /**
147
+ * For each attribute filter key (e.g. "fruit.color"), the list of values that
148
+ * still yield at least one match under the current search + active filters.
149
+ * Consumed by the frontend to mark filter tags as "unavailable".
150
+ */
151
+ export type AvailableAttributesI = Record<string, string[]>
152
+
153
+ /**
154
+ * Which filter surface the frontend should render for the current search.
155
+ * - `specific`: family-specific filters (e.g. tomate attributes)
156
+ * - `general`: global growing-conditions filters
157
+ *
158
+ * Mutually exclusive by design — the two sets never appear together.
159
+ */
160
+ export type PlantFiltersModeI = 'specific' | 'general'
161
+
162
+ /**
163
+ * Backend-driven description of the filter UI for a given search response.
164
+ * The frontend is a dumb renderer: it shows the filters listed here with the
165
+ * given mode and marks tags whose value is not in `availability` as unavailable.
166
+ */
167
+ export interface PlantFiltersUII {
168
+ mode: PlantFiltersModeI
169
+ filters: PlantFilterI[]
170
+ availability: Record<string, string[]>
171
+ }
172
+
173
+ export interface GrowingConditionsConfigI {
174
+ filters: PlantFilterI[]
175
+ }
176
+
177
+ export interface GrowingConditionsFiltersI {
178
+ sunRequirements?: 'partialShade' | 'fullShade'
179
+ rotationGroup?: 'regenerative' | 'demanding' | 'moderately_demanding' | 'less_demanding'
180
+ }
181
+
182
+ export interface PlantSearchResultI {
183
+ plants: PlantModelI[]
184
+ selections: SelectionModelI[]
185
+ total?: number
186
+ familyName?: string
187
+ filtersUI?: PlantFiltersUII
188
+ }
189
+
190
+ /**
191
+ * Response shape for `GET /selections/:slug/gardenZones/:id/rotation-suggestions`.
192
+ * - `advice`: short user-facing sentence explaining the recommendation
193
+ * - `Plants`: parent plants matching the recommended rotation group, with
194
+ * the avoided taxon families excluded. Empty when the zone has no usable
195
+ * history yet.
196
+ */
197
+ export interface PlantRotationSuggestionsI {
198
+ targetYear: number
199
+ advice: string
200
+ Plants: PlantI[]
201
+ }
@@ -113,10 +113,28 @@ export namespace USERS {
113
113
  gardenZoneTimelessPreference?: boolean
114
114
  /** Newsletter consent set from the in-app prompt. true = opt in, false = refused. */
115
115
  marketingConsent?: boolean
116
+ language?: string
116
117
  }
117
118
  }
118
119
  export type Response = PrivateMemberI
119
120
  }
121
+ export namespace EMAIL {
122
+ /** PUT /users/email — request a primary email change (step 1 of 2). */
123
+ export interface Request {
124
+ headers: RequestHeaders
125
+ body: {
126
+ /** The address the member wants to switch their account to. */
127
+ newEmail: string
128
+ }
129
+ }
130
+ export interface Response {
131
+ success: boolean
132
+ message?: string
133
+ suggestion?: string
134
+ error_message?: string
135
+ error_suggestion?: string
136
+ }
137
+ }
120
138
  export namespace GIFT_CARDS {
121
139
  export namespace REDEEM {
122
140
  export interface Request {
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Live weather conditions for the member's garden location.
3
+ * Powers the garden map weather badge and the real-time rain animation.
4
+ *
5
+ * Types are exported at the module top level (no nested namespace) so the
6
+ * `API.WEATHER` alias in index.ts resolves to `API.WEATHER.CurrentWeatherI`.
7
+ */
8
+ export interface CurrentWeatherI {
9
+ tempC: number
10
+ feelsLikeC: number
11
+ /** True when WeatherAPI reports daylight at the location. */
12
+ isDay: boolean
13
+ conditionText: string | null
14
+ /** WeatherAPI condition code — see https://www.weatherapi.com/docs/weather_conditions.json */
15
+ conditionCode: number | null
16
+ iconUrl: string | null
17
+ /** True when the current condition is rain/drizzle — drives the garden map rain animation. */
18
+ isRaining: boolean
19
+ isSnowing: boolean
20
+ /** Precipitation over the last hour, in millimeters. */
21
+ precipMm: number
22
+ humidity: number
23
+ windKph: number
24
+ /** Cloud cover percentage (0–100). */
25
+ cloud: number
26
+ locationName: string
27
+ lastUpdatedAt: string
28
+ dataSource: 'weatherapi'
29
+ }
30
+
31
+ export interface CurrentWeatherResponseI {
32
+ /** Null when the member has no usable location or the upstream call failed. */
33
+ weather: CurrentWeatherI | null
34
+ }