@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/package.json +1 -1
- package/src/audience.d.ts +93 -86
- package/src/fertilizer.d.ts +67 -55
- package/src/home.api.d.ts +347 -262
- package/src/index.ts +4 -0
- package/src/member.d.ts +19 -0
- package/src/plant.d.ts +201 -200
- package/src/users.api.d.ts +20 -0
- package/src/weather.api.d.ts +34 -0
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
|
-
| '
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface
|
|
45
|
-
componentType: '
|
|
46
|
-
title: string
|
|
47
|
-
subtitle
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface
|
|
71
|
-
|
|
72
|
-
title?: string
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export
|
|
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
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
export interface
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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
|