@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/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
- import * as PlantsAPI from './plants.api'
17
- import * as UsersAPI from './users.api'
18
- import * as SessionsAPI from './sessions.api'
19
- import * as HomeAPI from './home.api'
20
-
21
- // Allow access to the API namespaces without conflicts
22
- export namespace API {
23
- export import PLANTS = PlantsAPI
24
- export import USERS = UsersAPI
25
- export import SESSIONS = SessionsAPI
26
- export import HOME = HomeAPI
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
- export interface PlantI {
2
- id: number
3
- name: string
4
- slug: string
5
- description: string
6
- descriptionSource?: string
7
- female: boolean
8
- family?: string | null
9
- spaceBetweenSeedMin: number
10
- spaceBetweenSeedMax: number
11
- spaceBetweenAlleyMin: number
12
- spaceBetweenAlleyMax: number
13
- weeksInTransplant: number
14
- weeksDuringWhichYouCanSeedOutdoor: number
15
- weeksToMaturity: number
16
- weeksToWaitAfterFreezingDate: number
17
- weeksToHarvest: number
18
- indoorSeeding: boolean
19
- outdoorSeeding: boolean
20
- azoteNeedsKgPerHa: number
21
- hibernate: boolean
22
- germinationTemperature: number | null
23
- minGerminationTemperature: number | null
24
- germinationNumberOfDays: string | null
25
- germinationSeedDepth: string | null
26
- cultivationInfo: string | null
27
- parentId: number | null
28
- memberId?: number
29
- shared: boolean
30
- hexColor: string | null
31
- sunRequirements: 'partialShade' | 'fullSun' | 'fullShade' | null
32
- isHardy: boolean | null
33
- imageURL: string
34
- totalWeeksToMaturity: number
35
- hasNoInformation: boolean
36
- createdAt: Date
37
- updatedAt: Date
38
- translatedSunRequirements: 'Plein soleil' | 'Mi-ombre' | 'Ombre' | null
39
- parent?: PlantI
40
- children?: PlantI[]
41
- PlantInventories?: PlantInventoryI[]
42
- taggedItems?: TaggedItemI[]
43
- /**
44
- * List of selections that the plant is in.
45
- * --------------------------------------
46
- * Tends to be used for featured selections
47
- */
48
- Selections?: SelectionI[]
49
- tasks?: TaskI[]
50
- Images?: ImageI[]
51
- notes?: NoteI[]
52
- rotationFamily?: string
53
- }
54
-
55
- interface PlantTagI {
56
- name: string
57
- /**
58
- * Font color of the tag
59
- * Ex: #ffffff
60
- */
61
- fontColor: string
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
74
- }
75
-
76
- interface PlantInventoryI {
77
- id: number
78
- plantId: number
79
- supplierName: string
80
- plantName: string
81
- supplierURL: string
82
- imageLocation: string
83
- description: string
84
- inStock: boolean
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
+ }
@@ -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
+ }