@la-main-verte/shared-types 1.0.76 → 1.0.77
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/package.json +1 -1
- package/src/gardenMap.d.ts +214 -213
- package/src/gardenOverview.d.ts +87 -79
- package/src/index.ts +32 -32
- package/src/payments.api.d.ts +17 -17
- package/src/plant.d.ts +13 -0
package/package.json
CHANGED
package/src/gardenMap.d.ts
CHANGED
|
@@ -1,213 +1,214 @@
|
|
|
1
|
-
import type { FertilizerI } from './fertilizer'
|
|
2
|
-
import type { PlantSelectionI } from './plantSelection'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Viewport corners with x/y coordinates
|
|
6
|
-
* Used by front-end to describe the visible area of the map
|
|
7
|
-
*/
|
|
8
|
-
export interface ViewportCornersI {
|
|
9
|
-
topLeft: { x: number; y: number } | null
|
|
10
|
-
topRight: { x: number; y: number } | null
|
|
11
|
-
bottomLeft: { x: number; y: number } | null
|
|
12
|
-
bottomRight: { x: number; y: number } | null
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Viewport as min/max boundaries
|
|
17
|
-
* Used by back-end placement logic for collision detection
|
|
18
|
-
*/
|
|
19
|
-
export interface ViewportBoundariesI {
|
|
20
|
-
minX: number
|
|
21
|
-
minY: number
|
|
22
|
-
maxX: number
|
|
23
|
-
maxY: number
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Available garden map categories across the platform
|
|
28
|
-
*/
|
|
29
|
-
export type GardenMapCategory =
|
|
30
|
-
| 'community_garden'
|
|
31
|
-
| 'greenhouse'
|
|
32
|
-
| 'garden'
|
|
33
|
-
| 'recipe'
|
|
34
|
-
| 'favorites'
|
|
35
|
-
| 'indoor_garden'
|
|
36
|
-
| 'balcony'
|
|
37
|
-
| 'inventory'
|
|
38
|
-
| 'others'
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* A gardenMap is a collection of garden zones
|
|
42
|
-
*/
|
|
43
|
-
export interface GardenMapI {
|
|
44
|
-
id: number
|
|
45
|
-
name: string
|
|
46
|
-
icon_name: string
|
|
47
|
-
category: GardenMapCategory
|
|
48
|
-
default: boolean
|
|
49
|
-
memberId: number
|
|
50
|
-
width_in_units: number
|
|
51
|
-
height_in_units: number
|
|
52
|
-
createdAt: string
|
|
53
|
-
Selections: SelectionI[]
|
|
54
|
-
GardenZones: GardenZoneI[]
|
|
55
|
-
imageURL: string
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Legacy shape values accepted by the v1 route
|
|
60
|
-
* (`POST /selections/:slug/gardenMap/gardenZone`).
|
|
61
|
-
* This legacy param must remain rectangle/circle only.
|
|
62
|
-
*/
|
|
63
|
-
export type GardenZoneLegacyShape = 'rectangle' | 'circle'
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Visual shape identifier stored in `geometry.properties.shape`.
|
|
67
|
-
*/
|
|
68
|
-
export type GardenZoneShape = 'rectangle' | 'circle' | 'polygon'
|
|
69
|
-
|
|
70
|
-
export type GardenZoneCategory = 'cultural' | 'decorative'
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Inner GeoJSON Polygon geometry (coordinates ring).
|
|
74
|
-
*/
|
|
75
|
-
export interface GeoJSONPolygon {
|
|
76
|
-
type: 'Polygon'
|
|
77
|
-
coordinates: number[][][]
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Properties stored alongside the GeoJSON Feature.
|
|
82
|
-
* `shape` is the canonical shape identifier.
|
|
83
|
-
* Shape-specific fields (center, radius, radiusX, radiusY) describe the parametric definition.
|
|
84
|
-
* `rotation` (degrees, clockwise) and `cornerRadius` (cm) follow GeoJSON/MapBox conventions.
|
|
85
|
-
* `svgPath` holds the editable SVG path string for Bézier polygon rendering.
|
|
86
|
-
*/
|
|
87
|
-
export interface GeoJSONFeatureProperties {
|
|
88
|
-
shape: GardenZoneShape
|
|
89
|
-
/** Rotation in degrees, clockwise. GeoJSON convention name. */
|
|
90
|
-
rotation?: number
|
|
91
|
-
/** Corner radius in cm. MapBox convention name. */
|
|
92
|
-
cornerRadius?: number
|
|
93
|
-
/** SVG path string with Bézier curves for polygon rendering. */
|
|
94
|
-
svgPath?: string
|
|
95
|
-
/** Center point [x, y] in cm for circle/ellipse shapes. */
|
|
96
|
-
center?: [number, number]
|
|
97
|
-
/** Radius in cm for circle shapes. */
|
|
98
|
-
radius?: number
|
|
99
|
-
/** Horizontal radius in cm for ellipse shapes. */
|
|
100
|
-
radiusX?: number
|
|
101
|
-
/** Vertical radius in cm for ellipse shapes. */
|
|
102
|
-
radiusY?: number
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* GeoJSON Feature wrapping a Polygon geometry with shape properties.
|
|
107
|
-
* This is the canonical storage format for all garden zone geometries.
|
|
108
|
-
*
|
|
109
|
-
* - `properties` holds the parametric definition (shape, rotation, radii, svgPath)
|
|
110
|
-
* - `geometry` holds the computed polygon coordinates for calculations
|
|
111
|
-
*
|
|
112
|
-
* GeoJSON is the truth (for logic), SVG is the projection (for display and editing).
|
|
113
|
-
*/
|
|
114
|
-
export interface GeoJSONFeature {
|
|
115
|
-
type: 'Feature'
|
|
116
|
-
properties: GeoJSONFeatureProperties
|
|
117
|
-
geometry: GeoJSONPolygon
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export interface GardenZoneI {
|
|
121
|
-
id: number
|
|
122
|
-
name: string | null
|
|
123
|
-
gardenMapId: number
|
|
124
|
-
widthInMeters: number
|
|
125
|
-
heightInMeters: number
|
|
126
|
-
diameterInMeters: number
|
|
127
|
-
shape: GardenZoneShape
|
|
128
|
-
/**
|
|
129
|
-
* Virtual field — the actual visual shape derived from geometry.properties.shape,
|
|
130
|
-
* falling back to the DB shape column for legacy zones.
|
|
131
|
-
*/
|
|
132
|
-
geometryShape: GardenZoneShape
|
|
133
|
-
geometry?: GeoJSONFeature | null
|
|
134
|
-
category: GardenZoneCategory
|
|
135
|
-
backgroundImage: string | null
|
|
136
|
-
xPosition: number
|
|
137
|
-
yPosition: number
|
|
138
|
-
zIndex: number
|
|
139
|
-
order: number
|
|
140
|
-
/**
|
|
141
|
-
* When set, the zone is shown only for that year.
|
|
142
|
-
* Null means the zone is timeless (visible for every year).
|
|
143
|
-
*/
|
|
144
|
-
yearOfCulture: number | null
|
|
145
|
-
totalSurfaceInSquareMeters: number
|
|
146
|
-
totalSurfaceInSquareFeet: number
|
|
147
|
-
backgroundColor: string
|
|
148
|
-
createdAt: Date
|
|
149
|
-
updatedAt: Date
|
|
150
|
-
/**
|
|
151
|
-
* When set, the garden zone is a subdivision of another garden zone
|
|
152
|
-
* Parent zones are meant to be as eternal as possible.
|
|
153
|
-
* Subdivisions are meant to be created and destroyed on a yearly basis.
|
|
154
|
-
*/
|
|
155
|
-
parent_garden_zone_id: number
|
|
156
|
-
/**
|
|
157
|
-
* Virtual field to check if the garden zone is a subdivision
|
|
158
|
-
* It is a renamed field from parent_garden_zone_id
|
|
159
|
-
*/
|
|
160
|
-
is_subdivision: boolean
|
|
161
|
-
has_subdivisions: boolean
|
|
162
|
-
timeless: boolean
|
|
163
|
-
/**
|
|
164
|
-
* Orientation virtual field ONLY USE FOR RECTANGLES
|
|
165
|
-
* --------------------------------
|
|
166
|
-
* Disregard if the shape is a circle or square. It will return 'vertical'
|
|
167
|
-
*/
|
|
168
|
-
orientation: 'horizontal' | 'vertical'
|
|
169
|
-
/**
|
|
170
|
-
* NOT USED BY THE FRONTEND YET - Use GardenZoneCulture instead
|
|
171
|
-
*/
|
|
172
|
-
GardenZoneCultures?: GardenZoneCultureI[]
|
|
173
|
-
/**
|
|
174
|
-
* The culture on the GardenZone
|
|
175
|
-
*/
|
|
176
|
-
GardenZoneCulture?: GardenZoneCultureI
|
|
177
|
-
rotationSuggestion?: string
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
*
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
1
|
+
import type { FertilizerI } from './fertilizer'
|
|
2
|
+
import type { PlantSelectionI } from './plantSelection'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Viewport corners with x/y coordinates
|
|
6
|
+
* Used by front-end to describe the visible area of the map
|
|
7
|
+
*/
|
|
8
|
+
export interface ViewportCornersI {
|
|
9
|
+
topLeft: { x: number; y: number } | null
|
|
10
|
+
topRight: { x: number; y: number } | null
|
|
11
|
+
bottomLeft: { x: number; y: number } | null
|
|
12
|
+
bottomRight: { x: number; y: number } | null
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Viewport as min/max boundaries
|
|
17
|
+
* Used by back-end placement logic for collision detection
|
|
18
|
+
*/
|
|
19
|
+
export interface ViewportBoundariesI {
|
|
20
|
+
minX: number
|
|
21
|
+
minY: number
|
|
22
|
+
maxX: number
|
|
23
|
+
maxY: number
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Available garden map categories across the platform
|
|
28
|
+
*/
|
|
29
|
+
export type GardenMapCategory =
|
|
30
|
+
| 'community_garden'
|
|
31
|
+
| 'greenhouse'
|
|
32
|
+
| 'garden'
|
|
33
|
+
| 'recipe'
|
|
34
|
+
| 'favorites'
|
|
35
|
+
| 'indoor_garden'
|
|
36
|
+
| 'balcony'
|
|
37
|
+
| 'inventory'
|
|
38
|
+
| 'others'
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A gardenMap is a collection of garden zones
|
|
42
|
+
*/
|
|
43
|
+
export interface GardenMapI {
|
|
44
|
+
id: number
|
|
45
|
+
name: string
|
|
46
|
+
icon_name: string
|
|
47
|
+
category: GardenMapCategory
|
|
48
|
+
default: boolean
|
|
49
|
+
memberId: number
|
|
50
|
+
width_in_units: number
|
|
51
|
+
height_in_units: number
|
|
52
|
+
createdAt: string
|
|
53
|
+
Selections: SelectionI[]
|
|
54
|
+
GardenZones: GardenZoneI[]
|
|
55
|
+
imageURL: string
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Legacy shape values accepted by the v1 route
|
|
60
|
+
* (`POST /selections/:slug/gardenMap/gardenZone`).
|
|
61
|
+
* This legacy param must remain rectangle/circle only.
|
|
62
|
+
*/
|
|
63
|
+
export type GardenZoneLegacyShape = 'rectangle' | 'circle'
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Visual shape identifier stored in `geometry.properties.shape`.
|
|
67
|
+
*/
|
|
68
|
+
export type GardenZoneShape = 'rectangle' | 'circle' | 'polygon'
|
|
69
|
+
|
|
70
|
+
export type GardenZoneCategory = 'cultural' | 'decorative'
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Inner GeoJSON Polygon geometry (coordinates ring).
|
|
74
|
+
*/
|
|
75
|
+
export interface GeoJSONPolygon {
|
|
76
|
+
type: 'Polygon'
|
|
77
|
+
coordinates: number[][][]
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Properties stored alongside the GeoJSON Feature.
|
|
82
|
+
* `shape` is the canonical shape identifier.
|
|
83
|
+
* Shape-specific fields (center, radius, radiusX, radiusY) describe the parametric definition.
|
|
84
|
+
* `rotation` (degrees, clockwise) and `cornerRadius` (cm) follow GeoJSON/MapBox conventions.
|
|
85
|
+
* `svgPath` holds the editable SVG path string for Bézier polygon rendering.
|
|
86
|
+
*/
|
|
87
|
+
export interface GeoJSONFeatureProperties {
|
|
88
|
+
shape: GardenZoneShape
|
|
89
|
+
/** Rotation in degrees, clockwise. GeoJSON convention name. */
|
|
90
|
+
rotation?: number
|
|
91
|
+
/** Corner radius in cm. MapBox convention name. */
|
|
92
|
+
cornerRadius?: number
|
|
93
|
+
/** SVG path string with Bézier curves for polygon rendering. */
|
|
94
|
+
svgPath?: string
|
|
95
|
+
/** Center point [x, y] in cm for circle/ellipse shapes. */
|
|
96
|
+
center?: [number, number]
|
|
97
|
+
/** Radius in cm for circle shapes. */
|
|
98
|
+
radius?: number
|
|
99
|
+
/** Horizontal radius in cm for ellipse shapes. */
|
|
100
|
+
radiusX?: number
|
|
101
|
+
/** Vertical radius in cm for ellipse shapes. */
|
|
102
|
+
radiusY?: number
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* GeoJSON Feature wrapping a Polygon geometry with shape properties.
|
|
107
|
+
* This is the canonical storage format for all garden zone geometries.
|
|
108
|
+
*
|
|
109
|
+
* - `properties` holds the parametric definition (shape, rotation, radii, svgPath)
|
|
110
|
+
* - `geometry` holds the computed polygon coordinates for calculations
|
|
111
|
+
*
|
|
112
|
+
* GeoJSON is the truth (for logic), SVG is the projection (for display and editing).
|
|
113
|
+
*/
|
|
114
|
+
export interface GeoJSONFeature {
|
|
115
|
+
type: 'Feature'
|
|
116
|
+
properties: GeoJSONFeatureProperties
|
|
117
|
+
geometry: GeoJSONPolygon
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface GardenZoneI {
|
|
121
|
+
id: number
|
|
122
|
+
name: string | null
|
|
123
|
+
gardenMapId: number
|
|
124
|
+
widthInMeters: number
|
|
125
|
+
heightInMeters: number
|
|
126
|
+
diameterInMeters: number
|
|
127
|
+
shape: GardenZoneShape
|
|
128
|
+
/**
|
|
129
|
+
* Virtual field — the actual visual shape derived from geometry.properties.shape,
|
|
130
|
+
* falling back to the DB shape column for legacy zones.
|
|
131
|
+
*/
|
|
132
|
+
geometryShape: GardenZoneShape
|
|
133
|
+
geometry?: GeoJSONFeature | null
|
|
134
|
+
category: GardenZoneCategory
|
|
135
|
+
backgroundImage: string | null
|
|
136
|
+
xPosition: number
|
|
137
|
+
yPosition: number
|
|
138
|
+
zIndex: number
|
|
139
|
+
order: number
|
|
140
|
+
/**
|
|
141
|
+
* When set, the zone is shown only for that year.
|
|
142
|
+
* Null means the zone is timeless (visible for every year).
|
|
143
|
+
*/
|
|
144
|
+
yearOfCulture: number | null
|
|
145
|
+
totalSurfaceInSquareMeters: number
|
|
146
|
+
totalSurfaceInSquareFeet: number
|
|
147
|
+
backgroundColor: string
|
|
148
|
+
createdAt: Date
|
|
149
|
+
updatedAt: Date
|
|
150
|
+
/**
|
|
151
|
+
* When set, the garden zone is a subdivision of another garden zone
|
|
152
|
+
* Parent zones are meant to be as eternal as possible.
|
|
153
|
+
* Subdivisions are meant to be created and destroyed on a yearly basis.
|
|
154
|
+
*/
|
|
155
|
+
parent_garden_zone_id: number
|
|
156
|
+
/**
|
|
157
|
+
* Virtual field to check if the garden zone is a subdivision
|
|
158
|
+
* It is a renamed field from parent_garden_zone_id
|
|
159
|
+
*/
|
|
160
|
+
is_subdivision: boolean
|
|
161
|
+
has_subdivisions: boolean
|
|
162
|
+
timeless: boolean
|
|
163
|
+
/**
|
|
164
|
+
* Orientation virtual field ONLY USE FOR RECTANGLES
|
|
165
|
+
* --------------------------------
|
|
166
|
+
* Disregard if the shape is a circle or square. It will return 'vertical'
|
|
167
|
+
*/
|
|
168
|
+
orientation: 'horizontal' | 'vertical'
|
|
169
|
+
/**
|
|
170
|
+
* NOT USED BY THE FRONTEND YET - Use GardenZoneCulture instead
|
|
171
|
+
*/
|
|
172
|
+
GardenZoneCultures?: GardenZoneCultureI[]
|
|
173
|
+
/**
|
|
174
|
+
* The culture on the GardenZone
|
|
175
|
+
*/
|
|
176
|
+
GardenZoneCulture?: GardenZoneCultureI
|
|
177
|
+
rotationSuggestion?: string
|
|
178
|
+
category?: 'cultural' | 'decorative' | null
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export interface GardenZoneCultureI {
|
|
182
|
+
id: number
|
|
183
|
+
gardenZoneId: number
|
|
184
|
+
plantSelectionId: number
|
|
185
|
+
seedQuantity: number
|
|
186
|
+
densityMode: 'dense' | 'sparse' | 'custom'
|
|
187
|
+
fertilizerId: number
|
|
188
|
+
/**
|
|
189
|
+
* The year of the culture - do not use it yet.
|
|
190
|
+
* @deprecated Potentially a mistake to have this field here
|
|
191
|
+
*/
|
|
192
|
+
yearOfCulture: number
|
|
193
|
+
PlantSelection?: PlantSelectionI
|
|
194
|
+
/**
|
|
195
|
+
* The number of alleys
|
|
196
|
+
* --------------------------------
|
|
197
|
+
* Value is computed by the backend and NOT coming from the DB.
|
|
198
|
+
*/
|
|
199
|
+
numberOfAlleys?: number
|
|
200
|
+
/**
|
|
201
|
+
* The number of seeds per alley
|
|
202
|
+
* --------------------------------
|
|
203
|
+
* Value is computed by the backend and NOT coming from the DB.
|
|
204
|
+
*/
|
|
205
|
+
numberOfSeedsPerAlley?: number
|
|
206
|
+
Fertilizer?: FertilizerI
|
|
207
|
+
custom_space_between_seeds_in_cm?: number
|
|
208
|
+
custom_space_between_alley_in_cm?: number
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export type UpdateGardenZonePayload = Partial<GardenZoneI> &
|
|
212
|
+
Partial<GardenZoneCultureI> & {
|
|
213
|
+
targetNumberOfPlants?: number
|
|
214
|
+
}
|
package/src/gardenOverview.d.ts
CHANGED
|
@@ -1,79 +1,87 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Garden Overview Types
|
|
3
|
-
* Represents the detailed overview of a garden selection
|
|
4
|
-
*/
|
|
5
|
-
import { PlantI } from './plant'
|
|
6
|
-
|
|
7
|
-
export interface GardenOverviewI {
|
|
8
|
-
id: number
|
|
9
|
-
title: string
|
|
10
|
-
iconName: string
|
|
11
|
-
yearOfCulture: number
|
|
12
|
-
statistics: GardenOverviewStatsI
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface GardenOverviewStatsI {
|
|
16
|
-
totalSeeds: number
|
|
17
|
-
totalSurface: string
|
|
18
|
-
totalSurfaceWithoutCulture: string
|
|
19
|
-
surfaceComparisonMessage: string | null
|
|
20
|
-
familyDistribution: FamilyStatsI[]
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Garden Overview Types
|
|
3
|
+
* Represents the detailed overview of a garden selection
|
|
4
|
+
*/
|
|
5
|
+
import { PlantI } from './plant'
|
|
6
|
+
|
|
7
|
+
export interface GardenOverviewI {
|
|
8
|
+
id: number
|
|
9
|
+
title: string
|
|
10
|
+
iconName: string
|
|
11
|
+
yearOfCulture: number
|
|
12
|
+
statistics: GardenOverviewStatsI
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface GardenOverviewStatsI {
|
|
16
|
+
totalSeeds: number
|
|
17
|
+
totalSurface: string
|
|
18
|
+
totalSurfaceWithoutCulture: string
|
|
19
|
+
surfaceComparisonMessage: string | null
|
|
20
|
+
familyDistribution: FamilyStatsI[]
|
|
21
|
+
jardinVivrierComparison: GardenOverviewJardinVivrierFamilyStatsI[]
|
|
22
|
+
fertilization: FertilizationStatsI
|
|
23
|
+
zones: GardenOverviewZoneStatsI[]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface FertilizationStatsI {
|
|
27
|
+
totalWeightInKg: number
|
|
28
|
+
weightComparisonMessage: string | null
|
|
29
|
+
fertilizerDetails: FertilizerStatsI[]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface FertilizerStatsI {
|
|
33
|
+
fertilizerName: string
|
|
34
|
+
fertilizerQuantity: string
|
|
35
|
+
imageURL: string
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface FamilyStatsI {
|
|
39
|
+
family: string
|
|
40
|
+
hexColor: string
|
|
41
|
+
totalSeeds: number
|
|
42
|
+
totalSurface: string
|
|
43
|
+
percentage: number
|
|
44
|
+
plants: GardenOverviewPlantStatsI[]
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface GardenOverviewJardinVivrierFamilyStatsI {
|
|
48
|
+
family: string
|
|
49
|
+
parentImageURL: string | null
|
|
50
|
+
cultivatedQuantity: number
|
|
51
|
+
suggestedQuantityForFiveInJardinVivrier: number | null
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Extended PlantI with overview-specific statistics
|
|
56
|
+
* Contains the full plant data plus surface, seedQuantity, and position
|
|
57
|
+
*/
|
|
58
|
+
export interface GardenOverviewPlantStatsI extends PlantI {
|
|
59
|
+
seedQuantity: number
|
|
60
|
+
surface: string
|
|
61
|
+
position: number
|
|
62
|
+
densityMode: string
|
|
63
|
+
fertilizerName: string
|
|
64
|
+
fertilizerQuantity: string
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface GardenOverviewZonePlantStatsI {
|
|
68
|
+
id: number
|
|
69
|
+
name: string
|
|
70
|
+
imageURL: string | null
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface GardenOverviewZoneFertilizerStatsI {
|
|
74
|
+
name: string
|
|
75
|
+
quantity: string
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface GardenOverviewZoneStatsI {
|
|
79
|
+
id: number
|
|
80
|
+
name: string
|
|
81
|
+
totalSeeds: number
|
|
82
|
+
surface: string
|
|
83
|
+
fertilizerQuantity: string
|
|
84
|
+
thumbnailURL: string
|
|
85
|
+
plants: GardenOverviewZonePlantStatsI[]
|
|
86
|
+
fertilizers: GardenOverviewZoneFertilizerStatsI[]
|
|
87
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
export * from './member'
|
|
2
|
-
export * from './selection'
|
|
3
|
-
export * from './plantSelection'
|
|
4
|
-
export * from './plant'
|
|
5
|
-
export * from './task'
|
|
6
|
-
export * from './calendarView'
|
|
7
|
-
export * from './apiError'
|
|
8
|
-
export * from './gardenMap'
|
|
9
|
-
export * from './gardenOverview'
|
|
10
|
-
export * from './alert'
|
|
11
|
-
export * from './image'
|
|
12
|
-
export * from './note'
|
|
13
|
-
export * from './taggedItem'
|
|
14
|
-
export * from './fertilizer'
|
|
15
|
-
export * from './utmParams'
|
|
16
|
-
export * from './plantFilters'
|
|
17
|
-
import * as PlantsAPI from './plants.api'
|
|
18
|
-
import * as UsersAPI from './users.api'
|
|
19
|
-
import * as SessionsAPI from './sessions.api'
|
|
20
|
-
import * as HomeAPI from './home.api'
|
|
21
|
-
import * as PagesAPI from './pages.api'
|
|
22
|
-
import * as PaymentsAPI from './payments.api'
|
|
23
|
-
|
|
24
|
-
// Allow access to the API namespaces without conflicts
|
|
25
|
-
export namespace API {
|
|
26
|
-
export import PLANTS = PlantsAPI
|
|
27
|
-
export import USERS = UsersAPI
|
|
28
|
-
export import SESSIONS = SessionsAPI
|
|
29
|
-
export import HOME = HomeAPI
|
|
30
|
-
export import PAGES = PagesAPI
|
|
31
|
-
export import PAYMENTS = PaymentsAPI
|
|
32
|
-
}
|
|
1
|
+
export * from './member'
|
|
2
|
+
export * from './selection'
|
|
3
|
+
export * from './plantSelection'
|
|
4
|
+
export * from './plant'
|
|
5
|
+
export * from './task'
|
|
6
|
+
export * from './calendarView'
|
|
7
|
+
export * from './apiError'
|
|
8
|
+
export * from './gardenMap'
|
|
9
|
+
export * from './gardenOverview'
|
|
10
|
+
export * from './alert'
|
|
11
|
+
export * from './image'
|
|
12
|
+
export * from './note'
|
|
13
|
+
export * from './taggedItem'
|
|
14
|
+
export * from './fertilizer'
|
|
15
|
+
export * from './utmParams'
|
|
16
|
+
export * from './plantFilters'
|
|
17
|
+
import * as PlantsAPI from './plants.api'
|
|
18
|
+
import * as UsersAPI from './users.api'
|
|
19
|
+
import * as SessionsAPI from './sessions.api'
|
|
20
|
+
import * as HomeAPI from './home.api'
|
|
21
|
+
import * as PagesAPI from './pages.api'
|
|
22
|
+
import * as PaymentsAPI from './payments.api'
|
|
23
|
+
|
|
24
|
+
// Allow access to the API namespaces without conflicts
|
|
25
|
+
export namespace API {
|
|
26
|
+
export import PLANTS = PlantsAPI
|
|
27
|
+
export import USERS = UsersAPI
|
|
28
|
+
export import SESSIONS = SessionsAPI
|
|
29
|
+
export import HOME = HomeAPI
|
|
30
|
+
export import PAGES = PagesAPI
|
|
31
|
+
export import PAYMENTS = PaymentsAPI
|
|
32
|
+
}
|
package/src/payments.api.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export namespace PAYMENTS {
|
|
2
|
-
export namespace GET {
|
|
3
|
-
export interface Request {
|
|
4
|
-
params: {
|
|
5
|
-
checkoutSessionId: string
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface Response {
|
|
10
|
-
amount: number
|
|
11
|
-
category: 'Analysis' | 'Subscription'
|
|
12
|
-
email: string
|
|
13
|
-
member_id: number | null
|
|
14
|
-
productType: 'analysis' | 'monthlySubscription' | 'yearlySubscription' | 'fiveYearLicense' | null
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
1
|
+
export namespace PAYMENTS {
|
|
2
|
+
export namespace GET {
|
|
3
|
+
export interface Request {
|
|
4
|
+
params: {
|
|
5
|
+
checkoutSessionId: string
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface Response {
|
|
10
|
+
amount: number
|
|
11
|
+
category: 'Analysis' | 'Subscription'
|
|
12
|
+
email: string
|
|
13
|
+
member_id: number | null
|
|
14
|
+
productType: 'analysis' | 'monthlySubscription' | 'yearlySubscription' | 'fiveYearLicense' | null
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
package/src/plant.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TaxonFamilyI } from './taxonFamily'
|
|
2
2
|
import type { SeedingInfoI } from './pages.api'
|
|
3
|
+
import type { PlantFilterI } from './plantFilters'
|
|
3
4
|
/**
|
|
4
5
|
* Range filter value for min/max filters
|
|
5
6
|
*/
|
|
@@ -56,6 +57,7 @@ export interface PlantI {
|
|
|
56
57
|
hexColor: string | null
|
|
57
58
|
sunRequirements: 'partialShade' | 'fullSun' | 'fullShade' | null
|
|
58
59
|
isHardy: boolean | null
|
|
60
|
+
quantityForFiveInJardinVivrier?: number | null
|
|
59
61
|
imageURL: string
|
|
60
62
|
totalWeeksToMaturity: number
|
|
61
63
|
hasNoInformation: boolean
|
|
@@ -99,6 +101,17 @@ interface PlantInventoryI {
|
|
|
99
101
|
inStock: boolean
|
|
100
102
|
}
|
|
101
103
|
|
|
104
|
+
export type AvailableGrowingConditionsI = Record<string, string[]>
|
|
105
|
+
|
|
106
|
+
export interface GrowingConditionsConfigI {
|
|
107
|
+
filters: PlantFilterI[]
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface GrowingConditionsFiltersI {
|
|
111
|
+
sunRequirements?: 'partialShade' | 'fullShade'
|
|
112
|
+
rotationGroup?: 'regenerative' | 'demanding' | 'moderately_demanding' | 'less_demanding'
|
|
113
|
+
}
|
|
114
|
+
|
|
102
115
|
export interface PlantSearchResultI {
|
|
103
116
|
plants: PlantModelI[]
|
|
104
117
|
selections: SelectionModelI[]
|