@la-main-verte/shared-types 1.0.69 → 1.0.71

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,143 +1,143 @@
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
- export interface GardenZoneI {
59
- id: number
60
- name: string | null
61
- gardenMapId: number
62
- widthInMeters: number
63
- heightInMeters: number
64
- diameterInMeters: number
65
- shape: 'rectangle' | 'circle'
66
- xPosition: number
67
- yPosition: number
68
- zIndex: number
69
- order: number
70
- /**
71
- * When set, the zone is shown only for that year.
72
- * Null means the zone is timeless (visible for every year).
73
- */
74
- yearOfCulture: number | null
75
- totalSurfaceInSquareMeters: number
76
- totalSurfaceInSquareFeet: number
77
- backgroundColor: string
78
- createdAt: Date
79
- updatedAt: Date
80
- /**
81
- * When set, the garden zone is a subdivision of another garden zone
82
- * Parent zones are meant to be as eternal as possible.
83
- * Subdivisions are meant to be created and destroyed on a yearly basis.
84
- */
85
- parent_garden_zone_id: number
86
- /**
87
- * Virtual field to check if the garden zone is a subdivision
88
- * It is a renamed field from parent_garden_zone_id
89
- */
90
- is_subdivision: boolean
91
- has_subdivisions: boolean
92
- timeless: boolean
93
- /**
94
- * Orientation virtual field ONLY USE FOR RECTANGLES
95
- * --------------------------------
96
- * Disregard if the shape is a circle or square. It will return 'vertical'
97
- */
98
- orientation: 'horizontal' | 'vertical'
99
- /**
100
- * NOT USED BY THE FRONTEND YET - Use GardenZoneCulture instead
101
- */
102
- GardenZoneCultures?: GardenZoneCultureI[]
103
- /**
104
- * The culture on the GardenZone
105
- */
106
- GardenZoneCulture?: GardenZoneCultureI
107
- rotationSuggestion?: string
108
- }
109
-
110
- export interface GardenZoneCultureI {
111
- id: number
112
- gardenZoneId: number
113
- plantSelectionId: number
114
- seedQuantity: number
115
- densityMode: 'dense' | 'sparse' | 'custom'
116
- fertilizerId: number
117
- /**
118
- * The year of the culture - do not use it yet.
119
- * @deprecated Potentially a mistake to have this field here
120
- */
121
- yearOfCulture: number
122
- PlantSelection?: PlantSelectionI
123
- /**
124
- * The number of alleys
125
- * --------------------------------
126
- * Value is computed by the backend and NOT coming from the DB.
127
- */
128
- numberOfAlleys?: number
129
- /**
130
- * The number of seeds per alley
131
- * --------------------------------
132
- * Value is computed by the backend and NOT coming from the DB.
133
- */
134
- numberOfSeedsPerAlley?: number
135
- Fertilizer?: FertilizerI
136
- custom_space_between_seeds_in_cm?: number
137
- custom_space_between_alley_in_cm?: number
138
- }
139
-
140
- export type UpdateGardenZonePayload = Partial<GardenZoneI> &
141
- Partial<GardenZoneCultureI> & {
142
- targetNumberOfPlants?: number
143
- }
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
+ export interface GardenZoneI {
59
+ id: number
60
+ name: string | null
61
+ gardenMapId: number
62
+ widthInMeters: number
63
+ heightInMeters: number
64
+ diameterInMeters: number
65
+ shape: 'rectangle' | 'circle'
66
+ xPosition: number
67
+ yPosition: number
68
+ zIndex: number
69
+ order: number
70
+ /**
71
+ * When set, the zone is shown only for that year.
72
+ * Null means the zone is timeless (visible for every year).
73
+ */
74
+ yearOfCulture: number | null
75
+ totalSurfaceInSquareMeters: number
76
+ totalSurfaceInSquareFeet: number
77
+ backgroundColor: string
78
+ createdAt: Date
79
+ updatedAt: Date
80
+ /**
81
+ * When set, the garden zone is a subdivision of another garden zone
82
+ * Parent zones are meant to be as eternal as possible.
83
+ * Subdivisions are meant to be created and destroyed on a yearly basis.
84
+ */
85
+ parent_garden_zone_id: number
86
+ /**
87
+ * Virtual field to check if the garden zone is a subdivision
88
+ * It is a renamed field from parent_garden_zone_id
89
+ */
90
+ is_subdivision: boolean
91
+ has_subdivisions: boolean
92
+ timeless: boolean
93
+ /**
94
+ * Orientation virtual field ONLY USE FOR RECTANGLES
95
+ * --------------------------------
96
+ * Disregard if the shape is a circle or square. It will return 'vertical'
97
+ */
98
+ orientation: 'horizontal' | 'vertical'
99
+ /**
100
+ * NOT USED BY THE FRONTEND YET - Use GardenZoneCulture instead
101
+ */
102
+ GardenZoneCultures?: GardenZoneCultureI[]
103
+ /**
104
+ * The culture on the GardenZone
105
+ */
106
+ GardenZoneCulture?: GardenZoneCultureI
107
+ rotationSuggestion?: string
108
+ }
109
+
110
+ export interface GardenZoneCultureI {
111
+ id: number
112
+ gardenZoneId: number
113
+ plantSelectionId: number
114
+ seedQuantity: number
115
+ densityMode: 'dense' | 'sparse' | 'custom'
116
+ fertilizerId: number
117
+ /**
118
+ * The year of the culture - do not use it yet.
119
+ * @deprecated Potentially a mistake to have this field here
120
+ */
121
+ yearOfCulture: number
122
+ PlantSelection?: PlantSelectionI
123
+ /**
124
+ * The number of alleys
125
+ * --------------------------------
126
+ * Value is computed by the backend and NOT coming from the DB.
127
+ */
128
+ numberOfAlleys?: number
129
+ /**
130
+ * The number of seeds per alley
131
+ * --------------------------------
132
+ * Value is computed by the backend and NOT coming from the DB.
133
+ */
134
+ numberOfSeedsPerAlley?: number
135
+ Fertilizer?: FertilizerI
136
+ custom_space_between_seeds_in_cm?: number
137
+ custom_space_between_alley_in_cm?: number
138
+ }
139
+
140
+ export type UpdateGardenZonePayload = Partial<GardenZoneI> &
141
+ Partial<GardenZoneCultureI> & {
142
+ targetNumberOfPlants?: number
143
+ }
@@ -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
+ }
@@ -0,0 +1,7 @@
1
+ import type { HOME } from './home.api'
2
+
3
+ export namespace GARDEN_ZONE_BLUEPRINT {
4
+ export interface Response {
5
+ sections: HOME.SectionI[]
6
+ }
7
+ }
package/src/home.api.d.ts CHANGED
@@ -38,6 +38,7 @@ export namespace HOME {
38
38
  days: WeatherDayI[]
39
39
  lastUpdatedAt: string
40
40
  dataSource: 'weatherapi'
41
+ backgroundColor?: string
41
42
  }
