@la-main-verte/shared-types 1.0.88 → 1.0.90

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,262 +1,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
- | 'UpcomingTasks'
18
-
19
- export type CarouselComponentType = Extract<
20
- SectionComponentType,
21
- 'PlantCarousel' | 'HeroCardsCarousel' | 'WideCardsCarousel'
22
- >
23
-
24
- export interface WeatherDayI {
25
- date: string
26
- minTempC: number
27
- maxTempC: number
28
- iconUrl: string | null
29
- condition?: string | null
30
- }
31
-
32
- export interface WeatherSectionI {
33
- componentType: 'Weather'
34
- title: string
35
- subtitle?: string
36
- locationName: string
37
- timezone: string
38
- days: WeatherDayI[]
39
- lastUpdatedAt: string
40
- dataSource: 'weatherapi'
41
- backgroundColor?: string
42
- }
43
-
44
- export interface HeaderSectionI {
45
- componentType: 'Header'
46
- title: string
47
- subtitle: string
48
- }
49
-
50
- export interface AdviceI {
51
- id?: string | number
52
- title: string
53
- markdownContent: string
54
- titleColor?: string
55
- backgroundColor?: string
56
- }
57
-
58
- export interface AdviceSectionI {
59
- componentType: 'AdviceCarousel'
60
- title?: string
61
- subtitle?: string
62
- advices: AdviceI[]
63
- }
64
-
65
- export interface WideCardAuthorI {
66
- name?: string | null
67
- imageURL?: string | null
68
- }
69
-
70
- export interface WideCardItemI {
71
- id?: string | number
72
- title?: string | null
73
- text: string
74
- badgeText?: string | null
75
- thumbnailImageURL: string
76
- author?: WideCardAuthorI | null
77
- link?: string | null
78
- metadata?: Record<string, unknown>
79
- }
80
-
81
- export interface WideCardsCarouselSectionI {
82
- componentType: 'WideCardsCarousel'
83
- title: string
84
- subtitle?: string
85
- cards: WideCardItemI[]
86
- }
87
-
88
- export interface HeroCardBlueprintI {
89
- mode: HeroCardMode
90
- title?: string | null
91
- description?: string | null
92
- backgroundColor?: string | null
93
- backgroundImageUrl?: string | null
94
- ctaLabel?: string | null
95
- ctaRoute?: string | null
96
- previewPlants?: PlantI[]
97
- selection?: SelectionI | null
98
- plant?: PlantI | null
99
- }
100
-
101
- export interface HeroCardsSectionI {
102
- componentType: 'HeroCards'
103
- title?: string | null
104
- subtitle?: string | null
105
- cards: HeroCardBlueprintI[]
106
- }
107
-
108
- export interface PlantCarouselSectionI {
109
- componentType: 'PlantCarousel'
110
- title: string
111
- subtitle?: string
112
- selection: SelectionI
113
- displayRanking?: boolean
114
- }
115
-
116
- export interface HeroCardsCarouselSectionI {
117
- componentType: 'HeroCardsCarousel'
118
- selections: SelectionI[]
119
- }
120
-
121
- export interface FamilyRecommendationI {
122
- family: string
123
- headline: string
124
- plants: PlantI[]
125
- }
126
-
127
- export interface FamilyExplorerSectionI {
128
- componentType: 'FamilyExplorer'
129
- title: string
130
- subtitle?: string
131
- families: FamilyRecommendationI[]
132
- }
133
-
134
- export interface OnboardingStepI {
135
- id: string
136
- title: string
137
- description: string
138
- isCompleted: boolean
139
- ctaLink: string
140
- }
141
-
142
- export interface OnboardingCardSectionI {
143
- componentType: 'OnboardingCard'
144
- title: string
145
- subtitle: string
146
- steps: OnboardingStepI[]
147
- completedStepsCount: number
148
- totalStepsCount: number
149
- }
150
-
151
- /** Minimal plant info for preview display (e.g. parent plant in grouped tasks) */
152
- export interface TaskPlantPreviewI {
153
- name: string
154
- slug: string
155
- imageURL?: string | null
156
- }
157
-
158
- /** Plant info within a family group — includes the task ID specific to this plant */
159
- export interface TaskFamilyPlantPreviewI extends TaskPlantPreviewI {
160
- taskId: number
161
- }
162
-
163
- /** Family group info when multiple plants share the same task */
164
- export interface TaskFamilyGroupI {
165
- familyName: string
166
- plantsCount: number
167
- plants: TaskFamilyPlantPreviewI[]
168
- }
169
-
170
- export interface UpcomingTaskI {
171
- task: TaskI
172
- /** PlantSelection id used by task list views to group tasks per planted item. */
173
- plantSelectionId?: number
174
- plantName: string
175
- plantSlug: string
176
- plantImageURL?: string | null
177
- gardenName: string
178
- gardenCategory: string
179
- selectionSlug: string
180
- /** If this task is grouped by family */
181
- familyGroup?: TaskFamilyGroupI
182
- }
183
-
184
- export type TaskListView = 'current' | 'completed' | 'earlier'
185
-
186
- export interface UpcomingTaskAdviceI {
187
- /** @deprecated Since 1.9.10, this field is always `''`. */
188
- content: string
189
- taskName: string
190
- plantName: string
191
- plantSlug: string
192
- plantImageURL?: string | null
193
- gardenName: string
194
- gardenCategory: string
195
- selectionSlug: string
196
- task: TaskI
197
- /** If this task is grouped by family */
198
- familyGroup?: TaskFamilyGroupI
199
- }
200
-
201
- export interface UpcomingTasksSectionI {
202
- componentType: 'UpcomingTasks'
203
- title: string
204
- subtitle?: string
205
- advices: UpcomingTaskAdviceI[]
206
- }
207
-
208
- /** Preview plant for WhenToSeedWhat section */
209
- export interface WhenToSeedWhatPlantPreviewI {
210
- id: number
211
- name: string
212
- family?: string | null
213
- slug: string
214
- imageURL?: string | null
215
- }
216
-
217
- /** A generic link card section with title, subtitle, URL, and optional preview images */
218
- export interface LinkCardSectionI {
219
- componentType: 'LinkCard'
220
- title: string
221
- subtitle?: string
222
- url: string
223
- previewPlants?: WhenToSeedWhatPlantPreviewI[]
224
- backgroundColor?: string
225
- /** Show a red badge indicator (replaces the plant preview stack when true) */
226
- showBadge?: boolean
227
- /** Optional badge count to display */
228
- badgeCount?: number
229
- }
230
-
231
- export type SectionI =
232
- | HeaderSectionI
233
- | HeroCardsSectionI
234
- | PlantCarouselSectionI
235
- | HeroCardsCarouselSectionI
236
- | WideCardsCarouselSectionI
237
- | WeatherSectionI
238
- | AdviceSectionI
239
- | OnboardingCardSectionI
240
- | UpcomingTasksSectionI
241
- | LinkCardSectionI
242
-
243
- export interface Response {
244
- sections: SectionI[]
245
- weather?: WeatherSectionI
246
- advice?: AdviceSectionI
247
- }
248
-
249
- export interface HeroCardItemI {
250
- id?: string | null
251
- mode: HeroCardMode
252
- title?: string | null
253
- description?: string | null
254
- backgroundColor?: string | null
255
- backgroundImageUrl?: string | null
256
- previewPlants?: PlantI[]
257
- ctaLabel?: string | null
258
- selection?: SelectionI | null
259
- plant?: PlantI | null
260
- ctaRoute?: string | null
261
- }
262
- }
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 surface and reward card surface. */
181
+ backgroundColor: string
182
+ }
183
+
184
+ export interface MissionRewardI {
185
+ /** Heading above the reward, e.g. "Ta récompense". */
186
+ title: string
187
+ /** Fine print, e.g. utiliser sur ta prochaine commande !". */
188
+ description: string
189
+ /** Short highlight, e.g. "-10%" or "5 $ de rabais". */
190
+ badgeText: string
191
+ /** Partner brand the reward belongs to, e.g. "Semences du Portage". Null for first-party rewards. */
192
+ partnerName?: string | null
193
+ partnerLogoURL?: string | null
194
+ /** Coupon / discount code to redeem the reward. Revealed on completion. */
195
+ discountCode?: string | null
196
+ /** Outbound link to redeem (partner store, already UTM/discount-decorated). */
197
+ ctaLink?: string | null
198
+ }
199
+
200
+ export interface MissionStepI {
201
+ id: string
202
+ title: string
203
+ subtitle?: string
204
+ /** FontAwesome icon name. Ignored when `imageURL` is set. */
205
+ icon?: string | null
206
+ /** Custom image shown instead of an icon. */
207
+ imageURL?: string | null
208
+ /** Completion is decided by the backend; the client just displays it. */
209
+ isCompleted: boolean
210
+ /** Deep link / route opened when the step is tapped (every step has a CTA). */
211
+ ctaLink: string
212
+ /**
213
+ * When present, tapping this step activates the named onboarding flow on
214
+ * the destination screen. Null means no tutorial is attached to this step.
215
+ */
216
+ onboardingFlowId?: string | null
217
+ }
218
+
219
+ export interface MissionCardSectionI {
220
+ componentType: 'MissionCard'
221
+ /** Stable mission identifier (slug) — also used as the section id. */
222
+ id: string
223
+ title: string
224
+ subtitle: string
225
+ description?: string
226
+ /** Visual theme applied to the card and all its sub-elements. */
227
+ theme: MissionThemeI
228
+ /** Illustration aligned to the right of the card. */
229
+ backgroundImageURL?: string
230
+ steps: MissionStepI[]
231
+ completedStepsCount: number
232
+ totalStepsCount: number
233
+ /** True once every step is complete (reward unlocked). */
234
+ isCompleted: boolean
235
+ reward: MissionRewardI
236
+ /** Display order across missions (ascending). */
237
+ sortOrder: number
238
+ }
239
+
240
+ /** Minimal plant info for preview display (e.g. parent plant in grouped tasks) */
241
+ export interface TaskPlantPreviewI {
242
+ name: string
243
+ slug: string
244
+ imageURL?: string | null
245
+ }
246
+
247
+ /** Plant info within a family group — includes the task ID specific to this plant */
248
+ export interface TaskFamilyPlantPreviewI extends TaskPlantPreviewI {
249
+ taskId: number
250
+ }
251
+
252
+ /** Family group info when multiple plants share the same task */
253
+ export interface TaskFamilyGroupI {
254
+ familyName: string
255
+ plantsCount: number
256
+ plants: TaskFamilyPlantPreviewI[]
257
+ }
258
+
259
+ export interface UpcomingTaskI {
260
+ task: TaskI
261
+ /** PlantSelection id used by task list views to group tasks per planted item. */
262
+ plantSelectionId?: number
263
+ plantName: string
264
+ plantSlug: string
265
+ plantImageURL?: string | null
266
+ gardenName: string
267
+ gardenCategory: string
268
+ selectionSlug: string
269
+ /** If this task is grouped by family */
270
+ familyGroup?: TaskFamilyGroupI
271
+ }
272
+
273
+ export type TaskListView = 'current' | 'completed' | 'earlier'
274
+
275
+ export interface UpcomingTaskAdviceI {
276
+ /** @deprecated Since 1.9.10, this field is always `''`. */
277
+ content: string
278
+ taskName: string
279
+ plantName: string
280
+ plantSlug: string
281
+ plantImageURL?: string | null
282
+ gardenName: string
283
+ gardenCategory: string
284
+ selectionSlug: string
285
+ task: TaskI
286
+ /** If this task is grouped by family */
287
+ familyGroup?: TaskFamilyGroupI
288
+ }
289
+
290
+ export interface UpcomingTasksSectionI {
291
+ componentType: 'UpcomingTasks'
292
+ title: string
293
+ subtitle?: string
294
+ advices: UpcomingTaskAdviceI[]
295
+ }
296
+
297
+ /** Preview plant for WhenToSeedWhat section */
298
+ export interface WhenToSeedWhatPlantPreviewI {
299
+ id: number
300
+ name: string
301
+ family?: string | null
302
+ slug: string
303
+ imageURL?: string | null
304
+ }
305
+
306
+ /** A generic link card section with title, subtitle, URL, and optional preview images */
307
+ export interface LinkCardSectionI {
308
+ componentType: 'LinkCard'
309
+ title: string
310
+ subtitle?: string
311
+ url: string
312
+ previewPlants?: WhenToSeedWhatPlantPreviewI[]
313
+ backgroundColor?: string
314
+ /** Show a red badge indicator (replaces the plant preview stack when true) */
315
+ showBadge?: boolean
316
+ /** Optional badge count to display */
317
+ badgeCount?: number
318
+ }
319
+
320
+ export type SectionI =
321
+ | HeaderSectionI
322
+ | HeroCardsSectionI
323
+ | PlantCarouselSectionI
324
+ | HeroCardsCarouselSectionI
325
+ | WideCardsCarouselSectionI
326
+ | WeatherSectionI
327
+ | AdviceSectionI
328
+ | OnboardingCardSectionI
329
+ | MissionCardSectionI
330
+ | UpcomingTasksSectionI
331
+ | LinkCardSectionI
332
+
333
+ export interface Response {
334
+ sections: SectionI[]
335
+ weather?: WeatherSectionI
336
+ advice?: AdviceSectionI
337
+ }
338
+
339
+ export interface HeroCardItemI {
340
+ id?: string | null
341
+ mode: HeroCardMode
342
+ title?: string | null
343
+ description?: string | null
344
+ backgroundColor?: string | null
345
+ backgroundImageUrl?: string | null
346
+ previewPlants?: PlantI[]
347
+ ctaLabel?: string | null
348
+ selection?: SelectionI | null
349
+ plant?: PlantI | null
350
+ ctaRoute?: string | null
351
+ }
352
+ }
package/src/index.ts CHANGED
@@ -23,6 +23,7 @@ import * as SessionsAPI from './sessions.api'
23
23
  import * as HomeAPI from './home.api'
