@hogsend/core 0.7.0 → 0.9.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hogsend/core",
3
- "version": "0.7.0",
3
+ "version": "0.9.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.7.0"
35
+ "@hogsend/db": "^0.9.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": "latest",
@@ -1,5 +1,22 @@
1
- export interface PostHogService {
1
+ /**
2
+ * The minimal READ contract for the identity PULL: fetching a person's
3
+ * properties by distinct id. This is the only role the engine still requires of
4
+ * the injected analytics service at the hot path — per-user timezone resolution
5
+ * at journey enrollment (`getPersonProperties` in `define-journey` /
6
+ * `lib/timezone.ts`). It is intentionally narrow: the email/contact/journey/
7
+ * bucket lifecycle fan-out now flows through outbound DESTINATIONS on the
8
+ * durable spine, NOT through this provider.
9
+ *
10
+ * `PostHogService` satisfies `IdentityProvider` (it declares
11
+ * `getPersonProperties` plus the deprecated capture/identify shims). Code that
12
+ * only needs the PULL can depend on this narrower alias.
13
+ */
14
+ export interface IdentityProvider {
2
15
  getPersonProperties(distinctId: string): Promise<Record<string, unknown>>;
16
+ }
17
+
18
+ export interface PostHogService extends IdentityProvider {
19
+ // getPersonProperties is inherited from IdentityProvider (the identity PULL).
3
20
 
4
21
  captureEvent(opts: CaptureOptions): void;
5
22
 
@@ -142,7 +142,6 @@ export interface JourneyContext {
142
142
 
143
143
  checkpoint(label: string): Promise<void>;
144
144
  trigger(opts: TriggerOptions): Promise<void>;
145
- identify(properties: Record<string, unknown>): void;
146
145
 
147
146
  guard: {
148
147
  isSubscribed(): Promise<boolean>;
@@ -153,13 +152,6 @@ export interface JourneyContext {
153
152
  journey(opts: JourneyHistoryOptions): Promise<JourneyHistoryResult>;
154
153
  email(opts: EmailHistoryOptions): Promise<EmailHistoryResult>;
155
154
  };
156
-
157
- posthog: {
158
- capture(opts: {
159
- event: string;
160
- properties?: Record<string, unknown>;
161
- }): void;
162
- };
163
155
  }
164
156
 
165
157
  export type JourneyRunFn = (