42
43
 
43
44
  export interface HeaderSectionI {
@@ -47,6 +48,7 @@ export namespace HOME {
47
48
  }
48
49
 
49
50
  export interface AdviceI {
51
+ id?: string | number
50
52
  title: string
51
53
  markdownContent: string
52
54
  titleColor?: string
@@ -66,6 +68,7 @@ export namespace HOME {
66
68
  }
67
69
 
68
70
  export interface WideCardItemI {
71
+ id?: string | number
69
72
  title?: string | null
70
73
  text: string
71
74
  badgeText?: string | null
@@ -229,6 +232,8 @@ export namespace HOME {
229
232
 
230
233
  export interface Response {
231
234
  sections: SectionI[]
235
+ weather?: WeatherSectionI
236
+ advice?: AdviceSectionI
232
237
  }
233
238
 
234
239
  export interface HeroCardItemI {
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
+ }
package/src/index.ts CHANGED
@@ -1,30 +1,30 @@
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
-
23
- // Allow access to the API namespaces without conflicts
24
- export namespace API {
25
- export import PLANTS = PlantsAPI
26
- export import USERS = UsersAPI
27
- export import SESSIONS = SessionsAPI
28
- export import HOME = HomeAPI
29
- export import PAGES = PagesAPI
30
- }
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
+
23
+ // Allow access to the API namespaces without conflicts
24
+ export namespace API {
25
+ export import PLANTS = PlantsAPI
26
+ export import USERS = UsersAPI
27
+ export import SESSIONS = SessionsAPI
28
+ export import HOME = HomeAPI
29
+ export import PAGES = PagesAPI
30
+ }
package/src/member.d.ts CHANGED
@@ -27,9 +27,14 @@ export interface MemberI {
27
27
  hasAnActiveSubscription?: boolean
28
28
  /**
29
29
  * Acts as a one-way not identifiable token.
30
- * Crisp and other services may use this token to identify the user
30
+ * Crisp uses this token to identify the user conversation
31
31
  */
32
32
  userToken: string
33
+ /**
34
+ * HMAC signature used by Crisp identity verification.
35
+ * Signed on the backend from the user email.
36
+ */
37
+ crispUserEmailSignature?: string
33
38
  /**
34
39
  * neverAddedATask <=> Has the use ever open the task form?
35
40
  * Yes it is misleading, ticket is open to change it.
package/src/note.d.ts CHANGED
@@ -1,30 +1,30 @@
1
- import { ImageI } from './image.d.ts'
2
- import { TaggedItemI } from './taggedItem.d.ts'
3
- import { MemberI } from './member.d.ts'
4
-
5
- export interface NoteI {
6
- id: number
7
- memberId: number
8
- title: string
9
- contentInMarkdown: string
10
- color?: string
11
- agreedToShare: boolean
12
- createdAt: Date
13
- updatedAt: Date
14
- /**
15
- * Virtual field for the note thumbnail imageURL (absolute path) */
16
- imageURL?: string
17
- /**
18
- * Virtual field indicating if the note content is short
19
- * Used to alter the design of the note (likely with ContentInMarkdown replacing the title)
20
- * */
21
- hasShortContent?: boolean
22
- /**
23
- * Virtual field for the note sharing URL (relative path) */
24
- sharingURL: string
25
- darkColor: string
26
- pastelColor: string
27
- Images: ImageI[]
28
- TaggedItems: TaggedItemI[]
29
- Member?: MemberI
30
- }
1
+ import { ImageI } from './image.d.ts'
2
+ import { TaggedItemI } from './taggedItem.d.ts'
3
+ import { MemberI } from './member.d.ts'
4
+
5
+ export interface NoteI {
6
+ id: number
7
+ memberId: number
8
+ title: string
9
+ contentInMarkdown: string
10
+ color?: string
11
+ agreedToShare: boolean
12
+ createdAt: Date
13
+ updatedAt: Date
14
+ /**
15
+ * Virtual field for the note thumbnail imageURL (absolute path) */
16
+ imageURL?: string
17
+ /**
18
+ * Virtual field indicating if the note content is short
19
+ * Used to alter the design of the note (likely with ContentInMarkdown replacing the title)
20
+ * */
21
+ hasShortContent?: boolean
22
+ /**
23
+ * Virtual field for the note sharing URL (relative path) */
24
+ sharingURL: string
25
+ darkColor: string
26
+ pastelColor: string
27
+ Images: ImageI[]
28
+ TaggedItems: TaggedItemI[]
29
+ Member?: MemberI
30
+ }