@la-main-verte/shared-types 1.0.56 → 1.0.58
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 +25 -10
- package/src/home.api.d.ts +1 -1
- package/src/index.ts +1 -0
- package/src/plant.d.ts +28 -15
- package/src/plantFilters.d.ts +19 -0
- package/src/plants.api.d.ts +12 -4
- package/src/rotationGroup.d.ts +3 -0
package/package.json
CHANGED
package/src/gardenMap.d.ts
CHANGED
|
@@ -1,18 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Available garden map categories across the platform
|
|
3
|
+
*/
|
|
4
|
+
export type GardenMapCategory =
|
|
5
|
+
| 'community_garden'
|
|
6
|
+
| 'greenhouse'
|
|
7
|
+
| 'garden'
|
|
8
|
+
| 'recipe'
|
|
9
|
+
| 'favorites'
|
|
10
|
+
| 'indoor_garden'
|
|
11
|
+
| 'balcony'
|
|
12
|
+
| 'inventory'
|
|
13
|
+
| 'others'
|
|
14
|
+
|
|
1
15
|
/**
|
|
2
16
|
* A gardenMap is a collection of garden zones
|
|
3
17
|
*/
|
|
4
18
|
export interface GardenMapI {
|
|
5
|
-
id: number
|
|
6
|
-
name: string
|
|
7
|
-
icon_name: string
|
|
8
|
-
category
|
|
9
|
-
default: boolean
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
id: number
|
|
20
|
+
name: string
|
|
21
|
+
icon_name: string
|
|
22
|
+
category: GardenMapCategory
|
|
23
|
+
default: boolean
|
|
24
|
+
memberId: number
|
|
25
|
+
width_in_units: number
|
|
26
|
+
height_in_units: number
|
|
27
|
+
createdAt: string
|
|
28
|
+
Selections: SelectionI[]
|
|
14
29
|
GardenZones: GardenZoneI[]
|
|
15
|
-
|
|
30
|
+
imageURL: string
|
|
16
31
|
}
|
|
17
32
|
|
|
18
33
|
export interface GardenZoneI {
|
package/src/home.api.d.ts
CHANGED
|
@@ -23,7 +23,6 @@ export namespace HOME {
|
|
|
23
23
|
date: string
|
|
24
24
|
minTempC: number
|
|
25
25
|
maxTempC: number
|
|
26
|
-
chanceOfRainPercentage: number | null
|
|
27
26
|
iconUrl: string | null
|
|
28
27
|
condition?: string | null
|
|
29
28
|
}
|
|
@@ -88,6 +87,7 @@ export namespace HOME {
|
|
|
88
87
|
backgroundColor?: string | null
|
|
89
88
|
backgroundImageUrl?: string | null
|
|
90
89
|
ctaLabel?: string | null
|
|
90
|
+
ctaRoute?: string | null
|
|
91
91
|
previewPlants?: PlantI[]
|
|
92
92
|
selection?: SelectionI | null
|
|
93
93
|
plant?: PlantI | null
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './note'
|
|
|
13
13
|
export * from './taggedItem'
|
|
14
14
|
export * from './fertilizer'
|
|
15
15
|
export * from './utmParams'
|
|
16
|
+
export * from './plantFilters'
|
|
16
17
|
import * as PlantsAPI from './plants.api'
|
|
17
18
|
import * as UsersAPI from './users.api'
|
|
18
19
|
import * as SessionsAPI from './sessions.api'
|
package/src/plant.d.ts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
import type { TaxonFamilyI } from './taxonFamily'
|
|
2
|
+
/**
|
|
3
|
+
* Plant filter value types
|
|
4
|
+
* Represents the possible values for a single filter
|
|
5
|
+
*/
|
|
6
|
+
export type PlantFilterValueI = string | string[] | number | boolean
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Plant attributes for filtering
|
|
10
|
+
* Used in JSONB field and as query parameters
|
|
11
|
+
* Supports multiple value types for different filter types
|
|
12
|
+
*/
|
|
13
|
+
export type PlantAttributesI = Record<string, PlantFilterValueI>
|
|
14
|
+
|
|
1
15
|
export interface PlantI {
|
|
2
16
|
id: number
|
|
3
17
|
name: string
|
|
@@ -6,6 +20,7 @@ export interface PlantI {
|
|
|
6
20
|
descriptionSource?: string
|
|
7
21
|
female: boolean
|
|
8
22
|
family?: string | null
|
|
23
|
+
taxonFamilyId?: number | null
|
|
9
24
|
spaceBetweenSeedMin: number
|
|
10
25
|
spaceBetweenSeedMax: number
|
|
11
26
|
spaceBetweenAlleyMin: number
|
|
@@ -49,28 +64,19 @@ export interface PlantI {
|
|
|
49
64
|
tasks?: TaskI[]
|
|
50
65
|
Images?: ImageI[]
|
|
51
66
|
notes?: NoteI[]
|
|
67
|
+
rotationGroup?: string
|
|
68
|
+
// @deprecate once v1.8.1 is fully adopted
|
|
52
69
|
rotationFamily?: string
|
|
70
|
+
taxonFamily?: TaxonFamilyI
|
|
53
71
|
}
|
|
54
72
|
|
|
55
73
|
interface PlantTagI {
|
|
56
74
|
name: string
|
|
57
75
|
/**
|
|
58
|
-
*
|
|
59
|
-
* Ex:
|
|
76
|
+
* JSONB field containing plant-specific attributes for filtering
|
|
77
|
+
* Ex: { growth: { type: 'déterminée' }, fruit: { color: 'rouge' } }
|
|
60
78
|
*/
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Background color of the tag
|
|
64
|
-
* Ex: #1B76E6
|
|
65
|
-
*/
|
|
66
|
-
backgroundColor: string
|
|
67
|
-
/**
|
|
68
|
-
* Font awesome Icon name
|
|
69
|
-
* Ex: 'tomato'
|
|
70
|
-
*/
|
|
71
|
-
iconName: string
|
|
72
|
-
/** Selection slug related to the tag */
|
|
73
|
-
slug: string
|
|
79
|
+
attributes?: PlantAttributesI
|
|
74
80
|
}
|
|
75
81
|
|
|
76
82
|
interface PlantInventoryI {
|
|
@@ -83,3 +89,10 @@ interface PlantInventoryI {
|
|
|
83
89
|
description: string
|
|
84
90
|
inStock: boolean
|
|
85
91
|
}
|
|
92
|
+
|
|
93
|
+
export interface PlantSearchResultI {
|
|
94
|
+
plants: PlantModelI[]
|
|
95
|
+
selections: SelectionModelI[]
|
|
96
|
+
total?: number
|
|
97
|
+
familyName?: string
|
|
98
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface PlantFiltersConfigI {
|
|
2
|
+
filters: PlantFilterI[]
|
|
3
|
+
helpText?: string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface PlantFilterI {
|
|
7
|
+
key: string // Path in the JSONB (ex: "growth.type")
|
|
8
|
+
label: string // Label to display
|
|
9
|
+
type: 'select' | 'multiselect' | 'boolean' | 'range'
|
|
10
|
+
isMain?: boolean // If true, displayed as button filter; if false/undefined, in modal
|
|
11
|
+
options?: FilterOptionI[] // For select/multiselect
|
|
12
|
+
min?: number // For range
|
|
13
|
+
max?: number // For range
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface FilterOptionI {
|
|
17
|
+
value: string
|
|
18
|
+
label: string
|
|
19
|
+
}
|
package/src/plants.api.d.ts
CHANGED
|
@@ -23,11 +23,15 @@ export namespace PLANTS {
|
|
|
23
23
|
headers?: {
|
|
24
24
|
'x-session-token'?: string
|
|
25
25
|
}
|
|
26
|
+
query?: {
|
|
27
|
+
gardenZoneId?: string | number
|
|
28
|
+
selectionSlug?: string
|
|
29
|
+
}
|
|
26
30
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export type Response =
|
|
31
|
+
export type RecommendedPlantI = PlantExtendedDataI & {
|
|
32
|
+
contextualSearchText?: string
|
|
33
|
+
}
|
|
34
|
+
export type Response = RecommendedPlantI[]
|
|
31
35
|
}
|
|
32
36
|
export namespace SEARCH {
|
|
33
37
|
/**
|
|
@@ -52,6 +56,10 @@ export namespace PLANTS {
|
|
|
52
56
|
* - Plant.contextualSearchText may be added to the results to provided additional contextual information to the search results (and therefore the member)
|
|
53
57
|
*/
|
|
54
58
|
gardenZoneId?: string | number
|
|
59
|
+
/**
|
|
60
|
+
* Slug of the selection currently being edited. Used to contextualize rotation insights for search results.
|
|
61
|
+
*/
|
|
62
|
+
selectionSlug?: string
|
|
55
63
|
}
|
|
56
64
|
}
|
|
57
65
|
/**
|