@walkeros/server-destination-hubspot 4.7.0-next-1790245733116 → 4.7.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/CHANGELOG.md CHANGED
@@ -1,24 +1,35 @@
1
1
  # @walkeros/server-destination-hubspot
2
2
 
3
- ## 4.7.0-next-1790245733116
3
+ ## 4.7.0
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [57788bc]
7
+ - 74821ed: Simulate records every vendor call through one recorder, `observeEnv`
8
+ from `@walkeros/core`, and runs offline: BigQuery, Data Manager and the
9
+ Sheets, GCS and S3 stores reach the network through `env`. Client and `Env`
10
+ types of BigQuery, Firehose, PostHog, SQS and Pub/Sub are structural.
11
+ `@walkeros/cli` exports `resolveExportName` and `selectDevExamples` and drops
12
+ `findExample` and `compareOutput`.
13
+ - Updated dependencies [74821ed]
8
14
  - Updated dependencies [06b498a]
9
- - Updated dependencies [f5a1cfd]
10
- - Updated dependencies [ef02916]
15
+ - Updated dependencies [74821ed]
16
+ - Updated dependencies [64b06de]
17
+ - Updated dependencies [4b4937f]
18
+ - Updated dependencies [74821ed]
19
+ - Updated dependencies [74821ed]
20
+ - Updated dependencies [74821ed]
11
21
  - Updated dependencies [06b498a]
12
- - Updated dependencies [ef02916]
13
- - Updated dependencies [2aebc53]
14
- - Updated dependencies [f5a1cfd]
15
- - Updated dependencies [f5a1cfd]
16
- - Updated dependencies [2aebc53]
17
- - Updated dependencies [8f8aea6]
18
- - Updated dependencies [2aebc53]
19
- - Updated dependencies [2aebc53]
20
- - @walkeros/core@4.7.0-next-1790245733116
21
- - @walkeros/server-core@4.7.0-next-1790245733116
22
+ - Updated dependencies [74821ed]
23
+ - Updated dependencies [74821ed]
24
+ - Updated dependencies [74821ed]
25
+ - Updated dependencies [74821ed]
26
+ - Updated dependencies [74821ed]
27
+ - Updated dependencies [e860006]
28
+ - Updated dependencies [74821ed]
29
+ - Updated dependencies [74821ed]
30
+ - Updated dependencies [4f89234]
31
+ - @walkeros/core@4.7.0
32
+ - @walkeros/server-core@4.7.0
22
33
 
23
34
  ## 4.6.1
24
35
 
