@hogsend/core 0.23.0 → 0.24.0
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 +2 -2
- package/src/types/journey-context.ts +13 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hogsend/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"drizzle-orm": "^0.45.2",
|
|
33
33
|
"iana-db-timezones": "^0.3.0",
|
|
34
34
|
"zod": "^4.4.3",
|
|
35
|
-
"@hogsend/db": "^0.
|
|
35
|
+
"@hogsend/db": "^0.24.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "latest",
|
|
@@ -96,6 +96,18 @@ export interface EmailHistoryResult {
|
|
|
96
96
|
count: number;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
export interface RecentEventsOptions {
|
|
100
|
+
userId: string;
|
|
101
|
+
limit?: number;
|
|
102
|
+
within?: DurationObject;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface RecentEvent {
|
|
106
|
+
event: string;
|
|
107
|
+
properties: Record<string, unknown> | null;
|
|
108
|
+
occurredAt: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
99
111
|
export interface WaitForEventOptions {
|
|
100
112
|
/** Event name to wait for (use your `Events` constant). Matched verbatim. */
|
|
101
113
|
event: string;
|
|
@@ -169,6 +181,7 @@ export interface JourneyContext {
|
|
|
169
181
|
hasEvent(opts: HasEventOptions): Promise<HasEventResult>;
|
|
170
182
|
journey(opts: JourneyHistoryOptions): Promise<JourneyHistoryResult>;
|
|
171
183
|
email(opts: EmailHistoryOptions): Promise<EmailHistoryResult>;
|
|
184
|
+
events(opts: RecentEventsOptions): Promise<RecentEvent[]>;
|
|
172
185
|
};
|
|
173
186
|
}
|
|
174
187
|
|