@la-main-verte/shared-types 1.0.55 → 1.0.57

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.
@@ -1,54 +1,55 @@
1
- import { PlantI } from './plant'
2
-
3
- export interface SelectionI {
4
- id: number
5
- memberId: number
6
- title: string
7
- slug: string
8
- description?: string
9
- orderBy?: 'startDate' | 'name'
10
- default?: boolean
11
- viewsCount?: number
12
- imageLocation?: string
13
- imageURL?: string
14
- /**
15
- * Indicates if the selection is featured on the app (search, explore, etc).
16
- **/
17
- featured: boolean
18
- /**
19
- * Indicates if the selection is dynamically generated on the fly by the API.
20
- * Ex: "What you can seed in March"
21
- * INTERNAL USE ONLY
22
- */
23
- isDynamic: boolean
24
- /**
25
- * Background color of the selection, for UI purposes.
26
- */
27
- backgroundColor: string | null
28
- /**
29
- * Font color of the selection, for UI purposes.
30
- */
31
- fontColor: string | null
32
- /**
33
- * Font awesome icon name of the selection, for UI purposes.
34
- * -----------------------------------------
35
- * Not all icons are available in the react-native-app. Must be explicitly declared first.
36
- * Ex: 'fa-bag-seedling', 'fa-bug', etc.
37
- */
38
- iconName: string | null
39
- link?: string
40
- sharingURL?: string
41
- createdAt: Date
42
- updatedAt: Date
43
- Plants?: PlantI[]
44
- }
45
-
46
- /**
47
- * Those are the different possible types for a selection.
48
- */
49
- export type SelectionType = 'Serre' | 'Potager' | 'Recette' | 'Coup de coeur' | "Jardin d'intérieur" | 'Autres'
50
-
51
- export interface SelectionTypeI {
52
- name: SelectionType
53
- iconName?: IconName
54
- }
1
+ import { PlantI } from './plant'
2
+
3
+ export interface SelectionI {
4
+ id: number
5
+ memberId: number
6
+ title: string
7
+ slug: string
8
+ description?: string
9
+ orderBy?: 'startDate' | 'name'
10
+ default?: boolean
11
+ viewsCount?: number
12
+ imageLocation?: string
13
+ imageURL?: string
14
+ /**
15
+ * Indicates if the selection is featured on the app (search, explore, etc).
16
+ **/
17
+ featured: boolean
18
+ /**
19
+ * Indicates if the selection is dynamically generated on the fly by the API.
20
+ * Ex: "What you can seed in March"
21
+ * INTERNAL USE ONLY
22
+ */
23
+ isDynamic: boolean
24
+ /**
25
+ * Background color of the selection, for UI purposes.
26
+ */
27
+ backgroundColor: string | null
28
+ /**
29
+ * Font color of the selection, for UI purposes.
30
+ */
31
+ fontColor: string | null
32
+ /**
33
+ * Font awesome icon name of the selection, for UI purposes.
34
+ * -----------------------------------------
35
+ * Not all icons are available in the react-native-app. Must be explicitly declared first.
36
+ * Ex: 'fa-bag-seedling', 'fa-bug', etc.
37
+ */
38
+ iconName: string | null
39
+ link?: string
40
+ sharingURL?: string
41
+ createdAt: Date
42
+ updatedAt: Date
43
+ Plants?: PlantI[]
44
+ yearOfCulture: number
45
+ }
46
+
47
+ /**
48
+ * Those are the different possible types for a selection.
49
+ */
50
+ export type SelectionType = 'Serre' | 'Potager' | 'Recette' | 'Coup de coeur' | "Jardin d'intérieur" | 'Autres'
51
+
52
+ export interface SelectionTypeI {
53
+ name: SelectionType
54
+ iconName?: IconName
55
+ }
@@ -1,134 +1,134 @@
1
- import type { UTMParams } from './utmParams'
2
- import type { EventType, EventDetailsI } from '../../server/types/sessionEvent'
3
- import type { PaymentProductTypeI } from '../../server/types/payment'
4
-
5
- interface RequestHeaders {
6
- 'x-session-token'?: string
7
- 'x-native-app-version'?: string
8
- 'x-application-type'?: 'react-native' | 'web'
9
- 'user-agent'?: string
10
- }
11
-
12
- export namespace SESSIONS {
13
- export namespace POST {
14
- export interface Request {
15
- headers: RequestHeaders
16
- body: {
17
- uuid?: string
18
- platform?: 'web' | 'react-native' | 'unknown'
19
- device_id?: number
20
- app_version?: string
21
- ip_address?: string
22
- } & Partial<UTMParams>
23
- }
24
- export interface Response {
25
- success: boolean
26
- session: {
27
- id: number
28
- uuid: string
29
- is_authenticated: boolean
30
- expires_at: string
31
- platform: string
32
- first_seen_at: string
33
- last_activity_at: string
34
- }
35
- message?: string
36
- }
37
- }
38
-
39
- export namespace GET {
40
- export interface Request {
41
- headers: RequestHeaders
42
- query: {
43
- session_id: string
44
- }
45
- }
46
- export interface Response {
47
- success: boolean
48
- session?: {
49
- id: number
50
- uuid: string
51
- is_authenticated: boolean
52
- expires_at: string
53
- platform: string
54
- first_seen_at: string
55
- last_activity_at: string
56
- memberId?: number
57
- }
58
- message?: string
59
- }
60
- }
61
-
62
- export namespace EVENTS {
63
- export namespace POST {
64
- export interface Request {
65
- headers: RequestHeaders
66
- body: EventDetailsI & {
67
- uuid: string
68
- event_data?: any
69
- // Feature usage specific
70
- feature_name?: string
71
- feature_action?: string
72
- // Event metadata
73
- platform?: 'web' | 'react-native' | 'unknown'
74
- device_id?: number
75
- app_version?: string
76
- ip_address?: string
77
- // Payment tracking
78
- payment_customer_external_id?: string
79
- payment_processor?: 'stripe' | 'apple' | 'google'
80
- payment_middleware?: 'stripe' | 'revenuecat'
81
- payment_product_type?: PaymentProductTypeI
82
- payment_transaction_id?: string
83
- // Revenue tracking
84
- revenue_amount?: number
85
- currency?: string
86
- created_by?: 'server' | 'client' | 'unknown'
87
- }
88
- }
89
- export interface Response {
90
- success: boolean
91
- event: {
92
- id: number
93
- sessionId: number
94
- createdAt: string
95
- } & EventDetailsI
96
- message?: string
97
- }
98
- }
99
-
100
- export namespace GET {
101
- export interface Request {
102
- headers: RequestHeaders
103
- query: {
104
- session_id?: string
105
- event_type?: EventType
106
- feature_name?: string
107
- campaign_id?: string
108
- start_date?: string
109
- end_date?: string
110
- limit?: number
111
- offset?: number
112
- }
113
- }
114
- export interface Response {
115
- success: boolean
116
- events: Array<
117
- {
118
- id: number
119
- sessionId: number
120
- event_data?: any
121
- feature_name?: string
122
- feature_action?: string
123
- platform: string
124
- revenue_amount?: number
125
- currency?: string
126
- createdAt: string
127
- } & EventDetailsI
128
- >
129
- total_count: number
130
- message?: string
131
- }
132
- }
133
- }
134
- }
1
+ import type { UTMParams } from './utmParams'
2
+ import type { EventType, EventDetailsI } from '../../server/types/sessionEvent'
3
+ import type { PaymentProductTypeI } from '../../server/types/payment'
4
+
5
+ interface RequestHeaders {
6
+ 'x-session-token'?: string
7
+ 'x-native-app-version'?: string
8
+ 'x-application-type'?: 'react-native' | 'web'
9
+ 'user-agent'?: string
10
+ }
11
+
12
+ export namespace SESSIONS {
13
+ export namespace POST {
14
+ export interface Request {
15
+ headers: RequestHeaders
16
+ body: {
17
+ uuid?: string
18
+ platform?: 'web' | 'react-native' | 'unknown'
19
+ device_id?: number
20
+ app_version?: string
21
+ ip_address?: string
22
+ } & Partial<UTMParams>
23
+ }
24
+ export interface Response {
25
+ success: boolean
26
+ session: {
27
+ id: number
28
+ uuid: string
29
+ is_authenticated: boolean
30
+ expires_at: string
31
+ platform: string
32
+ first_seen_at: string
33
+ last_activity_at: string
34
+ }
35
+ message?: string
36
+ }
37
+ }
38
+
39
+ export namespace GET {
40
+ export interface Request {
41
+ headers: RequestHeaders
42
+ query: {
43
+ session_id: string
44
+ }
45
+ }
46
+ export interface Response {
47
+ success: boolean
48
+ session?: {
49
+ id: number
50
+ uuid: string
51
+ is_authenticated: boolean
52
+ expires_at: string
53
+ platform: string
54
+ first_seen_at: string
55
+ last_activity_at: string
56
+ memberId?: number
57
+ }
58
+ message?: string
59
+ }
60
+ }
61
+
62
+ export namespace EVENTS {
63
+ export namespace POST {
64
+ export interface Request {
65
+ headers: RequestHeaders
66
+ body: EventDetailsI & {
67
+ uuid: string
68
+ event_data?: any
69
+ // Feature usage specific
70
+ feature_name?: string
71
+ feature_action?: string
72
+ // Event metadata
73
+ platform?: 'web' | 'react-native' | 'unknown'
74
+ device_id?: number
75
+ app_version?: string
76
+ ip_address?: string
77
+ // Payment tracking
78
+ payment_customer_external_id?: string
79
+ payment_processor?: 'stripe' | 'apple' | 'google'
80
+ payment_middleware?: 'stripe' | 'revenuecat'
81
+ payment_product_type?: PaymentProductTypeI
82
+ payment_transaction_id?: string
83
+ // Revenue tracking
84
+ revenue_amount?: number
85
+ currency?: string
86
+ created_by?: 'server' | 'client' | 'unknown'
87
+ }
88
+ }
89
+ export interface Response {
90
+ success: boolean
91
+ event: {
92
+ id: number
93
+ sessionId: number
94
+ createdAt: string
95
+ } & EventDetailsI
96
+ message?: string
97
+ }
98
+ }
99
+
100
+ export namespace GET {
101
+ export interface Request {
102
+ headers: RequestHeaders
103
+ query: {
104
+ session_id?: string
105
+ event_type?: EventType
106
+ feature_name?: string
107
+ campaign_id?: string
108
+ start_date?: string
109
+ end_date?: string
110
+ limit?: number
111
+ offset?: number
112
+ }
113
+ }
114
+ export interface Response {
115
+ success: boolean
116
+ events: Array<
117
+ {
118
+ id: number
119
+ sessionId: number
120
+ event_data?: any
121
+ feature_name?: string
122
+ feature_action?: string
123
+ platform: string
124
+ revenue_amount?: number
125
+ currency?: string
126
+ createdAt: string
127
+ } & EventDetailsI
128
+ >
129
+ total_count: number
130
+ message?: string
131
+ }
132
+ }
133
+ }
134
+ }
@@ -1,12 +1,12 @@
1
- import { TagI } from './tag.d.ts'
2
-
3
- export interface TaggedItemI {
4
- id: number
5
- noteId: number
6
- tagId: number
7
- itemType: 'plant' | 'task'
8
- itemId: number
9
- createdAt: Date
10
- updatedAt: Date
11
- Tag: TagI
12
- }
1
+ import { TagI } from './tag.d.ts'
2
+
3
+ export interface TaggedItemI {
4
+ id: number
5
+ noteId: number
6
+ tagId: number
7
+ itemType: 'plant' | 'task'
8
+ itemId: number
9
+ createdAt: Date
10
+ updatedAt: Date
11
+ Tag: TagI
12
+ }
package/src/task.d.ts CHANGED
@@ -1,40 +1,40 @@
1
- export interface TaskI {
2
- id: number
3
- name: string
4
- startDate: Date
5
- endDate?: Date
6
- /**
7
- * ColourCode of the task
8
- * Ex: #ffffff
9
- */
10
- colourCode: string
11
- iconName?: string
12
- private: boolean
13
- }
14
-
15
- /**
16
- * Represents predefined task tags used in the task creation/modification form.
17
- * There are just a few Tasks that have their own tags
18
- * and they just have a name a colourCode and an optional iconName similar to the Task they represent
19
- */
20
- export interface TaskTagI {
21
- name: string
22
- /**
23
- * ColourCode of the task
24
- * Ex: #ffffff
25
- */
26
- colourCode: string
27
- iconName?: string
28
- }
29
-
30
- /**
31
- * Data used to create or edit a task
32
- */
33
- export interface TaskFormDataI {
34
- name: string
35
- startDate: Date
36
- endDate?: Date
37
- colourCode: string
38
- iconName?: string
39
- private: boolean
40
- }
1
+ export interface TaskI {
2
+ id: number
3
+ name: string
4
+ startDate: Date
5
+ endDate?: Date
6
+ /**
7
+ * ColourCode of the task
8
+ * Ex: #ffffff
9
+ */
10
+ colourCode: string
11
+ iconName?: string
12
+ private: boolean
13
+ }
14
+
15
+ /**
16
+ * Represents predefined task tags used in the task creation/modification form.
17
+ * There are just a few Tasks that have their own tags
18
+ * and they just have a name a colourCode and an optional iconName similar to the Task they represent
19
+ */
20
+ export interface TaskTagI {
21
+ name: string
22
+ /**
23
+ * ColourCode of the task
24
+ * Ex: #ffffff
25
+ */
26
+ colourCode: string
27
+ iconName?: string
28
+ }
29
+
30
+ /**
31
+ * Data used to create or edit a task
32
+ */
33
+ export interface TaskFormDataI {
34
+ name: string
35
+ startDate: Date
36
+ endDate?: Date
37
+ colourCode: string
38
+ iconName?: string
39
+ private: boolean
40
+ }
@@ -1,90 +1,90 @@
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 type RecommendationI =
79
- | PlantCarouselRecommendation
80
- | SelectionCarouselRecommendation
81
- | HeroCardsCarouselRecommendation
82
- | YourSelectionRecommendation
83
-
84
- export interface Request {
85
- headers: RequestHeaders
86
- }
87
-
88
- export type Response = RecommendationI[]
89
- }
90
- }
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 type RecommendationI =
79
+ | PlantCarouselRecommendation
80
+ | SelectionCarouselRecommendation
81
+ | HeroCardsCarouselRecommendation
82
+ | YourSelectionRecommendation
83
+
84
+ export interface Request {
85
+ headers: RequestHeaders
86
+ }
87
+
88
+ export type Response = RecommendationI[]
89
+ }
90
+ }