@la-main-verte/shared-types 1.0.56 → 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.
package/src/index.ts CHANGED
@@ -1,27 +1,27 @@
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
- import * as PlantsAPI from './plants.api'
17
- import * as UsersAPI from './users.api'
18
- import * as SessionsAPI from './sessions.api'
19
- import * as HomeAPI from './home.api'
20
-
21
- // Allow access to the API namespaces without conflicts
22
- export namespace API {
23
- export import PLANTS = PlantsAPI
24
- export import USERS = UsersAPI
25
- export import SESSIONS = SessionsAPI
26
- export import HOME = HomeAPI
27
- }
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
+ import * as PlantsAPI from './plants.api'
17
+ import * as UsersAPI from './users.api'
18
+ import * as SessionsAPI from './sessions.api'
19
+ import * as HomeAPI from './home.api'
20
+
21
+ // Allow access to the API namespaces without conflicts
22
+ export namespace API {
23
+ export import PLANTS = PlantsAPI
24
+ export import USERS = UsersAPI
25
+ export import SESSIONS = SessionsAPI
26
+ export import HOME = HomeAPI
27
+ }
package/src/member.d.ts CHANGED
@@ -1,61 +1,61 @@
1
- import { NoteI } from './note'
2
- import { SelectionI } from './selection'
3
-
4
- export interface MemberI {
5
- id: number
6
- email: string
7
- firstName: string
8
- lastName: string
9
- /** Virtual field to get the user's full name */
10
- fullName?: string | null
11
- city?: string
12
- hardinessZoneName?: string
13
- createdAt: Date
14
- updatedAt: Date
15
- lastFreezingDate?: Date
16
- firstFreezingDate?: Date
17
- /**
18
- * Number of unread Crisp messages
19
- */
20
- unreadMessagesCount?: number
21
- notes?: NoteI[]
22
- selections?: SelectionI[]
23
- userActivities?: UserActivityI[]
24
- /**
25
- * hasAnActiveSubscription is a VIRTUAL FIELD used to check if the user has an active subscription
26
- */
27
- hasAnActiveSubscription?: boolean
28
- /**
29
- * Acts as a one-way not identifiable token.
30
- * Crisp and other services may use this token to identify the user
31
- */
32
- userToken: string
33
- /**
34
- * neverAddedATask <=> Has the use ever open the task form?
35
- * Yes it is misleading, ticket is open to change it.
36
- * It was too intense to force the user to add a task.
37
- */
38
- neverAddedATask?: boolean
39
- neverAddedAPlant?: boolean
40
- neverAddedANote?: boolean
41
- neverTriedSpacingSection?: boolean
42
- neverTriedAiAgent?: boolean
43
- neverDeletedAPlant?: boolean
44
- neverDeletedATask?: boolean
45
- neverEditedATask?: boolean
46
- finishedOnboarding: boolean
47
- hasDownloadedNativeApp?: boolean
48
- unitSystem: 'imperial' | 'metric'
49
- subscriptionEndDate?: Date
50
- /**
51
- * Virtual field to get the app badge count
52
- * ----------------------------------------
53
- * For now, it's just the number of unread messages.
54
- */
55
- badgeCount?: number
56
- /**
57
- * Number of unread alerts, cached version of unread alerts (the table) count
58
- */
59
- unreadAlertsCount?: number
60
- isAdmin: boolean
61
- }
1
+ import { NoteI } from './note'
2
+ import { SelectionI } from './selection'
3
+
4
+ export interface MemberI {
5
+ id: number
6
+ email: string
7
+ firstName: string
8
+ lastName: string
9
+ /** Virtual field to get the user's full name */
10
+ fullName?: string | null
11
+ city?: string
12
+ hardinessZoneName?: string
13
+ createdAt: Date
14
+ updatedAt: Date
15
+ lastFreezingDate?: Date
16
+ firstFreezingDate?: Date
17
+ /**
18
+ * Number of unread Crisp messages
19
+ */
20
+ unreadMessagesCount?: number
21
+ notes?: NoteI[]
22
+ selections?: SelectionI[]
23
+ userActivities?: UserActivityI[]
24
+ /**
25
+ * hasAnActiveSubscription is a VIRTUAL FIELD used to check if the user has an active subscription
26
+ */
27
+ hasAnActiveSubscription?: boolean
28
+ /**
29
+ * Acts as a one-way not identifiable token.
30
+ * Crisp and other services may use this token to identify the user
31
+ */
32
+ userToken: string
33
+ /**
34
+ * neverAddedATask <=> Has the use ever open the task form?
35
+ * Yes it is misleading, ticket is open to change it.
36
+ * It was too intense to force the user to add a task.
37
+ */
38
+ neverAddedATask?: boolean
39
+ neverAddedAPlant?: boolean
40
+ neverAddedANote?: boolean
41
+ neverTriedSpacingSection?: boolean
42
+ neverTriedAiAgent?: boolean
43
+ neverDeletedAPlant?: boolean
44
+ neverDeletedATask?: boolean
45
+ neverEditedATask?: boolean
46
+ finishedOnboarding: boolean
47
+ hasDownloadedNativeApp?: boolean
48
+ unitSystem: 'imperial' | 'metric'
49
+ subscriptionEndDate?: Date
50
+ /**
51
+ * Virtual field to get the app badge count
52
+ * ----------------------------------------
53
+ * For now, it's just the number of unread messages.
54
+ */
55
+ badgeCount?: number
56
+ /**
57
+ * Number of unread alerts, cached version of unread alerts (the table) count
58
+ */
59
+ unreadAlertsCount?: number
60
+ isAdmin: boolean
61
+ }
package/src/note.d.ts CHANGED
@@ -1,28 +1,28 @@
1
- import { ImageI } from './image.d.ts'
2
- import { TaggedItemI } from './taggedItem.d.ts'
3
-
4
- export interface NoteI {
5
- id: number
6
- memberId: number
7
- title: string
8
- contentInMarkdown: string
9
- color?: string
10
- agreedToShare: boolean
11
- createdAt: Date
12
- updatedAt: Date
13
- /**
14
- * Virtual field for the note thumbnail imageURL (absolute path) */
15
- imageURL?: string
16
- /**
17
- * Virtual field indicating if the note content is short
18
- * Used to alter the design of the note (likely with ContentInMarkdown replacing the title)
19
- * */
20
- hasShortContent?: boolean
21
- /**
22
- * Virtual field for the note sharing URL (relative path) */
23
- sharingURL: string
24
- darkColor: string
25
- pastelColor: string
26
- Images: ImageI[]
27
- TaggedItems: TaggedItemI[]
28
- }
1
+ import { ImageI } from './image.d.ts'
2
+ import { TaggedItemI } from './taggedItem.d.ts'
3
+
4
+ export interface NoteI {
5
+ id: number
6
+ memberId: number
7
+ title: string
8
+ contentInMarkdown: string
9
+ color?: string
10
+ agreedToShare: boolean
11
+ createdAt: Date
12
+ updatedAt: Date
13
+ /**
14
+ * Virtual field for the note thumbnail imageURL (absolute path) */
15
+ imageURL?: string
16
+ /**
17
+ * Virtual field indicating if the note content is short
18
+ * Used to alter the design of the note (likely with ContentInMarkdown replacing the title)
19
+ * */
20
+ hasShortContent?: boolean
21
+ /**
22
+ * Virtual field for the note sharing URL (relative path) */
23
+ sharingURL: string
24
+ darkColor: string
25
+ pastelColor: string
26
+ Images: ImageI[]
27
+ TaggedItems: TaggedItemI[]
28
+ }
package/src/plant.d.ts CHANGED
@@ -1,85 +1,85 @@
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: 'Plein soleil' | 'Mi-ombre' | 'Ombre' | null
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
- notes?: NoteI[]
52
- rotationFamily?: string
53
- }
54
-
55
- interface PlantTagI {
56
- name: string
57
- /**
58
- * Font color of the tag
59
- * Ex: #ffffff
60
- */
61
- fontColor: string
62
- /**
63
- * Background color of the tag
64
- * Ex: #1B76E6
65
- */
66
- backgroundColor: string
67
- /**
68
- * Font awesome Icon name
69
- * Ex: 'tomato'
70
- */
71
- iconName: string
72
- /** Selection slug related to the tag */
73
- slug: string
74
- }
75
-
76
- interface PlantInventoryI {
77
- id: number
78
- plantId: number
79
- supplierName: string
80
- plantName: string
81
- supplierURL: string
82
- imageLocation: string
83
- description: string
84
- inStock: boolean
85
- }
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: 'Plein soleil' | 'Mi-ombre' | 'Ombre' | null
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
+ notes?: NoteI[]
52
+ rotationFamily?: string
53
+ }
54
+
55
+ interface PlantTagI {
56
+ name: string
57
+ /**
58
+ * Font color of the tag
59
+ * Ex: #ffffff
60
+ */
61
+ fontColor: string
62
+ /**
63
+ * Background color of the tag
64
+ * Ex: #1B76E6
65
+ */
66
+ backgroundColor: string
67
+ /**
68
+ * Font awesome Icon name
69
+ * Ex: 'tomato'
70
+ */
71
+ iconName: string
72
+ /** Selection slug related to the tag */
73
+ slug: string
74
+ }
75
+
76
+ interface PlantInventoryI {
77
+ id: number
78
+ plantId: number
79
+ supplierName: string
80
+ plantName: string
81
+ supplierURL: string
82
+ imageLocation: string
83
+ description: string
84
+ inStock: boolean
85
+ }
@@ -1,13 +1,13 @@
1
- import { PlantI } from './plant.d.ts'
2
- import { SelectionI } from './selection.d.ts'
3
-
4
- export interface PlantSelectionI {
5
- id: number
6
- plantId: number
7
- selectionId: number
8
- seedQuantity: number
9
- createdAt: Date
10
- updatedAt: Date
11
- Plant: PlantI
12
- Selection: SelectionI
13
- }
1
+ import { PlantI } from './plant.d.ts'
2
+ import { SelectionI } from './selection.d.ts'
3
+
4
+ export interface PlantSelectionI {
5
+ id: number
6
+ plantId: number
7
+ selectionId: number
8
+ seedQuantity: number
9
+ createdAt: Date
10
+ updatedAt: Date
11
+ Plant: PlantI
12
+ Selection: SelectionI
13
+ }
@@ -1,84 +1,84 @@
1
- import { PlantI } from './plant.d'
2
- import { SelectionI } from './selection.d'
3
- import { ImageDataI } from './image.d'
4
-
5
- interface PlantExtendedDataI extends PlantI {
6
- /**
7
- * Future plant images gallery for now using notes as a proxy
8
- */
9
- Images: ImageDataI[]
10
- /**
11
- * Selections of the plant
12
- */
13
- Selections: SelectionI[]
14
- }
15
-
16
- export namespace PLANTS {
17
- export namespace RECOMMENDATIONS {
18
- /**
19
- * Request parameters for plant recommendations
20
- * @remarks identification by session token is optional
21
- */
22
- export interface Request {
23
- headers?: {
24
- 'x-session-token'?: string
25
- }
26
- }
27
- /**
28
- * Response containing recommended plants with their tags
29
- */
30
- export type Response = PlantExtendedDataI[]
31
- }
32
- export namespace SEARCH {
33
- /**
34
- * Request parameters for plant recommendations
35
- * @remarks identification by session token is optional
36
- */
37
- export interface Request {
38
- headers?: {
39
- 'x-session-token'?: string
40
- }
41
- query?: {
42
- withAzoteNeedsKgPerHa?: boolean
43
- withSpacing?: boolean
44
- parentsOnly?: boolean
45
- search?: string
46
- family?: string
47
- limit?: number
48
- /**
49
- * If submitted, it means we are searching for plants that can be planted in the given garden zone.
50
- * It almost means:
51
- * - withSpacing will be set to true automatically.
52
- * - Plant.contextualSearchText may be added to the results to provided additional contextual information to the search results (and therefore the member)
53
- */
54
- gardenZoneId?: string | number
55
- }
56
- }
57
- /**
58
- * Response containing search plants with their tags
59
- */
60
- export type Response = PlantExtendedDataI[]
61
- }
62
- export namespace UPDATE {
63
- export interface Request {
64
- params: {
65
- slug: string
66
- }
67
- body: {
68
- name?: string
69
- description?: string
70
- shared?: boolean
71
- spaceBetweenSeedMin?: number | null
72
- spaceBetweenSeedMax?: number | null
73
- spaceBetweenAlleyMin?: number | null
74
- spaceBetweenAlleyMax?: number | null
75
- weeksToMaturity?: number | null
76
- indoorSeeding?: boolean
77
- outdoorSeeding?: boolean
78
- sunRequirements?: 'partialShade' | 'fullSun' | 'fullShade' | null
79
- isHardy?: boolean | null
80
- }
81
- }
82
- export type Response = PlantI
83
- }
84
- }
1
+ import { PlantI } from './plant.d'
2
+ import { SelectionI } from './selection.d'
3
+ import { ImageDataI } from './image.d'
4
+
5
+ interface PlantExtendedDataI extends PlantI {
6
+ /**
7
+ * Future plant images gallery for now using notes as a proxy
8
+ */
9
+ Images: ImageDataI[]
10
+ /**
11
+ * Selections of the plant
12
+ */
13
+ Selections: SelectionI[]
14
+ }
15
+
16
+ export namespace PLANTS {
17
+ export namespace RECOMMENDATIONS {
18
+ /**
19
+ * Request parameters for plant recommendations
20
+ * @remarks identification by session token is optional
21
+ */
22
+ export interface Request {
23
+ headers?: {
24
+ 'x-session-token'?: string
25
+ }
26
+ }
27
+ /**
28
+ * Response containing recommended plants with their tags
29
+ */
30
+ export type Response = PlantExtendedDataI[]
31
+ }
32
+ export namespace SEARCH {
33
+ /**
34
+ * Request parameters for plant recommendations
35
+ * @remarks identification by session token is optional
36
+ */
37
+ export interface Request {
38
+ headers?: {
39
+ 'x-session-token'?: string
40
+ }
41
+ query?: {
42
+ withAzoteNeedsKgPerHa?: boolean
43
+ withSpacing?: boolean
44
+ parentsOnly?: boolean
45
+ search?: string
46
+ family?: string
47
+ limit?: number
48
+ /**
49
+ * If submitted, it means we are searching for plants that can be planted in the given garden zone.
50
+ * It almost means:
51
+ * - withSpacing will be set to true automatically.
52
+ * - Plant.contextualSearchText may be added to the results to provided additional contextual information to the search results (and therefore the member)
53
+ */
54
+ gardenZoneId?: string | number
55
+ }
56
+ }
57
+ /**
58
+ * Response containing search plants with their tags
59
+ */
60
+ export type Response = PlantExtendedDataI[]
61
+ }
62
+ export namespace UPDATE {
63
+ export interface Request {
64
+ params: {
65
+ slug: string
66
+ }
67
+ body: {
68
+ name?: string
69
+ description?: string
70
+ shared?: boolean
71
+ spaceBetweenSeedMin?: number | null
72
+ spaceBetweenSeedMax?: number | null
73
+ spaceBetweenAlleyMin?: number | null
74
+ spaceBetweenAlleyMax?: number | null
75
+ weeksToMaturity?: number | null
76
+ indoorSeeding?: boolean
77
+ outdoorSeeding?: boolean
78
+ sunRequirements?: 'partialShade' | 'fullSun' | 'fullShade' | null
79
+ isHardy?: boolean | null
80
+ }
81
+ }
82
+ export type Response = PlantI
83
+ }
84
+ }