@la-main-verte/shared-types 1.0.48 → 1.0.49

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,83 +1,90 @@
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
- Images?: ImageI[]
51
- }
52
-
53
- interface PlantTagI {
54
- name: string
55
- /**
56
- * Font color of the tag
57
- * Ex: #ffffff
58
- */
59
- fontColor: string
60
- /**
61
- * Background color of the tag
62
- * Ex: #1B76E6
63
- */
64
- backgroundColor: string
65
- /**
66
- * Font awesome Icon name
67
- * Ex: 'tomato'
68
- */
69
- iconName: string
70
- /** Selection slug related to the tag */
71
- slug: string
72
- }
73
-
74
- interface PlantInventoryI {
75
- id: number
76
- plantId: number
77
- supplierName: string
78
- plantName: string
79
- supplierURL: string
80
- imageLocation: string
81
- description: string
82
- inStock: boolean
83
- }
1
+ import { ImageI } from './image.d.ts'
2
+ import { SelectionI } from './selection.d.ts'
3
+ import { TaskI } from './task.d.ts'
4
+ import { TaggedItemI } from './taggedItem.d.ts'
5
+ import { NoteI } from './note.js'
6
+
7
+ export interface PlantI {
8
+ id: number
9
+ name: string
10
+ slug: string
11
+ description: string
12
+ descriptionSource?: string
13
+ female: boolean
14
+ family?: string | null
15
+ spaceBetweenSeedMin: number
16
+ spaceBetweenSeedMax: number
17
+ spaceBetweenAlleyMin: number
18
+ spaceBetweenAlleyMax: number
19
+ weeksInTransplant: number
20
+ weeksDuringWhichYouCanSeedOutdoor: number
21
+ weeksToMaturity: number
22
+ weeksToWaitAfterFreezingDate: number
23
+ weeksToHarvest: number
24
+ indoorSeeding: boolean
25
+ outdoorSeeding: boolean
26
+ azoteNeedsKgPerHa: number
27
+ hibernate: boolean
28
+ germinationTemperature: number | null
29
+ minGerminationTemperature: number | null
30
+ germinationNumberOfDays: string | null
31
+ germinationSeedDepth: string | null
32
+ cultivationInfo: string | null
33
+ parentId: number | null
34
+ memberId?: number
35
+ shared: boolean
36
+ hexColor: string | null
37
+ sunRequirements: 'partialShade' | 'fullSun' | 'fullShade' | null
38
+ isHardy: boolean | null
39
+ imageURL: string
40
+ totalWeeksToMaturity: number
41
+ hasNoInformation: boolean
42
+ createdAt: Date
43
+ updatedAt: Date
44
+ translatedSunRequirements: string
45
+ parent?: PlantI
46
+ children?: PlantI[]
47
+ PlantInventories?: PlantInventoryI[]
48
+ taggedItems?: TaggedItemI[]
49
+ /**
50
+ * List of selections that the plant is in.
51
+ * --------------------------------------
52
+ * Tends to be used for featured selections
53
+ */
54
+ Selections?: SelectionI[]
55
+ tasks?: TaskI[]
56
+ Images?: ImageI[]
57
+ notes?: NoteI[]
58
+ }
59
+
60
+ interface PlantTagI {
61
+ name: string
62
+ /**
63
+ * Font color of the tag
64
+ * Ex: #ffffff
65
+ */
66
+ fontColor: string
67
+ /**
68
+ * Background color of the tag
69
+ * Ex: #1B76E6
70
+ */
71
+ backgroundColor: string
72
+ /**
73
+ * Font awesome Icon name
74
+ * Ex: 'tomato'
75
+ */
76
+ iconName: string
77
+ /** Selection slug related to the tag */
78
+ slug: string
79
+ }
80
+
81
+ interface PlantInventoryI {
82
+ id: number
83
+ plantId: number
84
+ supplierName: string
85
+ plantName: string
86
+ supplierURL: string
87
+ imageLocation: string
88
+ description: string
89
+ inStock: boolean
90
+ }
@@ -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,61 +1,61 @@
1
- import { PlantI, PlantTagI } from './plant.d'
2
- import { SelectionI } from './selection.d'
3
- import { ImageDataI } from './image.d'
4
- interface PlantExtendedDataI extends PlantI {
5
- /**
6
- * Future plant images gallery for now using notes as a proxy
7
- */
8
- Images: ImageDataI[]
9
- /**
10
- * Selections of the plant
11
- */
12
- Selections: SelectionI[]
13
- }
14
-
15
- export namespace PLANTS {
16
- export namespace RECOMMENDATIONS {
17
- /**
18
- * Request parameters for plant recommendations
19
- * @remarks identification by session token is optional
20
- */
21
- export interface Request {
22
- headers?: {
23
- 'x-session-token'?: string
24
- }
25
- }
26
- /**
27
- * Response containing recommended plants with their tags
28
- */
29
- export type Response = PlantExtendedDataI[]
30
- }
31
- export namespace SEARCH {
32
- /**
33
- * Request parameters for plant recommendations
34
- * @remarks identification by session token is optional
35
- */
36
- export interface Request {
37
- headers?: {
38
- 'x-session-token'?: string
39
- }
40
- query?: {
41
- withAzoteNeedsKgPerHa?: boolean
42
- withSpacing?: boolean
43
- parentsOnly?: boolean
44
- search?: string
45
- family?: string
46
- limit?: number
47
- /**
48
- * If submitted, it means we are searching for plants that can be planted in the given garden zone.
49
- * It almost means:
50
- * - withSpacing will be set to true automatically.
51
- * - Plant.contextualSearchText may be added to the results to provided additional contextual information to the search results (and therefore the member)
52
- */
53
- gardenZoneId?: string | number
54
- }
55
- }
56
- /**
57
- * Response containing search plants with their tags
58
- */
59
- export type Response = PlantExtendedDataI[]
60
- }
61
- }
1
+ import { PlantI, PlantTagI } from './plant.d'
2
+ import { SelectionI } from './selection.d'
3
+ import { ImageDataI } from './image.d'
4
+ interface PlantExtendedDataI extends PlantI {
5
+ /**
6
+ * Future plant images gallery for now using notes as a proxy
7
+ */
8
+ Images: ImageDataI[]
9
+ /**
10
+ * Selections of the plant
11
+ */
12
+ Selections: SelectionI[]
13
+ }
14
+
15
+ export namespace PLANTS {
16
+ export namespace RECOMMENDATIONS {
17
+ /**
18
+ * Request parameters for plant recommendations
19
+ * @remarks identification by session token is optional
20
+ */
21
+ export interface Request {
22
+ headers?: {
23
+ 'x-session-token'?: string
24
+ }
25
+ }
26
+ /**
27
+ * Response containing recommended plants with their tags
28
+ */
29
+ export type Response = PlantExtendedDataI[]
30
+ }
31
+ export namespace SEARCH {
32
+ /**
33
+ * Request parameters for plant recommendations
34
+ * @remarks identification by session token is optional
35
+ */
36
+ export interface Request {
37
+ headers?: {
38
+ 'x-session-token'?: string
39
+ }
40
+ query?: {
41
+ withAzoteNeedsKgPerHa?: boolean
42
+ withSpacing?: boolean
43
+ parentsOnly?: boolean
44
+ search?: string
45
+ family?: string
46
+ limit?: number
47
+ /**
48
+ * If submitted, it means we are searching for plants that can be planted in the given garden zone.
49
+ * It almost means:
50
+ * - withSpacing will be set to true automatically.
51
+ * - Plant.contextualSearchText may be added to the results to provided additional contextual information to the search results (and therefore the member)
52
+ */
53
+ gardenZoneId?: string | number
54
+ }
55
+ }
56
+ /**
57
+ * Response containing search plants with their tags
58
+ */
59
+ export type Response = PlantExtendedDataI[]
60
+ }
61
+ }
@@ -1,52 +1,54 @@
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
+ 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
+ }
package/src/tag.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ export interface TagI {
2
+ id?: number
3
+ name?: string
4
+ tagType?: 'plant' | 'task'
5
+ icon?: string
6
+ color?: string
7
+ createdAt: Date
8
+ updatedAt: Date
9
+ }
@@ -0,0 +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
+ }
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,38 +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
- }
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
- }
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
+ }