@la-main-verte/shared-types 1.0.43 → 1.0.46

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/plant.d.ts CHANGED
@@ -1,82 +1,82 @@
1
- export interface PlantI {
2
- id: number
3
- name: string
4
- slug: string
5
- description: string
6
- descriptionSource?: string
7
- female: boolean
8
- family?: string | null
9
- spaceBetweenSeedMin: number
10
- spaceBetweenSeedMax: number
11
- spaceBetweenAlleyMin: number
12
- spaceBetweenAlleyMax: number
13
- weeksInTransplant: number
14
- weeksDuringWhichYouCanSeedOutdoor: number
15
- weeksToMaturity: number
16
- weeksToWaitAfterFreezingDate: number
17
- weeksToHarvest: number
18
- indoorSeeding: boolean
19
- outdoorSeeding: boolean
20
- azoteNeedsKgPerHa: number
21
- hibernate: boolean
22
- germinationTemperature: number | null
23
- minGerminationTemperature: number | null
24
- germinationNumberOfDays: string | null
25
- germinationSeedDepth: string | null
26
- cultivationInfo: string | null
27
- parentId: number | null
28
- memberId?: number
29
- shared: boolean
30
- hexColor: string | null
31
- sunRequirements: 'partialShade' | 'fullSun' | 'fullShade' | null
32
- isHardy: boolean | null
33
- imageURL: string
34
- totalWeeksToMaturity: number
35
- hasNoInformation: boolean
36
- createdAt: Date
37
- updatedAt: Date
38
- translatedSunRequirements: string
39
- parent?: PlantI
40
- children?: PlantI[]
41
- PlantInventories?: PlantInventoryI[]
42
- taggedItems?: TaggedItemI[]
43
- /**
44
- * List of selections that the plant is in.
45
- * --------------------------------------
46
- * Tends to be used for featured selections
47
- */
48
- Selections?: SelectionI[]
49
- tasks?: TaskI[]
50
- }
51
-
52
- interface PlantTagI {
53
- name: string
54
- /**
55
- * Font color of the tag
56
- * Ex: #ffffff
57
- */
58
- fontColor: string
59
- /**
60
- * Background color of the tag
61
- * Ex: #1B76E6
62
- */
63
- backgroundColor: string
64
- /**
65
- * Font awesome Icon name
66
- * Ex: 'tomato'
67
- */
68
- iconName: string
69
- /** Selection slug related to the tag */
70
- slug: string
71
- }
72
-
73
- interface PlantInventoryI {
74
- id: number
75
- plantId: number
76
- supplierName: string
77
- plantName: string
78
- supplierURL: string
79
- imageLocation: string
80
- description: string
81
- inStock: boolean
82
- }
1
+ export interface PlantI {
2
+ id: number
3
+ name: string
4
+ slug: string
5
+ description: string
6
+ descriptionSource?: string
7
+ female: boolean
8
+ family?: string | null
9
+ spaceBetweenSeedMin: number
10
+ spaceBetweenSeedMax: number
11
+ spaceBetweenAlleyMin: number
12
+ spaceBetweenAlleyMax: number
13
+ weeksInTransplant: number
14
+ weeksDuringWhichYouCanSeedOutdoor: number
15
+ weeksToMaturity: number
16
+ weeksToWaitAfterFreezingDate: number
17
+ weeksToHarvest: number
18
+ indoorSeeding: boolean
19
+ outdoorSeeding: boolean
20
+ azoteNeedsKgPerHa: number
21
+ hibernate: boolean
22
+ germinationTemperature: number | null
23
+ minGerminationTemperature: number | null
24
+ germinationNumberOfDays: string | null
25
+ germinationSeedDepth: string | null
26
+ cultivationInfo: string | null
27
+ parentId: number | null
28
+ memberId?: number
29
+ shared: boolean
30
+ hexColor: string | null
31
+ sunRequirements: 'partialShade' | 'fullSun' | 'fullShade' | null
32
+ isHardy: boolean | null
33
+ imageURL: string
34
+ totalWeeksToMaturity: number
35
+ hasNoInformation: boolean
36
+ createdAt: Date
37
+ updatedAt: Date
38
+ translatedSunRequirements: string
39
+ parent?: PlantI
40
+ children?: PlantI[]
41
+ PlantInventories?: PlantInventoryI[]
42
+ taggedItems?: TaggedItemI[]
43
+ /**
44
+ * List of selections that the plant is in.
45
+ * --------------------------------------
46
+ * Tends to be used for featured selections
47
+ */
48
+ Selections?: SelectionI[]
49
+ tasks?: TaskI[]
50
+ }
51
+
52
+ interface PlantTagI {
53
+ name: string
54
+ /**
55
+ * Font color of the tag
56
+ * Ex: #ffffff
57
+ */
58
+ fontColor: string
59
+ /**
60
+ * Background color of the tag
61
+ * Ex: #1B76E6
62
+ */
63
+ backgroundColor: string
64
+ /**
65
+ * Font awesome Icon name
66
+ * Ex: 'tomato'
67
+ */
68
+ iconName: string
69
+ /** Selection slug related to the tag */
70
+ slug: string
71
+ }
72
+
73
+ interface PlantInventoryI {
74
+ id: number
75
+ plantId: number
76
+ supplierName: string
77
+ plantName: string
78
+ supplierURL: string
79
+ imageLocation: string
80
+ description: string
81
+ inStock: boolean
82
+ }
@@ -1,8 +1,8 @@
1
- export interface PlantSelectionI {
2
- id: number
3
- plantId: number
4
- selectionId: number
5
- seedQuantity: number
6
- createdAt: Date
7
- updatedAt: Date
8
- }
1
+ export interface PlantSelectionI {
2
+ id: number
3
+ plantId: number
4
+ selectionId: number
5
+ seedQuantity: number
6
+ createdAt: Date
7
+ updatedAt: Date
8
+ }
@@ -1,54 +1,54 @@
1
- import { PlantI, PlantTagI } from './plant.d'
2
- import { SelectionI } from './selection.d'
3
-
4
- interface PlantExtendedDataI extends PlantI {
5
- Selections: SelectionI[]
6
- }
7
-
8
- export namespace PLANTS {
9
- export namespace RECOMMENDATIONS {
10
- /**
11
- * Request parameters for plant recommendations
12
- * @remarks identification by session token is optional
13
- */
14
- export interface Request {
15
- headers?: {
16
- 'x-session-token'?: string
17
- }
18
- }
19
- /**
20
- * Response containing recommended plants with their tags
21
- */
22
- export type Response = PlantExtendedDataI[]
23
- }
24
- export namespace SEARCH {
25
- /**
26
- * Request parameters for plant recommendations
27
- * @remarks identification by session token is optional
28
- */
29
- export interface Request {
30
- headers?: {
31
- 'x-session-token'?: string
32
- }
33
- query?: {
34
- withAzoteNeedsKgPerHa?: boolean
35
- withSpacing?: boolean
36
- parentsOnly?: boolean
37
- search?: string
38
- family?: string
39
- limit?: number
40
- /**
41
- * If submitted, it means we are searching for plants that can be planted in the given garden zone.
42
- * It almost means:
43
- * - withSpacing will be set to true automatically.
44
- * - Plant.contextualSearchText may be added to the results to provided additional contextual information to the search results (and therefore the member)
45
- */
46
- gardenZoneId?: string | number
47
- }
48
- }
49
- /**
50
- * Response containing search plants with their tags
51
- */
52
- export type Response = PlantExtendedDataI[]
53
- }
54
- }
1
+ import { PlantI, PlantTagI } from './plant.d'
2
+ import { SelectionI } from './selection.d'
3
+
4
+ interface PlantExtendedDataI extends PlantI {
5
+ Selections: SelectionI[]
6
+ }
7
+
8
+ export namespace PLANTS {
9
+ export namespace RECOMMENDATIONS {
10
+ /**
11
+ * Request parameters for plant recommendations
12
+ * @remarks identification by session token is optional
13
+ */
14
+ export interface Request {
15
+ headers?: {
16
+ 'x-session-token'?: string
17
+ }
18
+ }
19
+ /**
20
+ * Response containing recommended plants with their tags
21
+ */
22
+ export type Response = PlantExtendedDataI[]
23
+ }
24
+ export namespace SEARCH {
25
+ /**
26
+ * Request parameters for plant recommendations
27
+ * @remarks identification by session token is optional
28
+ */
29
+ export interface Request {
30
+ headers?: {
31
+ 'x-session-token'?: string
32
+ }
33
+ query?: {
34
+ withAzoteNeedsKgPerHa?: boolean
35
+ withSpacing?: boolean
36
+ parentsOnly?: boolean
37
+ search?: string
38
+ family?: string
39
+ limit?: number
40
+ /**
41
+ * If submitted, it means we are searching for plants that can be planted in the given garden zone.
42
+ * It almost means:
43
+ * - withSpacing will be set to true automatically.
44
+ * - Plant.contextualSearchText may be added to the results to provided additional contextual information to the search results (and therefore the member)
45
+ */
46
+ gardenZoneId?: string | number
47
+ }
48
+ }
49
+ /**
50
+ * Response containing search plants with their tags
51
+ */
52
+ export type Response = PlantExtendedDataI[]
53
+ }
54
+ }
@@ -1,52 +1,52 @@
1
- export interface SelectionI {
2
- id: number
3
- memberId: number
4
- title: string
5
- slug: string
6
- description?: string
7
- orderBy?: 'startDate' | 'name'
8
- default?: boolean
9
- viewsCount?: number
10
- imageLocation?: string
11
- imageURL?: string
12
- /**
13
- * Indicates if the selection is featured on the app (search, explore, etc).
14
- **/
15
- featured: boolean
16
- /**
17
- * Indicates if the selection is dynamically generated on the fly by the API.
18
- * Ex: "What you can seed in March"
19
- * INTERNAL USE ONLY
20
- */
21
- isDynamic: boolean
22
- /**
23
- * Background color of the selection, for UI purposes.
24
- */
25
- backgroundColor: string | null
26
- /**
27
- * Font color of the selection, for UI purposes.
28
- */
29
- fontColor: string | null
30
- /**
31
- * Font awesome icon name of the selection, for UI purposes.
32
- * -----------------------------------------
33
- * Not all icons are available in the react-native-app. Must be explicitly declared first.
34
- * Ex: 'fa-bag-seedling', 'fa-bug', etc.
35
- */
36
- iconName: string | null
37
- link?: string
38
- sharingURL?: string
39
- createdAt: Date
40
- updatedAt: Date
41
- Plants?: PlantI[]
42
- }
43
-
44
- /**
45
- * Those are the different possible types for a selection.
46
- */
47
- export type SelectionType = 'Serre' | 'Potager' | 'Recette' | 'Coup de coeur' | "Jardin d'intérieur" | 'Autres'
48
-
49
- export interface SelectionTypeI {
50
- name: SelectionType
51
- iconName?: IconName
52
- }
1
+ export interface SelectionI {
2
+ id: number
3
+ memberId: number
4
+ title: string
5
+ slug: string
6
+ description?: string
7
+ orderBy?: 'startDate' | 'name'
8
+ default?: boolean
9
+ viewsCount?: number
10
+ imageLocation?: string
11
+ imageURL?: string
12
+ /**
13
+ * Indicates if the selection is featured on the app (search, explore, etc).
14
+ **/
15
+ featured: boolean
16
+ /**
17
+ * Indicates if the selection is dynamically generated on the fly by the API.
18
+ * Ex: "What you can seed in March"
19
+ * INTERNAL USE ONLY
20
+ */
21
+ isDynamic: boolean
22
+ /**
23
+ * Background color of the selection, for UI purposes.
24
+ */
25
+ backgroundColor: string | null
26
+ /**
27
+ * Font color of the selection, for UI purposes.
28
+ */
29
+ fontColor: string | null
30
+ /**
31
+ * Font awesome icon name of the selection, for UI purposes.
32
+ * -----------------------------------------
33
+ * Not all icons are available in the react-native-app. Must be explicitly declared first.
34
+ * Ex: 'fa-bag-seedling', 'fa-bug', etc.
35
+ */
36
+ iconName: string | null
37
+ link?: string
38
+ sharingURL?: string
39
+ createdAt: Date
40
+ updatedAt: Date
41
+ Plants?: PlantI[]
42
+ }
43
+
44
+ /**
45
+ * Those are the different possible types for a selection.
46
+ */
47
+ export type SelectionType = 'Serre' | 'Potager' | 'Recette' | 'Coup de coeur' | "Jardin d'intérieur" | 'Autres'
48
+
49
+ export interface SelectionTypeI {
50
+ name: SelectionType
51
+ iconName?: IconName
52
+ }
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,39 +1,38 @@
1
- import type { DeviceDataI } from './device.d'
2
- import type { MemberI as MemberDataI } from './member.d'
3
-
4
- interface RequestHeaders {
5
- 'x-session-token': string
6
- 'x-native-app-version'?: string
7
- 'x-application-type'?: 'react-native' | 'web'
8
- }
9
-
10
- export namespace USERS {
11
- export namespace GET {
12
- export interface Request {
13
- headers: RequestHeaders
14
- params: {
15
- scopes: ('unreadNotificationsCount' | 'coordinates')[]
16
- }
17
- }
18
- export type Response = MemberDataI & {
19
- unreadAlertsCount?: number
20
- unreadMessagesCount?: number
21
- }
22
- }
23
- export namespace DEVICES {
24
- export interface Request {
25
- headers: RequestHeaders
26
- body: {
27
- /** @see DeviceDataI */
28
- userAgent?: DeviceDataI['userAgent']
29
- platform?: DeviceDataI['platform']
30
- version?: DeviceDataI['version']
31
- model?: DeviceDataI['model']
32
- name?: DeviceDataI['name']
33
- appVersion?: DeviceDataI['appVersion']
34
- pushKey?: DeviceDataI['pushKey']
35
- }
36
- }
37
- export type Response = DeviceDataI
38
- }
39
- }
1
+ import type { DeviceDataI } from './device.d'
2
+ import type { MemberI as MemberDataI } from './member.d'
3
+
4
+ interface RequestHeaders {
5
+ 'x-session-token': string
6
+ 'x-native-app-version'?: string
7
+ 'x-application-type'?: 'react-native' | 'web'
8
+ }
9
+
10
+ export namespace USERS {
11
+ export namespace GET {
12
+ export interface Request {
13
+ headers: RequestHeaders
14
+ params: {
15
+ scopes: ('unreadNotificationsCount' | 'coordinates')[]
16
+ }
17
+ }
18
+ export type Response = MemberDataI & {
19
+ unreadAlertsCount?: number
20
+ }
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
+ }
35
+ }
36
+ export type Response = DeviceDataI
37
+ }
38
+ }