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

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/README.md CHANGED
@@ -1,26 +1,26 @@
1
- # La Main Verte - Shared TypeScript Interfaces
2
-
3
- This package contains the TypeScript interfaces used for the front-end of La Main Verte application.
4
-
5
- ## Installation
6
-
7
- To install the package, run:
8
-
9
- ```bash
10
-
11
- npm install @la-main-verte/shared-types
12
- ```
13
-
14
- ## Usage
15
-
16
- You can import the interfaces directly into your project:
17
-
18
- ```ts
19
- import type { PlantI, NoteI } from '@la-main-verte/shared-types'
20
-
21
- const plant: PlantI = await APIResponse.json()
22
- ```
23
-
24
- ## License
25
-
26
- This package is licensed under the MIT License.
1
+ # La Main Verte - Shared TypeScript Interfaces
2
+
3
+ This package contains the TypeScript interfaces used for the front-end of La Main Verte application.
4
+
5
+ ## Installation
6
+
7
+ To install the package, run:
8
+
9
+ ```bash
10
+
11
+ npm install @la-main-verte/shared-types
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ You can import the interfaces directly into your project:
17
+
18
+ ```ts
19
+ import type { PlantI, NoteI } from '@la-main-verte/shared-types'
20
+
21
+ const plant: PlantI = await APIResponse.json()
22
+ ```
23
+
24
+ ## License
25
+
26
+ This package is licensed under the MIT License.
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
- {
2
- "name": "@la-main-verte/shared-types",
3
- "version": "1.0.47",
4
- "description": "Shared TypeScript interfaces for frontend of la-main-verte app",
5
- "main": "src/index.js",
6
- "types": "src/index.d.ts",
7
- "author": "lamainverte.ca",
8
- "license": "MIT",
9
- "dependencies": {
10
- "typescript": "^5.6.3"
11
- },
12
- "devDependencies": {},
13
- "scripts": {
14
- "test": "echo \"Error: no test specified\" && exit 1"
15
- }
16
- }
1
+ {
2
+ "name": "@la-main-verte/shared-types",
3
+ "version": "1.0.48",
4
+ "description": "Shared TypeScript interfaces for frontend of la-main-verte app",
5
+ "main": "src/index.js",
6
+ "types": "src/index.d.ts",
7
+ "author": "lamainverte.ca",
8
+ "license": "MIT",
9
+ "dependencies": {
10
+ "typescript": "^5.6.3"
11
+ },
12
+ "devDependencies": {},
13
+ "scripts": {
14
+ "test": "echo \"Error: no test specified\" && exit 1"
15
+ }
16
+ }
package/src/alert.d.ts CHANGED
@@ -1,25 +1,25 @@
1
- export interface AlertI {
2
- id: number
3
- tags: AlertTagI[]
4
- icon: IconName
5
- /**
6
- * ColourCode of the icon
7
- * Ex: #ffffff
8
- */
9
- iconColor: string
10
- message: string
11
- }
12
-
13
- export interface AlertTagI {
14
- name: string
15
- /**
16
- * ColourCode of the alert tag background
17
- * Ex: #ffffff
18
- */
19
- backgroundColor: string
20
- /**
21
- * ColourCode of the alert tag text
22
- * Ex: #ffffff
23
- */
24
- textColor: string
25
- }
1
+ export interface AlertI {
2
+ id: number
3
+ tags: AlertTagI[]
4
+ icon: IconName
5
+ /**
6
+ * ColourCode of the icon
7
+ * Ex: #ffffff
8
+ */
9
+ iconColor: string
10
+ message: string
11
+ }
12
+
13
+ export interface AlertTagI {
14
+ name: string
15
+ /**
16
+ * ColourCode of the alert tag background
17
+ * Ex: #ffffff
18
+ */
19
+ backgroundColor: string
20
+ /**
21
+ * ColourCode of the alert tag text
22
+ * Ex: #ffffff
23
+ */
24
+ textColor: string
25
+ }
package/src/apiError.d.ts CHANGED
@@ -1,28 +1,28 @@
1
- export interface ApiErrorI {
2
- /**
3
- * Literally describe what the server error is, ideally in the language of the user
4
- */
5
- error_message?: string
6
- /**
7
- * A string code to identify the error
8
- */
9
- error_type?:
10
- | 'not_identified'
11
- | 'invalid_request'
12
- | 'subscription_required'
13
- | 'internal_server_error'
14
- | 'resource_already_exists'
15
- | 'not_found'
16
- | 'app_update_required'
17
- | string
18
- /**
19
- * A numerical code that can be used to identify the error
20
- * Ex: 401, 403, 404, 500 or L12, L13, L14
21
- */
22
- error_code?: string | number
23
- /**
24
- * A string that can be used to suggest a solution to the user
25
- * Ex: "Please check your internet connection and try again."
26
- */
27
- error_suggestion?: string
28
- }
1
+ export interface ApiErrorI {
2
+ /**
3
+ * Literally describe what the server error is, ideally in the language of the user
4
+ */
5
+ error_message?: string
6
+ /**
7
+ * A string code to identify the error
8
+ */
9
+ error_type?:
10
+ | 'not_identified'
11
+ | 'invalid_request'
12
+ | 'subscription_required'
13
+ | 'internal_server_error'
14
+ | 'resource_already_exists'
15
+ | 'not_found'
16
+ | 'app_update_required'
17
+ | string
18
+ /**
19
+ * A numerical code that can be used to identify the error
20
+ * Ex: 401, 403, 404, 500 or L12, L13, L14
21
+ */
22
+ error_code?: string | number
23
+ /**
24
+ * A string that can be used to suggest a solution to the user
25
+ * Ex: "Please check your internet connection and try again."
26
+ */
27
+ error_suggestion?: string
28
+ }
@@ -1,7 +1,7 @@
1
- export interface CalendarViewI {
2
- id: number
3
- title: string
4
- slug: string
5
- orderBy: 'startDate' | 'name'
6
- Plants: PlantI[]
7
- }
1
+ export interface CalendarViewI {
2
+ id: number
3
+ title: string
4
+ slug: string
5
+ orderBy: 'startDate' | 'name'
6
+ Plants: PlantI[]
7
+ }
package/src/device.d.ts CHANGED
@@ -1,41 +1,41 @@
1
- /**
2
- * Raw Data returned by the device model
3
- * Device.toJSON() will return this data
4
- */
5
- type DeviceDataI = {
6
- /** Unique identifier for the device */
7
- id: string
8
- /** Identifier for the user associated with the device (UUID) */
9
- memberId: string
10
- /** Optional push notification key */
11
- pushKey?: string
12
- /** Unique identifier for the device (UUID) */
13
- uuid: string
14
- /** RAW User agent string from the device */
15
- userAgent: string
16
- /** Optional platform (e.g., 'ios', 'android', 'windows') */
17
- platform?: 'ios' | 'android' | 'windows'
18
- /** Optional version of the device */
19
- version?: string
20
- /**
21
- * Technical model of the device
22
- * ---
23
- * Ex: iPhone12,1, iPhone13,2, iPhone14,4, etc.
24
- */
25
- model?: string
26
- /**
27
- * Readable name of the device
28
- * ---
29
- * Ex: 'iPhone 12 Pro Max', 'Samsung Galaxy S20', 'MacBook Pro 13 inch'
30
- * */
31
- name?: string
32
- /** Optional app version of the device. Ex: 1.0.0 */
33
- appVersion?: string
34
- /** Timestamp of when the device was created */
35
- createdAt: Date
36
- /** Timestamp of when the device was last updated */
37
- updatedAt: Date
38
- /** Virtual field that combines the name and appVersion */
39
- fullName: string
40
- }
41
- export { DeviceDataI }
1
+ /**
2
+ * Raw Data returned by the device model
3
+ * Device.toJSON() will return this data
4
+ */
5
+ type DeviceDataI = {
6
+ /** Unique identifier for the device */
7
+ id: string
8
+ /** Identifier for the user associated with the device (UUID) */
9
+ memberId: string
10
+ /** Optional push notification key */
11
+ pushKey?: string
12
+ /** Unique identifier for the device (UUID) */
13
+ uuid: string
14
+ /** RAW User agent string from the device */
15
+ userAgent: string
16
+ /** Optional platform (e.g., 'ios', 'android', 'windows') */
17
+ platform?: 'ios' | 'android' | 'windows'
18
+ /** Optional version of the device */
19
+ version?: string
20
+ /**
21
+ * Technical model of the device
22
+ * ---
23
+ * Ex: iPhone12,1, iPhone13,2, iPhone14,4, etc.
24
+ */
25
+ model?: string
26
+ /**
27
+ * Readable name of the device
28
+ * ---
29
+ * Ex: 'iPhone 12 Pro Max', 'Samsung Galaxy S20', 'MacBook Pro 13 inch'
30
+ * */
31
+ name?: string
32
+ /** Optional app version of the device. Ex: 1.0.0 */
33
+ appVersion?: string
34
+ /** Timestamp of when the device was created */
35
+ createdAt: Date
36
+ /** Timestamp of when the device was last updated */
37
+ updatedAt: Date
38
+ /** Virtual field that combines the name and appVersion */
39
+ fullName: string
40
+ }
41
+ export { DeviceDataI }
@@ -1,69 +1,69 @@
1
- /**
2
- * A gardenMap is a collection of garden zones
3
- */
4
- export interface GardenMapI {
5
- id: number
6
- memberId: number
7
- GardenZones: GardenZoneI[]
8
- createdAt: Date
9
- updatedAt: Date
10
- }
11
- export interface GardenZoneI {
12
- id: number
13
- name: string | null
14
- gardenMapId: number
15
- widthInMeters: number
16
- heightInMeters: number
17
- diameterInMeters: number
18
- shape: 'rectangle' | 'circle'
19
- xPosition: number
20
- yPosition: number | null
21
- zIndex: number
22
- order: number
23
- totalSurfaceInSquareMeters: number
24
- totalSurfaceInSquareFeet: number
25
- backgroundColor: string
26
- createdAt: Date
27
- updatedAt: Date
28
- /**
29
- * Orientation virtual field ONLY USE FOR RECTANGLES
30
- * --------------------------------
31
- * Disregard if the shape is a circle or square. It will return 'vertical'
32
- */
33
- orientation: 'horizontal' | 'vertical'
34
- /**
35
- * NOT USED BY THE FRONTEND YET - Use GardenZoneCulture instead
36
- */
37
- GardenZoneCultures?: GardenZoneCultureI[]
38
- /**
39
- * The culture on the GardenZone
40
- */
41
- GardenZoneCulture?: GardenZoneCultureI
42
- }
43
-
44
- export interface GardenZoneCultureI {
45
- id: number
46
- gardenZoneId: number
47
- plantSelectionId: number
48
- seedQuantity: number
49
- densityMode: 'dense' | 'sparse' | 'custom'
50
- /**
51
- * The year of the culture - do not use it yet.
52
- * @deprecated Potentially a mistake to have this field here
53
- */
54
- yearOfCulture: number
55
- PlantSelection?: PlantSelectionI
56
- /**
57
- * The number of alleys
58
- * --------------------------------
59
- * Value is computed by the backend and NOT coming from the DB.
60
- */
61
- numberOfAlleys?: number
62
- /**
63
- * The number of seeds per alley
64
- * --------------------------------
65
- * Value is computed by the backend and NOT coming from the DB.
66
- */
67
- numberOfSeedsPerAlley?: number
68
- fertilizerQuantitySuggested?: string
69
- }
1
+ /**
2
+ * A gardenMap is a collection of garden zones
3
+ */
4
+ export interface GardenMapI {
5
+ id: number
6
+ memberId: number
7
+ GardenZones: GardenZoneI[]
8
+ createdAt: Date
9
+ updatedAt: Date
10
+ }
11
+ export interface GardenZoneI {
12
+ id: number
13
+ name: string | null
14
+ gardenMapId: number
15
+ widthInMeters: number
16
+ heightInMeters: number
17
+ diameterInMeters: number
18
+ shape: 'rectangle' | 'circle'
19
+ xPosition: number
20
+ yPosition: number | null
21
+ zIndex: number
22
+ order: number
23
+ totalSurfaceInSquareMeters: number
24
+ totalSurfaceInSquareFeet: number
25
+ backgroundColor: string
26
+ createdAt: Date
27
+ updatedAt: Date
28
+ /**
29
+ * Orientation virtual field ONLY USE FOR RECTANGLES
30
+ * --------------------------------
31
+ * Disregard if the shape is a circle or square. It will return 'vertical'
32
+ */
33
+ orientation: 'horizontal' | 'vertical'
34
+ /**
35
+ * NOT USED BY THE FRONTEND YET - Use GardenZoneCulture instead
36
+ */
37
+ GardenZoneCultures?: GardenZoneCultureI[]
38
+ /**
39
+ * The culture on the GardenZone
40
+ */
41
+ GardenZoneCulture?: GardenZoneCultureI
42
+ }
43
+
44
+ export interface GardenZoneCultureI {
45
+ id: number
46
+ gardenZoneId: number
47
+ plantSelectionId: number
48
+ seedQuantity: number
49
+ densityMode: 'dense' | 'sparse' | 'custom'
50
+ /**
51
+ * The year of the culture - do not use it yet.
52
+ * @deprecated Potentially a mistake to have this field here
53
+ */
54
+ yearOfCulture: number
55
+ PlantSelection?: PlantSelectionI
56
+ /**
57
+ * The number of alleys
58
+ * --------------------------------
59
+ * Value is computed by the backend and NOT coming from the DB.
60
+ */
61
+ numberOfAlleys?: number
62
+ /**
63
+ * The number of seeds per alley
64
+ * --------------------------------
65
+ * Value is computed by the backend and NOT coming from the DB.
66
+ */
67
+ numberOfSeedsPerAlley?: number
68
+ fertilizerQuantitySuggested?: string
69
+ }
package/src/image.d.ts CHANGED
@@ -1,10 +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
- }
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
@@ -1,18 +1,18 @@
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 './alert'
10
- export * from './image'
11
- import * as PlantsAPI from './plants.api'
12
- import * as UsersAPI from './users.api'
13
-
14
- // Allow access to the API namespaces without conflicts
15
- export namespace API {
16
- export import PLANTS = PlantsAPI
17
- export import USERS = UsersAPI
18
- }
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 './alert'
10
+ export * from './image'
11
+ import * as PlantsAPI from './plants.api'
12
+ import * as UsersAPI from './users.api'
13
+
14
+ // Allow access to the API namespaces without conflicts
15
+ export namespace API {
16
+ export import PLANTS = PlantsAPI
17
+ export import USERS = UsersAPI
18
+ }
package/src/member.d.ts CHANGED
@@ -1,53 +1,58 @@
1
- export interface MemberI {
2
- id: number
3
- email: string
4
- firstName: string
5
- lastName: string
6
- /** Virtual field to get the user's full name */
7
- fullName?: string | null
8
- city?: string
9
- hardinessZoneName?: string
10
- createdAt: Date
11
- updatedAt: Date
12
- lastFreezingDate?: Date
13
- firstFreezingDate?: Date
14
- /**
15
- * Number of unread Crisp messages
16
- */
17
- unreadMessagesCount?: number
18
- notes?: NoteI[]
19
- selections?: SelectionI[]
20
- userActivities?: UserActivityI[]
21
- /**
22
- * hasAnActiveSubscription is a VIRTUAL FIELD used to check if the user has an active subscription
23
- */
24
- hasAnActiveSubscription?: boolean
25
- /**
26
- * Acts as a one-way not identifiable token.
27
- * Crisp and other services like Upvoty use this token to identify the user
28
- */
29
- userToken: string
30
- /**
31
- * neverAddedATask <=> Has the use ever open the task form?
32
- * Yes it is misleading, ticket is open to change it.
33
- * It was too intense to force the user to add a task.
34
- */
35
- neverAddedATask?: boolean
36
- neverAddedAPlant?: boolean
37
- neverAddedANote?: boolean
38
- neverTriedSpacingSection?: boolean
39
- neverTriedAiAgent?: boolean
40
- neverDeletedAPlant?: boolean
41
- neverDeletedATask?: boolean
42
- neverEditedATask?: boolean
43
- finishedOnboarding: boolean
44
- hasDownloadedNativeApp?: boolean
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
53
- }
1
+ export interface MemberI {
2
+ id: number
3
+ email: string
4
+ firstName: string
5
+ lastName: string
6
+ /** Virtual field to get the user's full name */
7
+ fullName?: string | null
8
+ city?: string
9
+ hardinessZoneName?: string
10
+ createdAt: Date
11
+ updatedAt: Date
12
+ lastFreezingDate?: Date
13
+ firstFreezingDate?: Date
14
+ /**
15
+ * Number of unread Crisp messages
16
+ */
17
+ unreadMessagesCount?: number
18
+ notes?: NoteI[]
19
+ selections?: SelectionI[]
20
+ userActivities?: UserActivityI[]
21
+ /**
22
+ * hasAnActiveSubscription is a VIRTUAL FIELD used to check if the user has an active subscription
23
+ */
24
+ hasAnActiveSubscription?: boolean
25
+ /**
26
+ * Acts as a one-way not identifiable token.
27
+ * Crisp and other services like Upvoty use this token to identify the user
28
+ */
29
+ userToken: string
30
+ /**
31
+ * neverAddedATask <=> Has the use ever open the task form?
32
+ * Yes it is misleading, ticket is open to change it.
33
+ * It was too intense to force the user to add a task.
34
+ */
35
+ neverAddedATask?: boolean
36
+ neverAddedAPlant?: boolean
37
+ neverAddedANote?: boolean
38
+ neverTriedSpacingSection?: boolean
39
+ neverTriedAiAgent?: boolean
40
+ neverDeletedAPlant?: boolean
41
+ neverDeletedATask?: boolean
42
+ neverEditedATask?: boolean
43
+ finishedOnboarding: boolean
44
+ hasDownloadedNativeApp?: boolean
45
+ unitSystem: 'imperial' | 'metric'
46
+ subscriptionEndDate?: Date
47
+ /**
48
+ * Virtual field to get the app badge count
49
+ * ----------------------------------------
50
+ * For now, it's just the number of unread messages.
51
+ */
52
+ badgeCount?: number
53
+ /**
54
+ * Number of unread alerts, cached version of unread alerts (the table) count
55
+ */
56
+ unreadAlertsCount?: number
57
+ isAdmin: boolean
58
+ }