@la-main-verte/shared-types 1.0.76 → 1.0.78

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@la-main-verte/shared-types",
3
- "version": "1.0.76",
3
+ "version": "1.0.78",
4
4
  "description": "Shared TypeScript interfaces for frontend of la-main-verte app",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -175,6 +175,7 @@ export interface GardenZoneI {
175
175
  */
176
176
  GardenZoneCulture?: GardenZoneCultureI
177
177
  rotationSuggestion?: string
178
+ category?: 'cultural' | 'decorative' | null
178
179
  }
179
180
 
180
181
  export interface GardenZoneCultureI {
@@ -18,6 +18,7 @@ export interface GardenOverviewStatsI {
18
18
  totalSurfaceWithoutCulture: string
19
19
  surfaceComparisonMessage: string | null
20
20
  familyDistribution: FamilyStatsI[]
21
+ jardinVivrierComparison: GardenOverviewJardinVivrierFamilyStatsI[]
21
22
  fertilization: FertilizationStatsI
22
23
  zones: GardenOverviewZoneStatsI[]
23
24
  }
@@ -43,6 +44,13 @@ export interface FamilyStatsI {
43
44
  plants: GardenOverviewPlantStatsI[]
44
45
  }
45
46
 
47
+ export interface GardenOverviewJardinVivrierFamilyStatsI {
48
+ family: string
49
+ parentImageURL: string | null
50
+ cultivatedQuantity: number
51
+ suggestedQuantityForFiveInJardinVivrier: number | null
52
+ }
53
+
46
54
  /**
47
55
  * Extended PlantI with overview-specific statistics
48
56
  * Contains the full plant data plus surface, seedQuantity, and position
package/src/index.ts CHANGED
@@ -1,32 +1,32 @@
1
- export * from './member'
2
- export * from './selection'
3
- export * from './plantSelection'
4
- export * from './plant'
5
- export * from './task'
6
- export * from './calendarView'
7
- export * from './apiError'
8
- export * from './gardenMap'
9
- export * from './gardenOverview'
10
- export * from './alert'
11
- export * from './image'
12
- export * from './note'
13
- export * from './taggedItem'
14
- export * from './fertilizer'
15
- export * from './utmParams'
16
- export * from './plantFilters'
17
- import * as PlantsAPI from './plants.api'
18
- import * as UsersAPI from './users.api'
19
- import * as SessionsAPI from './sessions.api'
20
- import * as HomeAPI from './home.api'
21
- import * as PagesAPI from './pages.api'
22
- import * as PaymentsAPI from './payments.api'
23
-
24
- // Allow access to the API namespaces without conflicts
25
- export namespace API {
26
- export import PLANTS = PlantsAPI
27
- export import USERS = UsersAPI
28
- export import SESSIONS = SessionsAPI
29
- export import HOME = HomeAPI
30
- export import PAGES = PagesAPI
31
- export import PAYMENTS = PaymentsAPI
32
- }
1
+ export * from './member'
2
+ export * from './selection'
3
+ export * from './plantSelection'
4
+ export * from './plant'
5
+ export * from './task'
6
+ export * from './calendarView'
7
+ export * from './apiError'
8
+ export * from './gardenMap'
9
+ export * from './gardenOverview'
10
+ export * from './alert'
11
+ export * from './image'
12
+ export * from './note'
13
+ export * from './taggedItem'
14
+ export * from './fertilizer'
15
+ export * from './utmParams'
16
+ export * from './plantFilters'
17
+ import * as PlantsAPI from './plants.api'
18
+ import * as UsersAPI from './users.api'
19
+ import * as SessionsAPI from './sessions.api'
20
+ import * as HomeAPI from './home.api'
21
+ import * as PagesAPI from './pages.api'
22
+ import * as PaymentsAPI from './payments.api'
23
+
24
+ // Allow access to the API namespaces without conflicts
25
+ export namespace API {
26
+ export import PLANTS = PlantsAPI
27
+ export import USERS = UsersAPI
28
+ export import SESSIONS = SessionsAPI
29
+ export import HOME = HomeAPI
30
+ export import PAGES = PagesAPI
31
+ export import PAYMENTS = PaymentsAPI
32
+ }
@@ -1,17 +1,17 @@
1
- export namespace PAYMENTS {
2
- export namespace GET {
3
- export interface Request {
4
- params: {
5
- checkoutSessionId: string
6
- }
7
- }
8
-
9
- export interface Response {
10
- amount: number
11
- category: 'Analysis' | 'Subscription'
12
- email: string
13
- member_id: number | null
14
- productType: 'analysis' | 'monthlySubscription' | 'yearlySubscription' | 'fiveYearLicense' | null
15
- }
16
- }
17
- }
1
+ export namespace PAYMENTS {
2
+ export namespace GET {
3
+ export interface Request {
4
+ params: {
5
+ checkoutSessionId: string
6
+ }
7
+ }
8
+
9
+ export interface Response {
10
+ amount: number
11
+ category: 'Analysis' | 'Subscription'
12
+ email: string
13
+ member_id: number | null
14
+ productType: 'analysis' | 'monthlySubscription' | 'yearlySubscription' | 'fiveYearLicense' | null
15
+ }
16
+ }
17
+ }
package/src/plant.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { TaxonFamilyI } from './taxonFamily'
2
2
  import type { SeedingInfoI } from './pages.api'
3
+ import type { PlantFilterI } from './plantFilters'
3
4
  /**
4
5
  * Range filter value for min/max filters
5
6
  */
@@ -56,7 +57,9 @@ export interface PlantI {
56
57
  hexColor: string | null
57
58
  sunRequirements: 'partialShade' | 'fullSun' | 'fullShade' | null
58
59
  isHardy: boolean | null
60
+ quantityForFiveInJardinVivrier?: number | null
59
61
  imageURL: string
62
+ plantMeshURL: string | null
60
63
  totalWeeksToMaturity: number
61
64
  hasNoInformation: boolean
62
65
  createdAt: Date
@@ -99,6 +102,17 @@ interface PlantInventoryI {
99
102
  inStock: boolean
100
103
  }
101
104
 
105
+ export type AvailableGrowingConditionsI = Record<string, string[]>
106
+
107
+ export interface GrowingConditionsConfigI {
108
+ filters: PlantFilterI[]
109
+ }
110
+
111
+ export interface GrowingConditionsFiltersI {
112
+ sunRequirements?: 'partialShade' | 'fullShade'
113
+ rotationGroup?: 'regenerative' | 'demanding' | 'moderately_demanding' | 'less_demanding'
114
+ }
115
+
102
116
  export interface PlantSearchResultI {
103
117
  plants: PlantModelI[]
104
118
  selections: SelectionModelI[]
@@ -1,136 +1,136 @@
1
- import type { DeviceDataI } from './device.d'
2
- import type { MemberI as MemberDataI } 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' | 'coordinates')[]
18
- }
19
- }
20
- export type Response = MemberDataI & {
21
- unreadAlertsCount?: number
22
- }
23
- }
24
- export namespace DEVICES {
25
- export interface Request {
26
- headers: RequestHeaders
27
- body: {
28
- /** @see DeviceDataI */
29
- userAgent?: DeviceDataI['userAgent']
30
- platform?: DeviceDataI['platform']
31
- version?: DeviceDataI['version']
32
- model?: DeviceDataI['model']
33
- name?: DeviceDataI['name']
34
- appVersion?: DeviceDataI['appVersion']
35
- pushKey?: DeviceDataI['pushKey']
36
- apnsToken?: DeviceDataI['apnsToken']
37
- fcmToken?: DeviceDataI['fcmToken']
38
- webPushEndpoint?: DeviceDataI['webPushEndpoint']
39
- webPushP256dh?: DeviceDataI['webPushP256dh']
40
- webPushAuth?: DeviceDataI['webPushAuth']
41
- webPushSubscription?: DeviceDataI['webPushSubscription']
42
- }
43
- }
44
- export type Response = DeviceDataI
45
- }
46
- export namespace RECOMMENDATIONS {
47
- export type ComponentType = 'PlantCarousel' | 'SelectionCarousel' | 'HeroCardsCarousel' | 'YourSelection'
48
-
49
- interface BaseRecommendation {
50
- id: string
51
- componentType: ComponentType
52
- title?: string
53
- subtitle?: string
54
- cardsVisible?: number
55
- }
56
-
57
- export interface PlantCarouselRecommendation extends BaseRecommendation {
58
- componentType: 'PlantCarousel'
59
- selection: SelectionI & { Plants?: PlantI[] }
60
- displayRanking?: boolean
61
- }
62
-
63
- export interface SelectionCarouselRecommendation extends BaseRecommendation {
64
- componentType: 'SelectionCarousel'
65
- selections: SelectionI[]
66
- displayRanking?: boolean
67
- }
68
-
69
- export interface HeroCardsCarouselRecommendation extends BaseRecommendation {
70
- componentType: 'HeroCardsCarousel'
71
- selections: SelectionI[]
72
- }
73
-
74
- export interface YourSelectionRecommendation extends BaseRecommendation {
75
- componentType: 'YourSelection'
76
- }
77
-
78
- export interface ThemedRecommendationI {
79
- id: string
80
- label: string
81
- icon: string
82
- title?: string
83
- subtitle?: string
84
- selections: SelectionI[]
85
- cardsVisible?: number
86
- displayRanking?: boolean
87
- }
88
-
89
- export type RecommendationI =
90
- | PlantCarouselRecommendation
91
- | SelectionCarouselRecommendation
92
- | HeroCardsCarouselRecommendation
93
- | YourSelectionRecommendation
94
-
95
- export interface Request {
96
- headers: RequestHeaders
97
- }
98
-
99
- export interface Response {
100
- recommendations: RecommendationI[]
101
- themedRecommendations: ThemedRecommendationI[]
102
- }
103
- }
104
- export namespace UPDATE {
105
- export interface Request {
106
- headers: RequestHeaders
107
- body: {
108
- city?: string
109
- lastFreezingDate?: string | Date
110
- firstFreezingDate?: string | Date
111
- moveDatesRequested?: boolean
112
- lastFertilizerIdChosen?: number
113
- lastOrganicMatterPercentage?: number
114
- unitSystem?: 'imperial' | 'metric'
115
- gardenZoneTimelessPreference?: boolean
116
- }
117
- }
118
- export type Response = MemberDataI
119
- }
120
- export namespace GIFT_CARDS {
121
- export namespace REDEEM {
122
- export interface Request {
123
- headers: RequestHeaders
124
- body: {
125
- code: string
126
- }
127
- }
128
- export interface Response {
129
- success: boolean
130
- message?: string
131
- error?: string
132
- error_message?: string
133
- }
134
- }
135
- }
136
- }
1
+ import type { DeviceDataI } from './device.d'
2
+ import type { MemberI as MemberDataI } 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' | 'coordinates')[]
18
+ }
19
+ }
20
+ export type Response = MemberDataI & {
21
+ unreadAlertsCount?: number
22
+ }
23
+ }
24
+ export namespace DEVICES {
25
+ export interface Request {
26
+ headers: RequestHeaders
27
+ body: {
28
+ /** @see DeviceDataI */
29
+ userAgent?: DeviceDataI['userAgent']
30
+ platform?: DeviceDataI['platform']
31
+ version?: DeviceDataI['version']
32
+ model?: DeviceDataI['model']
33
+ name?: DeviceDataI['name']
34
+ appVersion?: DeviceDataI['appVersion']
35
+ pushKey?: DeviceDataI['pushKey']
36
+ apnsToken?: DeviceDataI['apnsToken']
37
+ fcmToken?: DeviceDataI['fcmToken']
38
+ webPushEndpoint?: DeviceDataI['webPushEndpoint']
39
+ webPushP256dh?: DeviceDataI['webPushP256dh']
40
+ webPushAuth?: DeviceDataI['webPushAuth']
41
+ webPushSubscription?: DeviceDataI['webPushSubscription']
42
+ }
43
+ }
44
+ export type Response = DeviceDataI
45
+ }
46
+ export namespace RECOMMENDATIONS {
47
+ export type ComponentType = 'PlantCarousel' | 'SelectionCarousel' | 'HeroCardsCarousel' | 'YourSelection'
48
+
49
+ interface BaseRecommendation {
50
+ id: string
51
+ componentType: ComponentType
52
+ title?: string
53
+ subtitle?: string
54
+ cardsVisible?: number
55
+ }
56
+
57
+ export interface PlantCarouselRecommendation extends BaseRecommendation {
58
+ componentType: 'PlantCarousel'
59
+ selection: SelectionI & { Plants?: PlantI[] }
60
+ displayRanking?: boolean
61
+ }
62
+
63
+ export interface SelectionCarouselRecommendation extends BaseRecommendation {
64
+ componentType: 'SelectionCarousel'
65
+ selections: SelectionI[]
66
+ displayRanking?: boolean
67
+ }
68
+
69
+ export interface HeroCardsCarouselRecommendation extends BaseRecommendation {
70
+ componentType: 'HeroCardsCarousel'
71
+ selections: SelectionI[]
72
+ }
73
+
74
+ export interface YourSelectionRecommendation extends BaseRecommendation {
75
+ componentType: 'YourSelection'
76
+ }
77
+
78
+ export interface ThemedRecommendationI {
79
+ id: string
80
+ label: string
81
+ icon: string
82
+ title?: string
83
+ subtitle?: string
84
+ selections: SelectionI[]
85
+ cardsVisible?: number
86
+ displayRanking?: boolean
87
+ }
88
+
89
+ export type RecommendationI =
90
+ | PlantCarouselRecommendation
91
+ | SelectionCarouselRecommendation
92
+ | HeroCardsCarouselRecommendation
93
+ | YourSelectionRecommendation
94
+
95
+ export interface Request {
96
+ headers: RequestHeaders
97
+ }
98
+
99
+ export interface Response {
100
+ recommendations: RecommendationI[]
101
+ themedRecommendations: ThemedRecommendationI[]
102
+ }
103
+ }
104
+ export namespace UPDATE {
105
+ export interface Request {
106
+ headers: RequestHeaders
107
+ body: {
108
+ city?: string
109
+ lastFreezingDate?: string | Date
110
+ firstFreezingDate?: string | Date
111
+ moveDatesRequested?: boolean
112
+ lastFertilizerIdChosen?: number
113
+ lastOrganicMatterPercentage?: number
114
+ unitSystem?: 'imperial' | 'metric'
115
+ gardenZoneTimelessPreference?: boolean
116
+ }
117
+ }
118
+ export type Response = MemberDataI
119
+ }
120
+ export namespace GIFT_CARDS {
121
+ export namespace REDEEM {
122
+ export interface Request {
123
+ headers: RequestHeaders
124
+ body: {
125
+ code: string
126
+ }
127
+ }
128
+ export interface Response {
129
+ success: boolean
130
+ message?: string
131
+ error?: string
132
+ error_message?: string
133
+ }
134
+ }
135
+ }
136
+ }