@la-main-verte/shared-types 1.0.86 → 1.0.89

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,347 @@
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
+
214
+ export interface MissionCardSectionI {
215
+ componentType: 'MissionCard'
216
+ /** Stable mission identifier (slug) — also used as the section id. */
217
+ id: string
218
+ title: string
219
+ subtitle: string
220
+ description?: string
221
+ /** Visual theme applied to the card and all its sub-elements. */
222
+ theme: MissionThemeI
223
+ /** Illustration aligned to the right of the card. */
224
+ backgroundImageURL?: string
225
+ steps: MissionStepI[]
226
+ completedStepsCount: number
227
+ totalStepsCount: number
228
+ /** True once every step is complete (reward unlocked). */
229
+ isCompleted: boolean
230
+ reward: MissionRewardI
231
+ /** Display order across missions (ascending). */
232
+ sortOrder: number
233
+ }
234
+
235
+ /** Minimal plant info for preview display (e.g. parent plant in grouped tasks) */
236
+ export interface TaskPlantPreviewI {
237
+ name: string
238
+ slug: string
239
+ imageURL?: string | null
240
+ }
241
+
242
+ /** Plant info within a family group — includes the task ID specific to this plant */
243
+ export interface TaskFamilyPlantPreviewI extends TaskPlantPreviewI {
244
+ taskId: number
245
+ }
246
+
247
+ /** Family group info when multiple plants share the same task */
248
+ export interface TaskFamilyGroupI {
249
+ familyName: string
250
+ plantsCount: number
251
+ plants: TaskFamilyPlantPreviewI[]
252
+ }
253
+
254
+ export interface UpcomingTaskI {
255
+ task: TaskI
256
+ /** PlantSelection id used by task list views to group tasks per planted item. */
257
+ plantSelectionId?: number
258
+ plantName: string
259
+ plantSlug: string
260
+ plantImageURL?: string | null
261
+ gardenName: string
262
+ gardenCategory: string
263
+ selectionSlug: string
264
+ /** If this task is grouped by family */
265
+ familyGroup?: TaskFamilyGroupI
266
+ }
267
+
268
+ export type TaskListView = 'current' | 'completed' | 'earlier'
269
+
270
+ export interface UpcomingTaskAdviceI {
271
+ /** @deprecated Since 1.9.10, this field is always `''`. */
272
+ content: string
273
+ taskName: string
274
+ plantName: string
275
+ plantSlug: string
276
+ plantImageURL?: string | null
277
+ gardenName: string
278
+ gardenCategory: string
279
+ selectionSlug: string
280
+ task: TaskI
281
+ /** If this task is grouped by family */
282
+ familyGroup?: TaskFamilyGroupI
283
+ }
284
+
285
+ export interface UpcomingTasksSectionI {
286
+ componentType: 'UpcomingTasks'
287
+ title: string
288
+ subtitle?: string
289
+ advices: UpcomingTaskAdviceI[]
290
+ }
291
+
292
+ /** Preview plant for WhenToSeedWhat section */
293
+ export interface WhenToSeedWhatPlantPreviewI {
294
+ id: number
295
+ name: string
296
+ family?: string | null
297
+ slug: string
298
+ imageURL?: string | null
299
+ }
300
+
301
+ /** A generic link card section with title, subtitle, URL, and optional preview images */
302
+ export interface LinkCardSectionI {
303
+ componentType: 'LinkCard'
304
+ title: string
305
+ subtitle?: string
306
+ url: string
307
+ previewPlants?: WhenToSeedWhatPlantPreviewI[]
308
+ backgroundColor?: string
309
+ /** Show a red badge indicator (replaces the plant preview stack when true) */
310
+ showBadge?: boolean
311
+ /** Optional badge count to display */
312
+ badgeCount?: number
313
+ }
314
+
315
+ export type SectionI =
316
+ | HeaderSectionI
317
+ | HeroCardsSectionI
318
+ | PlantCarouselSectionI
319
+ | HeroCardsCarouselSectionI
320
+ | WideCardsCarouselSectionI
321
+ | WeatherSectionI
322
+ | AdviceSectionI
323
+ | OnboardingCardSectionI
324
+ | MissionCardSectionI
325
+ | UpcomingTasksSectionI
326
+ | LinkCardSectionI
327
+
328
+ export interface Response {
329
+ sections: SectionI[]
330
+ weather?: WeatherSectionI
331
+ advice?: AdviceSectionI
332
+ }
333
+
334
+ export interface HeroCardItemI {
335
+ id?: string | null
336
+ mode: HeroCardMode
337
+ title?: string | null
338
+ description?: string | null
339
+ backgroundColor?: string | null
340
+ backgroundImageUrl?: string | null
341
+ previewPlants?: PlantI[]
342
+ ctaLabel?: string | null
343
+ selection?: SelectionI | null
344
+ plant?: PlantI | null
345
+ ctaRoute?: string | null
346
+ }
347
+ }
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,8 +88,17 @@ 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'
101
+ language: 'fr-CA' | 'en-CA'
92
102
  gardenZoneTimelessPreference?: boolean
93
103
  firstFreezingDate?: Date
94
104
  lastFreezingDate?: Date
@@ -116,6 +126,15 @@ export interface PrivateMemberI {
116
126
  neverEditedATask?: boolean
117
127
  neverTriedAiAgent?: boolean
118
128
  neverTriedSpacingSection?: boolean
129
+ /**
130
+ * Newsletter opt-in.
131
+ * - true: opted in → never ask again
132
+ * - false: refused in-app → re-askable after a cooldown
133
+ * - null: never asked → ask now
134
+ */
135
+ marketingConsent?: boolean | null
136
+ /** When marketingConsent was last set. Drives the re-ask cooldown. */
137
+ marketingConsentUpdatedAt?: Date | null
119
138
  /**
120
139
  * True when the member belongs to the "very active" audience (~14 days of
121
140
  * distinct activity). Only present when GET /users is called with the