@la-main-verte/shared-types 1.0.47 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@la-main-verte/shared-types",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
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",
@@ -1,3 +1,5 @@
1
+ import { PlantI } from './plant'
2
+
1
3
  export interface CalendarViewI {
2
4
  id: number
3
5
  title: string
@@ -1,3 +1,5 @@
1
+ import { PlantSelectionI } from './plantSelection.d.ts'
2
+
1
3
  /**
2
4
  * A gardenMap is a collection of garden zones
3
5
  */
package/src/index.ts CHANGED
@@ -8,6 +8,9 @@ export * from './apiError'
8
8
  export * from './gardenMap'
9
9
  export * from './alert'
10
10
  export * from './image'
11
+ export * from './note'
12
+ export * from './taggedItem'
13
+ export * from './tag'
11
14
  import * as PlantsAPI from './plants.api'
12
15
  import * as UsersAPI from './users.api'
13
16
 
package/src/member.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ import { NoteI } from './note'
2
+ import { SelectionI } from './selection'
3
+
1
4
  export interface MemberI {
2
5
  id: number
3
6
  email: string
@@ -43,11 +46,16 @@ export interface MemberI {
43
46
  finishedOnboarding: boolean
44
47
  hasDownloadedNativeApp?: boolean
45
48
  unitSystem: 'imperial' | 'metric'
49
+ subscriptionEndDate?: Date
46
50
  /**
47
51
  * Virtual field to get the app badge count
48
52
  * ----------------------------------------
49
53
  * For now, it's just the number of unread messages.
50
54
  */
51
55
  badgeCount?: number
56
+ /**
57
+ * Number of unread alerts, cached version of unread alerts (the table) count
58
+ */
59
+ unreadAlertsCount?: number
52
60
  isAdmin: boolean
53
61
  }
package/src/note.d.ts ADDED
@@ -0,0 +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
+ }
package/src/plant.d.ts CHANGED
@@ -1,3 +1,9 @@
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
+
1
7
  export interface PlantI {
2
8
  id: number
3
9
  name: string
@@ -48,6 +54,7 @@ export interface PlantI {
48
54
  Selections?: SelectionI[]
49
55
  tasks?: TaskI[]
50
56
  Images?: ImageI[]
57
+ notes?: NoteI[]
51
58
  }
52
59
 
53
60
  interface PlantTagI {
@@ -1,7 +1,14 @@
1
1
  import { PlantI, PlantTagI } from './plant.d'
2
2
  import { SelectionI } from './selection.d'
3
-
3
+ import { ImageDataI } from './image.d'
4
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
+ */
5
12
  Selections: SelectionI[]
6
13
  }
7
14
 
@@ -1,3 +1,5 @@
1
+ import { PlantI } from './plant'
2
+
1
3
  export interface SelectionI {
2
4
  id: number
3
5
  memberId: number
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
+ }