24
24
  import * as PagesAPI from './pages.api'
25
25
  import * as PaymentsAPI from './payments.api'
26
+ import * as WeatherAPI from './weather.api'
26
27
 
27
28
  // Allow access to the API namespaces without conflicts
28
29
  export namespace API {
@@ -32,4 +33,7 @@ export namespace API {
32
33
  export import HOME = HomeAPI
33
34
  export import PAGES = PagesAPI
34
35
  export import PAYMENTS = PaymentsAPI
36
+ // weather.api exports its types at the module top level, so this alias
37
+ // resolves to API.WEATHER.CurrentWeatherI directly.
38
+ export import WEATHER = WeatherAPI
35
39
  }
package/src/member.d.ts CHANGED
@@ -51,6 +51,7 @@ export interface MemberI {
51
51
  finishedOnboarding: boolean
52
52
  hasDownloadedNativeApp?: boolean
53
53
  unitSystem: 'imperial' | 'metric'
54
+ language?: string
54
55
  gardenZoneTimelessPreference?: boolean
55
56
  subscriptionEndDate?: Date
56
57
  /**
@@ -87,6 +88,14 @@ export interface MemberI {
87
88
  export interface PrivateMemberI {
88
89
  id: number
89
90
  email: string
91
+ /** New email address awaiting verification during an email change. Null/absent when none pending. */
92
+ pendingEmail?: string | null
93
+ /**
94
+ * When `pendingEmail` was last requested. Lets the client tell whether the
95
+ * verification link is likely still within Stytch's 5-minute window, or
96
+ * whether the member should request a fresh one. Null/absent when none pending.
97
+ */
98
+ pendingEmailRequestedAt?: Date | null
90
99
  city?: string
91
100
  unitSystem: 'imperial' | 'metric'
92
101
  language: 'fr-CA' | 'en-CA'