@la-main-verte/shared-types 1.0.91 → 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 -354
- 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/users.api.d.ts
CHANGED
|
@@ -1,154 +1,154 @@
|
|
|
1
|
-
import type { DeviceDataI } from './device.d'
|
|
2
|
-
import type { PrivateMemberI } from './member.d'
|
|
3
|
-
import type { SelectionI } from './selection.d'
|
|
4
|
-
import type { PlantI } from './plant.d'
|
|
5
|
-
|
|
6
|
-
interface RequestHeaders {
|
|
7
|
-
'x-session-token': string
|
|
8
|
-
'x-native-app-version'?: string
|
|
9
|
-
'x-application-type'?: 'react-native' | 'web'
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export namespace USERS {
|
|
13
|
-
export namespace GET {
|
|
14
|
-
export interface Request {
|
|
15
|
-
headers: RequestHeaders
|
|
16
|
-
params: {
|
|
17
|
-
scopes: ('unreadNotificationsCount' | 'requestAppStoreReview')[]
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
export type Response = PrivateMemberI
|
|
21
|
-
}
|
|
22
|
-
export namespace DEVICES {
|
|
23
|
-
export interface Request {
|
|
24
|
-
headers: RequestHeaders
|
|
25
|
-
body: {
|
|
26
|
-
/** @see DeviceDataI */
|
|
27
|
-
userAgent?: DeviceDataI['userAgent']
|
|
28
|
-
platform?: DeviceDataI['platform']
|
|
29
|
-
version?: DeviceDataI['version']
|
|
30
|
-
model?: DeviceDataI['model']
|
|
31
|
-
name?: DeviceDataI['name']
|
|
32
|
-
appVersion?: DeviceDataI['appVersion']
|
|
33
|
-
pushKey?: DeviceDataI['pushKey']
|
|
34
|
-
apnsToken?: DeviceDataI['apnsToken']
|
|
35
|
-
fcmToken?: DeviceDataI['fcmToken']
|
|
36
|
-
webPushEndpoint?: DeviceDataI['webPushEndpoint']
|
|
37
|
-
webPushP256dh?: DeviceDataI['webPushP256dh']
|
|
38
|
-
webPushAuth?: DeviceDataI['webPushAuth']
|
|
39
|
-
webPushSubscription?: DeviceDataI['webPushSubscription']
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
export type Response = DeviceDataI
|
|
43
|
-
}
|
|
44
|
-
export namespace RECOMMENDATIONS {
|
|
45
|
-
export type ComponentType = 'PlantCarousel' | 'SelectionCarousel' | 'HeroCardsCarousel' | 'YourSelection'
|
|
46
|
-
|
|
47
|
-
interface BaseRecommendation {
|
|
48
|
-
id: string
|
|
49
|
-
componentType: ComponentType
|
|
50
|
-
title?: string
|
|
51
|
-
subtitle?: string
|
|
52
|
-
cardsVisible?: number
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface PlantCarouselRecommendation extends BaseRecommendation {
|
|
56
|
-
componentType: 'PlantCarousel'
|
|
57
|
-
selection: SelectionI & { Plants?: PlantI[] }
|
|
58
|
-
displayRanking?: boolean
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface SelectionCarouselRecommendation extends BaseRecommendation {
|
|
62
|
-
componentType: 'SelectionCarousel'
|
|
63
|
-
selections: SelectionI[]
|
|
64
|
-
displayRanking?: boolean
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface HeroCardsCarouselRecommendation extends BaseRecommendation {
|
|
68
|
-
componentType: 'HeroCardsCarousel'
|
|
69
|
-
selections: SelectionI[]
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface YourSelectionRecommendation extends BaseRecommendation {
|
|
73
|
-
componentType: 'YourSelection'
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export interface ThemedRecommendationI {
|
|
77
|
-
id: string
|
|
78
|
-
label: string
|
|
79
|
-
icon: string
|
|
80
|
-
title?: string
|
|
81
|
-
subtitle?: string
|
|
82
|
-
selections: SelectionI[]
|
|
83
|
-
cardsVisible?: number
|
|
84
|
-
displayRanking?: boolean
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export type RecommendationI =
|
|
88
|
-
| PlantCarouselRecommendation
|
|
89
|
-
| SelectionCarouselRecommendation
|
|
90
|
-
| HeroCardsCarouselRecommendation
|
|
91
|
-
| YourSelectionRecommendation
|
|
92
|
-
|
|
93
|
-
export interface Request {
|
|
94
|
-
headers: RequestHeaders
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export interface Response {
|
|
98
|
-
recommendations: RecommendationI[]
|
|
99
|
-
themedRecommendations: ThemedRecommendationI[]
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
export namespace UPDATE {
|
|
103
|
-
export interface Request {
|
|
104
|
-
headers: RequestHeaders
|
|
105
|
-
body: {
|
|
106
|
-
city?: string
|
|
107
|
-
lastFreezingDate?: string | Date
|
|
108
|
-
firstFreezingDate?: string | Date
|
|
109
|
-
moveDatesRequested?: boolean
|
|
110
|
-
lastFertilizerIdChosen?: number
|
|
111
|
-
lastOrganicMatterPercentage?: number
|
|
112
|
-
unitSystem?: 'imperial' | 'metric'
|
|
113
|
-
gardenZoneTimelessPreference?: boolean
|
|
114
|
-
/** Newsletter consent set from the in-app prompt. true = opt in, false = refused. */
|
|
115
|
-
marketingConsent?: boolean
|
|
116
|
-
language?: string
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
export type Response = PrivateMemberI
|
|
120
|
-
}
|
|
121
|
-
export namespace EMAIL {
|
|
122
|
-
/** PUT /users/email — request a primary email change (step 1 of 2). */
|
|
123
|
-
export interface Request {
|
|
124
|
-
headers: RequestHeaders
|
|
125
|
-
body: {
|
|
126
|
-
/** The address the member wants to switch their account to. */
|
|
127
|
-
newEmail: string
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
export interface Response {
|
|
131
|
-
success: boolean
|
|
132
|
-
message?: string
|
|
133
|
-
suggestion?: string
|
|
134
|
-
error_message?: string
|
|
135
|
-
error_suggestion?: string
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
export namespace GIFT_CARDS {
|
|
139
|
-
export namespace REDEEM {
|
|
140
|
-
export interface Request {
|
|
141
|
-
headers: RequestHeaders
|
|
142
|
-
body: {
|
|
143
|
-
code: string
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
export interface Response {
|
|
147
|
-
success: boolean
|
|
148
|
-
message?: string
|
|
149
|
-
error?: string
|
|
150
|
-
error_message?: string
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
1
|
+
import type { DeviceDataI } from './device.d'
|
|
2
|
+
import type { PrivateMemberI } from './member.d'
|
|
3
|
+
import type { SelectionI } from './selection.d'
|
|
4
|
+
import type { PlantI } from './plant.d'
|
|
5
|
+
|
|
6
|
+
interface RequestHeaders {
|
|
7
|
+
'x-session-token': string
|
|
8
|
+
'x-native-app-version'?: string
|
|
9
|
+
'x-application-type'?: 'react-native' | 'web'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export namespace USERS {
|
|
13
|
+
export namespace GET {
|
|
14
|
+
export interface Request {
|
|
15
|
+
headers: RequestHeaders
|
|
16
|
+
params: {
|
|
17
|
+
scopes: ('unreadNotificationsCount' | 'requestAppStoreReview')[]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export type Response = PrivateMemberI
|
|
21
|
+
}
|
|
22
|
+
export namespace DEVICES {
|
|
23
|
+
export interface Request {
|
|
24
|
+
headers: RequestHeaders
|
|
25
|
+
body: {
|
|
26
|
+
/** @see DeviceDataI */
|
|
27
|
+
userAgent?: DeviceDataI['userAgent']
|
|
28
|
+
platform?: DeviceDataI['platform']
|
|
29
|
+
version?: DeviceDataI['version']
|
|
30
|
+
model?: DeviceDataI['model']
|
|
31
|
+
name?: DeviceDataI['name']
|
|
32
|
+
appVersion?: DeviceDataI['appVersion']
|
|
33
|
+
pushKey?: DeviceDataI['pushKey']
|
|
34
|
+
apnsToken?: DeviceDataI['apnsToken']
|
|
35
|
+
fcmToken?: DeviceDataI['fcmToken']
|
|
36
|
+
webPushEndpoint?: DeviceDataI['webPushEndpoint']
|
|
37
|
+
webPushP256dh?: DeviceDataI['webPushP256dh']
|
|
38
|
+
webPushAuth?: DeviceDataI['webPushAuth']
|
|
39
|
+
webPushSubscription?: DeviceDataI['webPushSubscription']
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export type Response = DeviceDataI
|
|
43
|
+
}
|
|
44
|
+
export namespace RECOMMENDATIONS {
|
|
45
|
+
export type ComponentType = 'PlantCarousel' | 'SelectionCarousel' | 'HeroCardsCarousel' | 'YourSelection'
|
|
46
|
+
|
|
47
|
+
interface BaseRecommendation {
|
|
48
|
+
id: string
|
|
49
|
+
componentType: ComponentType
|
|
50
|
+
title?: string
|
|
51
|
+
subtitle?: string
|
|
52
|
+
cardsVisible?: number
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface PlantCarouselRecommendation extends BaseRecommendation {
|
|
56
|
+
componentType: 'PlantCarousel'
|
|
57
|
+
selection: SelectionI & { Plants?: PlantI[] }
|
|
58
|
+
displayRanking?: boolean
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface SelectionCarouselRecommendation extends BaseRecommendation {
|
|
62
|
+
componentType: 'SelectionCarousel'
|
|
63
|
+
selections: SelectionI[]
|
|
64
|
+
displayRanking?: boolean
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface HeroCardsCarouselRecommendation extends BaseRecommendation {
|
|
68
|
+
componentType: 'HeroCardsCarousel'
|
|
69
|
+
selections: SelectionI[]
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface YourSelectionRecommendation extends BaseRecommendation {
|
|
73
|
+
componentType: 'YourSelection'
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface ThemedRecommendationI {
|
|
77
|
+
id: string
|
|
78
|
+
label: string
|
|
79
|
+
icon: string
|
|
80
|
+
title?: string
|
|
81
|
+
subtitle?: string
|
|
82
|
+
selections: SelectionI[]
|
|
83
|
+
cardsVisible?: number
|
|
84
|
+
displayRanking?: boolean
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export type RecommendationI =
|
|
88
|
+
| PlantCarouselRecommendation
|
|
89
|
+
| SelectionCarouselRecommendation
|
|
90
|
+
| HeroCardsCarouselRecommendation
|
|
91
|
+
| YourSelectionRecommendation
|
|
92
|
+
|
|
93
|
+
export interface Request {
|
|
94
|
+
headers: RequestHeaders
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface Response {
|
|
98
|
+
recommendations: RecommendationI[]
|
|
99
|
+
themedRecommendations: ThemedRecommendationI[]
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export namespace UPDATE {
|
|
103
|
+
export interface Request {
|
|
104
|
+
headers: RequestHeaders
|
|
105
|
+
body: {
|
|
106
|
+
city?: string
|
|
107
|
+
lastFreezingDate?: string | Date
|
|
108
|
+
firstFreezingDate?: string | Date
|
|
109
|
+
moveDatesRequested?: boolean
|
|
110
|
+
lastFertilizerIdChosen?: number
|
|
111
|
+
lastOrganicMatterPercentage?: number
|
|
112
|
+
unitSystem?: 'imperial' | 'metric'
|
|
113
|
+
gardenZoneTimelessPreference?: boolean
|
|
114
|
+
/** Newsletter consent set from the in-app prompt. true = opt in, false = refused. */
|
|
115
|
+
marketingConsent?: boolean
|
|
116
|
+
language?: string
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
export type Response = PrivateMemberI
|
|
120
|
+
}
|
|
121
|
+
export namespace EMAIL {
|
|
122
|
+
/** PUT /users/email — request a primary email change (step 1 of 2). */
|
|
123
|
+
export interface Request {
|
|
124
|
+
headers: RequestHeaders
|
|
125
|
+
body: {
|
|
126
|
+
/** The address the member wants to switch their account to. */
|
|
127
|
+
newEmail: string
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
export interface Response {
|
|
131
|
+
success: boolean
|
|
132
|
+
message?: string
|
|
133
|
+
suggestion?: string
|
|
134
|
+
error_message?: string
|
|
135
|
+
error_suggestion?: string
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
export namespace GIFT_CARDS {
|
|
139
|
+
export namespace REDEEM {
|
|
140
|
+
export interface Request {
|
|
141
|
+
headers: RequestHeaders
|
|
142
|
+
body: {
|
|
143
|
+
code: string
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
export interface Response {
|
|
147
|
+
success: boolean
|
|
148
|
+
message?: string
|
|
149
|
+
error?: string
|
|
150
|
+
error_message?: string
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
package/src/weather.api.d.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Live weather conditions for the member's garden location.
|
|
3
|
-
* Powers the garden map weather badge and the real-time rain animation.
|
|
4
|
-
*
|
|
5
|
-
* Types are exported at the module top level (no nested namespace) so the
|
|
6
|
-
* `API.WEATHER` alias in index.ts resolves to `API.WEATHER.CurrentWeatherI`.
|
|
7
|
-
*/
|
|
8
|
-
export interface CurrentWeatherI {
|
|
9
|
-
tempC: number
|
|
10
|
-
feelsLikeC: number
|
|
11
|
-
/** True when WeatherAPI reports daylight at the location. */
|
|
12
|
-
isDay: boolean
|
|
13
|
-
conditionText: string | null
|
|
14
|
-
/** WeatherAPI condition code — see https://www.weatherapi.com/docs/weather_conditions.json */
|
|
15
|
-
conditionCode: number | null
|
|
16
|
-
iconUrl: string | null
|
|
17
|
-
/** True when the current condition is rain/drizzle — drives the garden map rain animation. */
|
|
18
|
-
isRaining: boolean
|
|
19
|
-
isSnowing: boolean
|
|
20
|
-
/** Precipitation over the last hour, in millimeters. */
|
|
21
|
-
precipMm: number
|
|
22
|
-
humidity: number
|
|
23
|
-
windKph: number
|
|
24
|
-
/** Cloud cover percentage (0–100). */
|
|
25
|
-
cloud: number
|
|
26
|
-
locationName: string
|
|
27
|
-
lastUpdatedAt: string
|
|
28
|
-
dataSource: 'weatherapi'
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface CurrentWeatherResponseI {
|
|
32
|
-
/** Null when the member has no usable location or the upstream call failed. */
|
|
33
|
-
weather: CurrentWeatherI | null
|
|
34
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Live weather conditions for the member's garden location.
|
|
3
|
+
* Powers the garden map weather badge and the real-time rain animation.
|
|
4
|
+
*
|
|
5
|
+
* Types are exported at the module top level (no nested namespace) so the
|
|
6
|
+
* `API.WEATHER` alias in index.ts resolves to `API.WEATHER.CurrentWeatherI`.
|
|
7
|
+
*/
|
|
8
|
+
export interface CurrentWeatherI {
|
|
9
|
+
tempC: number
|
|
10
|
+
feelsLikeC: number
|
|
11
|
+
/** True when WeatherAPI reports daylight at the location. */
|
|
12
|
+
isDay: boolean
|
|
13
|
+
conditionText: string | null
|
|
14
|
+
/** WeatherAPI condition code — see https://www.weatherapi.com/docs/weather_conditions.json */
|
|
15
|
+
conditionCode: number | null
|
|
16
|
+
iconUrl: string | null
|
|
17
|
+
/** True when the current condition is rain/drizzle — drives the garden map rain animation. */
|
|
18
|
+
isRaining: boolean
|
|
19
|
+
isSnowing: boolean
|
|
20
|
+
/** Precipitation over the last hour, in millimeters. */
|
|
21
|
+
precipMm: number
|
|
22
|
+
humidity: number
|
|
23
|
+
windKph: number
|
|
24
|
+
/** Cloud cover percentage (0–100). */
|
|
25
|
+
cloud: number
|
|
26
|
+
locationName: string
|
|
27
|
+
lastUpdatedAt: string
|
|
28
|
+
dataSource: 'weatherapi'
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface CurrentWeatherResponseI {
|
|
32
|
+
/** Null when the member has no usable location or the upstream call failed. */
|
|
33
|
+
weather: CurrentWeatherI | null
|
|
34
|
+
}
|