@la-main-verte/shared-types 1.0.90 → 1.0.92
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 +1 -1
- package/src/alert.d.ts +137 -124
- package/src/fertilizer.d.ts +67 -67
- package/src/home.api.d.ts +354 -352
- package/src/index.ts +41 -39
- package/src/member.d.ts +145 -145
- package/src/plant.d.ts +201 -201
- package/src/selections.api.d.ts +42 -0
- package/src/users.api.d.ts +154 -154
- package/src/weather.api.d.ts +34 -34
package/src/home.api.d.ts
CHANGED
|
@@ -1,352 +1,354 @@
|
|
|
1
|
-
import type { PlantI } from './plant'
|
|
2
|
-
import type { SelectionI } from './selection'
|
|
3
|
-
import type { TaskI } from './task'
|
|
4
|
-
|
|
5
|
-
export namespace HOME {
|
|
6
|
-
export type HeroCardMode = 'featuredSelection' | 'featuredPlant'
|
|
7
|
-
|
|
8
|
-
export type SectionComponentType =
|
|
9
|
-
| 'Header'
|
|
10
|
-
| 'HeroCards'
|
|
11
|
-
| 'PlantCarousel'
|
|
12
|
-
| 'HeroCardsCarousel'
|
|
13
|
-
| 'WideCardsCarousel'
|
|
14
|
-
| 'Weather'
|
|
15
|
-
| 'AdviceCarousel'
|
|
16
|
-
| 'OnboardingCard'
|
|
17
|
-
| 'MissionCard'
|
|
18
|
-
| 'UpcomingTasks'
|
|
19
|
-
|
|
20
|
-
export type CarouselComponentType = Extract<
|
|
21
|
-
SectionComponentType,
|
|
22
|
-
'PlantCarousel' | 'HeroCardsCarousel' | 'WideCardsCarousel'
|
|
23
|
-
>
|
|
24
|
-
|
|
25
|
-
export interface WeatherDayI {
|
|
26
|
-
/**
|
|
27
|
-
* Forecast date anchored at noon UTC, e.g. `2026-06-10T12:00:00Z`.
|
|
28
|
-
* Noon avoids clients parsing a bare `YYYY-MM-DD` as UTC midnight and
|
|
29
|
-
* displaying the previous local day in negative-offset timezones.
|
|
30
|
-
*/
|
|
31
|
-
date: string
|
|
32
|
-
/**
|
|
33
|
-
* Localized weekday label (e.g. "samedi" / "Saturday") pre-computed
|
|
34
|
-
* server-side. Provided so clients can render the correct day without
|
|
35
|
-
* reparsing `date`.
|
|
36
|
-
*/
|
|
37
|
-
weekday: string
|
|
38
|
-
minTempC: number
|
|
39
|
-
maxTempC: number
|
|
40
|
-
iconUrl: string | null
|
|
41
|
-
condition?: string | null
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface WeatherSectionI {
|
|
45
|
-
componentType: 'Weather'
|
|
46
|
-
title: string
|
|
47
|
-
subtitle?: string
|
|
48
|
-
locationName: string
|
|
49
|
-
timezone: string
|
|
50
|
-
days: WeatherDayI[]
|
|
51
|
-
lastUpdatedAt: string
|
|
52
|
-
dataSource: 'weatherapi'
|
|
53
|
-
backgroundColor?: string
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface HeaderSectionI {
|
|
57
|
-
componentType: 'Header'
|
|
58
|
-
title: string
|
|
59
|
-
subtitle: string
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface AdviceI {
|
|
63
|
-
id?: string | number
|
|
64
|
-
title: string
|
|
65
|
-
markdownContent: string
|
|
66
|
-
titleColor?: string
|
|
67
|
-
backgroundColor?: string
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface AdviceSectionI {
|
|
71
|
-
componentType: 'AdviceCarousel'
|
|
72
|
-
title?: string
|
|
73
|
-
subtitle?: string
|
|
74
|
-
advices: AdviceI[]
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export interface WideCardAuthorI {
|
|
78
|
-
name?: string | null
|
|
79
|
-
imageURL?: string | null
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface WideCardItemI {
|
|
83
|
-
id?: string | number
|
|
84
|
-
title?: string | null
|
|
85
|
-
text: string
|
|
86
|
-
badgeText?: string | null
|
|
87
|
-
thumbnailImageURL: string
|
|
88
|
-
author?: WideCardAuthorI | null
|
|
89
|
-
link?: string | null
|
|
90
|
-
metadata?: Record<string, unknown>
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export interface WideCardsCarouselSectionI {
|
|
94
|
-
componentType: 'WideCardsCarousel'
|
|
95
|
-
title: string
|
|
96
|
-
subtitle?: string
|
|
97
|
-
cards: WideCardItemI[]
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export interface HeroCardBlueprintI {
|
|
101
|
-
mode: HeroCardMode
|
|
102
|
-
title?: string | null
|
|
103
|
-
description?: string | null
|
|
104
|
-
backgroundColor?: string | null
|
|
105
|
-
backgroundImageUrl?: string | null
|
|
106
|
-
ctaLabel?: string | null
|
|
107
|
-
ctaRoute?: string | null
|
|
108
|
-
previewPlants?: PlantI[]
|
|
109
|
-
selection?: SelectionI | null
|
|
110
|
-
plant?: PlantI | null
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export interface HeroCardsSectionI {
|
|
114
|
-
componentType: 'HeroCards'
|
|
115
|
-
title?: string | null
|
|
116
|
-
subtitle?: string | null
|
|
117
|
-
cards: HeroCardBlueprintI[]
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export interface PlantCarouselSectionI {
|
|
121
|
-
componentType: 'PlantCarousel'
|
|
122
|
-
title: string
|
|
123
|
-
subtitle?: string
|
|
124
|
-
selection: SelectionI
|
|
125
|
-
displayRanking?: boolean
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export interface HeroCardsCarouselSectionI {
|
|
129
|
-
componentType: 'HeroCardsCarousel'
|
|
130
|
-
selections: SelectionI[]
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export interface FamilyRecommendationI {
|
|
134
|
-
family: string
|
|
135
|
-
headline: string
|
|
136
|
-
plants: PlantI[]
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export interface FamilyExplorerSectionI {
|
|
140
|
-
componentType: 'FamilyExplorer'
|
|
141
|
-
title: string
|
|
142
|
-
subtitle?: string
|
|
143
|
-
families: FamilyRecommendationI[]
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export interface OnboardingStepI {
|
|
147
|
-
id: string
|
|
148
|
-
title: string
|
|
149
|
-
description: string
|
|
150
|
-
isCompleted: boolean
|
|
151
|
-
ctaLink: string
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export interface OnboardingCardSectionI {
|
|
155
|
-
componentType: 'OnboardingCard'
|
|
156
|
-
title: string
|
|
157
|
-
subtitle: string
|
|
158
|
-
steps: OnboardingStepI[]
|
|
159
|
-
completedStepsCount: number
|
|
160
|
-
totalStepsCount: number
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Mission Engine
|
|
165
|
-
* --------------
|
|
166
|
-
* A mission is a reusable, data-driven collection of measurable steps that
|
|
167
|
-
* guides a member toward an objective. Completing every step unlocks the
|
|
168
|
-
* reward and (server-side) enrolls the member into the mission's Audience for
|
|
169
|
-
* downstream automation. The frontend only renders the completion state the
|
|
170
|
-
* backend computes — it never decides whether a step is done.
|
|
171
|
-
*
|
|
172
|
-
* Shipped under a NEW `componentType` ('MissionCard') so older app builds that
|
|
173
|
-
* only know 'OnboardingCard' gracefully skip it instead of rendering the new
|
|
174
|
-
* (incompatible) shape.
|
|
175
|
-
*/
|
|
176
|
-
/** Visual identity of a mission — drives all color decisions on the card. */
|
|
177
|
-
export interface MissionThemeI {
|
|
178
|
-
/** Accent color: badge, progress bar, reward text, icon tints. */
|
|
179
|
-
accentColor: string
|
|
180
|
-
/** Background color: card
|
|
181
|
-
backgroundColor: string
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
reward
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
export
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
|
324
|
-
|
|
|
325
|
-
|
|
|
326
|
-
|
|
|
327
|
-
|
|
|
328
|
-
|
|
|
329
|
-
|
|
|
330
|
-
|
|
|
331
|
-
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
1
|
+
import type { PlantI } from './plant'
|
|
2
|
+
import type { SelectionI } from './selection'
|
|
3
|
+
import type { TaskI } from './task'
|
|
4
|
+
|
|
5
|
+
export namespace HOME {
|
|
6
|
+
export type HeroCardMode = 'featuredSelection' | 'featuredPlant'
|
|
7
|
+
|
|
8
|
+
export type SectionComponentType =
|
|
9
|
+
| 'Header'
|
|
10
|
+
| 'HeroCards'
|
|
11
|
+
| 'PlantCarousel'
|
|
12
|
+
| 'HeroCardsCarousel'
|
|
13
|
+
| 'WideCardsCarousel'
|
|
14
|
+
| 'Weather'
|
|
15
|
+
| 'AdviceCarousel'
|
|
16
|
+
| 'OnboardingCard'
|
|
17
|
+
| 'MissionCard'
|
|
18
|
+
| 'UpcomingTasks'
|
|
19
|
+
|
|
20
|
+
export type CarouselComponentType = Extract<
|
|
21
|
+
SectionComponentType,
|
|
22
|
+
'PlantCarousel' | 'HeroCardsCarousel' | 'WideCardsCarousel'
|
|
23
|
+
>
|
|
24
|
+
|
|
25
|
+
export interface WeatherDayI {
|
|
26
|
+
/**
|
|
27
|
+
* Forecast date anchored at noon UTC, e.g. `2026-06-10T12:00:00Z`.
|
|
28
|
+
* Noon avoids clients parsing a bare `YYYY-MM-DD` as UTC midnight and
|
|
29
|
+
* displaying the previous local day in negative-offset timezones.
|
|
30
|
+
*/
|
|
31
|
+
date: string
|
|
32
|
+
/**
|
|
33
|
+
* Localized weekday label (e.g. "samedi" / "Saturday") pre-computed
|
|
34
|
+
* server-side. Provided so clients can render the correct day without
|
|
35
|
+
* reparsing `date`.
|
|
36
|
+
*/
|
|
37
|
+
weekday: string
|
|
38
|
+
minTempC: number
|
|
39
|
+
maxTempC: number
|
|
40
|
+
iconUrl: string | null
|
|
41
|
+
condition?: string | null
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface WeatherSectionI {
|
|
45
|
+
componentType: 'Weather'
|
|
46
|
+
title: string
|
|
47
|
+
subtitle?: string
|
|
48
|
+
locationName: string
|
|
49
|
+
timezone: string
|
|
50
|
+
days: WeatherDayI[]
|
|
51
|
+
lastUpdatedAt: string
|
|
52
|
+
dataSource: 'weatherapi'
|
|
53
|
+
backgroundColor?: string
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface HeaderSectionI {
|
|
57
|
+
componentType: 'Header'
|
|
58
|
+
title: string
|
|
59
|
+
subtitle: string
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface AdviceI {
|
|
63
|
+
id?: string | number
|
|
64
|
+
title: string
|
|
65
|
+
markdownContent: string
|
|
66
|
+
titleColor?: string
|
|
67
|
+
backgroundColor?: string
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface AdviceSectionI {
|
|
71
|
+
componentType: 'AdviceCarousel'
|
|
72
|
+
title?: string
|
|
73
|
+
subtitle?: string
|
|
74
|
+
advices: AdviceI[]
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface WideCardAuthorI {
|
|
78
|
+
name?: string | null
|
|
79
|
+
imageURL?: string | null
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface WideCardItemI {
|
|
83
|
+
id?: string | number
|
|
84
|
+
title?: string | null
|
|
85
|
+
text: string
|
|
86
|
+
badgeText?: string | null
|
|
87
|
+
thumbnailImageURL: string
|
|
88
|
+
author?: WideCardAuthorI | null
|
|
89
|
+
link?: string | null
|
|
90
|
+
metadata?: Record<string, unknown>
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface WideCardsCarouselSectionI {
|
|
94
|
+
componentType: 'WideCardsCarousel'
|
|
95
|
+
title: string
|
|
96
|
+
subtitle?: string
|
|
97
|
+
cards: WideCardItemI[]
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface HeroCardBlueprintI {
|
|
101
|
+
mode: HeroCardMode
|
|
102
|
+
title?: string | null
|
|
103
|
+
description?: string | null
|
|
104
|
+
backgroundColor?: string | null
|
|
105
|
+
backgroundImageUrl?: string | null
|
|
106
|
+
ctaLabel?: string | null
|
|
107
|
+
ctaRoute?: string | null
|
|
108
|
+
previewPlants?: PlantI[]
|
|
109
|
+
selection?: SelectionI | null
|
|
110
|
+
plant?: PlantI | null
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface HeroCardsSectionI {
|
|
114
|
+
componentType: 'HeroCards'
|
|
115
|
+
title?: string | null
|
|
116
|
+
subtitle?: string | null
|
|
117
|
+
cards: HeroCardBlueprintI[]
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface PlantCarouselSectionI {
|
|
121
|
+
componentType: 'PlantCarousel'
|
|
122
|
+
title: string
|
|
123
|
+
subtitle?: string
|
|
124
|
+
selection: SelectionI
|
|
125
|
+
displayRanking?: boolean
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface HeroCardsCarouselSectionI {
|
|
129
|
+
componentType: 'HeroCardsCarousel'
|
|
130
|
+
selections: SelectionI[]
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface FamilyRecommendationI {
|
|
134
|
+
family: string
|
|
135
|
+
headline: string
|
|
136
|
+
plants: PlantI[]
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface FamilyExplorerSectionI {
|
|
140
|
+
componentType: 'FamilyExplorer'
|
|
141
|
+
title: string
|
|
142
|
+
subtitle?: string
|
|
143
|
+
families: FamilyRecommendationI[]
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export interface OnboardingStepI {
|
|
147
|
+
id: string
|
|
148
|
+
title: string
|
|
149
|
+
description: string
|
|
150
|
+
isCompleted: boolean
|
|
151
|
+
ctaLink: string
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface OnboardingCardSectionI {
|
|
155
|
+
componentType: 'OnboardingCard'
|
|
156
|
+
title: string
|
|
157
|
+
subtitle: string
|
|
158
|
+
steps: OnboardingStepI[]
|
|
159
|
+
completedStepsCount: number
|
|
160
|
+
totalStepsCount: number
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Mission Engine
|
|
165
|
+
* --------------
|
|
166
|
+
* A mission is a reusable, data-driven collection of measurable steps that
|
|
167
|
+
* guides a member toward an objective. Completing every step unlocks the
|
|
168
|
+
* reward and (server-side) enrolls the member into the mission's Audience for
|
|
169
|
+
* downstream automation. The frontend only renders the completion state the
|
|
170
|
+
* backend computes — it never decides whether a step is done.
|
|
171
|
+
*
|
|
172
|
+
* Shipped under a NEW `componentType` ('MissionCard') so older app builds that
|
|
173
|
+
* only know 'OnboardingCard' gracefully skip it instead of rendering the new
|
|
174
|
+
* (incompatible) shape.
|
|
175
|
+
*/
|
|
176
|
+
/** Visual identity of a mission — drives all color decisions on the card. */
|
|
177
|
+
export interface MissionThemeI {
|
|
178
|
+
/** Accent color: badge, progress bar, reward text, icon tints. */
|
|
179
|
+
accentColor: string
|
|
180
|
+
/** Background color: card header and reward section surface. */
|
|
181
|
+
backgroundColor: string
|
|
182
|
+
/** Text color for content rendered on the backgroundColor surface. */
|
|
183
|
+
textColor: string
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface MissionRewardI {
|
|
187
|
+
/** Heading above the reward, e.g. "Ta récompense". */
|
|
188
|
+
title: string
|
|
189
|
+
/** Fine print, e.g. "À utiliser sur ta prochaine commande !". */
|
|
190
|
+
description: string
|
|
191
|
+
/** Short highlight, e.g. "-10%" or "5 $ de rabais". */
|
|
192
|
+
badgeText: string
|
|
193
|
+
/** Partner brand the reward belongs to, e.g. "Semences du Portage". Null for first-party rewards. */
|
|
194
|
+
partnerName?: string | null
|
|
195
|
+
partnerLogoURL?: string | null
|
|
196
|
+
/** Coupon / discount code to redeem the reward. Revealed on completion. */
|
|
197
|
+
discountCode?: string | null
|
|
198
|
+
/** Outbound link to redeem (partner store, already UTM/discount-decorated). */
|
|
199
|
+
ctaLink?: string | null
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export interface MissionStepI {
|
|
203
|
+
id: string
|
|
204
|
+
title: string
|
|
205
|
+
subtitle?: string
|
|
206
|
+
/** FontAwesome icon name. Ignored when `imageURL` is set. */
|
|
207
|
+
icon?: string | null
|
|
208
|
+
/** Custom image shown instead of an icon. */
|
|
209
|
+
imageURL?: string | null
|
|
210
|
+
/** Completion is decided by the backend; the client just displays it. */
|
|
211
|
+
isCompleted: boolean
|
|
212
|
+
/** Deep link / route opened when the step is tapped (every step has a CTA). */
|
|
213
|
+
ctaLink: string
|
|
214
|
+
/**
|
|
215
|
+
* When present, tapping this step activates the named onboarding flow on
|
|
216
|
+
* the destination screen. Null means no tutorial is attached to this step.
|
|
217
|
+
*/
|
|
218
|
+
onboardingFlowId?: string | null
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface MissionCardSectionI {
|
|
222
|
+
componentType: 'MissionCard'
|
|
223
|
+
/** Stable mission identifier (slug) — also used as the section id. */
|
|
224
|
+
id: string
|
|
225
|
+
title: string
|
|
226
|
+
subtitle: string
|
|
227
|
+
description?: string
|
|
228
|
+
/** Visual theme applied to the card and all its sub-elements. */
|
|
229
|
+
theme: MissionThemeI
|
|
230
|
+
/** Illustration aligned to the right of the card. */
|
|
231
|
+
backgroundImageURL?: string
|
|
232
|
+
steps: MissionStepI[]
|
|
233
|
+
completedStepsCount: number
|
|
234
|
+
totalStepsCount: number
|
|
235
|
+
/** True once every step is complete (reward unlocked). */
|
|
236
|
+
isCompleted: boolean
|
|
237
|
+
reward?: MissionRewardI | null
|
|
238
|
+
/** Display order across missions (ascending). */
|
|
239
|
+
sortOrder: number
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/** Minimal plant info for preview display (e.g. parent plant in grouped tasks) */
|
|
243
|
+
export interface TaskPlantPreviewI {
|
|
244
|
+
name: string
|
|
245
|
+
slug: string
|
|
246
|
+
imageURL?: string | null
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/** Plant info within a family group — includes the task ID specific to this plant */
|
|
250
|
+
export interface TaskFamilyPlantPreviewI extends TaskPlantPreviewI {
|
|
251
|
+
taskId: number
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/** Family group info when multiple plants share the same task */
|
|
255
|
+
export interface TaskFamilyGroupI {
|
|
256
|
+
familyName: string
|
|
257
|
+
plantsCount: number
|
|
258
|
+
plants: TaskFamilyPlantPreviewI[]
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export interface UpcomingTaskI {
|
|
262
|
+
task: TaskI
|
|
263
|
+
/** PlantSelection id used by task list views to group tasks per planted item. */
|
|
264
|
+
plantSelectionId?: number
|
|
265
|
+
plantName: string
|
|
266
|
+
plantSlug: string
|
|
267
|
+
plantImageURL?: string | null
|
|
268
|
+
gardenName: string
|
|
269
|
+
gardenCategory: string
|
|
270
|
+
selectionSlug: string
|
|
271
|
+
/** If this task is grouped by family */
|
|
272
|
+
familyGroup?: TaskFamilyGroupI
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export type TaskListView = 'current' | 'completed' | 'earlier'
|
|
276
|
+
|
|
277
|
+
export interface UpcomingTaskAdviceI {
|
|
278
|
+
/** @deprecated Since 1.9.10, this field is always `''`. */
|
|
279
|
+
content: string
|
|
280
|
+
taskName: string
|
|
281
|
+
plantName: string
|
|
282
|
+
plantSlug: string
|
|
283
|
+
plantImageURL?: string | null
|
|
284
|
+
gardenName: string
|
|
285
|
+
gardenCategory: string
|
|
286
|
+
selectionSlug: string
|
|
287
|
+
task: TaskI
|
|
288
|
+
/** If this task is grouped by family */
|
|
289
|
+
familyGroup?: TaskFamilyGroupI
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export interface UpcomingTasksSectionI {
|
|
293
|
+
componentType: 'UpcomingTasks'
|
|
294
|
+
title: string
|
|
295
|
+
subtitle?: string
|
|
296
|
+
advices: UpcomingTaskAdviceI[]
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/** Preview plant for WhenToSeedWhat section */
|
|
300
|
+
export interface WhenToSeedWhatPlantPreviewI {
|
|
301
|
+
id: number
|
|
302
|
+
name: string
|
|
303
|
+
family?: string | null
|
|
304
|
+
slug: string
|
|
305
|
+
imageURL?: string | null
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/** A generic link card section with title, subtitle, URL, and optional preview images */
|
|
309
|
+
export interface LinkCardSectionI {
|
|
310
|
+
componentType: 'LinkCard'
|
|
311
|
+
title: string
|
|
312
|
+
subtitle?: string
|
|
313
|
+
url: string
|
|
314
|
+
previewPlants?: WhenToSeedWhatPlantPreviewI[]
|
|
315
|
+
backgroundColor?: string
|
|
316
|
+
/** Show a red badge indicator (replaces the plant preview stack when true) */
|
|
317
|
+
showBadge?: boolean
|
|
318
|
+
/** Optional badge count to display */
|
|
319
|
+
badgeCount?: number
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export type SectionI =
|
|
323
|
+
| HeaderSectionI
|
|
324
|
+
| HeroCardsSectionI
|
|
325
|
+
| PlantCarouselSectionI
|
|
326
|
+
| HeroCardsCarouselSectionI
|
|
327
|
+
| WideCardsCarouselSectionI
|
|
328
|
+
| WeatherSectionI
|
|
329
|
+
| AdviceSectionI
|
|
330
|
+
| OnboardingCardSectionI
|
|
331
|
+
| MissionCardSectionI
|
|
332
|
+
| UpcomingTasksSectionI
|
|
333
|
+
| LinkCardSectionI
|
|
334
|
+
|
|
335
|
+
export interface Response {
|
|
336
|
+
sections: SectionI[]
|
|
337
|
+
weather?: WeatherSectionI
|
|
338
|
+
advice?: AdviceSectionI
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export interface HeroCardItemI {
|
|
342
|
+
id?: string | null
|
|
343
|
+
mode: HeroCardMode
|
|
344
|
+
title?: string | null
|
|
345
|
+
description?: string | null
|
|
346
|
+
backgroundColor?: string | null
|
|
347
|
+
backgroundImageUrl?: string | null
|
|
348
|
+
previewPlants?: PlantI[]
|
|
349
|
+
ctaLabel?: string | null
|
|
350
|
+
selection?: SelectionI | null
|
|
351
|
+
plant?: PlantI | null
|
|
352
|
+
ctaRoute?: string | null
|
|
353
|
+
}
|
|
354
|
+
}
|