@walkeros/server-destination-segment 3.3.0 → 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/dist/dev.d.mts +10 -0
- package/dist/dev.d.ts +10 -0
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/examples/index.d.mts +10 -0
- package/dist/examples/index.d.ts +10 -0
- package/dist/examples/index.js +85 -69
- package/dist/examples/index.mjs +85 -69
- package/dist/walkerOS.json +108 -92
- package/package.json +4 -4
package/dist/dev.d.mts
CHANGED
|
@@ -125,6 +125,16 @@ declare namespace env {
|
|
|
125
125
|
type SegmentStepExample = Flow.StepExample & {
|
|
126
126
|
settings?: Partial<Settings>;
|
|
127
127
|
};
|
|
128
|
+
/**
|
|
129
|
+
* Segment server destination invokes the injected `env.analytics` SDK methods
|
|
130
|
+
* (`track`, `identify`, `group`, `page`, `screen`) — not a raw HTTP endpoint.
|
|
131
|
+
* Each `out` entry is therefore `[callable, params]` where `callable` is the
|
|
132
|
+
* dotted method name (e.g. `'analytics.track'`) and `params` is the object
|
|
133
|
+
* passed to the SDK.
|
|
134
|
+
*
|
|
135
|
+
* Examples may emit multiple calls in order (e.g. identify + track), so
|
|
136
|
+
* every `out` is wrapped as `[[callable, params], ...]`.
|
|
137
|
+
*/
|
|
128
138
|
/**
|
|
129
139
|
* Default event forwarding -- analytics.track() with event name and empty
|
|
130
140
|
* properties. userId resolved from default settings.userId = 'user.id'.
|
package/dist/dev.d.ts
CHANGED
|
@@ -125,6 +125,16 @@ declare namespace env {
|
|
|
125
125
|
type SegmentStepExample = Flow.StepExample & {
|
|
126
126
|
settings?: Partial<Settings>;
|
|
127
127
|
};
|
|
128
|
+
/**
|
|
129
|
+
* Segment server destination invokes the injected `env.analytics` SDK methods
|
|
130
|
+
* (`track`, `identify`, `group`, `page`, `screen`) — not a raw HTTP endpoint.
|
|
131
|
+
* Each `out` entry is therefore `[callable, params]` where `callable` is the
|
|
132
|
+
* dotted method name (e.g. `'analytics.track'`) and `params` is the object
|
|
133
|
+
* passed to the SDK.
|
|
134
|
+
*
|
|
135
|
+
* Examples may emit multiple calls in order (e.g. identify + track), so
|
|
136
|
+
* every `out` is wrapped as `[[callable, params], ...]`.
|
|
137
|
+
*/
|
|
128
138
|
/**
|
|
129
139
|
* Default event forwarding -- analytics.track() with event name and empty
|
|
130
140
|
* properties. userId resolved from default settings.userId = 'user.id'.
|
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,i=(e,s)=>{for(var n in s)t(e,n,{get:s[n],enumerable:!0})},r={};i(r,{examples:()=>y,schemas:()=>o}),module.exports=(e=r,((e,i,r,o)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let p of n(i))a.call(e,p)||p===r||t(e,p,{get:()=>i[p],enumerable:!(o=s(i,p))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o={};i(o,{MappingSchema:()=>c,SettingsSchema:()=>u,mapping:()=>g,settings:()=>d});var p=require("@walkeros/core/dev"),m=require("@walkeros/core/dev"),u=m.z.object({writeKey:m.z.string().min(1).describe("Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys."),userId:m.z.string().describe("walkerOS mapping value path to resolve userId from each event (like user.id).").optional(),anonymousId:m.z.string().describe("walkerOS mapping value path to resolve anonymousId from each event (like user.session).").optional(),host:m.z.string().url().describe("Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.").optional(),path:m.z.string().describe("API path route (like /v1/batch).").optional(),flushAt:m.z.number().int().positive().describe("Events to enqueue before flushing a batch. Default: 15.").optional(),flushInterval:m.z.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxRetries:m.z.number().int().min(0).describe("Retry attempts for failed batches. Default: 3.").optional(),httpRequestTimeout:m.z.number().int().positive().describe("HTTP request timeout in milliseconds. Default: 10000.").optional(),disable:m.z.boolean().describe("Completely disable the SDK (no-ops all calls). Default: false.").optional(),identify:m.z.unknown().describe("Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.").optional(),group:m.z.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.").optional(),consent:m.z.record(m.z.string(),m.z.string()).describe('Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { "marketing": "Advertising", "analytics": "Analytics" }.').optional(),integrations:m.z.record(m.z.string(),m.z.unknown()).describe('Enable/disable downstream Segment destinations. Example: { "All": true, "Mixpanel": false }.').optional()}),l=require("@walkeros/core/dev"),c=l.z.object({identify:l.z.unknown().describe("Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.").optional(),group:l.z.unknown().describe("Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.").optional(),page:l.z.unknown().describe("Per-event page call. Resolves to { category?, name?, properties? } or true for minimal page(). Use with skip: true.").optional(),screen:l.z.unknown().describe("Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.").optional()}),d=(0,p.zodToSchema)(u),g=(0,p.zodToSchema)(c),y={};i(y,{env:()=>v,step:()=>k});var v={};i(v,{push:()=>w,simulation:()=>f});var b=()=>{};var w={analytics:{track:b,identify:b,group:b,page:b,screen:b,closeAndFlush:()=>Promise.resolve()}},f=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen"],k={};i(k,{anonymousOnly:()=>O,companyGroup:()=>E,consentForwarding:()=>x,defaultTrack:()=>I,destinationIdentify:()=>D,mappedEventName:()=>z,pageView:()=>P,screenView:()=>A,userLoginIdentify:()=>S,wildcardIgnored:()=>R});var h=require("@walkeros/core"),I={in:(0,h.getEvent)("product view",{timestamp:1700000100,user:{id:"us3r",session:"s3ss10n"}}),out:["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000100)}]},z={in:(0,h.getEvent)("order complete",{timestamp:1700000101,user:{id:"us3r",session:"s3ss10n"}}),mapping:{name:"Order Completed"},out:["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"Order Completed",properties:{},timestamp:new Date(1700000101)}]},D={in:(0,h.getEvent)("page view",{timestamp:1700000102,user:{id:"us3r",session:"s3ss10n",email:"user@example.com"}}),settings:{identify:{map:{traits:{map:{email:"user.email"}}}}},out:[["analytics.identify",{userId:"us3r",anonymousId:"s3ss10n",traits:{email:"user@example.com"},timestamp:new Date(1700000102)}],["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"page view",properties:{},timestamp:new Date(1700000102)}]]},S={in:(0,h.getEvent)("user login",{timestamp:1700000103,user:{id:"us3r",session:"s3ss10n"},data:{user_id:"new-user-123",email:"user@acme.com",name:"Jane Doe",plan:"premium"}}),mapping:{skip:!0,settings:{identify:{map:{userId:"data.user_id",traits:{map:{email:"data.email",name:"data.name",plan:"data.plan"}}}}}},out:["analytics.identify",{userId:"new-user-123",anonymousId:"s3ss10n",traits:{email:"user@acme.com",name:"Jane Doe",plan:"premium"},timestamp:new Date(1700000103)}]},E={in:(0,h.getEvent)("company update",{timestamp:1700000104,user:{id:"us3r",session:"s3ss10n"},data:{company_id:"comp-456",company_name:"Acme",industry:"tech",employees:50}}),mapping:{skip:!0,settings:{group:{map:{groupId:"data.company_id",traits:{map:{name:"data.company_name",industry:"data.industry",employees:"data.employees"}}}}}},out:["analytics.group",{userId:"us3r",anonymousId:"s3ss10n",groupId:"comp-456",traits:{name:"Acme",industry:"tech",employees:50},timestamp:new Date(1700000104)}]},P={in:(0,h.getEvent)("page view",{timestamp:1700000105,user:{id:"us3r",session:"s3ss10n"},data:{category:"docs",title:"Getting Started",section:"tutorials"}}),mapping:{skip:!0,settings:{page:{map:{category:"data.category",name:"data.title",properties:{map:{section:"data.section"}}}}}},out:["analytics.page",{userId:"us3r",anonymousId:"s3ss10n",category:"docs",name:"Getting Started",properties:{section:"tutorials"},timestamp:new Date(1700000105)}]},A={in:(0,h.getEvent)("screen view",{timestamp:1700000106,user:{id:"us3r",session:"s3ss10n"},data:{screen_name:"Welcome",section:"onboarding",build:"1.2.3"}}),mapping:{skip:!0,settings:{screen:{map:{name:"data.screen_name",category:"data.section",properties:{map:{build:"data.build"}}}}}},out:["analytics.screen",{userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",category:"onboarding",properties:{build:"1.2.3"},timestamp:new Date(1700000106)}]},O={in:(0,h.getEvent)("product view",{timestamp:1700000107,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:["analytics.track",{anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000107)}]},x={in:(0,h.getEvent)("product view",{timestamp:1700000108,user:{id:"us3r",session:"s3ss10n"},consent:{analytics:!0,marketing:!0}}),settings:{consent:{analytics:"Analytics",marketing:"Advertising"}},out:["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108),context:{consent:{categoryPreferences:{Analytics:!0,Advertising:!0}}}}]},R={in:(0,h.getEvent)("debug noise",{timestamp:1700000109,user:{id:"us3r",session:"s3ss10n"}}),mapping:{ignore:!0},out:[]};//# sourceMappingURL=dev.js.map
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,i=(e,s)=>{for(var n in s)t(e,n,{get:s[n],enumerable:!0})},r={};i(r,{examples:()=>y,schemas:()=>o}),module.exports=(e=r,((e,i,r,o)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let p of n(i))a.call(e,p)||p===r||t(e,p,{get:()=>i[p],enumerable:!(o=s(i,p))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o={};i(o,{MappingSchema:()=>c,SettingsSchema:()=>u,mapping:()=>g,settings:()=>d});var p=require("@walkeros/core/dev"),m=require("@walkeros/core/dev"),u=m.z.object({writeKey:m.z.string().min(1).describe("Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys."),userId:m.z.string().describe("walkerOS mapping value path to resolve userId from each event (like user.id).").optional(),anonymousId:m.z.string().describe("walkerOS mapping value path to resolve anonymousId from each event (like user.session).").optional(),host:m.z.string().url().describe("Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.").optional(),path:m.z.string().describe("API path route (like /v1/batch).").optional(),flushAt:m.z.number().int().positive().describe("Events to enqueue before flushing a batch. Default: 15.").optional(),flushInterval:m.z.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxRetries:m.z.number().int().min(0).describe("Retry attempts for failed batches. Default: 3.").optional(),httpRequestTimeout:m.z.number().int().positive().describe("HTTP request timeout in milliseconds. Default: 10000.").optional(),disable:m.z.boolean().describe("Completely disable the SDK (no-ops all calls). Default: false.").optional(),identify:m.z.unknown().describe("Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.").optional(),group:m.z.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.").optional(),consent:m.z.record(m.z.string(),m.z.string()).describe('Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { "marketing": "Advertising", "analytics": "Analytics" }.').optional(),integrations:m.z.record(m.z.string(),m.z.unknown()).describe('Enable/disable downstream Segment destinations. Example: { "All": true, "Mixpanel": false }.').optional()}),l=require("@walkeros/core/dev"),c=l.z.object({identify:l.z.unknown().describe("Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.").optional(),group:l.z.unknown().describe("Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.").optional(),page:l.z.unknown().describe("Per-event page call. Resolves to { category?, name?, properties? } or true for minimal page(). Use with skip: true.").optional(),screen:l.z.unknown().describe("Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.").optional()}),d=(0,p.zodToSchema)(u),g=(0,p.zodToSchema)(c),y={};i(y,{env:()=>v,step:()=>k});var v={};i(v,{push:()=>w,simulation:()=>f});var b=()=>{};var w={analytics:{track:b,identify:b,group:b,page:b,screen:b,closeAndFlush:()=>Promise.resolve()}},f=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen"],k={};i(k,{anonymousOnly:()=>O,companyGroup:()=>E,consentForwarding:()=>x,defaultTrack:()=>I,destinationIdentify:()=>D,mappedEventName:()=>z,pageView:()=>P,screenView:()=>A,userLoginIdentify:()=>S,wildcardIgnored:()=>R});var h=require("@walkeros/core"),I={in:(0,h.getEvent)("product view",{timestamp:1700000100,user:{id:"us3r",session:"s3ss10n"}}),out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000100)}]]},z={in:(0,h.getEvent)("order complete",{timestamp:1700000101,user:{id:"us3r",session:"s3ss10n"}}),mapping:{name:"Order Completed"},out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"Order Completed",properties:{},timestamp:new Date(1700000101)}]]},D={in:(0,h.getEvent)("page view",{timestamp:1700000102,user:{id:"us3r",session:"s3ss10n",email:"user@example.com"}}),settings:{identify:{map:{traits:{map:{email:"user.email"}}}}},out:[["analytics.identify",{userId:"us3r",anonymousId:"s3ss10n",traits:{email:"user@example.com"},timestamp:new Date(1700000102)}],["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"page view",properties:{},timestamp:new Date(1700000102)}]]},S={in:(0,h.getEvent)("user login",{timestamp:1700000103,user:{id:"us3r",session:"s3ss10n"},data:{user_id:"new-user-123",email:"user@acme.com",name:"Jane Doe",plan:"premium"}}),mapping:{skip:!0,settings:{identify:{map:{userId:"data.user_id",traits:{map:{email:"data.email",name:"data.name",plan:"data.plan"}}}}}},out:[["analytics.identify",{userId:"new-user-123",anonymousId:"s3ss10n",traits:{email:"user@acme.com",name:"Jane Doe",plan:"premium"},timestamp:new Date(1700000103)}]]},E={in:(0,h.getEvent)("company update",{timestamp:1700000104,user:{id:"us3r",session:"s3ss10n"},data:{company_id:"comp-456",company_name:"Acme",industry:"tech",employees:50}}),mapping:{skip:!0,settings:{group:{map:{groupId:"data.company_id",traits:{map:{name:"data.company_name",industry:"data.industry",employees:"data.employees"}}}}}},out:[["analytics.group",{userId:"us3r",anonymousId:"s3ss10n",groupId:"comp-456",traits:{name:"Acme",industry:"tech",employees:50},timestamp:new Date(1700000104)}]]},P={in:(0,h.getEvent)("page view",{timestamp:1700000105,user:{id:"us3r",session:"s3ss10n"},data:{category:"docs",title:"Getting Started",section:"tutorials"}}),mapping:{skip:!0,settings:{page:{map:{category:"data.category",name:"data.title",properties:{map:{section:"data.section"}}}}}},out:[["analytics.page",{userId:"us3r",anonymousId:"s3ss10n",category:"docs",name:"Getting Started",properties:{section:"tutorials"},timestamp:new Date(1700000105)}]]},A={in:(0,h.getEvent)("screen view",{timestamp:1700000106,user:{id:"us3r",session:"s3ss10n"},data:{screen_name:"Welcome",section:"onboarding",build:"1.2.3"}}),mapping:{skip:!0,settings:{screen:{map:{name:"data.screen_name",category:"data.section",properties:{map:{build:"data.build"}}}}}},out:[["analytics.screen",{userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",category:"onboarding",properties:{build:"1.2.3"},timestamp:new Date(1700000106)}]]},O={in:(0,h.getEvent)("product view",{timestamp:1700000107,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:[["analytics.track",{anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000107)}]]},x={in:(0,h.getEvent)("product view",{timestamp:1700000108,user:{id:"us3r",session:"s3ss10n"},consent:{analytics:!0,marketing:!0}}),settings:{consent:{analytics:"Analytics",marketing:"Advertising"}},out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108),context:{consent:{categoryPreferences:{Analytics:!0,Advertising:!0}}}}]]},R={in:(0,h.getEvent)("debug noise",{timestamp:1700000109,user:{id:"us3r",session:"s3ss10n"}}),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 writeKey: z\n .string()\n .min(1)\n .describe(\n 'Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys.',\n ),\n userId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve userId from each event (like user.id).',\n )\n .optional(),\n anonymousId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve anonymousId from each event (like user.session).',\n )\n .optional(),\n host: z\n .string()\n .url()\n .describe(\n 'Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.',\n )\n .optional(),\n path: z.string().describe('API path route (like /v1/batch).').optional(),\n flushAt: z\n .number()\n .int()\n .positive()\n .describe('Events to enqueue before flushing a batch. Default: 15.')\n .optional(),\n flushInterval: z\n .number()\n .int()\n .positive()\n .describe('Max milliseconds before auto-flush. Default: 10000.')\n .optional(),\n maxRetries: z\n .number()\n .int()\n .min(0)\n .describe('Retry attempts for failed batches. Default: 3.')\n .optional(),\n httpRequestTimeout: z\n .number()\n .int()\n .positive()\n .describe('HTTP request timeout in milliseconds. Default: 10000.')\n .optional(),\n disable: z\n .boolean()\n .describe('Completely disable the SDK (no-ops all calls). Default: false.')\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.',\n )\n .optional(),\n consent: z\n .record(z.string(), z.string())\n .describe(\n 'Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { \"marketing\": \"Advertising\", \"analytics\": \"Analytics\" }.',\n )\n .optional(),\n integrations: z\n .record(z.string(), z.unknown())\n .describe(\n 'Enable/disable downstream Segment destinations. Example: { \"All\": true, \"Mixpanel\": false }.',\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 identify: z\n .unknown()\n .describe(\n 'Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.',\n )\n .optional(),\n page: z\n .unknown()\n .describe(\n 'Per-event page call. Resolves to { category?, name?, properties? } or true for minimal page(). Use with skip: true.',\n )\n .optional(),\n screen: z\n .unknown()\n .describe(\n 'Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.',\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, SegmentAnalyticsMock } from '../types';\n\nconst noop = () => {};\nconst asyncNoop = () => Promise.resolve();\n\nfunction createMockAnalytics(): SegmentAnalyticsMock {\n return {\n track: noop,\n identify: noop,\n group: noop,\n page: noop,\n screen: noop,\n closeAndFlush: asyncNoop,\n };\n}\n\nexport const push: Env = {\n analytics: createMockAnalytics(),\n};\n\nexport const simulation = [\n 'call:analytics.track',\n 'call:analytics.identify',\n 'call:analytics.group',\n 'call:analytics.page',\n 'call:analytics.screen',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type SegmentStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default event forwarding -- analytics.track() with event name and empty\n * properties. userId resolved from default settings.userId = 'user.id'.\n */\nexport const defaultTrack: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000100,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n out: [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000100),\n },\n ],\n};\n\n/**\n * Mapped event name -- mapping.name renames the event for Segment.\n */\nexport const mappedEventName: SegmentStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000101,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: {\n name: 'Order Completed',\n },\n out: [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'Order Completed',\n properties: {},\n timestamp: new Date(1700000101),\n },\n ],\n};\n\n/**\n * Destination-level identify -- fires analytics.identify() on first push\n * when settings.identify mapping resolves. Then fires analytics.track().\n */\nexport const destinationIdentify: SegmentStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000102,\n user: { id: 'us3r', session: 's3ss10n', email: 'user@example.com' },\n }),\n settings: {\n identify: {\n map: {\n traits: {\n map: {\n email: 'user.email',\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.identify',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n traits: { email: 'user@example.com' },\n timestamp: new Date(1700000102),\n },\n ],\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'page view',\n properties: {},\n timestamp: new Date(1700000102),\n },\n ],\n ],\n};\n\n/**\n * Per-event identify with skip -- user login fires identify() only.\n */\nexport const userLoginIdentify: SegmentStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000103,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n user_id: 'new-user-123',\n email: 'user@acme.com',\n name: 'Jane Doe',\n plan: 'premium',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n userId: 'data.user_id',\n traits: {\n map: {\n email: 'data.email',\n name: 'data.name',\n plan: 'data.plan',\n },\n },\n },\n },\n },\n },\n out: [\n 'analytics.identify',\n {\n userId: 'new-user-123',\n anonymousId: 's3ss10n',\n traits: { email: 'user@acme.com', name: 'Jane Doe', plan: 'premium' },\n timestamp: new Date(1700000103),\n },\n ],\n};\n\n/**\n * Per-event group with skip -- company update fires group() only.\n */\nexport const companyGroup: SegmentStepExample = {\n in: getEvent('company update', {\n timestamp: 1700000104,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n company_id: 'comp-456',\n company_name: 'Acme',\n industry: 'tech',\n employees: 50,\n },\n }),\n mapping: {\n skip: true,\n settings: {\n group: {\n map: {\n groupId: 'data.company_id',\n traits: {\n map: {\n name: 'data.company_name',\n industry: 'data.industry',\n employees: 'data.employees',\n },\n },\n },\n },\n },\n },\n out: [\n 'analytics.group',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n groupId: 'comp-456',\n traits: { name: 'Acme', industry: 'tech', employees: 50 },\n timestamp: new Date(1700000104),\n },\n ],\n};\n\n/**\n * Explicit page() call with properties -- the canonical Segment page view.\n * skip: true suppresses track(); settings.page fires analytics.page().\n */\nexport const pageView: SegmentStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000105,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n category: 'docs',\n title: 'Getting Started',\n section: 'tutorials',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n page: {\n map: {\n category: 'data.category',\n name: 'data.title',\n properties: {\n map: {\n section: 'data.section',\n },\n },\n },\n },\n },\n },\n out: [\n 'analytics.page',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n category: 'docs',\n name: 'Getting Started',\n properties: { section: 'tutorials' },\n timestamp: new Date(1700000105),\n },\n ],\n};\n\n/**\n * Screen call -- server-only method for mobile app backends.\n */\nexport const screenView: SegmentStepExample = {\n in: getEvent('screen view', {\n timestamp: 1700000106,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n screen_name: 'Welcome',\n section: 'onboarding',\n build: '1.2.3',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n screen: {\n map: {\n name: 'data.screen_name',\n category: 'data.section',\n properties: {\n map: {\n build: 'data.build',\n },\n },\n },\n },\n },\n },\n out: [\n 'analytics.screen',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n name: 'Welcome',\n category: 'onboarding',\n properties: { build: '1.2.3' },\n timestamp: new Date(1700000106),\n },\n ],\n};\n\n/**\n * AnonymousId only -- no userId resolved. Segment accepts anonymousId alone.\n */\nexport const anonymousOnly: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000107,\n user: { session: 's3ss10n' },\n }),\n settings: {\n userId: undefined,\n },\n out: [\n 'analytics.track',\n {\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000107),\n },\n ],\n};\n\n/**\n * Consent context forwarding -- settings.consent maps walkerOS consent\n * keys to Segment categoryPreferences on the context object.\n */\nexport const consentForwarding: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000108,\n user: { id: 'us3r', session: 's3ss10n' },\n consent: { analytics: true, marketing: true },\n }),\n settings: {\n consent: {\n analytics: 'Analytics',\n marketing: 'Advertising',\n },\n },\n out: [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000108),\n context: {\n consent: {\n categoryPreferences: {\n Analytics: true,\n Advertising: true,\n },\n },\n },\n },\n ],\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: SegmentStepExample = {\n in: getEvent('debug noise', {\n timestamp: 1700000109,\n user: { id: 'us3r', session: 's3ss10n' },\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,UAAU,aACP,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,aACL,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,aACV,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,aACH,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,aAAE,OAAO,EAAE,SAAS,kCAAkC,EAAE,SAAS;AAAA,EACvE,SAAS,aACN,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,yDAAyD,EAClE,SAAS;AAAA,EACZ,eAAe,aACZ,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,qDAAqD,EAC9D,SAAS;AAAA,EACZ,YAAY,aACT,OAAO,EACP,IAAI,EACJ,IAAI,CAAC,EACL,SAAS,gDAAgD,EACzD,SAAS;AAAA,EACZ,oBAAoB,aACjB,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,uDAAuD,EAChE,SAAS;AAAA,EACZ,SAAS,aACN,QAAQ,EACR,SAAS,gEAAgE,EACzE,SAAS;AAAA,EACZ,UAAU,aACP,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,OAAO,aACJ,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,SAAS,aACN,OAAO,aAAE,OAAO,GAAG,aAAE,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AAS,UAAU;AAAA,EACzC,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 writeKey: z\n .string()\n .min(1)\n .describe(\n 'Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys.',\n ),\n userId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve userId from each event (like user.id).',\n )\n .optional(),\n anonymousId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve anonymousId from each event (like user.session).',\n )\n .optional(),\n host: z\n .string()\n .url()\n .describe(\n 'Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.',\n )\n .optional(),\n path: z.string().describe('API path route (like /v1/batch).').optional(),\n flushAt: z\n .number()\n .int()\n .positive()\n .describe('Events to enqueue before flushing a batch. Default: 15.')\n .optional(),\n flushInterval: z\n .number()\n .int()\n .positive()\n .describe('Max milliseconds before auto-flush. Default: 10000.')\n .optional(),\n maxRetries: z\n .number()\n .int()\n .min(0)\n .describe('Retry attempts for failed batches. Default: 3.')\n .optional(),\n httpRequestTimeout: z\n .number()\n .int()\n .positive()\n .describe('HTTP request timeout in milliseconds. Default: 10000.')\n .optional(),\n disable: z\n .boolean()\n .describe('Completely disable the SDK (no-ops all calls). Default: false.')\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.',\n )\n .optional(),\n consent: z\n .record(z.string(), z.string())\n .describe(\n 'Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { \"marketing\": \"Advertising\", \"analytics\": \"Analytics\" }.',\n )\n .optional(),\n integrations: z\n .record(z.string(), z.unknown())\n .describe(\n 'Enable/disable downstream Segment destinations. Example: { \"All\": true, \"Mixpanel\": false }.',\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 identify: z\n .unknown()\n .describe(\n 'Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.',\n )\n .optional(),\n page: z\n .unknown()\n .describe(\n 'Per-event page call. Resolves to { category?, name?, properties? } or true for minimal page(). Use with skip: true.',\n )\n .optional(),\n screen: z\n .unknown()\n .describe(\n 'Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.',\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, SegmentAnalyticsMock } from '../types';\n\nconst noop = () => {};\nconst asyncNoop = () => Promise.resolve();\n\nfunction createMockAnalytics(): SegmentAnalyticsMock {\n return {\n track: noop,\n identify: noop,\n group: noop,\n page: noop,\n screen: noop,\n closeAndFlush: asyncNoop,\n };\n}\n\nexport const push: Env = {\n analytics: createMockAnalytics(),\n};\n\nexport const simulation = [\n 'call:analytics.track',\n 'call:analytics.identify',\n 'call:analytics.group',\n 'call:analytics.page',\n 'call:analytics.screen',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type SegmentStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Segment server destination invokes the injected `env.analytics` SDK methods\n * (`track`, `identify`, `group`, `page`, `screen`) — not a raw HTTP endpoint.\n * Each `out` entry is therefore `[callable, params]` where `callable` is the\n * dotted method name (e.g. `'analytics.track'`) and `params` is the object\n * passed to the SDK.\n *\n * Examples may emit multiple calls in order (e.g. identify + track), so\n * every `out` is wrapped as `[[callable, params], ...]`.\n */\n\n/**\n * Default event forwarding -- analytics.track() with event name and empty\n * properties. userId resolved from default settings.userId = 'user.id'.\n */\nexport const defaultTrack: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000100,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000100),\n },\n ],\n ],\n};\n\n/**\n * Mapped event name -- mapping.name renames the event for Segment.\n */\nexport const mappedEventName: SegmentStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000101,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: {\n name: 'Order Completed',\n },\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'Order Completed',\n properties: {},\n timestamp: new Date(1700000101),\n },\n ],\n ],\n};\n\n/**\n * Destination-level identify -- fires analytics.identify() on first push\n * when settings.identify mapping resolves. Then fires analytics.track().\n */\nexport const destinationIdentify: SegmentStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000102,\n user: { id: 'us3r', session: 's3ss10n', email: 'user@example.com' },\n }),\n settings: {\n identify: {\n map: {\n traits: {\n map: {\n email: 'user.email',\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.identify',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n traits: { email: 'user@example.com' },\n timestamp: new Date(1700000102),\n },\n ],\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'page view',\n properties: {},\n timestamp: new Date(1700000102),\n },\n ],\n ],\n};\n\n/**\n * Per-event identify with skip -- user login fires identify() only.\n */\nexport const userLoginIdentify: SegmentStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000103,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n user_id: 'new-user-123',\n email: 'user@acme.com',\n name: 'Jane Doe',\n plan: 'premium',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n userId: 'data.user_id',\n traits: {\n map: {\n email: 'data.email',\n name: 'data.name',\n plan: 'data.plan',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.identify',\n {\n userId: 'new-user-123',\n anonymousId: 's3ss10n',\n traits: { email: 'user@acme.com', name: 'Jane Doe', plan: 'premium' },\n timestamp: new Date(1700000103),\n },\n ],\n ],\n};\n\n/**\n * Per-event group with skip -- company update fires group() only.\n */\nexport const companyGroup: SegmentStepExample = {\n in: getEvent('company update', {\n timestamp: 1700000104,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n company_id: 'comp-456',\n company_name: 'Acme',\n industry: 'tech',\n employees: 50,\n },\n }),\n mapping: {\n skip: true,\n settings: {\n group: {\n map: {\n groupId: 'data.company_id',\n traits: {\n map: {\n name: 'data.company_name',\n industry: 'data.industry',\n employees: 'data.employees',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.group',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n groupId: 'comp-456',\n traits: { name: 'Acme', industry: 'tech', employees: 50 },\n timestamp: new Date(1700000104),\n },\n ],\n ],\n};\n\n/**\n * Explicit page() call with properties -- the canonical Segment page view.\n * skip: true suppresses track(); settings.page fires analytics.page().\n */\nexport const pageView: SegmentStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000105,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n category: 'docs',\n title: 'Getting Started',\n section: 'tutorials',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n page: {\n map: {\n category: 'data.category',\n name: 'data.title',\n properties: {\n map: {\n section: 'data.section',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.page',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n category: 'docs',\n name: 'Getting Started',\n properties: { section: 'tutorials' },\n timestamp: new Date(1700000105),\n },\n ],\n ],\n};\n\n/**\n * Screen call -- server-only method for mobile app backends.\n */\nexport const screenView: SegmentStepExample = {\n in: getEvent('screen view', {\n timestamp: 1700000106,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n screen_name: 'Welcome',\n section: 'onboarding',\n build: '1.2.3',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n screen: {\n map: {\n name: 'data.screen_name',\n category: 'data.section',\n properties: {\n map: {\n build: 'data.build',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.screen',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n name: 'Welcome',\n category: 'onboarding',\n properties: { build: '1.2.3' },\n timestamp: new Date(1700000106),\n },\n ],\n ],\n};\n\n/**\n * AnonymousId only -- no userId resolved. Segment accepts anonymousId alone.\n */\nexport const anonymousOnly: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000107,\n user: { session: 's3ss10n' },\n }),\n settings: {\n userId: undefined,\n },\n out: [\n [\n 'analytics.track',\n {\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000107),\n },\n ],\n ],\n};\n\n/**\n * Consent context forwarding -- settings.consent maps walkerOS consent\n * keys to Segment categoryPreferences on the context object.\n */\nexport const consentForwarding: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000108,\n user: { id: 'us3r', session: 's3ss10n' },\n consent: { analytics: true, marketing: true },\n }),\n settings: {\n consent: {\n analytics: 'Analytics',\n marketing: 'Advertising',\n },\n },\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000108),\n context: {\n consent: {\n categoryPreferences: {\n Analytics: true,\n Advertising: true,\n },\n },\n },\n },\n ],\n ],\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: SegmentStepExample = {\n in: getEvent('debug noise', {\n timestamp: 1700000109,\n user: { id: 'us3r', session: 's3ss10n' },\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,UAAU,aACP,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,aACL,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,aACV,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,aACH,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,aAAE,OAAO,EAAE,SAAS,kCAAkC,EAAE,SAAS;AAAA,EACvE,SAAS,aACN,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,yDAAyD,EAClE,SAAS;AAAA,EACZ,eAAe,aACZ,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAAS,qDAAqD,EAC9D,SAAS;AAAA,EACZ,YAAY,aACT,OAAO,EACP,IAAI,EACJ,IAAI,CAAC,EACL,SAAS,gDAAgD,EACzD,SAAS;AAAA,EACZ,oBAAoB,aACjB,OAAO,EACP,IAAI,EACJ,SAAS,EACT,SAA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AAA,IACb;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,QAAQ;AAAA,QACR,aAAa;AAAA,QACb,OAAO;AAAA,QACP,YAAY,CAAC;AAAA,QACb,WAAW,oBAAI,KAAK,UAAU;AAAA,QAC9B,SAAS;AAAA,UACP,SAAS;AAAA,YACP,qBAAqB;AAAA,cACnB,WAAW;AAAA,cACX,aAAa;AAAA,YACf;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,kBAAsC;AAAA,EACjD,QAAI,sBAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,EACzC,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,s=(s,t)=>{for(var n in t)e(s,n,{get:t[n],enumerable:!0})},t={};s(t,{MappingSchema:()=>o,SettingsSchema:()=>i,mapping:()=>m,settings:()=>p});import{zodToSchema as n}from"@walkeros/core/dev";import{z as a}from"@walkeros/core/dev";var i=a.object({writeKey:a.string().min(1).describe("Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys."),userId:a.string().describe("walkerOS mapping value path to resolve userId from each event (like user.id).").optional(),anonymousId:a.string().describe("walkerOS mapping value path to resolve anonymousId from each event (like user.session).").optional(),host:a.string().url().describe("Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.").optional(),path:a.string().describe("API path route (like /v1/batch).").optional(),flushAt:a.number().int().positive().describe("Events to enqueue before flushing a batch. Default: 15.").optional(),flushInterval:a.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxRetries:a.number().int().min(0).describe("Retry attempts for failed batches. Default: 3.").optional(),httpRequestTimeout:a.number().int().positive().describe("HTTP request timeout in milliseconds. Default: 10000.").optional(),disable:a.boolean().describe("Completely disable the SDK (no-ops all calls). Default: false.").optional(),identify:a.unknown().describe("Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.").optional(),group:a.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.").optional(),consent:a.record(a.string(),a.string()).describe('Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { "marketing": "Advertising", "analytics": "Analytics" }.').optional(),integrations:a.record(a.string(),a.unknown()).describe('Enable/disable downstream Segment destinations. Example: { "All": true, "Mixpanel": false }.').optional()});import{z as r}from"@walkeros/core/dev";var o=r.object({identify:r.unknown().describe("Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.").optional(),group:r.unknown().describe("Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.").optional(),page:r.unknown().describe("Per-event page call. Resolves to { category?, name?, properties? } or true for minimal page(). Use with skip: true.").optional(),screen:r.unknown().describe("Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.").optional()}),p=n(i),m=n(o),u={};s(u,{env:()=>l,step:()=>y});var l={};s(l,{push:()=>c,simulation:()=>g});var d=()=>{};var c={analytics:{track:d,identify:d,group:d,page:d,screen:d,closeAndFlush:()=>Promise.resolve()}},g=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen"],y={};s(y,{anonymousOnly:()=>S,companyGroup:()=>I,consentForwarding:()=>A,defaultTrack:()=>w,destinationIdentify:()=>b,mappedEventName:()=>f,pageView:()=>h,screenView:()=>D,userLoginIdentify:()=>k,wildcardIgnored:()=>P});import{getEvent as v}from"@walkeros/core";var w={in:v("product view",{timestamp:1700000100,user:{id:"us3r",session:"s3ss10n"}}),out:["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000100)}]},f={in:v("order complete",{timestamp:1700000101,user:{id:"us3r",session:"s3ss10n"}}),mapping:{name:"Order Completed"},out:["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"Order Completed",properties:{},timestamp:new Date(1700000101)}]},b={in:v("page view",{timestamp:1700000102,user:{id:"us3r",session:"s3ss10n",email:"user@example.com"}}),settings:{identify:{map:{traits:{map:{email:"user.email"}}}}},out:[["analytics.identify",{userId:"us3r",anonymousId:"s3ss10n",traits:{email:"user@example.com"},timestamp:new Date(1700000102)}],["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"page view",properties:{},timestamp:new Date(1700000102)}]]},k={in:v("user login",{timestamp:1700000103,user:{id:"us3r",session:"s3ss10n"},data:{user_id:"new-user-123",email:"user@acme.com",name:"Jane Doe",plan:"premium"}}),mapping:{skip:!0,settings:{identify:{map:{userId:"data.user_id",traits:{map:{email:"data.email",name:"data.name",plan:"data.plan"}}}}}},out:["analytics.identify",{userId:"new-user-123",anonymousId:"s3ss10n",traits:{email:"user@acme.com",name:"Jane Doe",plan:"premium"},timestamp:new Date(1700000103)}]},I={in:v("company update",{timestamp:1700000104,user:{id:"us3r",session:"s3ss10n"},data:{company_id:"comp-456",company_name:"Acme",industry:"tech",employees:50}}),mapping:{skip:!0,settings:{group:{map:{groupId:"data.company_id",traits:{map:{name:"data.company_name",industry:"data.industry",employees:"data.employees"}}}}}},out:["analytics.group",{userId:"us3r",anonymousId:"s3ss10n",groupId:"comp-456",traits:{name:"Acme",industry:"tech",employees:50},timestamp:new Date(1700000104)}]},h={in:v("page view",{timestamp:1700000105,user:{id:"us3r",session:"s3ss10n"},data:{category:"docs",title:"Getting Started",section:"tutorials"}}),mapping:{skip:!0,settings:{page:{map:{category:"data.category",name:"data.title",properties:{map:{section:"data.section"}}}}}},out:["analytics.page",{userId:"us3r",anonymousId:"s3ss10n",category:"docs",name:"Getting Started",properties:{section:"tutorials"},timestamp:new Date(1700000105)}]},D={in:v("screen view",{timestamp:1700000106,user:{id:"us3r",session:"s3ss10n"},data:{screen_name:"Welcome",section:"onboarding",build:"1.2.3"}}),mapping:{skip:!0,settings:{screen:{map:{name:"data.screen_name",category:"data.section",properties:{map:{build:"data.build"}}}}}},out:["analytics.screen",{userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",category:"onboarding",properties:{build:"1.2.3"},timestamp:new Date(1700000106)}]},S={in:v("product view",{timestamp:1700000107,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:["analytics.track",{anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000107)}]},A={in:v("product view",{timestamp:1700000108,user:{id:"us3r",session:"s3ss10n"},consent:{analytics:!0,marketing:!0}}),settings:{consent:{analytics:"Analytics",marketing:"Advertising"}},out:["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108),context:{consent:{categoryPreferences:{Analytics:!0,Advertising:!0}}}}]},P={in:v("debug noise",{timestamp:1700000109,user:{id:"us3r",session:"s3ss10n"}}),mapping:{ignore:!0},out:[]};export{u as examples,t as schemas};//# sourceMappingURL=dev.mjs.map
|
|
1
|
+
var e=Object.defineProperty,s=(s,t)=>{for(var n in t)e(s,n,{get:t[n],enumerable:!0})},t={};s(t,{MappingSchema:()=>o,SettingsSchema:()=>i,mapping:()=>m,settings:()=>p});import{zodToSchema as n}from"@walkeros/core/dev";import{z as a}from"@walkeros/core/dev";var i=a.object({writeKey:a.string().min(1).describe("Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys."),userId:a.string().describe("walkerOS mapping value path to resolve userId from each event (like user.id).").optional(),anonymousId:a.string().describe("walkerOS mapping value path to resolve anonymousId from each event (like user.session).").optional(),host:a.string().url().describe("Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.").optional(),path:a.string().describe("API path route (like /v1/batch).").optional(),flushAt:a.number().int().positive().describe("Events to enqueue before flushing a batch. Default: 15.").optional(),flushInterval:a.number().int().positive().describe("Max milliseconds before auto-flush. Default: 10000.").optional(),maxRetries:a.number().int().min(0).describe("Retry attempts for failed batches. Default: 3.").optional(),httpRequestTimeout:a.number().int().positive().describe("HTTP request timeout in milliseconds. Default: 10000.").optional(),disable:a.boolean().describe("Completely disable the SDK (no-ops all calls). Default: false.").optional(),identify:a.unknown().describe("Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.").optional(),group:a.unknown().describe("Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.").optional(),consent:a.record(a.string(),a.string()).describe('Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { "marketing": "Advertising", "analytics": "Analytics" }.').optional(),integrations:a.record(a.string(),a.unknown()).describe('Enable/disable downstream Segment destinations. Example: { "All": true, "Mixpanel": false }.').optional()});import{z as r}from"@walkeros/core/dev";var o=r.object({identify:r.unknown().describe("Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.").optional(),group:r.unknown().describe("Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.").optional(),page:r.unknown().describe("Per-event page call. Resolves to { category?, name?, properties? } or true for minimal page(). Use with skip: true.").optional(),screen:r.unknown().describe("Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.").optional()}),p=n(i),m=n(o),u={};s(u,{env:()=>l,step:()=>y});var l={};s(l,{push:()=>c,simulation:()=>g});var d=()=>{};var c={analytics:{track:d,identify:d,group:d,page:d,screen:d,closeAndFlush:()=>Promise.resolve()}},g=["call:analytics.track","call:analytics.identify","call:analytics.group","call:analytics.page","call:analytics.screen"],y={};s(y,{anonymousOnly:()=>S,companyGroup:()=>I,consentForwarding:()=>A,defaultTrack:()=>w,destinationIdentify:()=>b,mappedEventName:()=>f,pageView:()=>h,screenView:()=>D,userLoginIdentify:()=>k,wildcardIgnored:()=>P});import{getEvent as v}from"@walkeros/core";var w={in:v("product view",{timestamp:1700000100,user:{id:"us3r",session:"s3ss10n"}}),out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000100)}]]},f={in:v("order complete",{timestamp:1700000101,user:{id:"us3r",session:"s3ss10n"}}),mapping:{name:"Order Completed"},out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"Order Completed",properties:{},timestamp:new Date(1700000101)}]]},b={in:v("page view",{timestamp:1700000102,user:{id:"us3r",session:"s3ss10n",email:"user@example.com"}}),settings:{identify:{map:{traits:{map:{email:"user.email"}}}}},out:[["analytics.identify",{userId:"us3r",anonymousId:"s3ss10n",traits:{email:"user@example.com"},timestamp:new Date(1700000102)}],["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"page view",properties:{},timestamp:new Date(1700000102)}]]},k={in:v("user login",{timestamp:1700000103,user:{id:"us3r",session:"s3ss10n"},data:{user_id:"new-user-123",email:"user@acme.com",name:"Jane Doe",plan:"premium"}}),mapping:{skip:!0,settings:{identify:{map:{userId:"data.user_id",traits:{map:{email:"data.email",name:"data.name",plan:"data.plan"}}}}}},out:[["analytics.identify",{userId:"new-user-123",anonymousId:"s3ss10n",traits:{email:"user@acme.com",name:"Jane Doe",plan:"premium"},timestamp:new Date(1700000103)}]]},I={in:v("company update",{timestamp:1700000104,user:{id:"us3r",session:"s3ss10n"},data:{company_id:"comp-456",company_name:"Acme",industry:"tech",employees:50}}),mapping:{skip:!0,settings:{group:{map:{groupId:"data.company_id",traits:{map:{name:"data.company_name",industry:"data.industry",employees:"data.employees"}}}}}},out:[["analytics.group",{userId:"us3r",anonymousId:"s3ss10n",groupId:"comp-456",traits:{name:"Acme",industry:"tech",employees:50},timestamp:new Date(1700000104)}]]},h={in:v("page view",{timestamp:1700000105,user:{id:"us3r",session:"s3ss10n"},data:{category:"docs",title:"Getting Started",section:"tutorials"}}),mapping:{skip:!0,settings:{page:{map:{category:"data.category",name:"data.title",properties:{map:{section:"data.section"}}}}}},out:[["analytics.page",{userId:"us3r",anonymousId:"s3ss10n",category:"docs",name:"Getting Started",properties:{section:"tutorials"},timestamp:new Date(1700000105)}]]},D={in:v("screen view",{timestamp:1700000106,user:{id:"us3r",session:"s3ss10n"},data:{screen_name:"Welcome",section:"onboarding",build:"1.2.3"}}),mapping:{skip:!0,settings:{screen:{map:{name:"data.screen_name",category:"data.section",properties:{map:{build:"data.build"}}}}}},out:[["analytics.screen",{userId:"us3r",anonymousId:"s3ss10n",name:"Welcome",category:"onboarding",properties:{build:"1.2.3"},timestamp:new Date(1700000106)}]]},S={in:v("product view",{timestamp:1700000107,user:{session:"s3ss10n"}}),settings:{userId:void 0},out:[["analytics.track",{anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000107)}]]},A={in:v("product view",{timestamp:1700000108,user:{id:"us3r",session:"s3ss10n"},consent:{analytics:!0,marketing:!0}}),settings:{consent:{analytics:"Analytics",marketing:"Advertising"}},out:[["analytics.track",{userId:"us3r",anonymousId:"s3ss10n",event:"product view",properties:{},timestamp:new Date(1700000108),context:{consent:{categoryPreferences:{Analytics:!0,Advertising:!0}}}}]]},P={in:v("debug noise",{timestamp:1700000109,user:{id:"us3r",session:"s3ss10n"}}),mapping:{ignore:!0},out:[]};export{u as examples,t 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 writeKey: z\n .string()\n .min(1)\n .describe(\n 'Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys.',\n ),\n userId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve userId from each event (like user.id).',\n )\n .optional(),\n anonymousId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve anonymousId from each event (like user.session).',\n )\n .optional(),\n host: z\n .string()\n .url()\n .describe(\n 'Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.',\n )\n .optional(),\n path: z.string().describe('API path route (like /v1/batch).').optional(),\n flushAt: z\n .number()\n .int()\n .positive()\n .describe('Events to enqueue before flushing a batch. Default: 15.')\n .optional(),\n flushInterval: z\n .number()\n .int()\n .positive()\n .describe('Max milliseconds before auto-flush. Default: 10000.')\n .optional(),\n maxRetries: z\n .number()\n .int()\n .min(0)\n .describe('Retry attempts for failed batches. Default: 3.')\n .optional(),\n httpRequestTimeout: z\n .number()\n .int()\n .positive()\n .describe('HTTP request timeout in milliseconds. Default: 10000.')\n .optional(),\n disable: z\n .boolean()\n .describe('Completely disable the SDK (no-ops all calls). Default: false.')\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.',\n )\n .optional(),\n consent: z\n .record(z.string(), z.string())\n .describe(\n 'Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { \"marketing\": \"Advertising\", \"analytics\": \"Analytics\" }.',\n )\n .optional(),\n integrations: z\n .record(z.string(), z.unknown())\n .describe(\n 'Enable/disable downstream Segment destinations. Example: { \"All\": true, \"Mixpanel\": false }.',\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 identify: z\n .unknown()\n .describe(\n 'Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.',\n )\n .optional(),\n page: z\n .unknown()\n .describe(\n 'Per-event page call. Resolves to { category?, name?, properties? } or true for minimal page(). Use with skip: true.',\n )\n .optional(),\n screen: z\n .unknown()\n .describe(\n 'Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.',\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, SegmentAnalyticsMock } from '../types';\n\nconst noop = () => {};\nconst asyncNoop = () => Promise.resolve();\n\nfunction createMockAnalytics(): SegmentAnalyticsMock {\n return {\n track: noop,\n identify: noop,\n group: noop,\n page: noop,\n screen: noop,\n closeAndFlush: asyncNoop,\n };\n}\n\nexport const push: Env = {\n analytics: createMockAnalytics(),\n};\n\nexport const simulation = [\n 'call:analytics.track',\n 'call:analytics.identify',\n 'call:analytics.group',\n 'call:analytics.page',\n 'call:analytics.screen',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type SegmentStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Default event forwarding -- analytics.track() with event name and empty\n * properties. userId resolved from default settings.userId = 'user.id'.\n */\nexport const defaultTrack: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000100,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n out: [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000100),\n },\n ],\n};\n\n/**\n * Mapped event name -- mapping.name renames the event for Segment.\n */\nexport const mappedEventName: SegmentStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000101,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: {\n name: 'Order Completed',\n },\n out: [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'Order Completed',\n properties: {},\n timestamp: new Date(1700000101),\n },\n ],\n};\n\n/**\n * Destination-level identify -- fires analytics.identify() on first push\n * when settings.identify mapping resolves. Then fires analytics.track().\n */\nexport const destinationIdentify: SegmentStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000102,\n user: { id: 'us3r', session: 's3ss10n', email: 'user@example.com' },\n }),\n settings: {\n identify: {\n map: {\n traits: {\n map: {\n email: 'user.email',\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.identify',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n traits: { email: 'user@example.com' },\n timestamp: new Date(1700000102),\n },\n ],\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'page view',\n properties: {},\n timestamp: new Date(1700000102),\n },\n ],\n ],\n};\n\n/**\n * Per-event identify with skip -- user login fires identify() only.\n */\nexport const userLoginIdentify: SegmentStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000103,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n user_id: 'new-user-123',\n email: 'user@acme.com',\n name: 'Jane Doe',\n plan: 'premium',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n userId: 'data.user_id',\n traits: {\n map: {\n email: 'data.email',\n name: 'data.name',\n plan: 'data.plan',\n },\n },\n },\n },\n },\n },\n out: [\n 'analytics.identify',\n {\n userId: 'new-user-123',\n anonymousId: 's3ss10n',\n traits: { email: 'user@acme.com', name: 'Jane Doe', plan: 'premium' },\n timestamp: new Date(1700000103),\n },\n ],\n};\n\n/**\n * Per-event group with skip -- company update fires group() only.\n */\nexport const companyGroup: SegmentStepExample = {\n in: getEvent('company update', {\n timestamp: 1700000104,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n company_id: 'comp-456',\n company_name: 'Acme',\n industry: 'tech',\n employees: 50,\n },\n }),\n mapping: {\n skip: true,\n settings: {\n group: {\n map: {\n groupId: 'data.company_id',\n traits: {\n map: {\n name: 'data.company_name',\n industry: 'data.industry',\n employees: 'data.employees',\n },\n },\n },\n },\n },\n },\n out: [\n 'analytics.group',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n groupId: 'comp-456',\n traits: { name: 'Acme', industry: 'tech', employees: 50 },\n timestamp: new Date(1700000104),\n },\n ],\n};\n\n/**\n * Explicit page() call with properties -- the canonical Segment page view.\n * skip: true suppresses track(); settings.page fires analytics.page().\n */\nexport const pageView: SegmentStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000105,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n category: 'docs',\n title: 'Getting Started',\n section: 'tutorials',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n page: {\n map: {\n category: 'data.category',\n name: 'data.title',\n properties: {\n map: {\n section: 'data.section',\n },\n },\n },\n },\n },\n },\n out: [\n 'analytics.page',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n category: 'docs',\n name: 'Getting Started',\n properties: { section: 'tutorials' },\n timestamp: new Date(1700000105),\n },\n ],\n};\n\n/**\n * Screen call -- server-only method for mobile app backends.\n */\nexport const screenView: SegmentStepExample = {\n in: getEvent('screen view', {\n timestamp: 1700000106,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n screen_name: 'Welcome',\n section: 'onboarding',\n build: '1.2.3',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n screen: {\n map: {\n name: 'data.screen_name',\n category: 'data.section',\n properties: {\n map: {\n build: 'data.build',\n },\n },\n },\n },\n },\n },\n out: [\n 'analytics.screen',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n name: 'Welcome',\n category: 'onboarding',\n properties: { build: '1.2.3' },\n timestamp: new Date(1700000106),\n },\n ],\n};\n\n/**\n * AnonymousId only -- no userId resolved. Segment accepts anonymousId alone.\n */\nexport const anonymousOnly: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000107,\n user: { session: 's3ss10n' },\n }),\n settings: {\n userId: undefined,\n },\n out: [\n 'analytics.track',\n {\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000107),\n },\n ],\n};\n\n/**\n * Consent context forwarding -- settings.consent maps walkerOS consent\n * keys to Segment categoryPreferences on the context object.\n */\nexport const consentForwarding: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000108,\n user: { id: 'us3r', session: 's3ss10n' },\n consent: { analytics: true, marketing: true },\n }),\n settings: {\n consent: {\n analytics: 'Analytics',\n marketing: 'Advertising',\n },\n },\n out: [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000108),\n context: {\n consent: {\n categoryPreferences: {\n Analytics: true,\n Advertising: true,\n },\n },\n },\n },\n ],\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: SegmentStepExample = {\n in: getEvent('debug noise', {\n timestamp: 1700000109,\n user: { id: 'us3r', session: 's3ss10n' },\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,UAAU,EACP,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,EACL,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,EACV,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,EACH,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,MAAM,EAAE,OAAO,EAAE,SAAS,kCAAkC,EAAE,SAAS;AAAA,EACvE,SAAS,EACN,OAAO,EACP,IAAI,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IACvC,SAAS,EAAE,WAAW,MAAM,WAAW,KAAK;AAAA,EAC9C,CAAC;AAAA,EACD,UAAU;AAAA,IACR,SAAS;AAAA,MACP,WAAW;AAAA,MACX,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,OAAO;AAAA,MACP,YAAY,CAAC;AAAA,MACb,WAAW,oBAAI,KAAK,UAAU;AAAA,MAC9B,SAAS;AAAA,QACP,SAAS;AAAA,UACP,qBAAqB;AAAA,YACnB,WAAW;AAAA,YACX,aAAa;AAAA,UACf;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,kBAAsC;AAAA,EACjD,IAAI,SAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,EACzC,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 writeKey: z\n .string()\n .min(1)\n .describe(\n 'Segment source write key. Find it in your Segment workspace under Connections > Sources > Settings > API Keys.',\n ),\n userId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve userId from each event (like user.id).',\n )\n .optional(),\n anonymousId: z\n .string()\n .describe(\n 'walkerOS mapping value path to resolve anonymousId from each event (like user.session).',\n )\n .optional(),\n host: z\n .string()\n .url()\n .describe(\n 'Base URL of Segment API. Set to https://events.eu1.segmentapis.com for EU endpoint.',\n )\n .optional(),\n path: z.string().describe('API path route (like /v1/batch).').optional(),\n flushAt: z\n .number()\n .int()\n .positive()\n .describe('Events to enqueue before flushing a batch. Default: 15.')\n .optional(),\n flushInterval: z\n .number()\n .int()\n .positive()\n .describe('Max milliseconds before auto-flush. Default: 10000.')\n .optional(),\n maxRetries: z\n .number()\n .int()\n .min(0)\n .describe('Retry attempts for failed batches. Default: 3.')\n .optional(),\n httpRequestTimeout: z\n .number()\n .int()\n .positive()\n .describe('HTTP request timeout in milliseconds. Default: 10000.')\n .optional(),\n disable: z\n .boolean()\n .describe('Completely disable the SDK (no-ops all calls). Default: false.')\n .optional(),\n identify: z\n .unknown()\n .describe(\n 'Destination-level identity mapping. Resolves to { traits } object. Fires identify() on the first push and re-fires when values change.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Destination-level group mapping. Resolves to { groupId, traits }. Fires group() on the first push and re-fires on change.',\n )\n .optional(),\n consent: z\n .record(z.string(), z.string())\n .describe(\n 'Mapping from walkerOS consent keys to Segment categoryPreferences keys. Example: { \"marketing\": \"Advertising\", \"analytics\": \"Analytics\" }.',\n )\n .optional(),\n integrations: z\n .record(z.string(), z.unknown())\n .describe(\n 'Enable/disable downstream Segment destinations. Example: { \"All\": true, \"Mixpanel\": false }.',\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 identify: z\n .unknown()\n .describe(\n 'Per-event identity mapping. Resolves to { userId?, traits? }. Use with rule-level skip: true on login/identify events.',\n )\n .optional(),\n group: z\n .unknown()\n .describe(\n 'Per-event group assignment. Resolves to { groupId, traits? }. Use with rule-level skip: true on company/team events.',\n )\n .optional(),\n page: z\n .unknown()\n .describe(\n 'Per-event page call. Resolves to { category?, name?, properties? } or true for minimal page(). Use with skip: true.',\n )\n .optional(),\n screen: z\n .unknown()\n .describe(\n 'Per-event screen call (mobile backends). Resolves to { category?, name?, properties? } or true for minimal screen(). Use with skip: true.',\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, SegmentAnalyticsMock } from '../types';\n\nconst noop = () => {};\nconst asyncNoop = () => Promise.resolve();\n\nfunction createMockAnalytics(): SegmentAnalyticsMock {\n return {\n track: noop,\n identify: noop,\n group: noop,\n page: noop,\n screen: noop,\n closeAndFlush: asyncNoop,\n };\n}\n\nexport const push: Env = {\n analytics: createMockAnalytics(),\n};\n\nexport const simulation = [\n 'call:analytics.track',\n 'call:analytics.identify',\n 'call:analytics.group',\n 'call:analytics.page',\n 'call:analytics.screen',\n];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\nimport type { Settings } from '../types';\n\n/**\n * Extended step example that may carry destination-level settings overrides.\n */\nexport type SegmentStepExample = Flow.StepExample & {\n settings?: Partial<Settings>;\n};\n\n/**\n * Segment server destination invokes the injected `env.analytics` SDK methods\n * (`track`, `identify`, `group`, `page`, `screen`) — not a raw HTTP endpoint.\n * Each `out` entry is therefore `[callable, params]` where `callable` is the\n * dotted method name (e.g. `'analytics.track'`) and `params` is the object\n * passed to the SDK.\n *\n * Examples may emit multiple calls in order (e.g. identify + track), so\n * every `out` is wrapped as `[[callable, params], ...]`.\n */\n\n/**\n * Default event forwarding -- analytics.track() with event name and empty\n * properties. userId resolved from default settings.userId = 'user.id'.\n */\nexport const defaultTrack: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000100,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000100),\n },\n ],\n ],\n};\n\n/**\n * Mapped event name -- mapping.name renames the event for Segment.\n */\nexport const mappedEventName: SegmentStepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000101,\n user: { id: 'us3r', session: 's3ss10n' },\n }),\n mapping: {\n name: 'Order Completed',\n },\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'Order Completed',\n properties: {},\n timestamp: new Date(1700000101),\n },\n ],\n ],\n};\n\n/**\n * Destination-level identify -- fires analytics.identify() on first push\n * when settings.identify mapping resolves. Then fires analytics.track().\n */\nexport const destinationIdentify: SegmentStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000102,\n user: { id: 'us3r', session: 's3ss10n', email: 'user@example.com' },\n }),\n settings: {\n identify: {\n map: {\n traits: {\n map: {\n email: 'user.email',\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.identify',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n traits: { email: 'user@example.com' },\n timestamp: new Date(1700000102),\n },\n ],\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'page view',\n properties: {},\n timestamp: new Date(1700000102),\n },\n ],\n ],\n};\n\n/**\n * Per-event identify with skip -- user login fires identify() only.\n */\nexport const userLoginIdentify: SegmentStepExample = {\n in: getEvent('user login', {\n timestamp: 1700000103,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n user_id: 'new-user-123',\n email: 'user@acme.com',\n name: 'Jane Doe',\n plan: 'premium',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n identify: {\n map: {\n userId: 'data.user_id',\n traits: {\n map: {\n email: 'data.email',\n name: 'data.name',\n plan: 'data.plan',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.identify',\n {\n userId: 'new-user-123',\n anonymousId: 's3ss10n',\n traits: { email: 'user@acme.com', name: 'Jane Doe', plan: 'premium' },\n timestamp: new Date(1700000103),\n },\n ],\n ],\n};\n\n/**\n * Per-event group with skip -- company update fires group() only.\n */\nexport const companyGroup: SegmentStepExample = {\n in: getEvent('company update', {\n timestamp: 1700000104,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n company_id: 'comp-456',\n company_name: 'Acme',\n industry: 'tech',\n employees: 50,\n },\n }),\n mapping: {\n skip: true,\n settings: {\n group: {\n map: {\n groupId: 'data.company_id',\n traits: {\n map: {\n name: 'data.company_name',\n industry: 'data.industry',\n employees: 'data.employees',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.group',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n groupId: 'comp-456',\n traits: { name: 'Acme', industry: 'tech', employees: 50 },\n timestamp: new Date(1700000104),\n },\n ],\n ],\n};\n\n/**\n * Explicit page() call with properties -- the canonical Segment page view.\n * skip: true suppresses track(); settings.page fires analytics.page().\n */\nexport const pageView: SegmentStepExample = {\n in: getEvent('page view', {\n timestamp: 1700000105,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n category: 'docs',\n title: 'Getting Started',\n section: 'tutorials',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n page: {\n map: {\n category: 'data.category',\n name: 'data.title',\n properties: {\n map: {\n section: 'data.section',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.page',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n category: 'docs',\n name: 'Getting Started',\n properties: { section: 'tutorials' },\n timestamp: new Date(1700000105),\n },\n ],\n ],\n};\n\n/**\n * Screen call -- server-only method for mobile app backends.\n */\nexport const screenView: SegmentStepExample = {\n in: getEvent('screen view', {\n timestamp: 1700000106,\n user: { id: 'us3r', session: 's3ss10n' },\n data: {\n screen_name: 'Welcome',\n section: 'onboarding',\n build: '1.2.3',\n },\n }),\n mapping: {\n skip: true,\n settings: {\n screen: {\n map: {\n name: 'data.screen_name',\n category: 'data.section',\n properties: {\n map: {\n build: 'data.build',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'analytics.screen',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n name: 'Welcome',\n category: 'onboarding',\n properties: { build: '1.2.3' },\n timestamp: new Date(1700000106),\n },\n ],\n ],\n};\n\n/**\n * AnonymousId only -- no userId resolved. Segment accepts anonymousId alone.\n */\nexport const anonymousOnly: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000107,\n user: { session: 's3ss10n' },\n }),\n settings: {\n userId: undefined,\n },\n out: [\n [\n 'analytics.track',\n {\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000107),\n },\n ],\n ],\n};\n\n/**\n * Consent context forwarding -- settings.consent maps walkerOS consent\n * keys to Segment categoryPreferences on the context object.\n */\nexport const consentForwarding: SegmentStepExample = {\n in: getEvent('product view', {\n timestamp: 1700000108,\n user: { id: 'us3r', session: 's3ss10n' },\n consent: { analytics: true, marketing: true },\n }),\n settings: {\n consent: {\n analytics: 'Analytics',\n marketing: 'Advertising',\n },\n },\n out: [\n [\n 'analytics.track',\n {\n userId: 'us3r',\n anonymousId: 's3ss10n',\n event: 'product view',\n properties: {},\n timestamp: new Date(1700000108),\n context: {\n consent: {\n categoryPreferences: {\n Analytics: true,\n Advertising: true,\n },\n },\n },\n },\n ],\n ],\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: SegmentStepExample = {\n in: getEvent('debug noise', {\n timestamp: 1700000109,\n user: { id: 'us3r', session: 's3ss10n' },\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,UAAU,EACP,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,QAAQ,EACL,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,aAAa,EACV,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ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AAQ;AAAA,EACV;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,QACP,YAAY,CAAC;AAAA,QACb,WAAW,oBAAI,KAAK,UAAU;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,oBAAwC;AAAA,EACnD,IAAI,SAAS,gBAAgB;AAAA,IAC3B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,IACvC,SAAS,EAAE,WAAW,MAAM,WAAW,KAAK;AAAA,EAC9C,CAAC;AAAA,EACD,UAAU;AAAA,IACR,SAAS;AAAA,MACP,WAAW;AAAA,MACX,WAAW;AAAA,IACb;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,QACE,QAAQ;AAAA,QACR,aAAa;AAAA,QACb,OAAO;AAAA,QACP,YAAY,CAAC;AAAA,QACb,WAAW,oBAAI,KAAK,UAAU;AAAA,QAC9B,SAAS;AAAA,UACP,SAAS;AAAA,YACP,qBAAqB;AAAA,cACnB,WAAW;AAAA,cACX,aAAa;AAAA,YACf;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAMO,IAAM,kBAAsC;AAAA,EACjD,IAAI,SAAS,eAAe;AAAA,IAC1B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,QAAQ,SAAS,UAAU;AAAA,EACzC,CAAC;AAAA,EACD,SAAS,EAAE,QAAQ,KAAK;AAAA,EACxB,KAAK,CAAC;AACR;","names":["z"]}
|
|
@@ -85,6 +85,16 @@ declare namespace env {
|
|
|
85
85
|
type SegmentStepExample = Flow.StepExample & {
|
|
86
86
|
settings?: Partial<Settings>;
|
|
87
87
|
};
|
|
88
|
+
/**
|
|
89
|
+
* Segment server destination invokes the injected `env.analytics` SDK methods
|
|
90
|
+
* (`track`, `identify`, `group`, `page`, `screen`) — not a raw HTTP endpoint.
|
|
91
|
+
* Each `out` entry is therefore `[callable, params]` where `callable` is the
|
|
92
|
+
* dotted method name (e.g. `'analytics.track'`) and `params` is the object
|
|
93
|
+
* passed to the SDK.
|
|
94
|
+
*
|
|
95
|
+
* Examples may emit multiple calls in order (e.g. identify + track), so
|
|
96
|
+
* every `out` is wrapped as `[[callable, params], ...]`.
|
|
97
|
+
*/
|
|
88
98
|
/**
|
|
89
99
|
* Default event forwarding -- analytics.track() with event name and empty
|
|
90
100
|
* properties. userId resolved from default settings.userId = 'user.id'.
|
package/dist/examples/index.d.ts
CHANGED
|
@@ -85,6 +85,16 @@ declare namespace env {
|
|
|
85
85
|
type SegmentStepExample = Flow.StepExample & {
|
|
86
86
|
settings?: Partial<Settings>;
|
|
87
87
|
};
|
|
88
|
+
/**
|
|
89
|
+
* Segment server destination invokes the injected `env.analytics` SDK methods
|
|
90
|
+
* (`track`, `identify`, `group`, `page`, `screen`) — not a raw HTTP endpoint.
|
|
91
|
+
* Each `out` entry is therefore `[callable, params]` where `callable` is the
|
|
92
|
+
* dotted method name (e.g. `'analytics.track'`) and `params` is the object
|
|
93
|
+
* passed to the SDK.
|
|
94
|
+
*
|
|
95
|
+
* Examples may emit multiple calls in order (e.g. identify + track), so
|
|
96
|
+
* every `out` is wrapped as `[[callable, params], ...]`.
|
|
97
|
+
*/
|
|
88
98
|
/**
|
|
89
99
|
* Default event forwarding -- analytics.track() with event name and empty
|
|
90
100
|
* properties. userId resolved from default settings.userId = 'user.id'.
|
package/dist/examples/index.js
CHANGED
|
@@ -76,14 +76,16 @@ var defaultTrack = {
|
|
|
76
76
|
user: { id: "us3r", session: "s3ss10n" }
|
|
77
77
|
}),
|
|
78
78
|
out: [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
[
|
|
80
|
+
"analytics.track",
|
|
81
|
+
{
|
|
82
|
+
userId: "us3r",
|
|
83
|
+
anonymousId: "s3ss10n",
|
|
84
|
+
event: "product view",
|
|
85
|
+
properties: {},
|
|
86
|
+
timestamp: /* @__PURE__ */ new Date(1700000100)
|
|
87
|
+
}
|
|
88
|
+
]
|
|
87
89
|
]
|
|
88
90
|
};
|
|
89
91
|
var mappedEventName = {
|
|
@@ -95,14 +97,16 @@ var mappedEventName = {
|
|
|
95
97
|
name: "Order Completed"
|
|
96
98
|
},
|
|
97
99
|
out: [
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
[
|
|
101
|
+
"analytics.track",
|
|
102
|
+
{
|
|
103
|
+
userId: "us3r",
|
|
104
|
+
anonymousId: "s3ss10n",
|
|
105
|
+
event: "Order Completed",
|
|
106
|
+
properties: {},
|
|
107
|
+
timestamp: /* @__PURE__ */ new Date(1700000101)
|
|
108
|
+
}
|
|
109
|
+
]
|
|
106
110
|
]
|
|
107
111
|
};
|
|
108
112
|
var destinationIdentify = {
|
|
@@ -172,13 +176,15 @@ var userLoginIdentify = {
|
|
|
172
176
|
}
|
|
173
177
|
},
|
|
174
178
|
out: [
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
179
|
+
[
|
|
180
|
+
"analytics.identify",
|
|
181
|
+
{
|
|
182
|
+
userId: "new-user-123",
|
|
183
|
+
anonymousId: "s3ss10n",
|
|
184
|
+
traits: { email: "user@acme.com", name: "Jane Doe", plan: "premium" },
|
|
185
|
+
timestamp: /* @__PURE__ */ new Date(1700000103)
|
|
186
|
+
}
|
|
187
|
+
]
|
|
182
188
|
]
|
|
183
189
|
};
|
|
184
190
|
var companyGroup = {
|
|
@@ -210,14 +216,16 @@ var companyGroup = {
|
|
|
210
216
|
}
|
|
211
217
|
},
|
|
212
218
|
out: [
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
[
|
|
220
|
+
"analytics.group",
|
|
221
|
+
{
|
|
222
|
+
userId: "us3r",
|
|
223
|
+
anonymousId: "s3ss10n",
|
|
224
|
+
groupId: "comp-456",
|
|
225
|
+
traits: { name: "Acme", industry: "tech", employees: 50 },
|
|
226
|
+
timestamp: /* @__PURE__ */ new Date(1700000104)
|
|
227
|
+
}
|
|
228
|
+
]
|
|
221
229
|
]
|
|
222
230
|
};
|
|
223
231
|
var pageView = {
|
|
@@ -247,15 +255,17 @@ var pageView = {
|
|
|
247
255
|
}
|
|
248
256
|
},
|
|
249
257
|
out: [
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
258
|
+
[
|
|
259
|
+
"analytics.page",
|
|
260
|
+
{
|
|
261
|
+
userId: "us3r",
|
|
262
|
+
anonymousId: "s3ss10n",
|
|
263
|
+
category: "docs",
|
|
264
|
+
name: "Getting Started",
|
|
265
|
+
properties: { section: "tutorials" },
|
|
266
|
+
timestamp: /* @__PURE__ */ new Date(1700000105)
|
|
267
|
+
}
|
|
268
|
+
]
|
|
259
269
|
]
|
|
260
270
|
};
|
|
261
271
|
var screenView = {
|
|
@@ -285,15 +295,17 @@ var screenView = {
|
|
|
285
295
|
}
|
|
286
296
|
},
|
|
287
297
|
out: [
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
298
|
+
[
|
|
299
|
+
"analytics.screen",
|
|
300
|
+
{
|
|
301
|
+
userId: "us3r",
|
|
302
|
+
anonymousId: "s3ss10n",
|
|
303
|
+
name: "Welcome",
|
|
304
|
+
category: "onboarding",
|
|
305
|
+
properties: { build: "1.2.3" },
|
|
306
|
+
timestamp: /* @__PURE__ */ new Date(1700000106)
|
|
307
|
+
}
|
|
308
|
+
]
|
|
297
309
|
]
|
|
298
310
|
};
|
|
299
311
|
var anonymousOnly = {
|
|
@@ -305,13 +317,15 @@ var anonymousOnly = {
|
|
|
305
317
|
userId: void 0
|
|
306
318
|
},
|
|
307
319
|
out: [
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
320
|
+
[
|
|
321
|
+
"analytics.track",
|
|
322
|
+
{
|
|
323
|
+
anonymousId: "s3ss10n",
|
|
324
|
+
event: "product view",
|
|
325
|
+
properties: {},
|
|
326
|
+
timestamp: /* @__PURE__ */ new Date(1700000107)
|
|
327
|
+
}
|
|
328
|
+
]
|
|
315
329
|
]
|
|
316
330
|
};
|
|
317
331
|
var consentForwarding = {
|
|
@@ -327,22 +341,24 @@ var consentForwarding = {
|
|
|
327
341
|
}
|
|
328
342
|
},
|
|
329
343
|
out: [
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
344
|
+
[
|
|
345
|
+
"analytics.track",
|
|
346
|
+
{
|
|
347
|
+
userId: "us3r",
|
|
348
|
+
anonymousId: "s3ss10n",
|
|
349
|
+
event: "product view",
|
|
350
|
+
properties: {},
|
|
351
|
+
timestamp: /* @__PURE__ */ new Date(1700000108),
|
|
352
|
+
context: {
|
|
353
|
+
consent: {
|
|
354
|
+
categoryPreferences: {
|
|
355
|
+
Analytics: true,
|
|
356
|
+
Advertising: true
|
|
357
|
+
}
|
|
342
358
|
}
|
|
343
359
|
}
|
|
344
360
|
}
|
|
345
|
-
|
|
361
|
+
]
|
|
346
362
|
]
|
|
347
363
|
};
|
|
348
364
|
var wildcardIgnored = {
|
package/dist/examples/index.mjs
CHANGED
|
@@ -55,14 +55,16 @@ var defaultTrack = {
|
|
|
55
55
|
user: { id: "us3r", session: "s3ss10n" }
|
|
56
56
|
}),
|
|
57
57
|
out: [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
[
|
|
59
|
+
"analytics.track",
|
|
60
|
+
{
|
|
61
|
+
userId: "us3r",
|
|
62
|
+
anonymousId: "s3ss10n",
|
|
63
|
+
event: "product view",
|
|
64
|
+
properties: {},
|
|
65
|
+
timestamp: /* @__PURE__ */ new Date(1700000100)
|
|
66
|
+
}
|
|
67
|
+
]
|
|
66
68
|
]
|
|
67
69
|
};
|
|
68
70
|
var mappedEventName = {
|
|
@@ -74,14 +76,16 @@ var mappedEventName = {
|
|
|
74
76
|
name: "Order Completed"
|
|
75
77
|
},
|
|
76
78
|
out: [
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
[
|
|
80
|
+
"analytics.track",
|
|
81
|
+
{
|
|
82
|
+
userId: "us3r",
|
|
83
|
+
anonymousId: "s3ss10n",
|
|
84
|
+
event: "Order Completed",
|
|
85
|
+
properties: {},
|
|
86
|
+
timestamp: /* @__PURE__ */ new Date(1700000101)
|
|
87
|
+
}
|
|
88
|
+
]
|
|
85
89
|
]
|
|
86
90
|
};
|
|
87
91
|
var destinationIdentify = {
|
|
@@ -151,13 +155,15 @@ var userLoginIdentify = {
|
|
|
151
155
|
}
|
|
152
156
|
},
|
|
153
157
|
out: [
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
[
|
|
159
|
+
"analytics.identify",
|
|
160
|
+
{
|
|
161
|
+
userId: "new-user-123",
|
|
162
|
+
anonymousId: "s3ss10n",
|
|
163
|
+
traits: { email: "user@acme.com", name: "Jane Doe", plan: "premium" },
|
|
164
|
+
timestamp: /* @__PURE__ */ new Date(1700000103)
|
|
165
|
+
}
|
|
166
|
+
]
|
|
161
167
|
]
|
|
162
168
|
};
|
|
163
169
|
var companyGroup = {
|
|
@@ -189,14 +195,16 @@ var companyGroup = {
|
|
|
189
195
|
}
|
|
190
196
|
},
|
|
191
197
|
out: [
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
[
|
|
199
|
+
"analytics.group",
|
|
200
|
+
{
|
|
201
|
+
userId: "us3r",
|
|
202
|
+
anonymousId: "s3ss10n",
|
|
203
|
+
groupId: "comp-456",
|
|
204
|
+
traits: { name: "Acme", industry: "tech", employees: 50 },
|
|
205
|
+
timestamp: /* @__PURE__ */ new Date(1700000104)
|
|
206
|
+
}
|
|
207
|
+
]
|
|
200
208
|
]
|
|
201
209
|
};
|
|
202
210
|
var pageView = {
|
|
@@ -226,15 +234,17 @@ var pageView = {
|
|
|
226
234
|
}
|
|
227
235
|
},
|
|
228
236
|
out: [
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
237
|
+
[
|
|
238
|
+
"analytics.page",
|
|
239
|
+
{
|
|
240
|
+
userId: "us3r",
|
|
241
|
+
anonymousId: "s3ss10n",
|
|
242
|
+
category: "docs",
|
|
243
|
+
name: "Getting Started",
|
|
244
|
+
properties: { section: "tutorials" },
|
|
245
|
+
timestamp: /* @__PURE__ */ new Date(1700000105)
|
|
246
|
+
}
|
|
247
|
+
]
|
|
238
248
|
]
|
|
239
249
|
};
|
|
240
250
|
var screenView = {
|
|
@@ -264,15 +274,17 @@ var screenView = {
|
|
|
264
274
|
}
|
|
265
275
|
},
|
|
266
276
|
out: [
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
277
|
+
[
|
|
278
|
+
"analytics.screen",
|
|
279
|
+
{
|
|
280
|
+
userId: "us3r",
|
|
281
|
+
anonymousId: "s3ss10n",
|
|
282
|
+
name: "Welcome",
|
|
283
|
+
category: "onboarding",
|
|
284
|
+
properties: { build: "1.2.3" },
|
|
285
|
+
timestamp: /* @__PURE__ */ new Date(1700000106)
|
|
286
|
+
}
|
|
287
|
+
]
|
|
276
288
|
]
|
|
277
289
|
};
|
|
278
290
|
var anonymousOnly = {
|
|
@@ -284,13 +296,15 @@ var anonymousOnly = {
|
|
|
284
296
|
userId: void 0
|
|
285
297
|
},
|
|
286
298
|
out: [
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
299
|
+
[
|
|
300
|
+
"analytics.track",
|
|
301
|
+
{
|
|
302
|
+
anonymousId: "s3ss10n",
|
|
303
|
+
event: "product view",
|
|
304
|
+
properties: {},
|
|
305
|
+
timestamp: /* @__PURE__ */ new Date(1700000107)
|
|
306
|
+
}
|
|
307
|
+
]
|
|
294
308
|
]
|
|
295
309
|
};
|
|
296
310
|
var consentForwarding = {
|
|
@@ -306,22 +320,24 @@ var consentForwarding = {
|
|
|
306
320
|
}
|
|
307
321
|
},
|
|
308
322
|
out: [
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
323
|
+
[
|
|
324
|
+
"analytics.track",
|
|
325
|
+
{
|
|
326
|
+
userId: "us3r",
|
|
327
|
+
anonymousId: "s3ss10n",
|
|
328
|
+
event: "product view",
|
|
329
|
+
properties: {},
|
|
330
|
+
timestamp: /* @__PURE__ */ new Date(1700000108),
|
|
331
|
+
context: {
|
|
332
|
+
consent: {
|
|
333
|
+
categoryPreferences: {
|
|
334
|
+
Analytics: true,
|
|
335
|
+
Advertising: true
|
|
336
|
+
}
|
|
321
337
|
}
|
|
322
338
|
}
|
|
323
339
|
}
|
|
324
|
-
|
|
340
|
+
]
|
|
325
341
|
]
|
|
326
342
|
};
|
|
327
343
|
var wildcardIgnored = {
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/server-destination-segment",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.4.0-next-1776749829492",
|
|
5
5
|
"type": "destination",
|
|
6
6
|
"platform": [
|
|
7
7
|
"server"
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
"group": "gr0up",
|
|
186
186
|
"count": 1,
|
|
187
187
|
"version": {
|
|
188
|
-
"source": "3.
|
|
188
|
+
"source": "3.4.0-next-1776749829492",
|
|
189
189
|
"tagging": 1
|
|
190
190
|
},
|
|
191
191
|
"source": {
|
|
@@ -196,13 +196,15 @@
|
|
|
196
196
|
},
|
|
197
197
|
"settings": {},
|
|
198
198
|
"out": [
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
199
|
+
[
|
|
200
|
+
"analytics.track",
|
|
201
|
+
{
|
|
202
|
+
"anonymousId": "s3ss10n",
|
|
203
|
+
"event": "product view",
|
|
204
|
+
"properties": {},
|
|
205
|
+
"timestamp": {}
|
|
206
|
+
}
|
|
207
|
+
]
|
|
206
208
|
]
|
|
207
209
|
},
|
|
208
210
|
"companyGroup": {
|
|
@@ -257,7 +259,7 @@
|
|
|
257
259
|
"group": "gr0up",
|
|
258
260
|
"count": 1,
|
|
259
261
|
"version": {
|
|
260
|
-
"source": "3.
|
|
262
|
+
"source": "3.4.0-next-1776749829492",
|
|
261
263
|
"tagging": 1
|
|
262
264
|
},
|
|
263
265
|
"source": {
|
|
@@ -284,18 +286,20 @@
|
|
|
284
286
|
}
|
|
285
287
|
},
|
|
286
288
|
"out": [
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
"
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
289
|
+
[
|
|
290
|
+
"analytics.group",
|
|
291
|
+
{
|
|
292
|
+
"userId": "us3r",
|
|
293
|
+
"anonymousId": "s3ss10n",
|
|
294
|
+
"groupId": "comp-456",
|
|
295
|
+
"traits": {
|
|
296
|
+
"name": "Acme",
|
|
297
|
+
"industry": "tech",
|
|
298
|
+
"employees": 50
|
|
299
|
+
},
|
|
300
|
+
"timestamp": {}
|
|
301
|
+
}
|
|
302
|
+
]
|
|
299
303
|
]
|
|
300
304
|
},
|
|
301
305
|
"consentForwarding": {
|
|
@@ -338,7 +342,7 @@
|
|
|
338
342
|
"group": "gr0up",
|
|
339
343
|
"count": 1,
|
|
340
344
|
"version": {
|
|
341
|
-
"source": "3.
|
|
345
|
+
"source": "3.4.0-next-1776749829492",
|
|
342
346
|
"tagging": 1
|
|
343
347
|
},
|
|
344
348
|
"source": {
|
|
@@ -354,22 +358,24 @@
|
|
|
354
358
|
}
|
|
355
359
|
},
|
|
356
360
|
"out": [
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
"
|
|
366
|
-
"
|
|
367
|
-
"
|
|
368
|
-
|
|
361
|
+
[
|
|
362
|
+
"analytics.track",
|
|
363
|
+
{
|
|
364
|
+
"userId": "us3r",
|
|
365
|
+
"anonymousId": "s3ss10n",
|
|
366
|
+
"event": "product view",
|
|
367
|
+
"properties": {},
|
|
368
|
+
"timestamp": {},
|
|
369
|
+
"context": {
|
|
370
|
+
"consent": {
|
|
371
|
+
"categoryPreferences": {
|
|
372
|
+
"Analytics": true,
|
|
373
|
+
"Advertising": true
|
|
374
|
+
}
|
|
369
375
|
}
|
|
370
376
|
}
|
|
371
377
|
}
|
|
372
|
-
|
|
378
|
+
]
|
|
373
379
|
]
|
|
374
380
|
},
|
|
375
381
|
"defaultTrack": {
|
|
@@ -411,7 +417,7 @@
|
|
|
411
417
|
"group": "gr0up",
|
|
412
418
|
"count": 1,
|
|
413
419
|
"version": {
|
|
414
|
-
"source": "3.
|
|
420
|
+
"source": "3.4.0-next-1776749829492",
|
|
415
421
|
"tagging": 1
|
|
416
422
|
},
|
|
417
423
|
"source": {
|
|
@@ -421,14 +427,16 @@
|
|
|
421
427
|
}
|
|
422
428
|
},
|
|
423
429
|
"out": [
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
430
|
+
[
|
|
431
|
+
"analytics.track",
|
|
432
|
+
{
|
|
433
|
+
"userId": "us3r",
|
|
434
|
+
"anonymousId": "s3ss10n",
|
|
435
|
+
"event": "product view",
|
|
436
|
+
"properties": {},
|
|
437
|
+
"timestamp": {}
|
|
438
|
+
}
|
|
439
|
+
]
|
|
432
440
|
]
|
|
433
441
|
},
|
|
434
442
|
"destinationIdentify": {
|
|
@@ -486,7 +494,7 @@
|
|
|
486
494
|
"group": "gr0up",
|
|
487
495
|
"count": 1,
|
|
488
496
|
"version": {
|
|
489
|
-
"source": "3.
|
|
497
|
+
"source": "3.4.0-next-1776749829492",
|
|
490
498
|
"tagging": 1
|
|
491
499
|
},
|
|
492
500
|
"source": {
|
|
@@ -616,7 +624,7 @@
|
|
|
616
624
|
"group": "gr0up",
|
|
617
625
|
"count": 1,
|
|
618
626
|
"version": {
|
|
619
|
-
"source": "3.
|
|
627
|
+
"source": "3.4.0-next-1776749829492",
|
|
620
628
|
"tagging": 1
|
|
621
629
|
},
|
|
622
630
|
"source": {
|
|
@@ -629,14 +637,16 @@
|
|
|
629
637
|
"name": "Order Completed"
|
|
630
638
|
},
|
|
631
639
|
"out": [
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
+
[
|
|
641
|
+
"analytics.track",
|
|
642
|
+
{
|
|
643
|
+
"userId": "us3r",
|
|
644
|
+
"anonymousId": "s3ss10n",
|
|
645
|
+
"event": "Order Completed",
|
|
646
|
+
"properties": {},
|
|
647
|
+
"timestamp": {}
|
|
648
|
+
}
|
|
649
|
+
]
|
|
640
650
|
]
|
|
641
651
|
},
|
|
642
652
|
"pageView": {
|
|
@@ -690,7 +700,7 @@
|
|
|
690
700
|
"group": "gr0up",
|
|
691
701
|
"count": 1,
|
|
692
702
|
"version": {
|
|
693
|
-
"source": "3.
|
|
703
|
+
"source": "3.4.0-next-1776749829492",
|
|
694
704
|
"tagging": 1
|
|
695
705
|
},
|
|
696
706
|
"source": {
|
|
@@ -716,17 +726,19 @@
|
|
|
716
726
|
}
|
|
717
727
|
},
|
|
718
728
|
"out": [
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
"
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
729
|
+
[
|
|
730
|
+
"analytics.page",
|
|
731
|
+
{
|
|
732
|
+
"userId": "us3r",
|
|
733
|
+
"anonymousId": "s3ss10n",
|
|
734
|
+
"category": "docs",
|
|
735
|
+
"name": "Getting Started",
|
|
736
|
+
"properties": {
|
|
737
|
+
"section": "tutorials"
|
|
738
|
+
},
|
|
739
|
+
"timestamp": {}
|
|
740
|
+
}
|
|
741
|
+
]
|
|
730
742
|
]
|
|
731
743
|
},
|
|
732
744
|
"screenView": {
|
|
@@ -780,7 +792,7 @@
|
|
|
780
792
|
"group": "gr0up",
|
|
781
793
|
"count": 1,
|
|
782
794
|
"version": {
|
|
783
|
-
"source": "3.
|
|
795
|
+
"source": "3.4.0-next-1776749829492",
|
|
784
796
|
"tagging": 1
|
|
785
797
|
},
|
|
786
798
|
"source": {
|
|
@@ -806,17 +818,19 @@
|
|
|
806
818
|
}
|
|
807
819
|
},
|
|
808
820
|
"out": [
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
"
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
821
|
+
[
|
|
822
|
+
"analytics.screen",
|
|
823
|
+
{
|
|
824
|
+
"userId": "us3r",
|
|
825
|
+
"anonymousId": "s3ss10n",
|
|
826
|
+
"name": "Welcome",
|
|
827
|
+
"category": "onboarding",
|
|
828
|
+
"properties": {
|
|
829
|
+
"build": "1.2.3"
|
|
830
|
+
},
|
|
831
|
+
"timestamp": {}
|
|
832
|
+
}
|
|
833
|
+
]
|
|
820
834
|
]
|
|
821
835
|
},
|
|
822
836
|
"userLoginIdentify": {
|
|
@@ -871,7 +885,7 @@
|
|
|
871
885
|
"group": "gr0up",
|
|
872
886
|
"count": 1,
|
|
873
887
|
"version": {
|
|
874
|
-
"source": "3.
|
|
888
|
+
"source": "3.4.0-next-1776749829492",
|
|
875
889
|
"tagging": 1
|
|
876
890
|
},
|
|
877
891
|
"source": {
|
|
@@ -898,17 +912,19 @@
|
|
|
898
912
|
}
|
|
899
913
|
},
|
|
900
914
|
"out": [
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
"
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
915
|
+
[
|
|
916
|
+
"analytics.identify",
|
|
917
|
+
{
|
|
918
|
+
"userId": "new-user-123",
|
|
919
|
+
"anonymousId": "s3ss10n",
|
|
920
|
+
"traits": {
|
|
921
|
+
"email": "user@acme.com",
|
|
922
|
+
"name": "Jane Doe",
|
|
923
|
+
"plan": "premium"
|
|
924
|
+
},
|
|
925
|
+
"timestamp": {}
|
|
926
|
+
}
|
|
927
|
+
]
|
|
912
928
|
]
|
|
913
929
|
},
|
|
914
930
|
"wildcardIgnored": {
|
|
@@ -967,7 +983,7 @@
|
|
|
967
983
|
"group": "gr0up",
|
|
968
984
|
"count": 1,
|
|
969
985
|
"version": {
|
|
970
|
-
"source": "3.
|
|
986
|
+
"source": "3.4.0-next-1776749829492",
|
|
971
987
|
"tagging": 1
|
|
972
988
|
},
|
|
973
989
|
"source": {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/server-destination-segment",
|
|
3
3
|
"description": "Segment CDP server destination for walkerOS (@segment/analytics-node, full Segment Spec)",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.4.0-next-1776749829492",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@segment/analytics-node": "^3.0.0",
|
|
38
|
-
"@walkeros/core": "3.
|
|
39
|
-
"@walkeros/server-core": "3.
|
|
38
|
+
"@walkeros/core": "3.4.0-next-1776749829492",
|
|
39
|
+
"@walkeros/server-core": "3.4.0-next-1776749829492"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@walkeros/collector": "3.
|
|
42
|
+
"@walkeros/collector": "3.4.0-next-1776749829492"
|
|
43
43
|
},
|
|
44
44
|
"repository": {
|
|
45
45
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|