@la-main-verte/shared-types 1.0.91 → 1.0.92
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 +1 -1
- package/src/alert.d.ts +137 -124
- package/src/fertilizer.d.ts +67 -67
- package/src/home.api.d.ts +354 -354
- package/src/index.ts +41 -39
- package/src/member.d.ts +145 -145
- package/src/plant.d.ts +201 -201
- package/src/selections.api.d.ts +42 -0
- package/src/users.api.d.ts +154 -154
- package/src/weather.api.d.ts +34 -34
package/src/index.ts
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
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 './audience'
|
|
12
|
-
export * from './image'
|
|
13
|
-
export * from './note'
|
|
14
|
-
export * from './taggedItem'
|
|
15
|
-
export * from './fertilizer'
|
|
16
|
-
export * from './utmParams'
|
|
17
|
-
export * from './plantFilters'
|
|
18
|
-
export * from './taxonFamily'
|
|
19
|
-
export * from './rotationGroup'
|
|
20
|
-
import * as PlantsAPI from './plants.api'
|
|
21
|
-
import * as
|
|
22
|
-
import * as
|
|
23
|
-
import * as
|
|
24
|
-
import * as
|
|
25
|
-
import * as
|
|
26
|
-
import * as
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export import
|
|
32
|
-
export import
|
|
33
|
-
export import
|
|
34
|
-
export import
|
|
35
|
-
export import
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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 './audience'
|
|
12
|
+
export * from './image'
|
|
13
|
+
export * from './note'
|
|
14
|
+
export * from './taggedItem'
|
|
15
|
+
export * from './fertilizer'
|
|
16
|
+
export * from './utmParams'
|
|
17
|
+
export * from './plantFilters'
|
|
18
|
+
export * from './taxonFamily'
|
|
19
|
+
export * from './rotationGroup'
|
|
20
|
+
import * as PlantsAPI from './plants.api'
|
|
21
|
+
import * as SelectionsAPI from './selections.api'
|
|
22
|
+
import * as UsersAPI from './users.api'
|
|
23
|
+
import * as SessionsAPI from './sessions.api'
|
|
24
|
+
import * as HomeAPI from './home.api'
|
|
25
|
+
import * as PagesAPI from './pages.api'
|
|
26
|
+
import * as PaymentsAPI from './payments.api'
|
|
27
|
+
import * as WeatherAPI from './weather.api'
|
|
28
|
+
|
|
29
|
+
// Allow access to the API namespaces without conflicts
|
|
30
|
+
export namespace API {
|
|
31
|
+
export import PLANTS = PlantsAPI
|
|
32
|
+
export import SELECTIONS = SelectionsAPI
|
|
33
|
+
export import USERS = UsersAPI
|
|
34
|
+
export import SESSIONS = SessionsAPI
|
|
35
|
+
export import HOME = HomeAPI
|
|
36
|
+
export import PAGES = PagesAPI
|
|
37
|
+
export import PAYMENTS = PaymentsAPI
|
|
38
|
+
// weather.api exports its types at the module top level, so this alias
|
|
39
|
+
// resolves to API.WEATHER.CurrentWeatherI directly.
|
|
40
|
+
export import WEATHER = WeatherAPI
|
|
41
|
+
}
|
package/src/member.d.ts
CHANGED
|
@@ -1,145 +1,145 @@
|
|
|
1
|
-
import type { NoteI } from './note'
|
|
2
|
-
import type { 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 uses this token to identify the user conversation
|
|
31
|
-
*/
|
|
32
|
-
userToken: string
|
|
33
|
-
/**
|
|
34
|
-
* HMAC signature used by Crisp identity verification.
|
|
35
|
-
* Signed on the backend from the user email.
|
|
36
|
-
*/
|
|
37
|
-
crispUserEmailSignature?: string
|
|
38
|
-
/**
|
|
39
|
-
* neverAddedATask <=> Has the use ever open the task form?
|
|
40
|
-
* Yes it is misleading, ticket is open to change it.
|
|
41
|
-
* It was too intense to force the user to add a task.
|
|
42
|
-
*/
|
|
43
|
-
neverAddedATask?: boolean
|
|
44
|
-
neverAddedAPlant?: boolean
|
|
45
|
-
neverAddedANote?: boolean
|
|
46
|
-
neverTriedSpacingSection?: boolean
|
|
47
|
-
neverTriedAiAgent?: boolean
|
|
48
|
-
neverDeletedAPlant?: boolean
|
|
49
|
-
neverDeletedATask?: boolean
|
|
50
|
-
neverEditedATask?: boolean
|
|
51
|
-
finishedOnboarding: boolean
|
|
52
|
-
hasDownloadedNativeApp?: boolean
|
|
53
|
-
unitSystem: 'imperial' | 'metric'
|
|
54
|
-
language?: string
|
|
55
|
-
gardenZoneTimelessPreference?: boolean
|
|
56
|
-
subscriptionEndDate?: Date
|
|
57
|
-
/**
|
|
58
|
-
* Last fertilizer ID chosen by the user.
|
|
59
|
-
* Used as the default fertilizer for new garden zones.
|
|
60
|
-
*/
|
|
61
|
-
lastFertilizerIdChosen?: number
|
|
62
|
-
/**
|
|
63
|
-
* Virtual field to get the app badge count
|
|
64
|
-
* ----------------------------------------
|
|
65
|
-
* For now, it's just the number of unread messages.
|
|
66
|
-
*/
|
|
67
|
-
badgeCount?: number
|
|
68
|
-
/**
|
|
69
|
-
* Number of unread alerts, cached version of unread alerts (the table) count
|
|
70
|
-
*/
|
|
71
|
-
unreadAlertsCount?: number
|
|
72
|
-
isAdmin: boolean
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* PrivateMemberI
|
|
77
|
-
* --------------
|
|
78
|
-
* The data a member is allowed to see about *themselves* — the shape
|
|
79
|
-
* returned to the front-end by GET/POST /users. (A future `PublicMemberI`
|
|
80
|
-
* will model the much smaller set of fields shown to other members.)
|
|
81
|
-
*
|
|
82
|
-
* Unlike `MemberI` (the full domain model), this is a deliberate
|
|
83
|
-
* allow-list of only the fields the client actually consumes. It exists
|
|
84
|
-
* to prevent leaking sensitive or internal Member columns: anything not
|
|
85
|
-
* listed here is never serialized to the client. Keep this in sync with
|
|
86
|
-
* `privateMember.presenter.ts` on the backend.
|
|
87
|
-
*/
|
|
88
|
-
export interface PrivateMemberI {
|
|
89
|
-
id: number
|
|
90
|
-
email: string
|
|
91
|
-
/** New email address awaiting verification during an email change. Null/absent when none pending. */
|
|
92
|
-
pendingEmail?: string | null
|
|
93
|
-
/**
|
|
94
|
-
* When `pendingEmail` was last requested. Lets the client tell whether the
|
|
95
|
-
* verification link is likely still within Stytch's 5-minute window, or
|
|
96
|
-
* whether the member should request a fresh one. Null/absent when none pending.
|
|
97
|
-
*/
|
|
98
|
-
pendingEmailRequestedAt?: Date | null
|
|
99
|
-
city?: string
|
|
100
|
-
unitSystem: 'imperial' | 'metric'
|
|
101
|
-
language: 'fr-CA' | 'en-CA'
|
|
102
|
-
gardenZoneTimelessPreference?: boolean
|
|
103
|
-
firstFreezingDate?: Date
|
|
104
|
-
lastFreezingDate?: Date
|
|
105
|
-
subscriptionEndDate?: Date
|
|
106
|
-
hasAnActiveSubscription?: boolean
|
|
107
|
-
hasDownloadedNativeApp?: boolean
|
|
108
|
-
isAdmin: boolean
|
|
109
|
-
/**
|
|
110
|
-
* App badge count (currently unread messages + unread alerts).
|
|
111
|
-
*/
|
|
112
|
-
badgeCount?: number
|
|
113
|
-
/**
|
|
114
|
-
* One-way Crisp identification token. Not personally identifiable.
|
|
115
|
-
*/
|
|
116
|
-
userToken: string
|
|
117
|
-
/**
|
|
118
|
-
* HMAC signature used by Crisp identity verification.
|
|
119
|
-
*/
|
|
120
|
-
crispUserEmailSignature?: string
|
|
121
|
-
unreadMessagesCount?: number
|
|
122
|
-
unreadAlertsCount?: number
|
|
123
|
-
neverAddedANote?: boolean
|
|
124
|
-
neverAddedAPlant?: boolean
|
|
125
|
-
neverDeletedAPlant?: boolean
|
|
126
|
-
neverEditedATask?: boolean
|
|
127
|
-
neverTriedAiAgent?: boolean
|
|
128
|
-
neverTriedSpacingSection?: boolean
|
|
129
|
-
/**
|
|
130
|
-
* Newsletter opt-in.
|
|
131
|
-
* - true: opted in → never ask again
|
|
132
|
-
* - false: refused in-app → re-askable after a cooldown
|
|
133
|
-
* - null: never asked → ask now
|
|
134
|
-
*/
|
|
135
|
-
marketingConsent?: boolean | null
|
|
136
|
-
/** When marketingConsent was last set. Drives the re-ask cooldown. */
|
|
137
|
-
marketingConsentUpdatedAt?: Date | null
|
|
138
|
-
/**
|
|
139
|
-
* True when the member belongs to the "very active" audience (~14 days of
|
|
140
|
-
* distinct activity). Only present when GET /users is called with the
|
|
141
|
-
* `requestAppStoreReview` scope; the app uses it to trigger a one-time
|
|
142
|
-
* in-app store-review prompt.
|
|
143
|
-
*/
|
|
144
|
-
requestAppStoreReview?: boolean
|
|
145
|
-
}
|
|
1
|
+
import type { NoteI } from './note'
|
|
2
|
+
import type { 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 uses this token to identify the user conversation
|
|
31
|
+
*/
|
|
32
|
+
userToken: string
|
|
33
|
+
/**
|
|
34
|
+
* HMAC signature used by Crisp identity verification.
|
|
35
|
+
* Signed on the backend from the user email.
|
|
36
|
+
*/
|
|
37
|
+
crispUserEmailSignature?: string
|
|
38
|
+
/**
|
|
39
|
+
* neverAddedATask <=> Has the use ever open the task form?
|
|
40
|
+
* Yes it is misleading, ticket is open to change it.
|
|
41
|
+
* It was too intense to force the user to add a task.
|
|
42
|
+
*/
|
|
43
|
+
neverAddedATask?: boolean
|
|
44
|
+
neverAddedAPlant?: boolean
|
|
45
|
+
neverAddedANote?: boolean
|
|
46
|
+
neverTriedSpacingSection?: boolean
|
|
47
|
+
neverTriedAiAgent?: boolean
|
|
48
|
+
neverDeletedAPlant?: boolean
|
|
49
|
+
neverDeletedATask?: boolean
|
|
50
|
+
neverEditedATask?: boolean
|
|
51
|
+
finishedOnboarding: boolean
|
|
52
|
+
hasDownloadedNativeApp?: boolean
|
|
53
|
+
unitSystem: 'imperial' | 'metric'
|
|
54
|
+
language?: string
|
|
55
|
+
gardenZoneTimelessPreference?: boolean
|
|
56
|
+
subscriptionEndDate?: Date
|
|
57
|
+
/**
|
|
58
|
+
* Last fertilizer ID chosen by the user.
|
|
59
|
+
* Used as the default fertilizer for new garden zones.
|
|
60
|
+
*/
|
|
61
|
+
lastFertilizerIdChosen?: number
|
|
62
|
+
/**
|
|
63
|
+
* Virtual field to get the app badge count
|
|
64
|
+
* ----------------------------------------
|
|
65
|
+
* For now, it's just the number of unread messages.
|
|
66
|
+
*/
|
|
67
|
+
badgeCount?: number
|
|
68
|
+
/**
|
|
69
|
+
* Number of unread alerts, cached version of unread alerts (the table) count
|
|
70
|
+
*/
|
|
71
|
+
unreadAlertsCount?: number
|
|
72
|
+
isAdmin: boolean
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* PrivateMemberI
|
|
77
|
+
* --------------
|
|
78
|
+
* The data a member is allowed to see about *themselves* — the shape
|
|
79
|
+
* returned to the front-end by GET/POST /users. (A future `PublicMemberI`
|
|
80
|
+
* will model the much smaller set of fields shown to other members.)
|
|
81
|
+
*
|
|
82
|
+
* Unlike `MemberI` (the full domain model), this is a deliberate
|
|
83
|
+
* allow-list of only the fields the client actually consumes. It exists
|
|
84
|
+
* to prevent leaking sensitive or internal Member columns: anything not
|
|
85
|
+
* listed here is never serialized to the client. Keep this in sync with
|
|
86
|
+
* `privateMember.presenter.ts` on the backend.
|
|
87
|
+
*/
|
|
88
|
+
export interface PrivateMemberI {
|
|
89
|
+
id: number
|
|
90
|
+
email: string
|
|
91
|
+
/** New email address awaiting verification during an email change. Null/absent when none pending. */
|
|
92
|
+
pendingEmail?: string | null
|
|
93
|
+
/**
|
|
94
|
+
* When `pendingEmail` was last requested. Lets the client tell whether the
|
|
95
|
+
* verification link is likely still within Stytch's 5-minute window, or
|
|
96
|
+
* whether the member should request a fresh one. Null/absent when none pending.
|
|
97
|
+
*/
|
|
98
|
+
pendingEmailRequestedAt?: Date | null
|
|
99
|
+
city?: string
|
|
100
|
+
unitSystem: 'imperial' | 'metric'
|
|
101
|
+
language: 'fr-CA' | 'en-CA'
|
|
102
|
+
gardenZoneTimelessPreference?: boolean
|
|
103
|
+
firstFreezingDate?: Date
|
|
104
|
+
lastFreezingDate?: Date
|
|
105
|
+
subscriptionEndDate?: Date
|
|
106
|
+
hasAnActiveSubscription?: boolean
|
|
107
|
+
hasDownloadedNativeApp?: boolean
|
|
108
|
+
isAdmin: boolean
|
|
109
|
+
/**
|
|
110
|
+
* App badge count (currently unread messages + unread alerts).
|
|
111
|
+
*/
|
|
112
|
+
badgeCount?: number
|
|
113
|
+
/**
|
|
114
|
+
* One-way Crisp identification token. Not personally identifiable.
|
|
115
|
+
*/
|
|
116
|
+
userToken: string
|
|
117
|
+
/**
|
|
118
|
+
* HMAC signature used by Crisp identity verification.
|
|
119
|
+
*/
|
|
120
|
+
crispUserEmailSignature?: string
|
|
121
|
+
unreadMessagesCount?: number
|
|
122
|
+
unreadAlertsCount?: number
|
|
123
|
+
neverAddedANote?: boolean
|
|
124
|
+
neverAddedAPlant?: boolean
|
|
125
|
+
neverDeletedAPlant?: boolean
|
|
126
|
+
neverEditedATask?: boolean
|
|
127
|
+
neverTriedAiAgent?: boolean
|
|
128
|
+
neverTriedSpacingSection?: boolean
|
|
129
|
+
/**
|
|
130
|
+
* Newsletter opt-in.
|
|
131
|
+
* - true: opted in → never ask again
|
|
132
|
+
* - false: refused in-app → re-askable after a cooldown
|
|
133
|
+
* - null: never asked → ask now
|
|
134
|
+
*/
|
|
135
|
+
marketingConsent?: boolean | null
|
|
136
|
+
/** When marketingConsent was last set. Drives the re-ask cooldown. */
|
|
137
|
+
marketingConsentUpdatedAt?: Date | null
|
|
138
|
+
/**
|
|
139
|
+
* True when the member belongs to the "very active" audience (~14 days of
|
|
140
|
+
* distinct activity). Only present when GET /users is called with the
|
|
141
|
+
* `requestAppStoreReview` scope; the app uses it to trigger a one-time
|
|
142
|
+
* in-app store-review prompt.
|
|
143
|
+
*/
|
|
144
|
+
requestAppStoreReview?: boolean
|
|
145
|
+
}
|