@walkeros/server-destination-hubspot 3.4.0-next-1776749829492

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 ADDED
@@ -0,0 +1,81 @@
1
+ # @walkeros/server-destination-hubspot
2
+
3
+ Server-side HubSpot CRM destination for
4
+ [walkerOS](https://github.com/elbwalker/walkerOS). Sends custom events and
5
+ upserts contacts via the official `@hubspot/api-client` SDK.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @walkeros/server-destination-hubspot
11
+ ```
12
+
13
+ ## Quick Start
14
+
15
+ ```json
16
+ {
17
+ "destinations": {
18
+ "hubspot": {
19
+ "package": "@walkeros/server-destination-hubspot",
20
+ "config": {
21
+ "consent": { "marketing": true },
22
+ "settings": {
23
+ "accessToken": "$env:HUBSPOT_ACCESS_TOKEN",
24
+ "eventNamePrefix": "pe12345678_",
25
+ "email": "user.email",
26
+ "defaultProperties": {
27
+ "hs_touchpoint_source": "walkerOS"
28
+ }
29
+ }
30
+ }
31
+ }
32
+ }
33
+ }
34
+ ```
35
+
36
+ ## Settings
37
+
38
+ | Setting | Type | Required | Default | Description |
39
+ | ------------------- | ------------ | -------- | -------------- | ---------------------------------------- |
40
+ | `accessToken` | string | Yes | -- | HubSpot private app access token |
41
+ | `eventNamePrefix` | string | Yes | -- | Fully qualified prefix: `pe{HubID}_` |
42
+ | `email` | string | No | `'user.email'` | Mapping path to resolve contact email |
43
+ | `objectId` | string | No | -- | Mapping path to resolve CRM objectId |
44
+ | `identify` | MappingValue | No | -- | Destination-level contact upsert mapping |
45
+ | `defaultProperties` | Record | No | -- | Static properties added to every event |
46
+ | `batch` | boolean | No | `false` | Use batch API for events |
47
+ | `batchSize` | number | No | `50` | Events before auto-flush (max 500) |
48
+
49
+ ## Mapping Settings
50
+
51
+ Per-event mapping settings control behavior per rule:
52
+
53
+ | Setting | Effect | Use with `skip: true` |
54
+ | ------------ | ------------------------------------------------------------ | --------------------- |
55
+ | `eventName` | Overrides auto-generated event name (prefix still prepended) | No |
56
+ | `identify` | Upserts contact via CRM API | Yes, for login events |
57
+ | `properties` | Maps event data to HubSpot event properties | No |
58
+
59
+ ## Identity
60
+
61
+ HubSpot requires every event to be associated with a contact via `email` or
62
+ `objectId`. Events where neither resolves are skipped with a warning.
63
+
64
+ ## Contact Upsert
65
+
66
+ The `identify` setting (destination-level or per-rule) resolves to
67
+ `{ email, properties }` and calls `crm.contacts.basicApi.update()` with
68
+ `idProperty: 'email'`. State-based dedup prevents redundant API calls when
69
+ identity has not changed.
70
+
71
+ ## Batch Mode
72
+
73
+ Set `batch: true` to accumulate events and flush via
74
+ `events.send.batchApi.send()` when the queue reaches `batchSize`. Remaining
75
+ events are flushed on `destroy()`.
76
+
77
+ ## Prerequisites
78
+
79
+ - HubSpot Marketing Hub Professional+ (required for custom events)
80
+ - Private app with `analytics.behavioral_events.send` scope
81
+ - Custom events must be pre-defined in HubSpot before sending occurrences
package/dist/dev.d.mts ADDED
@@ -0,0 +1,224 @@
1
+ import * as _walkeros_core_dev from '@walkeros/core/dev';
2
+ import { z } from '@walkeros/core/dev';
3
+ import { Mapping as Mapping$1, Flow } from '@walkeros/core';
4
+ import { DestinationServer } from '@walkeros/server-core';
5
+
6
+ declare const SettingsSchema: z.ZodObject<{
7
+ accessToken: z.ZodString;
8
+ eventNamePrefix: z.ZodString;
9
+ email: z.ZodOptional<z.ZodString>;
10
+ objectId: z.ZodOptional<z.ZodString>;
11
+ identify: z.ZodOptional<z.ZodUnknown>;
12
+ defaultProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
13
+ batch: z.ZodOptional<z.ZodBoolean>;
14
+ batchSize: z.ZodOptional<z.ZodNumber>;
15
+ }, z.core.$strip>;
16
+ type Settings$1 = z.infer<typeof SettingsSchema>;
17
+
18
+ declare const MappingSchema: z.ZodObject<{
19
+ eventName: z.ZodOptional<z.ZodString>;
20
+ identify: z.ZodOptional<z.ZodUnknown>;
21
+ properties: z.ZodOptional<z.ZodUnknown>;
22
+ }, z.core.$strip>;
23
+ type Mapping = z.infer<typeof MappingSchema>;
24
+
25
+ declare const settings: _walkeros_core_dev.JSONSchema;
26
+ declare const mapping: _walkeros_core_dev.JSONSchema;
27
+
28
+ type index$1_Mapping = Mapping;
29
+ declare const index$1_MappingSchema: typeof MappingSchema;
30
+ declare const index$1_SettingsSchema: typeof SettingsSchema;
31
+ declare const index$1_mapping: typeof mapping;
32
+ declare const index$1_settings: typeof settings;
33
+ declare namespace index$1 {
34
+ export { type index$1_Mapping as Mapping, index$1_MappingSchema as MappingSchema, type Settings$1 as Settings, index$1_SettingsSchema as SettingsSchema, index$1_mapping as mapping, index$1_settings as settings };
35
+ }
36
+
37
+ /** Shape of a single custom event occurrence sent to HubSpot. */
38
+ interface HubSpotEventRequest {
39
+ eventName: string;
40
+ email?: string;
41
+ objectId?: string;
42
+ utk?: string;
43
+ uuid?: string;
44
+ occurredAt?: Date;
45
+ properties?: Record<string, string>;
46
+ }
47
+ /**
48
+ * Mock-friendly interface for the HubSpot Client methods the destination
49
+ * actually calls. Tests provide this via env.client instead of the real SDK.
50
+ */
51
+ interface HubSpotClientMock {
52
+ events: {
53
+ send: {
54
+ basicApi: {
55
+ send: (data: HubSpotEventRequest) => Promise<void>;
56
+ };
57
+ batchApi: {
58
+ send: (data: {
59
+ inputs: HubSpotEventRequest[];
60
+ }) => Promise<void>;
61
+ };
62
+ };
63
+ };
64
+ crm: {
65
+ contacts: {
66
+ basicApi: {
67
+ update: (id: string, data: {
68
+ properties: Record<string, string>;
69
+ }, idProperty?: string) => Promise<void>;
70
+ };
71
+ };
72
+ };
73
+ }
74
+ interface Settings {
75
+ /** HubSpot private app access token (required). */
76
+ accessToken: string;
77
+ /**
78
+ * Fully qualified event name prefix: pe{HubID}_
79
+ * Used to construct eventName from walkerOS event names.
80
+ * Example: 'pe12345678_'
81
+ */
82
+ eventNamePrefix: string;
83
+ /**
84
+ * walkerOS mapping value path to resolve contact email from events.
85
+ * Default: 'user.email'
86
+ */
87
+ email?: string;
88
+ /**
89
+ * walkerOS mapping value path to resolve HubSpot objectId from events.
90
+ * Default: undefined (use email for association)
91
+ */
92
+ objectId?: string;
93
+ /**
94
+ * Destination-level contact upsert mapping.
95
+ * Resolves to { email, properties } and upserts the contact on each push
96
+ * (with dedup via state hash).
97
+ */
98
+ identify?: Mapping$1.Value;
99
+ /**
100
+ * Static event properties added to every event occurrence.
101
+ * Useful for hs_touchpoint_source, hs_page_content_type, etc.
102
+ */
103
+ defaultProperties?: Record<string, string>;
104
+ /**
105
+ * Whether to use batch API for events (accumulate and flush).
106
+ * Default: false (single event sends).
107
+ */
108
+ batch?: boolean;
109
+ /**
110
+ * Batch size before auto-flush. Only used when batch: true.
111
+ * Default: 50. Max: 500.
112
+ */
113
+ batchSize?: number;
114
+ /** Runtime state -- not user-facing. Mutated by init/push. */
115
+ _client?: HubSpotClientMock;
116
+ _state?: RuntimeState;
117
+ _eventQueue?: HubSpotEventRequest[];
118
+ }
119
+ interface RuntimeState {
120
+ lastIdentity?: {
121
+ email?: string;
122
+ propertiesHash?: string;
123
+ };
124
+ }
125
+ /**
126
+ * Env -- optional SDK override. Production leaves this undefined and the
127
+ * destination creates a real Client instance. Tests provide a mock via
128
+ * env.client.
129
+ */
130
+ interface Env extends DestinationServer.Env {
131
+ client?: HubSpotClientMock;
132
+ }
133
+
134
+ declare const push: Env;
135
+ declare const simulation: string[];
136
+
137
+ declare const env_push: typeof push;
138
+ declare const env_simulation: typeof simulation;
139
+ declare namespace env {
140
+ export { env_push as push, env_simulation as simulation };
141
+ }
142
+
143
+ /**
144
+ * HubSpot SDK step examples.
145
+ *
146
+ * At push time, the destination invokes the `@hubspot/api-client` SDK. The
147
+ * public method paths users see on the client are:
148
+ *
149
+ * - `events.send.basicApi.send(eventRequest)` — fires an event
150
+ * - `events.send.batchApi.send({ inputs: [...] })` — flushes a batch
151
+ * - `crm.contacts.basicApi.update(id, data, idProperty)` — contact upsert
152
+ *
153
+ * Each `out` is therefore a list of tuples `[['method.path', ...args], ...]`
154
+ * matching the actual SDK call order. `identify` fires before the event.
155
+ * When the destination skips an event (`skip: true`, `ignore: true`, or
156
+ * missing identity), `out` is `[]`.
157
+ */
158
+ /**
159
+ * Extended step example that may carry destination-level settings overrides.
160
+ */
161
+ type HubSpotStepExample = Flow.StepExample & {
162
+ settings?: Partial<Settings>;
163
+ };
164
+ /**
165
+ * Default event forwarding -- events.send.basicApi.send() with auto-generated
166
+ * event name. Email resolved from default settings.email = 'user.email'.
167
+ */
168
+ declare const defaultEvent: HubSpotStepExample;
169
+ /**
170
+ * Mapped event name -- mapping.settings.eventName overrides the auto-generated
171
+ * name. The prefix is still prepended.
172
+ */
173
+ declare const mappedEventName: HubSpotStepExample;
174
+ /**
175
+ * Event with defaultProperties -- settings.defaultProperties are merged
176
+ * into every event. Per-event properties override defaults.
177
+ */
178
+ declare const defaultProperties: HubSpotStepExample;
179
+ /**
180
+ * Destination-level identify -- fires crm.contacts.basicApi.update() on
181
+ * first push when settings.identify mapping resolves. Then fires the event.
182
+ */
183
+ declare const destinationIdentify: HubSpotStepExample;
184
+ /**
185
+ * Per-event identify with skip -- user login fires contact upsert only,
186
+ * no custom event sent.
187
+ */
188
+ declare const userLoginIdentify: HubSpotStepExample;
189
+ /**
190
+ * objectId association -- use objectId instead of email for contact
191
+ * association on the event.
192
+ */
193
+ declare const objectIdAssociation: HubSpotStepExample;
194
+ /**
195
+ * No identity resolved -- event is skipped with a warning. Neither email
196
+ * nor objectId can be resolved from the event.
197
+ */
198
+ declare const noIdentity: HubSpotStepExample;
199
+ /**
200
+ * Wildcard ignore -- the event matches a mapping rule with ignore: true.
201
+ * The destination fires zero SDK calls.
202
+ */
203
+ declare const wildcardIgnored: HubSpotStepExample;
204
+
205
+ type step_HubSpotStepExample = HubSpotStepExample;
206
+ declare const step_defaultEvent: typeof defaultEvent;
207
+ declare const step_defaultProperties: typeof defaultProperties;
208
+ declare const step_destinationIdentify: typeof destinationIdentify;
209
+ declare const step_mappedEventName: typeof mappedEventName;
210
+ declare const step_noIdentity: typeof noIdentity;
211
+ declare const step_objectIdAssociation: typeof objectIdAssociation;
212
+ declare const step_userLoginIdentify: typeof userLoginIdentify;
213
+ declare const step_wildcardIgnored: typeof wildcardIgnored;
214
+ declare namespace step {
215
+ export { type step_HubSpotStepExample as HubSpotStepExample, step_defaultEvent as defaultEvent, step_defaultProperties as defaultProperties, step_destinationIdentify as destinationIdentify, step_mappedEventName as mappedEventName, step_noIdentity as noIdentity, step_objectIdAssociation as objectIdAssociation, step_userLoginIdentify as userLoginIdentify, step_wildcardIgnored as wildcardIgnored };
216
+ }
217
+
218
+ declare const index_env: typeof env;
219
+ declare const index_step: typeof step;
220
+ declare namespace index {
221
+ export { index_env as env, index_step as step };
222
+ }
223
+
224
+ export { index as examples, index$1 as schemas };
package/dist/dev.d.ts ADDED
@@ -0,0 +1,224 @@
1
+ import * as _walkeros_core_dev from '@walkeros/core/dev';
2
+ import { z } from '@walkeros/core/dev';
3
+ import { Mapping as Mapping$1, Flow } from '@walkeros/core';
4
+ import { DestinationServer } from '@walkeros/server-core';
5
+
6
+ declare const SettingsSchema: z.ZodObject<{
7
+ accessToken: z.ZodString;
8
+ eventNamePrefix: z.ZodString;
9
+ email: z.ZodOptional<z.ZodString>;
10
+ objectId: z.ZodOptional<z.ZodString>;
11
+ identify: z.ZodOptional<z.ZodUnknown>;
12
+ defaultProperties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
13
+ batch: z.ZodOptional<z.ZodBoolean>;
14
+ batchSize: z.ZodOptional<z.ZodNumber>;
15
+ }, z.core.$strip>;
16
+ type Settings$1 = z.infer<typeof SettingsSchema>;
17
+
18
+ declare const MappingSchema: z.ZodObject<{
19
+ eventName: z.ZodOptional<z.ZodString>;
20
+ identify: z.ZodOptional<z.ZodUnknown>;
21
+ properties: z.ZodOptional<z.ZodUnknown>;
22
+ }, z.core.$strip>;
23
+ type Mapping = z.infer<typeof MappingSchema>;
24
+
25
+ declare const settings: _walkeros_core_dev.JSONSchema;
26
+ declare const mapping: _walkeros_core_dev.JSONSchema;
27
+
28
+ type index$1_Mapping = Mapping;
29
+ declare const index$1_MappingSchema: typeof MappingSchema;
30
+ declare const index$1_SettingsSchema: typeof SettingsSchema;
31
+ declare const index$1_mapping: typeof mapping;
32
+ declare const index$1_settings: typeof settings;
33
+ declare namespace index$1 {
34
+ export { type index$1_Mapping as Mapping, index$1_MappingSchema as MappingSchema, type Settings$1 as Settings, index$1_SettingsSchema as SettingsSchema, index$1_mapping as mapping, index$1_settings as settings };
35
+ }
36
+
37
+ /** Shape of a single custom event occurrence sent to HubSpot. */
38
+ interface HubSpotEventRequest {
39
+ eventName: string;
40
+ email?: string;
41
+ objectId?: string;
42
+ utk?: string;
43
+ uuid?: string;
44
+ occurredAt?: Date;
45
+ properties?: Record<string, string>;
46
+ }
47
+ /**
48
+ * Mock-friendly interface for the HubSpot Client methods the destination
49
+ * actually calls. Tests provide this via env.client instead of the real SDK.
50
+ */
51
+ interface HubSpotClientMock {
52
+ events: {
53
+ send: {
54
+ basicApi: {
55
+ send: (data: HubSpotEventRequest) => Promise<void>;
56
+ };
57
+ batchApi: {
58
+ send: (data: {
59
+ inputs: HubSpotEventRequest[];
60
+ }) => Promise<void>;
61
+ };
62
+ };
63
+ };
64
+ crm: {
65
+ contacts: {
66
+ basicApi: {
67
+ update: (id: string, data: {
68
+ properties: Record<string, string>;
69
+ }, idProperty?: string) => Promise<void>;
70
+ };
71
+ };
72
+ };
73
+ }
74
+ interface Settings {
75
+ /** HubSpot private app access token (required). */
76
+ accessToken: string;
77
+ /**
78
+ * Fully qualified event name prefix: pe{HubID}_
79
+ * Used to construct eventName from walkerOS event names.
80
+ * Example: 'pe12345678_'
81
+ */
82
+ eventNamePrefix: string;
83
+ /**
84
+ * walkerOS mapping value path to resolve contact email from events.
85
+ * Default: 'user.email'
86
+ */
87
+ email?: string;
88
+ /**
89
+ * walkerOS mapping value path to resolve HubSpot objectId from events.
90
+ * Default: undefined (use email for association)
91
+ */
92
+ objectId?: string;
93
+ /**
94
+ * Destination-level contact upsert mapping.
95
+ * Resolves to { email, properties } and upserts the contact on each push
96
+ * (with dedup via state hash).
97
+ */
98
+ identify?: Mapping$1.Value;
99
+ /**
100
+ * Static event properties added to every event occurrence.
101
+ * Useful for hs_touchpoint_source, hs_page_content_type, etc.
102
+ */
103
+ defaultProperties?: Record<string, string>;
104
+ /**
105
+ * Whether to use batch API for events (accumulate and flush).
106
+ * Default: false (single event sends).
107
+ */
108
+ batch?: boolean;
109
+ /**
110
+ * Batch size before auto-flush. Only used when batch: true.
111
+ * Default: 50. Max: 500.
112
+ */
113
+ batchSize?: number;
114
+ /** Runtime state -- not user-facing. Mutated by init/push. */
115
+ _client?: HubSpotClientMock;
116
+ _state?: RuntimeState;
117
+ _eventQueue?: HubSpotEventRequest[];
118
+ }
119
+ interface RuntimeState {
120
+ lastIdentity?: {
121
+ email?: string;
122
+ propertiesHash?: string;
123
+ };
124
+ }
125
+ /**
126
+ * Env -- optional SDK override. Production leaves this undefined and the
127
+ * destination creates a real Client instance. Tests provide a mock via
128
+ * env.client.
129
+ */
130
+ interface Env extends DestinationServer.Env {
131
+ client?: HubSpotClientMock;
132
+ }
133
+
134
+ declare const push: Env;
135
+ declare const simulation: string[];
136
+
137
+ declare const env_push: typeof push;
138
+ declare const env_simulation: typeof simulation;
139
+ declare namespace env {
140
+ export { env_push as push, env_simulation as simulation };
141
+ }
142
+
143
+ /**
144
+ * HubSpot SDK step examples.
145
+ *
146
+ * At push time, the destination invokes the `@hubspot/api-client` SDK. The
147
+ * public method paths users see on the client are:
148
+ *
149
+ * - `events.send.basicApi.send(eventRequest)` — fires an event
150
+ * - `events.send.batchApi.send({ inputs: [...] })` — flushes a batch
151
+ * - `crm.contacts.basicApi.update(id, data, idProperty)` — contact upsert
152
+ *
153
+ * Each `out` is therefore a list of tuples `[['method.path', ...args], ...]`
154
+ * matching the actual SDK call order. `identify` fires before the event.
155
+ * When the destination skips an event (`skip: true`, `ignore: true`, or
156
+ * missing identity), `out` is `[]`.
157
+ */
158
+ /**
159
+ * Extended step example that may carry destination-level settings overrides.
160
+ */
161
+ type HubSpotStepExample = Flow.StepExample & {
162
+ settings?: Partial<Settings>;
163
+ };
164
+ /**
165
+ * Default event forwarding -- events.send.basicApi.send() with auto-generated
166
+ * event name. Email resolved from default settings.email = 'user.email'.
167
+ */
168
+ declare const defaultEvent: HubSpotStepExample;
169
+ /**
170
+ * Mapped event name -- mapping.settings.eventName overrides the auto-generated
171
+ * name. The prefix is still prepended.
172
+ */
173
+ declare const mappedEventName: HubSpotStepExample;
174
+ /**
175
+ * Event with defaultProperties -- settings.defaultProperties are merged
176
+ * into every event. Per-event properties override defaults.
177
+ */
178
+ declare const defaultProperties: HubSpotStepExample;
179
+ /**
180
+ * Destination-level identify -- fires crm.contacts.basicApi.update() on
181
+ * first push when settings.identify mapping resolves. Then fires the event.
182
+ */
183
+ declare const destinationIdentify: HubSpotStepExample;
184
+ /**
185
+ * Per-event identify with skip -- user login fires contact upsert only,
186
+ * no custom event sent.
187
+ */
188
+ declare const userLoginIdentify: HubSpotStepExample;
189
+ /**
190
+ * objectId association -- use objectId instead of email for contact
191
+ * association on the event.
192
+ */
193
+ declare const objectIdAssociation: HubSpotStepExample;
194
+ /**
195
+ * No identity resolved -- event is skipped with a warning. Neither email
196
+ * nor objectId can be resolved from the event.
197
+ */
198
+ declare const noIdentity: HubSpotStepExample;
199
+ /**
200
+ * Wildcard ignore -- the event matches a mapping rule with ignore: true.
201
+ * The destination fires zero SDK calls.
202
+ */
203
+ declare const wildcardIgnored: HubSpotStepExample;
204
+
205
+ type step_HubSpotStepExample = HubSpotStepExample;
206
+ declare const step_defaultEvent: typeof defaultEvent;
207
+ declare const step_defaultProperties: typeof defaultProperties;
208
+ declare const step_destinationIdentify: typeof destinationIdentify;
209
+ declare const step_mappedEventName: typeof mappedEventName;
210
+ declare const step_noIdentity: typeof noIdentity;
211
+ declare const step_objectIdAssociation: typeof objectIdAssociation;
212
+ declare const step_userLoginIdentify: typeof userLoginIdentify;
213
+ declare const step_wildcardIgnored: typeof wildcardIgnored;
214
+ declare namespace step {
215
+ export { type step_HubSpotStepExample as HubSpotStepExample, step_defaultEvent as defaultEvent, step_defaultProperties as defaultProperties, step_destinationIdentify as destinationIdentify, step_mappedEventName as mappedEventName, step_noIdentity as noIdentity, step_objectIdAssociation as objectIdAssociation, step_userLoginIdentify as userLoginIdentify, step_wildcardIgnored as wildcardIgnored };
216
+ }
217
+
218
+ declare const index_env: typeof env;
219
+ declare const index_step: typeof step;
220
+ declare namespace index {
221
+ export { index_env as env, index_step as step };
222
+ }
223
+
224
+ export { index as examples, index$1 as schemas };
package/dist/dev.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,s=(e,a)=>{for(var i in a)t(e,i,{get:a[i],enumerable:!0})},n={};s(n,{examples:()=>g,schemas:()=>o}),module.exports=(e=n,((e,s,n,o)=>{if(s&&"object"==typeof s||"function"==typeof s)for(let p of i(s))r.call(e,p)||p===n||t(e,p,{get:()=>s[p],enumerable:!(o=a(s,p))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o={};s(o,{MappingSchema:()=>d,SettingsSchema:()=>m,mapping:()=>v,settings:()=>u});var p=require("@walkeros/core/dev"),c=require("@walkeros/core/dev"),m=c.z.object({accessToken:c.z.string().min(1).describe("HubSpot private app access token. Create one in HubSpot Settings > Integrations > Private Apps. Requires analytics.behavioral_events.send scope."),eventNamePrefix:c.z.string().min(1).describe("Fully qualified event name prefix: pe{HubID}_ (e.g. pe12345678_). Find it in HubSpot under Data Management > Custom Events."),email:c.z.string().describe("walkerOS mapping value path to resolve contact email from events (like user.email). Required for contact association.").optional(),objectId:c.z.string().describe("walkerOS mapping value path to resolve HubSpot CRM objectId from events. Alternative to email for contact association.").optional(),identify:c.z.unknown().describe("Destination-level contact upsert mapping. Resolves to { email, properties }. Fires contact update on first push and re-fires when values change.").optional(),defaultProperties:c.z.record(c.z.string(),c.z.string()).describe("Static event properties added to every event occurrence. Useful for hs_touchpoint_source, hs_page_content_type, etc.").optional(),batch:c.z.boolean().describe("Use batch API for events (accumulate and flush). Default: false.").optional(),batchSize:c.z.number().int().positive().max(500).describe("Batch size before auto-flush. Only used when batch: true. Default: 50. Max: 500.").optional()}),l=require("@walkeros/core/dev"),d=l.z.object({eventName:l.z.string().describe("Override eventName for this rule. Without the prefix -- just the event name part (e.g. purchase_completed). The eventNamePrefix is prepended automatically.").optional(),identify:l.z.unknown().describe("Per-event contact upsert. Resolves to { email, properties }. Overrides destination-level identify. Use with skip: true on login/identify events.").optional(),properties:l.z.unknown().describe("Additional event properties mapping. Resolved values are merged with defaultProperties and serialized to strings.").optional()}),u=(0,p.zodToSchema)(m),v=(0,p.zodToSchema)(d),g={};s(g,{env:()=>f,step:()=>w});var f={};s(f,{push:()=>h,simulation:()=>_});var b=()=>Promise.resolve();var h={client:{events:{send:{basicApi:{send:b},batchApi:{send:b}}},crm:{contacts:{basicApi:{update:b}}}}},_=["call:events.send.basicApi.send","call:events.send.batchApi.send","call:crm.contacts.basicApi.update"],w={};s(w,{defaultEvent:()=>A,defaultProperties:()=>x,destinationIdentify:()=>D,mappedEventName:()=>z,noIdentity:()=>k,objectIdAssociation:()=>S,userLoginIdentify:()=>N,wildcardIgnored:()=>P});var y=require("@walkeros/core"),A={in:(0,y.getEvent)("product view",{timestamp:1700000100,user:{email:"user@example.com"}}),out:[["events.send.basicApi.send",{eventName:"pe12345678_product_view",email:"user@example.com",occurredAt:new Date(1700000100),properties:{}}]]},z={in:(0,y.getEvent)("order complete",{timestamp:1700000101,user:{email:"user@example.com"},data:{total:99.5,currency:"EUR",id:"ord-123"}}),mapping:{name:"order complete",settings:{eventName:"purchase_completed",properties:{map:{revenue:"data.total",currency:"data.currency",order_id:"data.id"}}}},out:[["events.send.basicApi.send",{eventName:"pe12345678_purchase_completed",email:"user@example.com",occurredAt:new Date(1700000101),properties:{revenue:"99.5",currency:"EUR",order_id:"ord-123"}}]]},x={in:(0,y.getEvent)("page view",{timestamp:1700000102,user:{email:"user@example.com"}}),settings:{defaultProperties:{hs_touchpoint_source:"walkerOS",hs_page_content_type:"STANDARD_PAGE"}},out:[["events.send.basicApi.send",{eventName:"pe12345678_page_view",email:"user@example.com",occurredAt:new Date(1700000102),properties:{hs_touchpoint_source:"walkerOS",hs_page_content_type:"STANDARD_PAGE"}}]]},D={in:(0,y.getEvent)("page view",{timestamp:1700000103,user:{email:"user@example.com",firstName:"Jane",lastName:"Doe"}}),settings:{identify:{map:{email:"user.email",properties:{map:{firstname:"user.firstName",lastname:"user.lastName"}}}}},out:[["crm.contacts.basicApi.update","user@example.com",{properties:{firstname:"Jane",lastname:"Doe"}},"email"],["events.send.basicApi.send",{eventName:"pe12345678_page_view",email:"user@example.com",occurredAt:new Date(1700000103),properties:{}}]]},N={in:(0,y.getEvent)("user login",{timestamp:1700000104,user:{email:"user@example.com"},data:{email:"login@acme.com",first_name:"Jane",last_name:"Doe",lifecycle:"lead"}}),mapping:{skip:!0,settings:{identify:{map:{email:"data.email",properties:{map:{firstname:"data.first_name",lastname:"data.last_name",lifecyclestage:"data.lifecycle"}}}}}},out:[["crm.contacts.basicApi.update","login@acme.com",{properties:{firstname:"Jane",lastname:"Doe",lifecyclestage:"lead"}},"email"]]},S={in:(0,y.getEvent)("product view",{timestamp:1700000105,user:{id:"hs-contact-789"}}),settings:{email:void 0,objectId:"user.id"},out:[["events.send.basicApi.send",{eventName:"pe12345678_product_view",objectId:"hs-contact-789",occurredAt:new Date(1700000105),properties:{}}]]},k={in:(0,y.getEvent)("product view",{timestamp:1700000106,user:{}}),out:[]},P={in:(0,y.getEvent)("debug noise",{timestamp:1700000107,user:{email:"user@example.com"}}),mapping:{ignore:!0},out:[]};//# sourceMappingURL=dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n accessToken: z\n .string()\n .min(1)\n .describe(\n 'HubSpot private app access token. Create one in HubSpot Settings > Integrations > Private Apps. Requires analytics.behavioral_events.send scope.',\n ),\n eventNamePrefix: z\n .string()\n .min(1)\n .describe(\n 'Fully qualified event name prefix: pe{HubID}_ (e.g. pe12345678_). Find it in HubSpot under Data Management > Custom Events.',\n ),\n email: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve contact email from events (like user.email). Required for contact association.',\n )\n .optional(),\n objectId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve HubSpot CRM objectId from events. Alternative to email for contact association.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'Destination-level contact upsert mapping. Resolves to { email, properties }. Fires contact update on first push and re-fires when values change.',\n )\n .optional(),\n defaultProperties: z\n .record(z.string(), z.string())\n .describe(\n 'Static event properties added to every event occurrence. Useful for hs_touchpoint_source, hs_page_content_type, etc.',\n )\n .optional(),\n batch: z\n .boolean()\n .describe(\n 'Use batch API for events (accumulate and flush). Default: false.',\n )\n .optional(),\n batchSize: z\n .number()\n .int()\n .positive()\n .max(500)\n .describe(\n 'Batch size before auto-flush. Only used when batch: true. Default: 50. Max: 500.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n eventName: z\n .string()\n .describe(\n 'Override eventName for this rule. Without the prefix -- just the event name part (e.g. purchase_completed). The eventNamePrefix is prepended automatically.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'Per-event contact upsert. Resolves to { email, properties }. Overrides destination-level identify. Use with skip: true on login/identify events.',\n )\n .optional(),\n properties: z\n .unknown()\n .describe(\n 'Additional event properties mapping. Resolved values are merged with defaultProperties and serialized to strings.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, HubSpotClientMock } from '../types';\n\nconst asyncNoop = () => Promise.resolve();\n\nfunction createMockClient(): HubSpotClientMock {\n return {\n events: {\n send: {\n basicApi: { send: asyncNoop },\n batchApi: { send: asyncNoop },\n },\n },\n crm: {\n contacts: {\n basicApi: { update: asyncNoop },\n },\n },\n };\n}\n\nexport const push: Env = {\n client: createMockClient(),\n};\n\nexport const simulation = [\n 'call:events.send.basicApi.send',\n 'call:events.send.batchApi.send',\n 'call:crm.contacts.basicApi.update',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * HubSpot SDK step examples.\n *\n * At push time, the destination invokes the `@hubspot/api-client` SDK. The\n * public method paths users see on the client are:\n *\n * - `events.send.basicApi.send(eventRequest)` — fires an event\n * - `events.send.batchApi.send({ inputs: [...] })` — flushes a batch\n * - `crm.contacts.basicApi.update(id, data, idProperty)` — contact upsert\n *\n * Each `out` is therefore a list of tuples `[['method.path', ...args], ...]`\n * matching the actual SDK call order. `identify` fires before the event.\n * When the destination skips an event (`skip: true`, `ignore: true`, or\n * missing identity), `out` is `[]`.\n */\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type HubSpotStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default event forwarding -- events.send.basicApi.send() with auto-generated\n * event name. Email resolved from default settings.email = 'user.email'.\n */\nexport const defaultEvent: HubSpotStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000100,\n user: { email: 'user@example.com' },\n }),\n out: [\n [\n 'events.send.basicApi.send',\n {\n eventName: 'pe12345678_product_view',\n email: 'user@example.com',\n occurredAt: new Date(1700000100),\n properties: {},\n },\n ],\n ],\n};\n\n/**\n * Mapped event name -- mapping.settings.eventName overrides the auto-generated\n * name. The prefix is still prepended.\n */\nexport const mappedEventName: HubSpotStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000101,\n user: { email: 'user@example.com' },\n data: { total: 99.5, currency: 'EUR', id: 'ord-123' },\n }),\n mapping: {\n name: 'order complete',\n settings: {\n eventName: 'purchase_completed',\n properties: {\n map: {\n revenue: 'data.total',\n currency: 'data.currency',\n order_id: 'data.id',\n },\n },\n },\n },\n out: [\n [\n 'events.send.basicApi.send',\n {\n eventName: 'pe12345678_purchase_completed',\n email: 'user@example.com',\n occurredAt: new Date(1700000101),\n properties: {\n revenue: '99.5',\n currency: 'EUR',\n order_id: 'ord-123',\n },\n },\n ],\n ],\n};\n\n/**\n * Event with defaultProperties -- settings.defaultProperties are merged\n * into every event. Per-event properties override defaults.\n */\nexport const defaultProperties: HubSpotStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000102,\n user: { email: 'user@example.com' },\n }),\n settings: {\n defaultProperties: {\n hs_touchpoint_source: 'walkerOS',\n hs_page_content_type: 'STANDARD_PAGE',\n },\n },\n out: [\n [\n 'events.send.basicApi.send',\n {\n eventName: 'pe12345678_page_view',\n email: 'user@example.com',\n occurredAt: new Date(1700000102),\n properties: {\n hs_touchpoint_source: 'walkerOS',\n hs_page_content_type: 'STANDARD_PAGE',\n },\n },\n ],\n ],\n};\n\n/**\n * Destination-level identify -- fires crm.contacts.basicApi.update() on\n * first push when settings.identify mapping resolves. Then fires the event.\n */\nexport const destinationIdentify: HubSpotStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000103,\n user: { email: 'user@example.com', firstName: 'Jane', lastName: 'Doe' },\n }),\n settings: {\n identify: {\n map: {\n email: 'user.email',\n properties: {\n map: {\n firstname: 'user.firstName',\n lastname: 'user.lastName',\n },\n },\n },\n },\n },\n out: [\n [\n 'crm.contacts.basicApi.update',\n 'user@example.com',\n { properties: { firstname: 'Jane', lastname: 'Doe' } },\n 'email',\n ],\n [\n 'events.send.basicApi.send',\n {\n eventName: 'pe12345678_page_view',\n email: 'user@example.com',\n occurredAt: new Date(1700000103),\n properties: {},\n },\n ],\n ],\n};\n\n/**\n * Per-event identify with skip -- user login fires contact upsert only,\n * no custom event sent.\n */\nexport const userLoginIdentify: HubSpotStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000104,\n user: { email: 'user@example.com' },\n data: {\n email: 'login@acme.com',\n first_name: 'Jane',\n last_name: 'Doe',\n lifecycle: 'lead',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n email: 'data.email',\n properties: {\n map: {\n firstname: 'data.first_name',\n lastname: 'data.last_name',\n lifecyclestage: 'data.lifecycle',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'crm.contacts.basicApi.update',\n 'login@acme.com',\n {\n properties: {\n firstname: 'Jane',\n lastname: 'Doe',\n lifecyclestage: 'lead',\n },\n },\n 'email',\n ],\n ],\n};\n\n/**\n * objectId association -- use objectId instead of email for contact\n * association on the event.\n */\nexport const objectIdAssociation: HubSpotStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000105,\n user: { id: 'hs-contact-789' },\n }),\n settings: {\n email: undefined,\n objectId: 'user.id',\n },\n out: [\n [\n 'events.send.basicApi.send',\n {\n eventName: 'pe12345678_product_view',\n objectId: 'hs-contact-789',\n occurredAt: new Date(1700000105),\n properties: {},\n },\n ],\n ],\n};\n\n/**\n * No identity resolved -- event is skipped with a warning. Neither email\n * nor objectId can be resolved from the event.\n */\nexport const noIdentity: HubSpotStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000106,\n user: {},\n }),\n out: [],\n};\n\n/**\n * Wildcard ignore -- the event matches a mapping rule with ignore: true.\n * The destination fires zero SDK calls.\n */\nexport const wildcardIgnored: HubSpotStepExample = {\n in: getEvent('debug noise', {\n timestamp: 1700000107,\n user: { email: 'user@example.com' },\n }),\n mapping: { ignore: true },\n out: [],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,aAAa,aACV,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,iBAAiB,aACd,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,OAAO,aACJ,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,aACP,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,aACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,mBAAmB,aAChB,OAAO,aAAE,OAAO,GAAG,aAAE,OAAO,CAAC,EAC7B;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,OAAO,aACJ,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,WAAW,aACR,OAAO,EACP,IAAI,EACJ,SAAS,EACT,IAAI,GAAG,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;ACtDD,IAAAC,cAAkB;AAEX,IAAM,gBAAgB,cAAE,OAAO;AAAA,EACpC,WAAW,cACR,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,cACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,YAAY,cACT,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd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AAA,EACF;AACF;AAMO,IAAM,aAAiC;AAAA,EAC5C,QAAI,sBAAS,gBAAgB;AAAA,IAC3B,WAAW;AAAA,IACX,MAAM,CAAC;AAAA,EACT,CAAC;AAAA,EACD,KAAK,CAAC;AACR;AAMO,IAAM,kBAAsC;AAAA,EACjD,QAAI,sBAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,IACX,MAAM,EAAE,OAAO,mBAAmB;AAAA,EACpC,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["import_dev","import_dev"]}
package/dist/dev.mjs ADDED
@@ -0,0 +1 @@
1
+ var e=Object.defineProperty,t=(t,a)=>{for(var i in a)e(t,i,{get:a[i],enumerable:!0})},a={};t(a,{MappingSchema:()=>o,SettingsSchema:()=>r,mapping:()=>c,settings:()=>p});import{zodToSchema as i}from"@walkeros/core/dev";import{z as s}from"@walkeros/core/dev";var r=s.object({accessToken:s.string().min(1).describe("HubSpot private app access token. Create one in HubSpot Settings > Integrations > Private Apps. Requires analytics.behavioral_events.send scope."),eventNamePrefix:s.string().min(1).describe("Fully qualified event name prefix: pe{HubID}_ (e.g. pe12345678_). Find it in HubSpot under Data Management > Custom Events."),email:s.string().describe("walkerOS mapping value path to resolve contact email from events (like user.email). Required for contact association.").optional(),objectId:s.string().describe("walkerOS mapping value path to resolve HubSpot CRM objectId from events. Alternative to email for contact association.").optional(),identify:s.unknown().describe("Destination-level contact upsert mapping. Resolves to { email, properties }. Fires contact update on first push and re-fires when values change.").optional(),defaultProperties:s.record(s.string(),s.string()).describe("Static event properties added to every event occurrence. Useful for hs_touchpoint_source, hs_page_content_type, etc.").optional(),batch:s.boolean().describe("Use batch API for events (accumulate and flush). Default: false.").optional(),batchSize:s.number().int().positive().max(500).describe("Batch size before auto-flush. Only used when batch: true. Default: 50. Max: 500.").optional()});import{z as n}from"@walkeros/core/dev";var o=n.object({eventName:n.string().describe("Override eventName for this rule. Without the prefix -- just the event name part (e.g. purchase_completed). The eventNamePrefix is prepended automatically.").optional(),identify:n.unknown().describe("Per-event contact upsert. Resolves to { email, properties }. Overrides destination-level identify. Use with skip: true on login/identify events.").optional(),properties:n.unknown().describe("Additional event properties mapping. Resolved values are merged with defaultProperties and serialized to strings.").optional()}),p=i(r),c=i(o),m={};t(m,{env:()=>l,step:()=>f});var l={};t(l,{push:()=>u,simulation:()=>v});var d=()=>Promise.resolve();var u={client:{events:{send:{basicApi:{send:d},batchApi:{send:d}}},crm:{contacts:{basicApi:{update:d}}}}},v=["call:events.send.basicApi.send","call:events.send.batchApi.send","call:crm.contacts.basicApi.update"],f={};t(f,{defaultEvent:()=>b,defaultProperties:()=>_,destinationIdentify:()=>w,mappedEventName:()=>h,noIdentity:()=>x,objectIdAssociation:()=>y,userLoginIdentify:()=>A,wildcardIgnored:()=>D});import{getEvent as g}from"@walkeros/core";var b={in:g("product view",{timestamp:1700000100,user:{email:"user@example.com"}}),out:[["events.send.basicApi.send",{eventName:"pe12345678_product_view",email:"user@example.com",occurredAt:new Date(1700000100),properties:{}}]]},h={in:g("order complete",{timestamp:1700000101,user:{email:"user@example.com"},data:{total:99.5,currency:"EUR",id:"ord-123"}}),mapping:{name:"order complete",settings:{eventName:"purchase_completed",properties:{map:{revenue:"data.total",currency:"data.currency",order_id:"data.id"}}}},out:[["events.send.basicApi.send",{eventName:"pe12345678_purchase_completed",email:"user@example.com",occurredAt:new Date(1700000101),properties:{revenue:"99.5",currency:"EUR",order_id:"ord-123"}}]]},_={in:g("page view",{timestamp:1700000102,user:{email:"user@example.com"}}),settings:{defaultProperties:{hs_touchpoint_source:"walkerOS",hs_page_content_type:"STANDARD_PAGE"}},out:[["events.send.basicApi.send",{eventName:"pe12345678_page_view",email:"user@example.com",occurredAt:new Date(1700000102),properties:{hs_touchpoint_source:"walkerOS",hs_page_content_type:"STANDARD_PAGE"}}]]},w={in:g("page view",{timestamp:1700000103,user:{email:"user@example.com",firstName:"Jane",lastName:"Doe"}}),settings:{identify:{map:{email:"user.email",properties:{map:{firstname:"user.firstName",lastname:"user.lastName"}}}}},out:[["crm.contacts.basicApi.update","user@example.com",{properties:{firstname:"Jane",lastname:"Doe"}},"email"],["events.send.basicApi.send",{eventName:"pe12345678_page_view",email:"user@example.com",occurredAt:new Date(1700000103),properties:{}}]]},A={in:g("user login",{timestamp:1700000104,user:{email:"user@example.com"},data:{email:"login@acme.com",first_name:"Jane",last_name:"Doe",lifecycle:"lead"}}),mapping:{skip:!0,settings:{identify:{map:{email:"data.email",properties:{map:{firstname:"data.first_name",lastname:"data.last_name",lifecyclestage:"data.lifecycle"}}}}}},out:[["crm.contacts.basicApi.update","login@acme.com",{properties:{firstname:"Jane",lastname:"Doe",lifecyclestage:"lead"}},"email"]]},y={in:g("product view",{timestamp:1700000105,user:{id:"hs-contact-789"}}),settings:{email:void 0,objectId:"user.id"},out:[["events.send.basicApi.send",{eventName:"pe12345678_product_view",objectId:"hs-contact-789",occurredAt:new Date(1700000105),properties:{}}]]},x={in:g("product view",{timestamp:1700000106,user:{}}),out:[]},D={in:g("debug noise",{timestamp:1700000107,user:{email:"user@example.com"}}),mapping:{ignore:!0},out:[]};export{m as examples,a as schemas};//# sourceMappingURL=dev.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z.object({\n accessToken: z\n .string()\n .min(1)\n .describe(\n 'HubSpot private app access token. Create one in HubSpot Settings > Integrations > Private Apps. Requires analytics.behavioral_events.send scope.',\n ),\n eventNamePrefix: z\n .string()\n .min(1)\n .describe(\n 'Fully qualified event name prefix: pe{HubID}_ (e.g. pe12345678_). Find it in HubSpot under Data Management > Custom Events.',\n ),\n email: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve contact email from events (like user.email). Required for contact association.',\n )\n .optional(),\n objectId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve HubSpot CRM objectId from events. Alternative to email for contact association.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'Destination-level contact upsert mapping. Resolves to { email, properties }. Fires contact update on first push and re-fires when values change.',\n )\n .optional(),\n defaultProperties: z\n .record(z.string(), z.string())\n .describe(\n 'Static event properties added to every event occurrence. Useful for hs_touchpoint_source, hs_page_content_type, etc.',\n )\n .optional(),\n batch: z\n .boolean()\n .describe(\n 'Use batch API for events (accumulate and flush). Default: false.',\n )\n .optional(),\n batchSize: z\n .number()\n .int()\n .positive()\n .max(500)\n .describe(\n 'Batch size before auto-flush. Only used when batch: true. Default: 50. Max: 500.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({\n eventName: z\n .string()\n .describe(\n 'Override eventName for this rule. Without the prefix -- just the event name part (e.g. purchase_completed). The eventNamePrefix is prepended automatically.',\n )\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'Per-event contact upsert. Resolves to { email, properties }. Overrides destination-level identify. Use with skip: true on login/identify events.',\n )\n .optional(),\n properties: z\n .unknown()\n .describe(\n 'Additional event properties mapping. Resolved values are merged with defaultProperties and serialized to strings.',\n )\n .optional(),\n});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { Env, HubSpotClientMock } from '../types';\n\nconst asyncNoop = () => Promise.resolve();\n\nfunction createMockClient(): HubSpotClientMock {\n return {\n events: {\n send: {\n basicApi: { send: asyncNoop },\n batchApi: { send: asyncNoop },\n },\n },\n crm: {\n contacts: {\n basicApi: { update: asyncNoop },\n },\n },\n };\n}\n\nexport const push: Env = {\n client: createMockClient(),\n};\n\nexport const simulation = [\n 'call:events.send.basicApi.send',\n 'call:events.send.batchApi.send',\n 'call:crm.contacts.basicApi.update',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * HubSpot SDK step examples.\n *\n * At push time, the destination invokes the `@hubspot/api-client` SDK. The\n * public method paths users see on the client are:\n *\n * - `events.send.basicApi.send(eventRequest)` — fires an event\n * - `events.send.batchApi.send({ inputs: [...] })` — flushes a batch\n * - `crm.contacts.basicApi.update(id, data, idProperty)` — contact upsert\n *\n * Each `out` is therefore a list of tuples `[['method.path', ...args], ...]`\n * matching the actual SDK call order. `identify` fires before the event.\n * When the destination skips an event (`skip: true`, `ignore: true`, or\n * missing identity), `out` is `[]`.\n */\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type HubSpotStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default event forwarding -- events.send.basicApi.send() with auto-generated\n * event name. Email resolved from default settings.email = 'user.email'.\n */\nexport const defaultEvent: HubSpotStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000100,\n user: { email: 'user@example.com' },\n }),\n out: [\n [\n 'events.send.basicApi.send',\n {\n eventName: 'pe12345678_product_view',\n email: 'user@example.com',\n occurredAt: new Date(1700000100),\n properties: {},\n },\n ],\n ],\n};\n\n/**\n * Mapped event name -- mapping.settings.eventName overrides the auto-generated\n * name. The prefix is still prepended.\n */\nexport const mappedEventName: HubSpotStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000101,\n user: { email: 'user@example.com' },\n data: { total: 99.5, currency: 'EUR', id: 'ord-123' },\n }),\n mapping: {\n name: 'order complete',\n settings: {\n eventName: 'purchase_completed',\n properties: {\n map: {\n revenue: 'data.total',\n currency: 'data.currency',\n order_id: 'data.id',\n },\n },\n },\n },\n out: [\n [\n 'events.send.basicApi.send',\n {\n eventName: 'pe12345678_purchase_completed',\n email: 'user@example.com',\n occurredAt: new Date(1700000101),\n properties: {\n revenue: '99.5',\n currency: 'EUR',\n order_id: 'ord-123',\n },\n },\n ],\n ],\n};\n\n/**\n * Event with defaultProperties -- settings.defaultProperties are merged\n * into every event. Per-event properties override defaults.\n */\nexport const defaultProperties: HubSpotStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000102,\n user: { email: 'user@example.com' },\n }),\n settings: {\n defaultProperties: {\n hs_touchpoint_source: 'walkerOS',\n hs_page_content_type: 'STANDARD_PAGE',\n },\n },\n out: [\n [\n 'events.send.basicApi.send',\n {\n eventName: 'pe12345678_page_view',\n email: 'user@example.com',\n occurredAt: new Date(1700000102),\n properties: {\n hs_touchpoint_source: 'walkerOS',\n hs_page_content_type: 'STANDARD_PAGE',\n },\n },\n ],\n ],\n};\n\n/**\n * Destination-level identify -- fires crm.contacts.basicApi.update() on\n * first push when settings.identify mapping resolves. Then fires the event.\n */\nexport const destinationIdentify: HubSpotStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000103,\n user: { email: 'user@example.com', firstName: 'Jane', lastName: 'Doe' },\n }),\n settings: {\n identify: {\n map: {\n email: 'user.email',\n properties: {\n map: {\n firstname: 'user.firstName',\n lastname: 'user.lastName',\n },\n },\n },\n },\n },\n out: [\n [\n 'crm.contacts.basicApi.update',\n 'user@example.com',\n { properties: { firstname: 'Jane', lastname: 'Doe' } },\n 'email',\n ],\n [\n 'events.send.basicApi.send',\n {\n eventName: 'pe12345678_page_view',\n email: 'user@example.com',\n occurredAt: new Date(1700000103),\n properties: {},\n },\n ],\n ],\n};\n\n/**\n * Per-event identify with skip -- user login fires contact upsert only,\n * no custom event sent.\n */\nexport const userLoginIdentify: HubSpotStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000104,\n user: { email: 'user@example.com' },\n data: {\n email: 'login@acme.com',\n first_name: 'Jane',\n last_name: 'Doe',\n lifecycle: 'lead',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n email: 'data.email',\n properties: {\n map: {\n firstname: 'data.first_name',\n lastname: 'data.last_name',\n lifecyclestage: 'data.lifecycle',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'crm.contacts.basicApi.update',\n 'login@acme.com',\n {\n properties: {\n firstname: 'Jane',\n lastname: 'Doe',\n lifecyclestage: 'lead',\n },\n },\n 'email',\n ],\n ],\n};\n\n/**\n * objectId association -- use objectId instead of email for contact\n * association on the event.\n */\nexport const objectIdAssociation: HubSpotStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000105,\n user: { id: 'hs-contact-789' },\n }),\n settings: {\n email: undefined,\n objectId: 'user.id',\n },\n out: [\n [\n 'events.send.basicApi.send',\n {\n eventName: 'pe12345678_product_view',\n objectId: 'hs-contact-789',\n occurredAt: new Date(1700000105),\n properties: {},\n },\n ],\n ],\n};\n\n/**\n * No identity resolved -- event is skipped with a warning. Neither email\n * nor objectId can be resolved from the event.\n */\nexport const noIdentity: HubSpotStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000106,\n user: {},\n }),\n out: [],\n};\n\n/**\n * Wildcard ignore -- the event matches a mapping rule with ignore: true.\n * The destination fires zero SDK calls.\n */\nexport const wildcardIgnored: HubSpotStepExample = {\n in: getEvent('debug noise', {\n timestamp: 1700000107,\n user: { email: 'user@example.com' },\n }),\n mapping: { ignore: true },\n out: [],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,aAAa,EACV,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,iBAAiB,EACd,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,OAAO,EACJ,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA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