@la-main-verte/shared-types 1.0.29 → 1.0.32

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@la-main-verte/shared-types",
3
- "version": "1.0.29",
3
+ "version": "1.0.32",
4
4
  "description": "Shared TypeScript interfaces for frontend of la-main-verte app",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
package/src/plant.d.ts CHANGED
@@ -40,7 +40,12 @@ export interface PlantI {
40
40
  children?: PlantI[]
41
41
  PlantInventories?: PlantInventoryI[]
42
42
  taggedItems?: TaggedItemI[]
43
- tags?: PlantTagI[]
43
+ /**
44
+ * List of selections that the plant is in.
45
+ * --------------------------------------
46
+ * Tends to be used for featured selections
47
+ */
48
+ Selections?: SelectionI[]
44
49
  tasks?: TaskI[]
45
50
  }
46
51
 
@@ -1,7 +1,8 @@
1
1
  import { PlantI, PlantTagI } from './plant.d'
2
+ import { SelectionI } from './selection.d'
2
3
 
3
- interface PlantDataWithTagsI extends PlantI {
4
- tags: PlantTagI[]
4
+ interface PlantExtendedDataI extends PlantI {
5
+ Selections: SelectionI[]
5
6
  }
6
7
 
7
8
  export namespace API.Plants {
@@ -18,6 +19,29 @@ export namespace API.Plants {
18
19
  /**
19
20
  * Response containing recommended plants with their tags
20
21
  */
21
- export type Response = readonly PlantDataWithTagsI[]
22
+ export type Response = readonly PlantExtendedDataI[]
23
+ }
24
+ export namespace Search {
25
+ /**
26
+ * Request parameters for plant recommendations
27
+ * @remarks identification by session token is optional
28
+ */
29
+ export interface Request {
30
+ headers?: {
31
+ 'x-session-token'?: string
32
+ }
33
+ query?: {
34
+ withAzoteNeedsKgPerHa?: boolean
35
+ withSpacing?: boolean
36
+ parentsOnly?: boolean
37
+ search?: string
38
+ family?: string
39
+ limit?: number
40
+ }
41
+ }
42
+ /**
43
+ * Response containing search plants with their tags
44
+ */
45
+ export type Response = readonly PlantExtendedDataI[]
22
46
  }
23
47
  }
@@ -11,6 +11,18 @@ export interface SelectionI {
11
11
  imageURL?: string
12
12
  featured: boolean
13
13
  isDynamic: boolean
14
+ /**
15
+ * Background color of the selection, for UI purposes.
16
+ */
17
+ backgroundColor: string | null
18
+ /**
19
+ * Font color of the selection, for UI purposes.
20
+ */
21
+ fontColor: string | null
22
+ /**
23
+ * Icon name of the selection, for UI purposes.
24
+ */
25
+ iconName: string | null
14
26
  link?: string
15
27
  sharingURL?: string
16
28
  createdAt: Date