@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/src/home.api.d.ts CHANGED
@@ -1,159 +1,173 @@
1
- import type { PlantI } from './plant'
2
- import type { SelectionI } from './selection'
3
-
4
- export namespace HOME {
5
- export type HeroCardMode = 'featuredSelection' | 'featuredPlant'
6
-
7
- export type SectionComponentType =
8
- | 'Header'
9
- | 'HeroCards'
10
- | 'PlantCarousel'
11
- | 'HeroCardsCarousel'
12
- | 'WideCardsCarousel'
13
- | 'Weather'
14
- | 'AdviceCarousel'
15
- | 'OnboardingCard'
16
-
17
- export type CarouselComponentType = Extract<
18
- SectionComponentType,
19
- 'PlantCarousel' | 'HeroCardsCarousel' | 'WideCardsCarousel'
20
- >
21
-
22
- export interface WeatherDayI {
23
- date: string
24
- minTempC: number
25
- maxTempC: number
26
- chanceOfRainPercentage: number | null
27
- iconUrl: string | null
28
- condition?: string | null
29
- }
30
-
31
- export interface WeatherSectionI {
32
- componentType: 'Weather'
33
- title: string
34
- subtitle?: string
35
- locationName: string
36
- timezone: string
37
- days: WeatherDayI[]
38
- lastUpdatedAt: string
39
- dataSource: 'weatherapi'
40
- }
41
-
42
- export interface HeaderSectionI {
43
- componentType: 'Header'
44
- title: string
45
- subtitle: string
46
- }
47
-
48
- export interface AdviceI {
49
- title: string
50
- markdownContent: string
51
- titleColor?: string
52
- backgroundColor?: string
53
- }
54
-
55
- export interface AdviceSectionI {
56
- componentType: 'AdviceCarousel'
57
- title?: string
58
- subtitle?: string
59
- advices: AdviceI[]
60
- }
61
-
62
- export interface WideCardAuthorI {
63
- name?: string | null
64
- imageURL?: string | null
65
- }
66
-
67
- export interface WideCardItemI {
68
- title?: string | null
69
- text: string
70
- badgeText?: string | null
71
- thumbnailImageURL: string
72
- author?: WideCardAuthorI | null
73
- link?: string | null
74
- metadata?: Record<string, unknown>
75
- }
76
-
77
- export interface WideCardsCarouselSectionI {
78
- componentType: 'WideCardsCarousel'
79
- title: string
80
- subtitle?: string
81
- cards: WideCardItemI[]
82
- }
83
-
84
- export interface HeroCardBlueprintI {
85
- mode: HeroCardMode
86
- title?: string | null
87
- description?: string | null
88
- backgroundColor?: string | null
89
- backgroundImageUrl?: string | null
90
- ctaLabel?: string | null
91
- previewPlants?: PlantI[]
92
- selection?: SelectionI | null
93
- plant?: PlantI | null
94
- }
95
-
96
- export interface HeroCardsSectionI {
97
- componentType: 'HeroCards'
98
- title?: string | null
99
- subtitle?: string | null
100
- cards: HeroCardBlueprintI[]
101
- }
102
-
103
- export interface PlantCarouselSectionI {
104
- componentType: 'PlantCarousel'
105
- title: string
106
- subtitle?: string
107
- selection: SelectionI
108
- displayRanking?: boolean
109
- }
110
-
111
- export interface HeroCardsCarouselSectionI {
112
- componentType: 'HeroCardsCarousel'
113
- selections: SelectionI[]
114
- }
115
-
116
- export interface FamilyRecommendationI {
117
- family: string
118
- headline: string
119
- plants: PlantI[]
120
- }
121
-
122
- export interface FamilyExplorerSectionI {
123
- componentType: 'FamilyExplorer'
124
- title: string
125
- subtitle?: string
126
- families: FamilyRecommendationI[]
127
- }
128
-
129
- export interface OnboardingStepI {
130
- id: string
131
- title: string
132
- description: string
133
- isCompleted: boolean
134
- ctaLink: string
135
- }
136
-
137
- export interface OnboardingCardSectionI {
138
- componentType: 'OnboardingCard'
139
- title: string
140
- subtitle: string
141
- steps: OnboardingStepI[]
142
- completedStepsCount: number
143
- totalStepsCount: number
144
- }
145
-
146
- export type SectionI =
147
- | HeaderSectionI
148
- | HeroCardsSectionI
149
- | PlantCarouselSectionI
150
- | HeroCardsCarouselSectionI
151
- | WideCardsCarouselSectionI
152
- | WeatherSectionI
153
- | AdviceSectionI
154
- | OnboardingCardSectionI
155
-
156
- export interface Response {
157
- sections: SectionI[]
158
- }
159
- }
1
+ import type { PlantI } from './plant'
2
+ import type { SelectionI } from './selection'
3
+
4
+ export namespace HOME {
5
+ export type HeroCardMode = 'featuredSelection' | 'featuredPlant'
6
+
7
+ export type SectionComponentType =
8
+ | 'Header'
9
+ | 'HeroCards'
10
+ | 'PlantCarousel'
11
+ | 'HeroCardsCarousel'
12
+ | 'WideCardsCarousel'
13
+ | 'Weather'
14
+ | 'AdviceCarousel'
15
+ | 'OnboardingCard'
16
+
17
+ export type CarouselComponentType = Extract<
18
+ SectionComponentType,
19
+ 'PlantCarousel' | 'HeroCardsCarousel' | 'WideCardsCarousel'
20
+ >
21
+
22
+ export interface WeatherDayI {
23
+ date: string
24
+ minTempC: number
25
+ maxTempC: number
26
+ iconUrl: string | null
27
+ condition?: string | null
28
+ }
29
+
30
+ export interface WeatherSectionI {
31
+ componentType: 'Weather'
32
+ title: string
33
+ subtitle?: string
34
+ locationName: string
35
+ timezone: string
36
+ days: WeatherDayI[]
37
+ lastUpdatedAt: string
38
+ dataSource: 'weatherapi'
39
+ }
40
+
41
+ export interface HeaderSectionI {
42
+ componentType: 'Header'
43
+ title: string
44
+ subtitle: string
45
+ }
46
+
47
+ export interface AdviceI {
48
+ title: string
49
+ markdownContent: string
50
+ titleColor?: string
51
+ backgroundColor?: string
52
+ }
53
+
54
+ export interface AdviceSectionI {
55
+ componentType: 'AdviceCarousel'
56
+ title?: string
57
+ subtitle?: string
58
+ advices: AdviceI[]
59
+ }
60
+
61
+ export interface WideCardAuthorI {
62
+ name?: string | null
63
+ imageURL?: string | null
64
+ }
65
+
66
+ export interface WideCardItemI {
67
+ title?: string | null
68
+ text: string
69
+ badgeText?: string | null
70
+ thumbnailImageURL: string
71
+ author?: WideCardAuthorI | null
72
+ link?: string | null
73
+ metadata?: Record<string, unknown>
74
+ }
75
+
76
+ export interface WideCardsCarouselSectionI {
77
+ componentType: 'WideCardsCarousel'
78
+ title: string
79
+ subtitle?: string
80
+ cards: WideCardItemI[]
81
+ }
82
+
83
+ export interface HeroCardBlueprintI {
84
+ mode: HeroCardMode
85
+ title?: string | null
86
+ description?: string | null
87
+ backgroundColor?: string | null
88
+ backgroundImageUrl?: string | null
89
+ ctaLabel?: string | null
90
+ ctaRoute?: string | null
91
+ previewPlants?: PlantI[]
92
+ selection?: SelectionI | null
93
+ plant?: PlantI | null
94
+ }
95
+
96
+ export interface HeroCardsSectionI {
97
+ componentType: 'HeroCards'
98
+ title?: string | null
99
+ subtitle?: string | null
100
+ cards: HeroCardBlueprintI[]
101
+ }
102
+
103
+ export interface PlantCarouselSectionI {
104
+ componentType: 'PlantCarousel'
105
+ title: string
106
+ subtitle?: string
107
+ selection: SelectionI
108
+ displayRanking?: boolean
109
+ }
110
+
111
+ export interface HeroCardsCarouselSectionI {
112
+ componentType: 'HeroCardsCarousel'
113
+ selections: SelectionI[]
114
+ }
115
+
116
+ export interface FamilyRecommendationI {
117
+ family: string
118
+ headline: string
119
+ plants: PlantI[]
120
+ }
121
+
122
+ export interface FamilyExplorerSectionI {
123
+ componentType: 'FamilyExplorer'
124
+ title: string
125
+ subtitle?: string
126
+ families: FamilyRecommendationI[]
127
+ }
128
+
129
+ export interface OnboardingStepI {
130
+ id: string
131
+ title: string
132
+ description: string
133
+ isCompleted: boolean
134
+ ctaLink: string
135
+ }
136
+
137
+ export interface OnboardingCardSectionI {
138
+ componentType: 'OnboardingCard'
139
+ title: string
140
+ subtitle: string
141
+ steps: OnboardingStepI[]
142
+ completedStepsCount: number
143
+ totalStepsCount: number
144
+ }
145
+
146
+ export type SectionI =
147
+ | HeaderSectionI
148
+ | HeroCardsSectionI
149
+ | PlantCarouselSectionI
150
+ | HeroCardsCarouselSectionI
151
+ | WideCardsCarouselSectionI
152
+ | WeatherSectionI
153
+ | AdviceSectionI
154
+ | OnboardingCardSectionI
155
+
156
+ export interface Response {
157
+ sections: SectionI[]
158
+ }
159
+
160
+ export interface HeroCardItemI {
161
+ id?: string | null
162
+ mode: HeroCardMode
163
+ title?: string | null
164
+ description?: string | null
165
+ backgroundColor?: string | null
166
+ backgroundImageUrl?: string | null
167
+ previewPlants?: PlantI[]
168
+ ctaLabel?: string | null
169
+ selection?: SelectionI | null
170
+ plant?: PlantI | null
171
+ ctaRoute?: string | null
172
+ }
173
+ }
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
+ }