package/dist/dev.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,n=(e,a)=>{for(var i in a)t(e,i,{get:a[i],enumerable:!0})},r={};n(r,{examples:()=>b,schemas:()=>o}),module.exports=(e=r,((e,n,r,o)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let p of i(n))s.call(e,p)||p===r||t(e,p,{get:()=>n[p],enumerable:!(o=a(n,p))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o={};n(o,{MappingSchema:()=>d,SettingsSchema:()=>l,mapping:()=>v,settings:()=>u});var p=require("@walkeros/core/dev"),c=require("@walkeros/core/dev"),l=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()}),m=require("@walkeros/core/dev"),d=m.z.object({eventName:m.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:m.z.unknown().describe("Per-event contact upsert. Resolves to { email, properties }. Overrides destination-level identify. Use with silent: true on login/identify events.").optional(),properties:m.z.unknown().describe("Additional event properties mapping. Resolved values are merged with defaultProperties and serialized to strings.").optional()}),u=(0,p.zodToSchema)(l),v=(0,p.zodToSchema)(d),b={};n(b,{env:()=>f,step:()=>_});var f={};n(f,{push:()=>h,simulation:()=>y});var g=()=>Promise.resolve();var h={client:{events:{send:{basicApi:{send:g},batchApi:{send:g}}},crm:{contacts:{basicApi:{update:g}}}}},y=["call:events.send.basicApi.send","call:events.send.batchApi.send","call:crm.contacts.basicApi.update"],_={};n(_,{defaultEvent:()=>A,defaultProperties:()=>S,destinationIdentify:()=>z,mappedEventName:()=>D,noIdentity:()=>N,objectIdAssociation:()=>k,userLoginIdentify:()=>x,wildcardIgnored:()=>P});var w=require("@walkeros/core"),A={title:"Default event",description:"A walker event is sent to HubSpot as a custom behavioral event keyed by the user email.",in:(0,w.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:{}}]]},D={title:"Custom event name",description:"A mapping supplies a custom HubSpot event name and maps order data into properties for the behavioral event.",in:(0,w.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"}}]]},S={title:"Default properties",description:"Destination-level default properties are merged into every HubSpot event payload, such as traffic source metadata.",in:(0,w.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"}}]]},z={title:"Destination identify",description:"Destination-level identify upserts the HubSpot contact with mapped properties before sending the behavioral event.",in:(0,w.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:{}}]]},x={title:"User login identify",description:"A user login only upserts the HubSpot contact with profile and lifecycle properties, skipping the event send.",in:(0,w.getEvent)("user login",{timestamp:1700000104,user:{email:"user@example.com"},data:{email:"login@acme.com",first_name:"Jane",last_name:"Doe",lifecycle:"lead"}}),mapping:{silent:!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"]]},k={title:"Object id association",description:"The HubSpot event is associated via objectId instead of email, resolved from the walker user id.",in:(0,w.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:{}}]]},N={public:!1,in:(0,w.getEvent)("product view",{timestamp:1700000106,user:{}}),out:[]},P={public:!1,in:(0,w.getEvent)("debug noise",{timestamp:1700000107,user:{email:"user@example.com"}}),mapping:{ignore:!0},out:[]};//# sourceMappingURL=dev.js.map
1
+ "use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,s=(e,a)=>{for(var i in a)t(e,i,{get:a[i],enumerable:!0})},r={};s(r,{examples:()=>b,schemas:()=>o}),module.exports=(e=r,((e,s,r,o)=>{if(s&&"object"==typeof s||"function"==typeof s)for(let p of i(s))n.call(e,p)||p===r||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:()=>l,mapping:()=>v,settings:()=>u});var p=require("@walkeros/core/dev"),c=require("@walkeros/core/dev"),l=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()}),m=require("@walkeros/core/dev"),d=m.z.object({eventName:m.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:m.z.unknown().describe("Per-event contact upsert. Resolves to { email, properties }. Overrides destination-level identify. Use with silent: true on login/identify events.").optional(),properties:m.z.unknown().describe("Additional event properties mapping. Resolved values are merged with defaultProperties and serialized to strings.").optional()}),u=(0,p.zodToSchema)(l),v=(0,p.zodToSchema)(d),b={};s(b,{env:()=>f,step:()=>_});var f={};s(f,{push:()=>h,simulation:()=>y});var g=()=>Promise.resolve();var h={client:{events:{send:{basicApi:{send:g},batchApi:{send:g}}},crm:{contacts:{basicApi:{update:g}}}}},y=["call:client.events.send.basicApi.send","call:client.events.send.batchApi.send","call:client.crm.contacts.basicApi.update"],_={};s(_,{defaultEvent:()=>A,defaultProperties:()=>S,destinationIdentify:()=>z,mappedEventName:()=>D,noIdentity:()=>N,objectIdAssociation:()=>k,userLoginIdentify:()=>x,wildcardIgnored:()=>P});var w=require("@walkeros/core"),A={title:"Default event",description:"A walker event is sent to HubSpot as a custom behavioral event keyed by the user email.",in:(0,w.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:{}}]]},D={title:"Custom event name",description:"A mapping supplies a custom HubSpot event name and maps order data into properties for the behavioral event.",in:(0,w.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"}}]]},S={title:"Default properties",description:"Destination-level default properties are merged into every HubSpot event payload, such as traffic source metadata.",in:(0,w.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"}}]]},z={title:"Destination identify",description:"Destination-level identify upserts the HubSpot contact with mapped properties before sending the behavioral event.",in:(0,w.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:{}}]]},x={title:"User login identify",description:"A user login only upserts the HubSpot contact with profile and lifecycle properties, skipping the event send.",in:(0,w.getEvent)("user login",{timestamp:1700000104,user:{email:"user@example.com"},data:{email:"login@acme.com",first_name:"Jane",last_name:"Doe",lifecycle:"lead"}}),mapping:{silent:!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"]]},k={title:"Object id association",description:"The HubSpot event is associated via objectId instead of email, resolved from the walker user id.",in:(0,w.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:{}}]]},N={public:!1,in:(0,w.getEvent)("product view",{timestamp:1700000106,user:{}}),out:[]},P={public:!1,in:(0,w.getEvent)("debug noise",{timestamp:1700000107,user:{email:"user@example.com"}}),mapping:{ignore:!0},out:[]};//# sourceMappingURL=dev.js.map
package/dist/dev.js.map CHANGED
@@ -1 +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 silent: 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 (`silent: 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 title: 'Default event',\n description:\n 'A walker event is sent to HubSpot as a custom behavioral event keyed by the user email.',\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 title: 'Custom event name',\n description:\n 'A mapping supplies a custom HubSpot event name and maps order data into properties for the behavioral event.',\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 title: 'Default properties',\n description:\n 'Destination-level default properties are merged into every HubSpot event payload, such as traffic source metadata.',\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 title: 'Destination identify',\n description:\n 'Destination-level identify upserts the HubSpot contact with mapped properties before sending the behavioral event.',\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 silent -- user login fires contact upsert only,\n * no custom event sent.\n */\nexport const userLoginIdentify: HubSpotStepExample = {\n title: 'User login identify',\n description:\n 'A user login only upserts the HubSpot contact with profile and lifecycle properties, skipping the event send.',\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 silent: 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 title: 'Object id association',\n description:\n 'The HubSpot event is associated via objectId instead of email, resolved from the walker user id.',\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 public: false,\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 public: false,\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;AAA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AACF;AAMO,IAAM,sBAA0C;AAAA,EACrD,OAAO;AAAA,EACP,aACE;AAAA,EACF,QAAI,sBAAS,gBAAgB;AAAA,IAC3B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,iBAAiB;AAAA,EAC/B,CAAC;AAAA,EACD,UAAU;AAAA,IACR,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,WAAW;AAAA,QACX,UAAU;AAAA,QACV,YAAY,oBAAI,KAAK,UAAU;AAAA,QAC/B,YAAY,CAAC;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,aAAiC;AAAA,EAC5C,QAAQ;AAAA,EACR,QAAI,sBAAS,gBAAgB;AAAA,IAC3B,WAAW;AAAA,IACX,MAAM,CAAC;AAAA,EACT,CAAC;AAAA,EACD,KAAK,CAAC;AACR;AAMO,IAAM,kBAAsC;AAAA,EACjD,QAAQ;AAAA,EACR,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"]}
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 silent: 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:client.events.send.basicApi.send',\n 'call:client.events.send.batchApi.send',\n 'call:client.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 (`silent: 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 title: 'Default event',\n description:\n 'A walker event is sent to HubSpot as a custom behavioral event keyed by the user email.',\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 title: 'Custom event name',\n description:\n 'A mapping supplies a custom HubSpot event name and maps order data into properties for the behavioral event.',\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 title: 'Default properties',\n description:\n 'Destination-level default properties are merged into every HubSpot event payload, such as traffic source metadata.',\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 title: 'Destination identify',\n description:\n 'Destination-level identify upserts the HubSpot contact with mapped properties before sending the behavioral event.',\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 silent -- user login fires contact upsert only,\n * no custom event sent.\n */\nexport const userLoginIdentify: HubSpotStepExample = {\n title: 'User login identify',\n description:\n 'A user login only upserts the HubSpot contact with profile and lifecycle properties, skipping the event send.',\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 silent: 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 title: 'Object id association',\n description:\n 'The HubSpot event is associated via objectId instead of email, resolved from the walker user id.',\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 public: false,\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 public: false,\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,CAAC;;;AFbM,IAAM,eAAW,y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AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,WAAW;AAAA,QACX,UAAU;AAAA,QACV,YAAY,oBAAI,KAAK,UAAU;AAAA,QAC/B,YAAY,CAAC;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,aAAiC;AAAA,EAC5C,QAAQ;AAAA,EACR,QAAI,sBAAS,gBAAgB;AAAA,IAC3B,WAAW;AAAA,IACX,MAAM,CAAC;AAAA,EACT,CAAC;AAAA,EACD,KAAK,CAAC;AACR;AAMO,IAAM,kBAAsC;AAAA,EACjD,QAAQ;AAAA,EACR,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 CHANGED
@@ -1 +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:()=>n,mapping:()=>c,settings:()=>p});import{zodToSchema as i}from"@walkeros/core/dev";import{z as s}from"@walkeros/core/dev";var n=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 r}from"@walkeros/core/dev";var o=r.object({eventName:r.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:r.unknown().describe("Per-event contact upsert. Resolves to { email, properties }. Overrides destination-level identify. Use with silent: true on login/identify events.").optional(),properties:r.unknown().describe("Additional event properties mapping. Resolved values are merged with defaultProperties and serialized to strings.").optional()}),p=i(n),c=i(o),l={};t(l,{env:()=>m,step:()=>f});var m={};t(m,{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:()=>g,defaultProperties:()=>_,destinationIdentify:()=>y,mappedEventName:()=>h,noIdentity:()=>D,objectIdAssociation:()=>A,userLoginIdentify:()=>w,wildcardIgnored:()=>S});import{getEvent as b}from"@walkeros/core";var g={title:"Default event",description:"A walker event is sent to HubSpot as a custom behavioral event keyed by the user email.",in:b("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={title:"Custom event name",description:"A mapping supplies a custom HubSpot event name and maps order data into properties for the behavioral event.",in:b("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"}}]]},_={title:"Default properties",description:"Destination-level default properties are merged into every HubSpot event payload, such as traffic source metadata.",in:b("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"}}]]},y={title:"Destination identify",description:"Destination-level identify upserts the HubSpot contact with mapped properties before sending the behavioral event.",in:b("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:{}}]]},w={title:"User login identify",description:"A user login only upserts the HubSpot contact with profile and lifecycle properties, skipping the event send.",in:b("user login",{timestamp:1700000104,user:{email:"user@example.com"},data:{email:"login@acme.com",first_name:"Jane",last_name:"Doe",lifecycle:"lead"}}),mapping:{silent:!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"]]},A={title:"Object id association",description:"The HubSpot event is associated via objectId instead of email, resolved from the walker user id.",in:b("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:{}}]]},D={public:!1,in:b("product view",{timestamp:1700000106,user:{}}),out:[]},S={public:!1,in:b("debug noise",{timestamp:1700000107,user:{email:"user@example.com"}}),mapping:{ignore:!0},out:[]};export{l as examples,a as schemas};//# sourceMappingURL=dev.mjs.map
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:()=>n,mapping:()=>c,settings:()=>p});import{zodToSchema as i}from"@walkeros/core/dev";import{z as s}from"@walkeros/core/dev";var n=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 r}from"@walkeros/core/dev";var o=r.object({eventName:r.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:r.unknown().describe("Per-event contact upsert. Resolves to { email, properties }. Overrides destination-level identify. Use with silent: true on login/identify events.").optional(),properties:r.unknown().describe("Additional event properties mapping. Resolved values are merged with defaultProperties and serialized to strings.").optional()}),p=i(n),c=i(o),l={};t(l,{env:()=>m,step:()=>f});var m={};t(m,{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:client.events.send.basicApi.send","call:client.events.send.batchApi.send","call:client.crm.contacts.basicApi.update"],f={};t(f,{defaultEvent:()=>g,defaultProperties:()=>_,destinationIdentify:()=>y,mappedEventName:()=>h,noIdentity:()=>D,objectIdAssociation:()=>A,userLoginIdentify:()=>w,wildcardIgnored:()=>S});import{getEvent as b}from"@walkeros/core";var g={title:"Default event",description:"A walker event is sent to HubSpot as a custom behavioral event keyed by the user email.",in:b("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={title:"Custom event name",description:"A mapping supplies a custom HubSpot event name and maps order data into properties for the behavioral event.",in:b("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"}}]]},_={title:"Default properties",description:"Destination-level default properties are merged into every HubSpot event payload, such as traffic source metadata.",in:b("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"}}]]},y={title:"Destination identify",description:"Destination-level identify upserts the HubSpot contact with mapped properties before sending the behavioral event.",in:b("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:{}}]]},w={title:"User login identify",description:"A user login only upserts the HubSpot contact with profile and lifecycle properties, skipping the event send.",in:b("user login",{timestamp:1700000104,user:{email:"user@example.com"},data:{email:"login@acme.com",first_name:"Jane",last_name:"Doe",lifecycle:"lead"}}),mapping:{silent:!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"]]},A={title:"Object id association",description:"The HubSpot event is associated via objectId instead of email, resolved from the walker user id.",in:b("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:{}}]]},D={public:!1,in:b("product view",{timestamp:1700000106,user:{}}),out:[]},S={public:!1,in:b("debug noise",{timestamp:1700000107,user:{email:"user@example.com"}}),mapping:{ignore:!0},out:[]};export{l as examples,a as schemas};//# sourceMappingURL=dev.mjs.map
package/dist/dev.mjs.map CHANGED
@@ -1 +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 silent: 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 (`silent: 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 title: 'Default event',\n description:\n 'A walker event is sent to HubSpot as a custom behavioral event keyed by the user email.',\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 title: 'Custom event name',\n description:\n 'A mapping supplies a custom HubSpot event name and maps order data into properties for the behavioral event.',\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 title: 'Default properties',\n description:\n 'Destination-level default properties are merged into every HubSpot event payload, such as traffic source metadata.',\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 title: 'Destination identify',\n description:\n 'Destination-level identify upserts the HubSpot contact with mapped properties before sending the behavioral event.',\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 silent -- user login fires contact upsert only,\n * no custom event sent.\n */\nexport const userLoginIdentify: HubSpotStepExample = {\n title: 'User login identify',\n description:\n 'A user login only upserts the HubSpot contact with profile and lifecycle properties, skipping the event send.',\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 silent: 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 title: 'Object id association',\n description:\n 'The HubSpot event is associated via objectId instead of email, resolved from the walker user id.',\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 public: false,\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 public: false,\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,EACZ,UAAU,EACP,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAU,EACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,mBAAmB,EAChB,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,EAC7B;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,OAAO,EACJ,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,WAAW,EACR,OAAO,EACP,IAAI,EACJ,SAAS,EACT,IAAI,GAAG,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;ACtDD,SAAS,KAAAA,UAAS;AAEX,IAAM,gBAAgBA,GAAE,OAAO;AAAA,EACpC,WAAWA,GACR,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,UAAUA,GACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,YAAYA,GACT,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;AFbM,IAAM,WAAW,YAAY,cAAc;AAC3C,IAAM,UAAU,YAAY,aAAa;;;AGThD;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;A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,UAAU;AAAA,QAC/B,YAAY,CAAC;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,aAAiC;AAAA,EAC5C,QAAQ;AAAA,EACR,IAAI,SAAS,gBAAgB;AAAA,IAC3B,WAAW;AAAA,IACX,MAAM,CAAC;AAAA,EACT,CAAC;AAAA,EACD,KAAK,CAAC;AACR;AAMO,IAAM,kBAAsC;AAAA,EACjD,QAAQ;AAAA,EACR,IAAI,SAAS,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":["z"]}
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 silent: 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:client.events.send.basicApi.send',\n 'call:client.events.send.batchApi.send',\n 'call:client.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 (`silent: 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 title: 'Default event',\n description:\n 'A walker event is sent to HubSpot as a custom behavioral event keyed by the user email.',\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 title: 'Custom event name',\n description:\n 'A mapping supplies a custom HubSpot event name and maps order data into properties for the behavioral event.',\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 title: 'Default properties',\n description:\n 'Destination-level default properties are merged into every HubSpot event payload, such as traffic source metadata.',\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 title: 'Destination identify',\n description:\n 'Destination-level identify upserts the HubSpot contact with mapped properties before sending the behavioral event.',\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 silent -- user login fires contact upsert only,\n * no custom event sent.\n */\nexport const userLoginIdentify: HubSpotStepExample = {\n title: 'User login identify',\n description:\n 'A user login only upserts the HubSpot contact with profile and lifecycle properties, skipping the event send.',\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 silent: 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 title: 'Object id association',\n description:\n 'The HubSpot event is associated via objectId instead of email, resolved from the walker user id.',\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 public: false,\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 public: false,\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;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,EAAE,OAAO,mBAAmB;AAAA,EACpC,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["z"]}
@@ -51,9 +51,9 @@ var push = {
51
51
  client: createMockClient()
52
52
  };
53
53
  var simulation = [
54
- "call:events.send.basicApi.send",
55
- "call:events.send.batchApi.send",
56
- "call:crm.contacts.basicApi.update"
54
+ "call:client.events.send.basicApi.send",
55
+ "call:client.events.send.batchApi.send",
56
+ "call:client.crm.contacts.basicApi.update"
57
57
  ];
58
58
 
59
59
  // src/examples/step.ts
@@ -30,9 +30,9 @@ var push = {
30
30
  client: createMockClient()
31
31
  };
32
32
  var simulation = [
33
- "call:events.send.basicApi.send",
34
- "call:events.send.batchApi.send",
35
- "call:crm.contacts.basicApi.update"
33
+ "call:client.events.send.basicApi.send",
34
+ "call:client.events.send.batchApi.send",
35
+ "call:client.crm.contacts.basicApi.update"
36
36
  ];
37
37
 
38
38
  // src/examples/step.ts
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "$meta": {
3
3
  "package": "@walkeros/server-destination-hubspot",
4
- "version": "4.7.0-next-1790245733116",
4
+ "version": "4.7.0",
5
5
  "type": "destination",
6
6
  "platform": [
7
7
  "server"
8
8
  ],
9
+ "exports": {},
9
10
  "docs": "https://www.walkeros.io/docs/destinations/server/hubspot",
10
11
  "source": "https://github.com/elbwalker/walkerOS/tree/main/packages/server/destinations/hubspot/src"
11
12
  },
@@ -110,9 +111,9 @@
110
111
  }
111
112
  },
112
113
  "simulation": [
113
- "call:events.send.basicApi.send",
114
- "call:events.send.batchApi.send",
115
- "call:crm.contacts.basicApi.update"
114
+ "call:client.events.send.basicApi.send",
115
+ "call:client.events.send.batchApi.send",
116
+ "call:client.crm.contacts.basicApi.update"
116
117
  ]
117
118
  },
