@la-main-verte/shared-types 1.0.57 → 1.0.59
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/README.md +26 -26
- package/package.json +16 -16
- package/src/alert.d.ts +124 -124
- package/src/apiError.d.ts +28 -28
- package/src/calendarView.d.ts +9 -9
- package/src/device.d.ts +52 -52
- package/src/fertilizer.d.ts +20 -20
- package/src/gardenMap.d.ts +105 -90
- package/src/gardenOverview.d.ts +79 -79
- package/src/home.api.d.ts +173 -159
- package/src/image.d.ts +10 -10
- package/src/index.ts +28 -27
- package/src/member.d.ts +61 -61
- package/src/note.d.ts +28 -28
- package/src/plant.d.ts +98 -85
- package/src/plantFilters.d.ts +19 -0
- package/src/plantSelection.d.ts +13 -13
- package/src/plants.api.d.ts +92 -84
- package/src/rotationGroup.d.ts +3 -0
- package/src/selection.d.ts +55 -55
- package/src/sessions.api.d.ts +134 -134
- package/src/taggedItem.d.ts +12 -12
- package/src/task.d.ts +40 -40
- package/src/users.api.d.ts +90 -90
- package/src/utmParams.d.ts +134 -134
- package/tsconfig.json +110 -110
package/src/plant.d.ts
CHANGED
|
@@ -1,85 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
+
|
|
15
|
+
export interface PlantI {
|
|
16
|
+
id: number
|
|
17
|
+
name: string
|
|
18
|
+
slug: string
|
|
19
|
+
description: string
|
|
20
|
+
descriptionSource?: string
|
|
21
|
+
female: boolean
|
|
22
|
+
family?: string | null
|
|
23
|
+
taxonFamilyId?: number | null
|
|
24
|
+
spaceBetweenSeedMin: number
|
|
25
|
+
spaceBetweenSeedMax: number
|
|
26
|
+
spaceBetweenAlleyMin: number
|
|
27
|
+
spaceBetweenAlleyMax: number
|
|
28
|
+
weeksInTransplant: number
|
|
29
|
+
weeksDuringWhichYouCanSeedOutdoor: number
|
|
30
|
+
weeksToMaturity: number
|
|
31
|
+
weeksToWaitAfterFreezingDate: number
|
|
32
|
+
weeksToHarvest: number
|
|
33
|
+
indoorSeeding: boolean
|
|
34
|
+
outdoorSeeding: boolean
|
|
35
|
+
azoteNeedsKgPerHa: number
|
|
36
|
+
hibernate: boolean
|
|
37
|
+
germinationTemperature: number | null
|
|
38
|
+
minGerminationTemperature: number | null
|
|
39
|
+
germinationNumberOfDays: string | null
|
|
40
|
+
germinationSeedDepth: string | null
|
|
41
|
+
cultivationInfo: string | null
|
|
42
|
+
parentId: number | null
|
|
43
|
+
memberId?: number
|
|
44
|
+
shared: boolean
|
|
45
|
+
hexColor: string | null
|
|
46
|
+
sunRequirements: 'partialShade' | 'fullSun' | 'fullShade' | null
|
|
47
|
+
isHardy: boolean | null
|
|
48
|
+
imageURL: string
|
|
49
|
+
totalWeeksToMaturity: number
|
|
50
|
+
hasNoInformation: boolean
|
|
51
|
+
createdAt: Date
|
|
52
|
+
updatedAt: Date
|
|
53
|
+
translatedSunRequirements: 'Plein soleil' | 'Mi-ombre' | 'Ombre' | null
|
|
54
|
+
parent?: PlantI
|
|
55
|
+
children?: PlantI[]
|
|
56
|
+
PlantInventories?: PlantInventoryI[]
|
|
57
|
+
taggedItems?: TaggedItemI[]
|
|
58
|
+
/**
|
|
59
|
+
* List of selections that the plant is in.
|
|
60
|
+
* --------------------------------------
|
|
61
|
+
* Tends to be used for featured selections
|
|
62
|
+
*/
|
|
63
|
+
Selections?: SelectionI[]
|
|
64
|
+
tasks?: TaskI[]
|
|
65
|
+
Images?: ImageI[]
|
|
66
|
+
notes?: NoteI[]
|
|
67
|
+
rotationGroup?: string
|
|
68
|
+
// @deprecate once v1.8.1 is fully adopted
|
|
69
|
+
rotationFamily?: string
|
|
70
|
+
taxonFamily?: TaxonFamilyI
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
interface PlantTagI {
|
|
74
|
+
name: string
|
|
75
|
+
/**
|
|
76
|
+
* JSONB field containing plant-specific attributes for filtering
|
|
77
|
+
* Ex: { growth: { type: 'déterminée' }, fruit: { color: 'rouge' } }
|
|
78
|
+
*/
|
|
79
|
+
attributes?: PlantAttributesI
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
interface PlantInventoryI {
|
|
83
|
+
id: number
|
|
84
|
+
plantId: number
|
|
85
|
+
supplierName: string
|
|
86
|
+
plantName: string
|
|
87
|
+
supplierURL: string
|
|
88
|
+
imageLocation: string
|
|
89
|
+
description: string
|
|
90
|
+
inStock: boolean
|
|
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/plantSelection.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { PlantI } from './plant.d.ts'
|
|
2
|
-
import { SelectionI } from './selection.d.ts'
|
|
3
|
-
|
|
4
|
-
export interface PlantSelectionI {
|
|
5
|
-
id: number
|
|
6
|
-
plantId: number
|
|
7
|
-
selectionId: number
|
|
8
|
-
seedQuantity: number
|
|
9
|
-
createdAt: Date
|
|
10
|
-
updatedAt: Date
|
|
11
|
-
Plant: PlantI
|
|
12
|
-
Selection: SelectionI
|
|
13
|
-
}
|
|
1
|
+
import { PlantI } from './plant.d.ts'
|
|
2
|
+
import { SelectionI } from './selection.d.ts'
|
|
3
|
+
|
|
4
|
+
export interface PlantSelectionI {
|
|
5
|
+
id: number
|
|
6
|
+
plantId: number
|
|
7
|
+
selectionId: number
|
|
8
|
+
seedQuantity: number
|
|
9
|
+
createdAt: Date
|
|
10
|
+
updatedAt: Date
|
|
11
|
+
Plant: PlantI
|
|
12
|
+
Selection: SelectionI
|
|
13
|
+
}
|
package/src/plants.api.d.ts
CHANGED
|
@@ -1,84 +1,92 @@
|
|
|
1
|
-
import { PlantI } from './plant.d'
|
|
2
|
-
import { SelectionI } from './selection.d'
|
|
3
|
-
import { ImageDataI } from './image.d'
|
|
4
|
-
|
|
5
|
-
interface PlantExtendedDataI extends PlantI {
|
|
6
|
-
/**
|
|
7
|
-
* Future plant images gallery for now using notes as a proxy
|
|
8
|
-
*/
|
|
9
|
-
Images: ImageDataI[]
|
|
10
|
-
/**
|
|
11
|
-
* Selections of the plant
|
|
12
|
-
*/
|
|
13
|
-
Selections: SelectionI[]
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export namespace PLANTS {
|
|
17
|
-
export namespace RECOMMENDATIONS {
|
|
18
|
-
/**
|
|
19
|
-
* Request parameters for plant recommendations
|
|
20
|
-
* @remarks identification by session token is optional
|
|
21
|
-
*/
|
|
22
|
-
export interface Request {
|
|
23
|
-
headers?: {
|
|
24
|
-
'x-session-token'?: string
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
1
|
+
import { PlantI } from './plant.d'
|
|
2
|
+
import { SelectionI } from './selection.d'
|
|
3
|
+
import { ImageDataI } from './image.d'
|
|
4
|
+
|
|
5
|
+
interface PlantExtendedDataI extends PlantI {
|
|
6
|
+
/**
|
|
7
|
+
* Future plant images gallery for now using notes as a proxy
|
|
8
|
+
*/
|
|
9
|
+
Images: ImageDataI[]
|
|
10
|
+
/**
|
|
11
|
+
* Selections of the plant
|
|
12
|
+
*/
|
|
13
|
+
Selections: SelectionI[]
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export namespace PLANTS {
|
|
17
|
+
export namespace RECOMMENDATIONS {
|
|
18
|
+
/**
|
|
19
|
+
* Request parameters for plant recommendations
|
|
20
|
+
* @remarks identification by session token is optional
|
|
21
|
+
*/
|
|
22
|
+
export interface Request {
|
|
23
|
+
headers?: {
|
|
24
|
+
'x-session-token'?: string
|
|
25
|
+
}
|
|
26
|
+
query?: {
|
|
27
|
+
gardenZoneId?: string | number
|
|
28
|
+
selectionSlug?: string
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export type RecommendedPlantI = PlantExtendedDataI & {
|
|
32
|
+
contextualSearchText?: string
|
|
33
|
+
}
|
|
34
|
+
export type Response = RecommendedPlantI[]
|
|
35
|
+
}
|
|
36
|
+
export namespace SEARCH {
|
|
37
|
+
/**
|
|
38
|
+
* Request parameters for plant recommendations
|
|
39
|
+
* @remarks identification by session token is optional
|
|
40
|
+
*/
|
|
41
|
+
export interface Request {
|
|
42
|
+
headers?: {
|
|
43
|
+
'x-session-token'?: string
|
|
44
|
+
}
|
|
45
|
+
query?: {
|
|
46
|
+
withAzoteNeedsKgPerHa?: boolean
|
|
47
|
+
withSpacing?: boolean
|
|
48
|
+
parentsOnly?: boolean
|
|
49
|
+
search?: string
|
|
50
|
+
family?: string
|
|
51
|
+
limit?: number
|
|
52
|
+
/**
|
|
53
|
+
* If submitted, it means we are searching for plants that can be planted in the given garden zone.
|
|
54
|
+
* It almost means:
|
|
55
|
+
* - withSpacing will be set to true automatically.
|
|
56
|
+
* - Plant.contextualSearchText may be added to the results to provided additional contextual information to the search results (and therefore the member)
|
|
57
|
+
*/
|
|
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
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Response containing search plants with their tags
|
|
67
|
+
*/
|
|
68
|
+
export type Response = PlantExtendedDataI[]
|
|
69
|
+
}
|
|
70
|
+
export namespace UPDATE {
|
|
71
|
+
export interface Request {
|
|
72
|
+
params: {
|
|
73
|
+
slug: string
|
|
74
|
+
}
|
|
75
|
+
body: {
|
|
76
|
+
name?: string
|
|
77
|
+
description?: string
|
|
78
|
+
shared?: boolean
|
|
79
|
+
spaceBetweenSeedMin?: number | null
|
|
80
|
+
spaceBetweenSeedMax?: number | null
|
|
81
|
+
spaceBetweenAlleyMin?: number | null
|
|
82
|
+
spaceBetweenAlleyMax?: number | null
|
|
83
|
+
weeksToMaturity?: number | null
|
|
84
|
+
indoorSeeding?: boolean
|
|
85
|
+
outdoorSeeding?: boolean
|
|
86
|
+
sunRequirements?: 'partialShade' | 'fullSun' | 'fullShade' | null
|
|
87
|
+
isHardy?: boolean | null
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
export type Response = PlantI
|
|
91
|
+
}
|
|
92
|
+
}
|
package/src/selection.d.ts
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { PlantI } from './plant'
|
|
2
|
-
|
|
3
|
-
export interface SelectionI {
|
|
4
|
-
id: number
|
|
5
|
-
memberId: number
|
|
6
|
-
title: string
|
|
7
|
-
slug: string
|
|
8
|
-
description?: string
|
|
9
|
-
orderBy?: 'startDate' | 'name'
|
|
10
|
-
default?: boolean
|
|
11
|
-
viewsCount?: number
|
|
12
|
-
imageLocation?: string
|
|
13
|
-
imageURL?: string
|
|
14
|
-
/**
|
|
15
|
-
* Indicates if the selection is featured on the app (search, explore, etc).
|
|
16
|
-
**/
|
|
17
|
-
featured: boolean
|
|
18
|
-
/**
|
|
19
|
-
* Indicates if the selection is dynamically generated on the fly by the API.
|
|
20
|
-
* Ex: "What you can seed in March"
|
|
21
|
-
* INTERNAL USE ONLY
|
|
22
|
-
*/
|
|
23
|
-
isDynamic: boolean
|
|
24
|
-
/**
|
|
25
|
-
* Background color of the selection, for UI purposes.
|
|
26
|
-
*/
|
|
27
|
-
backgroundColor: string | null
|
|
28
|
-
/**
|
|
29
|
-
* Font color of the selection, for UI purposes.
|
|
30
|
-
*/
|
|
31
|
-
fontColor: string | null
|
|
32
|
-
/**
|
|
33
|
-
* Font awesome icon name of the selection, for UI purposes.
|
|
34
|
-
* -----------------------------------------
|
|
35
|
-
* Not all icons are available in the react-native-app. Must be explicitly declared first.
|
|
36
|
-
* Ex: 'fa-bag-seedling', 'fa-bug', etc.
|
|
37
|
-
*/
|
|
38
|
-
iconName: string | null
|
|
39
|
-
link?: string
|
|
40
|
-
sharingURL?: string
|
|
41
|
-
createdAt: Date
|
|
42
|
-
updatedAt: Date
|
|
43
|
-
Plants?: PlantI[]
|
|
44
|
-
yearOfCulture: number
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Those are the different possible types for a selection.
|
|
49
|
-
*/
|
|
50
|
-
export type SelectionType = 'Serre' | 'Potager' | 'Recette' | 'Coup de coeur' | "Jardin d'intérieur" | 'Autres'
|
|
51
|
-
|
|
52
|
-
export interface SelectionTypeI {
|
|
53
|
-
name: SelectionType
|
|
54
|
-
iconName?: IconName
|
|
55
|
-
}
|
|
1
|
+
import { PlantI } from './plant'
|
|
2
|
+
|
|
3
|
+
export interface SelectionI {
|
|
4
|
+
id: number
|
|
5
|
+
memberId: number
|
|
6
|
+
title: string
|
|
7
|
+
slug: string
|
|
8
|
+
description?: string
|
|
9
|
+
orderBy?: 'startDate' | 'name'
|
|
10
|
+
default?: boolean
|
|
11
|
+
viewsCount?: number
|
|
12
|
+
imageLocation?: string
|
|
13
|
+
imageURL?: string
|
|
14
|
+
/**
|
|
15
|
+
* Indicates if the selection is featured on the app (search, explore, etc).
|
|
16
|
+
**/
|
|
17
|
+
featured: boolean
|
|
18
|
+
/**
|
|
19
|
+
* Indicates if the selection is dynamically generated on the fly by the API.
|
|
20
|
+
* Ex: "What you can seed in March"
|
|
21
|
+
* INTERNAL USE ONLY
|
|
22
|
+
*/
|
|
23
|
+
isDynamic: boolean
|
|
24
|
+
/**
|
|
25
|
+
* Background color of the selection, for UI purposes.
|
|
26
|
+
*/
|
|
27
|
+
backgroundColor: string | null
|
|
28
|
+
/**
|
|
29
|
+
* Font color of the selection, for UI purposes.
|
|
30
|
+
*/
|
|
31
|
+
fontColor: string | null
|
|
32
|
+
/**
|
|
33
|
+
* Font awesome icon name of the selection, for UI purposes.
|
|
34
|
+
* -----------------------------------------
|
|
35
|
+
* Not all icons are available in the react-native-app. Must be explicitly declared first.
|
|
36
|
+
* Ex: 'fa-bag-seedling', 'fa-bug', etc.
|
|
37
|
+
*/
|
|
38
|
+
iconName: string | null
|
|
39
|
+
link?: string
|
|
40
|
+
sharingURL?: string
|
|
41
|
+
createdAt: Date
|
|
42
|
+
updatedAt: Date
|
|
43
|
+
Plants?: PlantI[]
|
|
44
|
+
yearOfCulture: number
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Those are the different possible types for a selection.
|
|
49
|
+
*/
|
|
50
|
+
export type SelectionType = 'Serre' | 'Potager' | 'Recette' | 'Coup de coeur' | "Jardin d'intérieur" | 'Autres'
|
|
51
|
+
|
|
52
|
+
export interface SelectionTypeI {
|
|
53
|
+
name: SelectionType
|
|
54
|
+
iconName?: IconName
|
|
55
|
+
}
|