@la-main-verte/shared-types 1.0.57 → 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/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 +159 -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/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,27 +1,28 @@
|
|
|
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
|
-
|
|
17
|
-
import * as
|
|
18
|
-
import * as
|
|
19
|
-
import * as
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export import
|
|
25
|
-
export import
|
|
26
|
-
export import
|
|
27
|
-
|
|
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
|
+
|
|
22
|
+
// Allow access to the API namespaces without conflicts
|
|
23
|
+
export namespace API {
|
|
24
|
+
export import PLANTS = PlantsAPI
|
|
25
|
+
export import USERS = UsersAPI
|
|
26
|
+
export import SESSIONS = SessionsAPI
|
|
27
|
+
export import HOME = HomeAPI
|
|
28
|
+
}
|
package/src/member.d.ts
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import { NoteI } from './note'
|
|
2
|
-
import { SelectionI } from './selection'
|
|
3
|
-
|
|
4
|
-
export interface MemberI {
|
|
5
|
-
id: number
|
|
6
|
-
email: string
|
|
7
|
-
firstName: string
|
|
8
|
-
lastName: string
|
|
9
|
-
/** Virtual field to get the user's full name */
|
|
10
|
-
fullName?: string | null
|
|
11
|
-
city?: string
|
|
12
|
-
hardinessZoneName?: string
|
|
13
|
-
createdAt: Date
|
|
14
|
-
updatedAt: Date
|
|
15
|
-
lastFreezingDate?: Date
|
|
16
|
-
firstFreezingDate?: Date
|
|
17
|
-
/**
|
|
18
|
-
* Number of unread Crisp messages
|
|
19
|
-
*/
|
|
20
|
-
unreadMessagesCount?: number
|
|
21
|
-
notes?: NoteI[]
|
|
22
|
-
selections?: SelectionI[]
|
|
23
|
-
userActivities?: UserActivityI[]
|
|
24
|
-
/**
|
|
25
|
-
* hasAnActiveSubscription is a VIRTUAL FIELD used to check if the user has an active subscription
|
|
26
|
-
*/
|
|
27
|
-
hasAnActiveSubscription?: boolean
|
|
28
|
-
/**
|
|
29
|
-
* Acts as a one-way not identifiable token.
|
|
30
|
-
* Crisp and other services may use this token to identify the user
|
|
31
|
-
*/
|
|
32
|
-
userToken: string
|
|
33
|
-
/**
|
|
34
|
-
* neverAddedATask <=> Has the use ever open the task form?
|
|
35
|
-
* Yes it is misleading, ticket is open to change it.
|
|
36
|
-
* It was too intense to force the user to add a task.
|
|
37
|
-
*/
|
|
38
|
-
neverAddedATask?: boolean
|
|
39
|
-
neverAddedAPlant?: boolean
|
|
40
|
-
neverAddedANote?: boolean
|
|
41
|
-
neverTriedSpacingSection?: boolean
|
|
42
|
-
neverTriedAiAgent?: boolean
|
|
43
|
-
neverDeletedAPlant?: boolean
|
|
44
|
-
neverDeletedATask?: boolean
|
|
45
|
-
neverEditedATask?: boolean
|
|
46
|
-
finishedOnboarding: boolean
|
|
47
|
-
hasDownloadedNativeApp?: boolean
|
|
48
|
-
unitSystem: 'imperial' | 'metric'
|
|
49
|
-
subscriptionEndDate?: Date
|
|
50
|
-
/**
|
|
51
|
-
* Virtual field to get the app badge count
|
|
52
|
-
* ----------------------------------------
|
|
53
|
-
* For now, it's just the number of unread messages.
|
|
54
|
-
*/
|
|
55
|
-
badgeCount?: number
|
|
56
|
-
/**
|
|
57
|
-
* Number of unread alerts, cached version of unread alerts (the table) count
|
|
58
|
-
*/
|
|
59
|
-
unreadAlertsCount?: number
|
|
60
|
-
isAdmin: boolean
|
|
61
|
-
}
|
|
1
|
+
import { NoteI } from './note'
|
|
2
|
+
import { SelectionI } from './selection'
|
|
3
|
+
|
|
4
|
+
export interface MemberI {
|
|
5
|
+
id: number
|
|
6
|
+
email: string
|
|
7
|
+
firstName: string
|
|
8
|
+
lastName: string
|
|
9
|
+
/** Virtual field to get the user's full name */
|
|
10
|
+
fullName?: string | null
|
|
11
|
+
city?: string
|
|
12
|
+
hardinessZoneName?: string
|
|
13
|
+
createdAt: Date
|
|
14
|
+
updatedAt: Date
|
|
15
|
+
lastFreezingDate?: Date
|
|
16
|
+
firstFreezingDate?: Date
|
|
17
|
+
/**
|
|
18
|
+
* Number of unread Crisp messages
|
|
19
|
+
*/
|
|
20
|
+
unreadMessagesCount?: number
|
|
21
|
+
notes?: NoteI[]
|
|
22
|
+
selections?: SelectionI[]
|
|
23
|
+
userActivities?: UserActivityI[]
|
|
24
|
+
/**
|
|
25
|
+
* hasAnActiveSubscription is a VIRTUAL FIELD used to check if the user has an active subscription
|
|
26
|
+
*/
|
|
27
|
+
hasAnActiveSubscription?: boolean
|
|
28
|
+
/**
|
|
29
|
+
* Acts as a one-way not identifiable token.
|
|
30
|
+
* Crisp and other services may use this token to identify the user
|
|
31
|
+
*/
|
|
32
|
+
userToken: string
|
|
33
|
+
/**
|
|
34
|
+
* neverAddedATask <=> Has the use ever open the task form?
|
|
35
|
+
* Yes it is misleading, ticket is open to change it.
|
|
36
|
+
* It was too intense to force the user to add a task.
|
|
37
|
+
*/
|
|
38
|
+
neverAddedATask?: boolean
|
|
39
|
+
neverAddedAPlant?: boolean
|
|
40
|
+
neverAddedANote?: boolean
|
|
41
|
+
neverTriedSpacingSection?: boolean
|
|
42
|
+
neverTriedAiAgent?: boolean
|
|
43
|
+
neverDeletedAPlant?: boolean
|
|
44
|
+
neverDeletedATask?: boolean
|
|
45
|
+
neverEditedATask?: boolean
|
|
46
|
+
finishedOnboarding: boolean
|
|
47
|
+
hasDownloadedNativeApp?: boolean
|
|
48
|
+
unitSystem: 'imperial' | 'metric'
|
|
49
|
+
subscriptionEndDate?: Date
|
|
50
|
+
/**
|
|
51
|
+
* Virtual field to get the app badge count
|
|
52
|
+
* ----------------------------------------
|
|
53
|
+
* For now, it's just the number of unread messages.
|
|
54
|
+
*/
|
|
55
|
+
badgeCount?: number
|
|
56
|
+
/**
|
|
57
|
+
* Number of unread alerts, cached version of unread alerts (the table) count
|
|
58
|
+
*/
|
|
59
|
+
unreadAlertsCount?: number
|
|
60
|
+
isAdmin: boolean
|
|
61
|
+
}
|
package/src/note.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { ImageI } from './image.d.ts'
|
|
2
|
-
import { TaggedItemI } from './taggedItem.d.ts'
|
|
3
|
-
|
|
4
|
-
export interface NoteI {
|
|
5
|
-
id: number
|
|
6
|
-
memberId: number
|
|
7
|
-
title: string
|
|
8
|
-
contentInMarkdown: string
|
|
9
|
-
color?: string
|
|
10
|
-
agreedToShare: boolean
|
|
11
|
-
createdAt: Date
|
|
12
|
-
updatedAt: Date
|
|
13
|
-
/**
|
|
14
|
-
* Virtual field for the note thumbnail imageURL (absolute path) */
|
|
15
|
-
imageURL?: string
|
|
16
|
-
/**
|
|
17
|
-
* Virtual field indicating if the note content is short
|
|
18
|
-
* Used to alter the design of the note (likely with ContentInMarkdown replacing the title)
|
|
19
|
-
* */
|
|
20
|
-
hasShortContent?: boolean
|
|
21
|
-
/**
|
|
22
|
-
* Virtual field for the note sharing URL (relative path) */
|
|
23
|
-
sharingURL: string
|
|
24
|
-
darkColor: string
|
|
25
|
-
pastelColor: string
|
|
26
|
-
Images: ImageI[]
|
|
27
|
-
TaggedItems: TaggedItemI[]
|
|
28
|
-
}
|
|
1
|
+
import { ImageI } from './image.d.ts'
|
|
2
|
+
import { TaggedItemI } from './taggedItem.d.ts'
|
|
3
|
+
|
|
4
|
+
export interface NoteI {
|
|
5
|
+
id: number
|
|
6
|
+
memberId: number
|
|
7
|
+
title: string
|
|
8
|
+
contentInMarkdown: string
|
|
9
|
+
color?: string
|
|
10
|
+
agreedToShare: boolean
|
|
11
|
+
createdAt: Date
|
|
12
|
+
updatedAt: Date
|
|
13
|
+
/**
|
|
14
|
+
* Virtual field for the note thumbnail imageURL (absolute path) */
|
|
15
|
+
imageURL?: string
|
|
16
|
+
/**
|
|
17
|
+
* Virtual field indicating if the note content is short
|
|
18
|
+
* Used to alter the design of the note (likely with ContentInMarkdown replacing the title)
|
|
19
|
+
* */
|
|
20
|
+
hasShortContent?: boolean
|
|
21
|
+
/**
|
|
22
|
+
* Virtual field for the note sharing URL (relative path) */
|
|
23
|
+
sharingURL: string
|
|
24
|
+
darkColor: string
|
|
25
|
+
pastelColor: string
|
|
26
|
+
Images: ImageI[]
|
|
27
|
+
TaggedItems: TaggedItemI[]
|
|
28
|
+
}
|
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
|
+
}
|