@la-main-verte/shared-types 1.0.56 → 1.0.57

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.
@@ -1,90 +1,90 @@
1
- /**
2
- * A gardenMap is a collection of garden zones
3
- */
4
- export interface GardenMapI {
5
- id: number;
6
- name: string;
7
- icon_name: string;
8
- category?: string;
9
- default: boolean;
10
- width_in_units: number;
11
- height_in_units: number;
12
- createdAt: string;
13
- Selections: SelectionI[];
14
- GardenZones: GardenZoneI[]
15
- imageUrl: string;
16
- }
17
-
18
- export interface GardenZoneI {
19
- id: number
20
- name: string | null
21
- gardenMapId: number
22
- widthInMeters: number
23
- heightInMeters: number
24
- diameterInMeters: number
25
- shape: 'rectangle' | 'circle'
26
- xPosition: number
27
- yPosition: number
28
- zIndex: number
29
- order: number
30
- totalSurfaceInSquareMeters: number
31
- totalSurfaceInSquareFeet: number
32
- backgroundColor: string
33
- createdAt: Date
34
- updatedAt: Date
35
- /**
36
- * When set, the garden zone is a subdivision of another garden zone
37
- * Parent zones are meant to be as eternal as possible.
38
- * Subdivisions are meant to be created and destroyed on a yearly basis.
39
- */
40
- parent_garden_zone_id: number
41
- /**
42
- * Virtual field to check if the garden zone is a subdivision
43
- * It is a renamed field from parent_garden_zone_id
44
- */
45
- is_subdivision: boolean
46
- has_subdivisions: boolean
47
- /**
48
- * Orientation virtual field ONLY USE FOR RECTANGLES
49
- * --------------------------------
50
- * Disregard if the shape is a circle or square. It will return 'vertical'
51
- */
52
- orientation: 'horizontal' | 'vertical'
53
- /**
54
- * NOT USED BY THE FRONTEND YET - Use GardenZoneCulture instead
55
- */
56
- GardenZoneCultures?: GardenZoneCultureI[]
57
- /**
58
- * The culture on the GardenZone
59
- */
60
- GardenZoneCulture?: GardenZoneCultureI
61
- }
62
-
63
- export interface GardenZoneCultureI {
64
- id: number
65
- gardenZoneId: number
66
- plantSelectionId: number
67
- seedQuantity: number
68
- densityMode: 'dense' | 'sparse' | 'custom'
69
- fertilizerId: number
70
- /**
71
- * The year of the culture - do not use it yet.
72
- * @deprecated Potentially a mistake to have this field here
73
- */
74
- yearOfCulture: number
75
- PlantSelection?: PlantSelectionI
76
- /**
77
- * The number of alleys
78
- * --------------------------------
79
- * Value is computed by the backend and NOT coming from the DB.
80
- */
81
- numberOfAlleys?: number
82
- /**
83
- * The number of seeds per alley
84
- * --------------------------------
85
- * Value is computed by the backend and NOT coming from the DB.
86
- */
87
- numberOfSeedsPerAlley?: number
88
- fertilizerQuantitySuggested?: string
89
- Fertilizer?: FertilizerI
90
- }
1
+ /**
2
+ * A gardenMap is a collection of garden zones
3
+ */
4
+ export interface GardenMapI {
5
+ id: number
6
+ name: string
7
+ icon_name: string
8
+ category?: string
9
+ default: boolean
10
+ width_in_units: number
11
+ height_in_units: number
12
+ createdAt: string
13
+ Selections: SelectionI[]
14
+ GardenZones: GardenZoneI[]
15
+ imageURL: string
16
+ }
17
+
18
+ export interface GardenZoneI {
19
+ id: number
20
+ name: string | null
21
+ gardenMapId: number
22
+ widthInMeters: number
23
+ heightInMeters: number
24
+ diameterInMeters: number
25
+ shape: 'rectangle' | 'circle'
26
+ xPosition: number
27
+ yPosition: number
28
+ zIndex: number
29
+ order: number
30
+ totalSurfaceInSquareMeters: number
31
+ totalSurfaceInSquareFeet: number
32
+ backgroundColor: string
33
+ createdAt: Date
34
+ updatedAt: Date
35
+ /**
36
+ * When set, the garden zone is a subdivision of another garden zone
37
+ * Parent zones are meant to be as eternal as possible.
38
+ * Subdivisions are meant to be created and destroyed on a yearly basis.
39
+ */
40
+ parent_garden_zone_id: number
41
+ /**
42
+ * Virtual field to check if the garden zone is a subdivision
43
+ * It is a renamed field from parent_garden_zone_id
44
+ */
45
+ is_subdivision: boolean
46
+ has_subdivisions: boolean
47
+ /**
48
+ * Orientation virtual field ONLY USE FOR RECTANGLES
49
+ * --------------------------------
50
+ * Disregard if the shape is a circle or square. It will return 'vertical'
51
+ */
52
+ orientation: 'horizontal' | 'vertical'
53
+ /**
54
+ * NOT USED BY THE FRONTEND YET - Use GardenZoneCulture instead
55
+ */
56
+ GardenZoneCultures?: GardenZoneCultureI[]
57
+ /**
58
+ * The culture on the GardenZone
59
+ */
60
+ GardenZoneCulture?: GardenZoneCultureI
61
+ }
62
+
63
+ export interface GardenZoneCultureI {
64
+ id: number
65
+ gardenZoneId: number
66
+ plantSelectionId: number
67
+ seedQuantity: number
68
+ densityMode: 'dense' | 'sparse' | 'custom'
69
+ fertilizerId: number
70
+ /**
71
+ * The year of the culture - do not use it yet.
72
+ * @deprecated Potentially a mistake to have this field here
73
+ */
74
+ yearOfCulture: number
75
+ PlantSelection?: PlantSelectionI
76
+ /**
77
+ * The number of alleys
78
+ * --------------------------------
79
+ * Value is computed by the backend and NOT coming from the DB.
80
+ */
81
+ numberOfAlleys?: number
82
+ /**
83
+ * The number of seeds per alley
84
+ * --------------------------------
85
+ * Value is computed by the backend and NOT coming from the DB.
86
+ */
87
+ numberOfSeedsPerAlley?: number
88
+ fertilizerQuantitySuggested?: string
89
+ Fertilizer?: FertilizerI
90
+ }
@@ -1,79 +1,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
- fertilization: FertilizationStatsI
22
- zones: GardenOverviewZoneStatsI[]
23
- }
24
-
25
- export interface FertilizationStatsI {
26
- totalWeightInKg: number
27
- weightComparisonMessage: string | null
28
- fertilizerDetails: FertilizerStatsI[]
29
- }
30
-
31
- export interface FertilizerStatsI {
32
- fertilizerName: string
33
- fertilizerQuantity: string
34
- imageURL: string
35
- }
36
-
37
- export interface FamilyStatsI {
38
- family: string
39
- hexColor: string
40
- totalSeeds: number
41
- totalSurface: string
42
- percentage: number
43
- plants: GardenOverviewPlantStatsI[]
44
- }
45
-
46
- /**
47
- * Extended PlantI with overview-specific statistics
48
- * Contains the full plant data plus surface, seedQuantity, and position
49
- */
50
- export interface GardenOverviewPlantStatsI extends PlantI {
51
- seedQuantity: number
52
- surface: string
53
- position: number
54
- densityMode: string
55
- fertilizerName: string
56
- fertilizerQuantity: string
57
- }
58
-
59
- export interface GardenOverviewZonePlantStatsI {
60
- id: number
61
- name: string
62
- imageURL: string | null
63
- }
64
-
65
- export interface GardenOverviewZoneFertilizerStatsI {
66
- name: string
67
- quantity: string
68
- }
69
-
70
- export interface GardenOverviewZoneStatsI {
71
- id: number
72
- name: string
73
- totalSeeds: number
74
- surface: string
75
- fertilizerQuantity: string
76
- thumbnailURL: string
77
- plants: GardenOverviewZonePlantStatsI[]
78
- fertilizers: GardenOverviewZoneFertilizerStatsI[]
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
+ fertilization: FertilizationStatsI
22
+ zones: GardenOverviewZoneStatsI[]
23
+ }
24
+
25
+ export interface FertilizationStatsI {
26
+ totalWeightInKg: number
27
+ weightComparisonMessage: string | null
28
+ fertilizerDetails: FertilizerStatsI[]
29
+ }
30
+
31
+ export interface FertilizerStatsI {
32
+ fertilizerName: string
33
+ fertilizerQuantity: string
34
+ imageURL: string
35
+ }
36
+
37
+ export interface FamilyStatsI {
38
+ family: string
39
+ hexColor: string
40
+ totalSeeds: number
41
+ totalSurface: string
42
+ percentage: number
43
+ plants: GardenOverviewPlantStatsI[]
44
+ }
45
+
46
+ /**
47
+ * Extended PlantI with overview-specific statistics
48
+ * Contains the full plant data plus surface, seedQuantity, and position
49
+ */
50
+ export interface GardenOverviewPlantStatsI extends PlantI {
51
+ seedQuantity: number
52
+ surface: string
53
+ position: number
54
+ densityMode: string
55
+ fertilizerName: string
56
+ fertilizerQuantity: string
57
+ }
58
+
59
+ export interface GardenOverviewZonePlantStatsI {
60
+ id: number
61
+ name: string
62
+ imageURL: string | null
63
+ }
64
+
65
+ export interface GardenOverviewZoneFertilizerStatsI {
66
+ name: string
67
+ quantity: string
68
+ }
69
+
70
+ export interface GardenOverviewZoneStatsI {
71
+ id: number
72
+ name: string
73
+ totalSeeds: number
74
+ surface: string
75
+ fertilizerQuantity: string
76
+ thumbnailURL: string
77
+ plants: GardenOverviewZonePlantStatsI[]
78
+ fertilizers: GardenOverviewZoneFertilizerStatsI[]
79
+ }
package/src/home.api.d.ts CHANGED
@@ -1,159 +1,159 @@
1
- import type { PlantI } from './plant'
2
- import type { SelectionI } from './selection'
3
-
4
- export namespace HOME {
5
- export type HeroCardMode = 'featuredSelection' | 'featuredPlant'
6
-
7
- export type SectionComponentType =
8
- | 'Header'
9
- | 'HeroCards'
10
- | 'PlantCarousel'
11
- | 'HeroCardsCarousel'
12
- | 'WideCardsCarousel'
13
- | 'Weather'
14
- | 'AdviceCarousel'
15
- | 'OnboardingCard'
16
-
17
- export type CarouselComponentType = Extract<
18
- SectionComponentType,
19
- 'PlantCarousel' | 'HeroCardsCarousel' | 'WideCardsCarousel'
20
- >
21
-
22
- export interface WeatherDayI {
23
- date: string
24
- minTempC: number
25
- maxTempC: number
26
- chanceOfRainPercentage: number | null
27
- iconUrl: string | null
28
- condition?: string | null
29
- }
30
-
31
- export interface WeatherSectionI {
32
- componentType: 'Weather'
33
- title: string
34
- subtitle?: string
35
- locationName: string
36
- timezone: string
37
- days: WeatherDayI[]
38
- lastUpdatedAt: string
39
- dataSource: 'weatherapi'
40
- }
41
-
42
- export interface HeaderSectionI {
43
- componentType: 'Header'
44
- title: string
45
- subtitle: string
46
- }
47
-
48
- export interface AdviceI {
49
- title: string
50
- markdownContent: string
51
- titleColor?: string
52
- backgroundColor?: string
53
- }
54
-
55
- export interface AdviceSectionI {
56
- componentType: 'AdviceCarousel'
57
- title?: string
58
- subtitle?: string
59
- advices: AdviceI[]
60
- }
61
-
62
- export interface WideCardAuthorI {
63
- name?: string | null
64
- imageURL?: string | null
65
- }
66
-
67
- export interface WideCardItemI {
68
- title?: string | null
69
- text: string
70
- badgeText?: string | null
71
- thumbnailImageURL: string
72
- author?: WideCardAuthorI | null
73
- link?: string | null
74
- metadata?: Record<string, unknown>
75
- }
76
-
77
- export interface WideCardsCarouselSectionI {
78
- componentType: 'WideCardsCarousel'
79
- title: string
80
- subtitle?: string
81
- cards: WideCardItemI[]
82
- }
83
-
84
- export interface HeroCardBlueprintI {
85
- mode: HeroCardMode
86
- title?: string | null
87
- description?: string | null
88
- backgroundColor?: string | null
89
- backgroundImageUrl?: string | null
90
- ctaLabel?: string | null
91
- previewPlants?: PlantI[]
92
- selection?: SelectionI | null
93
- plant?: PlantI | null
94
- }
95
-
96
- export interface HeroCardsSectionI {
97
- componentType: 'HeroCards'
98
- title?: string | null
99
- subtitle?: string | null
100
- cards: HeroCardBlueprintI[]
101
- }
102
-
103
- export interface PlantCarouselSectionI {
104
- componentType: 'PlantCarousel'
105
- title: string
106
- subtitle?: string
107
- selection: SelectionI
108
- displayRanking?: boolean
109
- }
110
-
111
- export interface HeroCardsCarouselSectionI {
112
- componentType: 'HeroCardsCarousel'
113
- selections: SelectionI[]
114
- }
115
-
116
- export interface FamilyRecommendationI {
117
- family: string
118
- headline: string
119
- plants: PlantI[]
120
- }
121
-
122
- export interface FamilyExplorerSectionI {
123
- componentType: 'FamilyExplorer'
124
- title: string
125
- subtitle?: string
126
- families: FamilyRecommendationI[]
127
- }
128
-
129
- export interface OnboardingStepI {
130
- id: string
131
- title: string
132
- description: string
133
- isCompleted: boolean
134
- ctaLink: string
135
- }
136
-
137
- export interface OnboardingCardSectionI {
138
- componentType: 'OnboardingCard'
139
- title: string
140
- subtitle: string
141
- steps: OnboardingStepI[]
142
- completedStepsCount: number
143
- totalStepsCount: number
144
- }
145
-
146
- export type SectionI =
147
- | HeaderSectionI
148
- | HeroCardsSectionI
149
- | PlantCarouselSectionI
150
- | HeroCardsCarouselSectionI
151
- | WideCardsCarouselSectionI
152
- | WeatherSectionI
153
- | AdviceSectionI
154
- | OnboardingCardSectionI
155
-
156
- export interface Response {
157
- sections: SectionI[]
158
- }
159
- }
1
+ import type { PlantI } from './plant'
2
+ import type { SelectionI } from './selection'
3
+
4
+ export namespace HOME {
5
+ export type HeroCardMode = 'featuredSelection' | 'featuredPlant'
6
+
7
+ export type SectionComponentType =
8
+ | 'Header'
9
+ | 'HeroCards'
10
+ | 'PlantCarousel'
11
+ | 'HeroCardsCarousel'
12
+ | 'WideCardsCarousel'
13
+ | 'Weather'
14
+ | 'AdviceCarousel'
15
+ | 'OnboardingCard'
16
+
17
+ export type CarouselComponentType = Extract<
18
+ SectionComponentType,
19
+ 'PlantCarousel' | 'HeroCardsCarousel' | 'WideCardsCarousel'
20
+ >
21
+
22
+ export interface WeatherDayI {
23
+ date: string
24
+ minTempC: number
25
+ maxTempC: number
26
+ chanceOfRainPercentage: number | null
27
+ iconUrl: string | null
28
+ condition?: string | null
29
+ }
30
+
31
+ export interface WeatherSectionI {
32
+ componentType: 'Weather'
33
+ title: string
34
+ subtitle?: string
35
+ locationName: string
36
+ timezone: string
37
+ days: WeatherDayI[]
38
+ lastUpdatedAt: string
39
+ dataSource: 'weatherapi'
40
+ }
41
+
42
+ export interface HeaderSectionI {
43
+ componentType: 'Header'
44
+ title: string
45
+ subtitle: string
46
+ }
47
+
48
+ export interface AdviceI {
49
+ title: string
50
+ markdownContent: string
51
+ titleColor?: string
52
+ backgroundColor?: string
53
+ }
54
+
55
+ export interface AdviceSectionI {
56
+ componentType: 'AdviceCarousel'
57
+ title?: string
58
+ subtitle?: string
59
+ advices: AdviceI[]
60
+ }
61
+
62
+ export interface WideCardAuthorI {
63
+ name?: string | null
64
+ imageURL?: string | null
65
+ }
66
+
67
+ export interface WideCardItemI {
68
+ title?: string | null
69
+ text: string
70
+ badgeText?: string | null
71
+ thumbnailImageURL: string
72
+ author?: WideCardAuthorI | null
73
+ link?: string | null
74
+ metadata?: Record<string, unknown>
75
+ }
76
+
77
+ export interface WideCardsCarouselSectionI {
78
+ componentType: 'WideCardsCarousel'
79
+ title: string
80
+ subtitle?: string
81
+ cards: WideCardItemI[]
82
+ }
83
+
84
+ export interface HeroCardBlueprintI {
85
+ mode: HeroCardMode
86
+ title?: string | null
87
+ description?: string | null
88
+ backgroundColor?: string | null
89
+ backgroundImageUrl?: string | null
90
+ ctaLabel?: string | null
91
+ previewPlants?: PlantI[]
92
+ selection?: SelectionI | null
93
+ plant?: PlantI | null
94
+ }
95
+
96
+ export interface HeroCardsSectionI {
97
+ componentType: 'HeroCards'
98
+ title?: string | null
99
+ subtitle?: string | null
100
+ cards: HeroCardBlueprintI[]
101
+ }
102
+
103
+ export interface PlantCarouselSectionI {
104
+ componentType: 'PlantCarousel'
105
+ title: string
106
+ subtitle?: string
107
+ selection: SelectionI
108
+ displayRanking?: boolean
109
+ }
110
+
111
+ export interface HeroCardsCarouselSectionI {
112
+ componentType: 'HeroCardsCarousel'
113
+ selections: SelectionI[]
114
+ }
115
+
116
+ export interface FamilyRecommendationI {
117
+ family: string
118
+ headline: string
119
+ plants: PlantI[]
120
+ }
121
+
122
+ export interface FamilyExplorerSectionI {
123
+ componentType: 'FamilyExplorer'
124
+ title: string
125
+ subtitle?: string
126
+ families: FamilyRecommendationI[]
127
+ }
128
+
129
+ export interface OnboardingStepI {
130
+ id: string
131
+ title: string
132
+ description: string
133
+ isCompleted: boolean
134
+ ctaLink: string
135
+ }
136
+
137
+ export interface OnboardingCardSectionI {
138
+ componentType: 'OnboardingCard'
139
+ title: string
140
+ subtitle: string
141
+ steps: OnboardingStepI[]
142
+ completedStepsCount: number
143
+ totalStepsCount: number
144
+ }
145
+
146
+ export type SectionI =
147
+ | HeaderSectionI
148
+ | HeroCardsSectionI
149
+ | PlantCarouselSectionI
150
+ | HeroCardsCarouselSectionI
151
+ | WideCardsCarouselSectionI
152
+ | WeatherSectionI
153
+ | AdviceSectionI
154
+ | OnboardingCardSectionI
155
+
156
+ export interface Response {
157
+ sections: SectionI[]
158
+ }
159
+ }
package/src/image.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export interface ImageI {
2
- id: number
3
- noteId: number
4
- s3Key: string
5
- s3Url: string
6
- filename: string
7
- imageURL: string
8
- createdAt: Date
9
- updatedAt: Date
10
- }
1
+ export interface ImageI {
2
+ id: number
3
+ noteId: number
4
+ s3Key: string
5
+ s3Url: string
6
+ filename: string
7
+ imageURL: string
8
+ createdAt: Date
9
+ updatedAt: Date
10
+ }