118
119
  "step": {
@@ -147,7 +148,7 @@
147
148
  "consent": {
148
149
  "functional": true
149
150
  },
150
- "id": "2b7118bd36822630",
151
+ "id": "96a2a07f6c56f613",
151
152
  "trigger": "load",
152
153
  "entity": "product",
153
154
  "action": "view",
@@ -211,7 +212,7 @@
211
212
  "consent": {
212
213
  "functional": true
213
214
  },
214
- "id": "c9caf7d749443a1b",
215
+ "id": "91e862b00af18d51",
215
216
  "trigger": "load",
216
217
  "entity": "page",
217
218
  "action": "view",
@@ -286,7 +287,7 @@
286
287
  "consent": {
287
288
  "functional": true
288
289
  },
289
- "id": "0ffa6e78d71f22d2",
290
+ "id": "be2ccd4f114dd6cc",
290
291
  "trigger": "load",
291
292
  "entity": "page",
292
293
  "action": "view",
@@ -411,7 +412,7 @@
411
412
  "consent": {
412
413
  "functional": true
413
414
  },
414
- "id": "1774fd1b67592a5e",
415
+ "id": "c2efa40418fcaf06",
415
416
  "trigger": "load",
416
417
  "entity": "order",
417
418
  "action": "complete",
@@ -481,7 +482,7 @@
481
482
  "consent": {
482
483
  "functional": true
483
484
  },
484
- "id": "3f82cfbefbbca383",
485
+ "id": "401fa6d90fa80f63",
485
486
  "trigger": "load",
486
487
  "entity": "product",
487
488
  "action": "view",
@@ -527,7 +528,7 @@
527
528
  "consent": {
528
529
  "functional": true
529
530
  },
530
- "id": "8bb76fb533bbf143",
531
+ "id": "947dbb5597f8d1c2",
531
532
  "trigger": "load",
532
533
  "entity": "product",
533
534
  "action": "view",
@@ -592,7 +593,7 @@
592
593
  "consent": {
593
594
  "functional": true
594
595
  },
595
- "id": "0302e11e67be2a22",
596
+ "id": "869f3629c8648910",
596
597
  "trigger": "test",
597
598
  "entity": "user",
598
599
  "action": "login",
@@ -677,7 +678,7 @@
677
678
  "consent": {
678
679
  "functional": true
679
680
  },
680
- "id": "b27a09a786ef8589",
681
+ "id": "415a327807bda439",
681
682
  "trigger": "test",
682
683
  "entity": "debug",
683
684
  "action": "noise",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@walkeros/server-destination-hubspot",
3
3
  "description": "HubSpot CRM server destination for walkerOS (@hubspot/api-client, custom events + contact upsert)",
4
- "version": "4.7.0-next-1790245733116",
4
+ "version": "4.7.0",
5
5
  "license": "MIT",
6
6
  "exports": {
7
7
  ".": {
@@ -36,11 +36,11 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@hubspot/api-client": "^13.0.0",
39
- "@walkeros/core": "4.7.0-next-1790245733116",
40
- "@walkeros/server-core": "4.7.0-next-1790245733116"
39
+ "@walkeros/core": "4.7.0",
40
+ "@walkeros/server-core": "4.7.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@walkeros/collector": "4.7.0-next-1790245733116"
43
+ "@walkeros/collector": "4.7.0"
44
44
  },
45
45
  "repository": {
46
46
  "url": "git+https://github.com/elbwalker/walkerOS.git",