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

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.43",
3
+ "version": "1.0.47",
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",
package/src/device.d.ts CHANGED
@@ -1,9 +1,3 @@
1
- import { Model } from 'sequelize'
2
-
3
- /**
4
- * Raw Data returned by the device model
5
- * Device.toJSON() will return this data
6
- */
7
1
  /**
8
2
  * Raw Data returned by the device model
9
3
  * Device.toJSON() will return this data
@@ -23,9 +17,17 @@ type DeviceDataI = {
23
17
  platform?: 'ios' | 'android' | 'windows'
24
18
  /** Optional version of the device */
25
19
  version?: string
26
- /** Optional model of the device */
20
+ /**
21
+ * Technical model of the device
22
+ * ---
23
+ * Ex: iPhone12,1, iPhone13,2, iPhone14,4, etc.
24
+ */
27
25
  model?: string
28
- /** Optional name of the device */
26
+ /**
27
+ * Readable name of the device
28
+ * ---
29
+ * Ex: 'iPhone 12 Pro Max', 'Samsung Galaxy S20', 'MacBook Pro 13 inch'
30
+ * */
29
31
  name?: string
30
32
  /** Optional app version of the device. Ex: 1.0.0 */
31
33
  appVersion?: string
@@ -33,5 +35,7 @@ type DeviceDataI = {
33
35
  createdAt: Date
34
36
  /** Timestamp of when the device was last updated */
35
37
  updatedAt: Date
38
+ /** Virtual field that combines the name and appVersion */
39
+ fullName: string
36
40
  }
37
- interface DeviceModelI extends Model<DeviceDataI> {}
41
+ export { DeviceDataI }
package/src/image.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ export interface ImageI {
2
+ id: number
3
+ noteId: number
4
+ s3Key: string
5
+ s3Url: string
6
+ filename: string
7
+ imageURL: string
8
+ createdAt: Date
9
+ updatedAt: Date
10
+ }
package/src/index.ts CHANGED
@@ -7,6 +7,7 @@ export * from './calendarView'
7
7
  export * from './apiError'
8
8
  export * from './gardenMap'
9
9
  export * from './alert'
10
+ export * from './image'
10
11
  import * as PlantsAPI from './plants.api'
11
12
  import * as UsersAPI from './users.api'
12
13
 
package/src/member.d.ts CHANGED
@@ -3,12 +3,18 @@ export interface MemberI {
3
3
  email: string
4
4
  firstName: string
5
5
  lastName: string
6
+ /** Virtual field to get the user's full name */
7
+ fullName?: string | null
6
8
  city?: string
7
9
  hardinessZoneName?: string
8
10
  createdAt: Date
9
11
  updatedAt: Date
10
12
  lastFreezingDate?: Date
11
13
  firstFreezingDate?: Date
14
+ /**
15
+ * Number of unread Crisp messages
16
+ */
17
+ unreadMessagesCount?: number
12
18
  notes?: NoteI[]
13
19
  selections?: SelectionI[]
14
20
  userActivities?: UserActivityI[]
@@ -37,4 +43,11 @@ export interface MemberI {
37
43
  finishedOnboarding: boolean
38
44
  hasDownloadedNativeApp?: boolean
39
45
  unitSystem: 'imperial' | 'metric'
46
+ /**
47
+ * Virtual field to get the app badge count
48
+ * ----------------------------------------
49
+ * For now, it's just the number of unread messages.
50
+ */
51
+ badgeCount?: number
52
+ isAdmin: boolean
40
53
  }
package/src/plant.d.ts CHANGED
@@ -47,6 +47,7 @@ export interface PlantI {
47
47
  */
48
48
  Selections?: SelectionI[]
49
49
  tasks?: TaskI[]
50
+ Images?: ImageI[]
50
51
  }
51
52
 
52
53
  interface PlantTagI {
@@ -17,7 +17,6 @@ export namespace USERS {
17
17
  }
18
18
  export type Response = MemberDataI & {
19
19
  unreadAlertsCount?: number
20
- unreadMessagesCount?: number
21
20
  }
22
21
  }
23
22
  export namespace DEVICES {