@walkeros/server-destination-mparticle 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 elbWalker GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,69 @@
1
+ <p align="left">
2
+ <a href="https://www.walkeros.io">
3
+ <img alt="walkerOS" title="walkerOS" src="https://www.walkeros.io/img/walkerOS_logo.svg" width="256px"/>
4
+ </a>
5
+ </p>
6
+
7
+ # Meta (CAPI) Destination for walkerOS
8
+
9
+ [Source Code](https://github.com/elbwalker/walkerOS/tree/main/packages/server/destinations/meta)
10
+ &bull;
11
+ [NPM Package](https://www.npmjs.com/package/@walkeros/server-destination-meta)
12
+
13
+ walkerOS follows a **source → collector → destination** architecture. This Meta
14
+ CAPI destination receives processed events from the walkerOS collector and sends
15
+ them server-to-server to Meta's Conversions API, providing enhanced data
16
+ accuracy and attribution for Meta advertising campaigns while bypassing browser
17
+ limitations.
18
+
19
+ ## Installation
20
+
21
+ ```sh
22
+ npm install @walkeros/server-destination-meta
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ Here's a basic example of how to use the Meta CAPI destination:
28
+
29
+ ```typescript
30
+ import { startFlow } from '@walkeros/collector';
31
+ import { destinationMeta } from '@walkeros/server-destination-meta';
32
+
33
+ await startFlow({
34
+ destinations: {
35
+ meta: {
36
+ code: destinationMeta,
37
+ config: {
38
+ settings: {
39
+ accessToken: 'YOUR_ACCESS_TOKEN',
40
+ pixelId: 'YOUR_PIXEL_ID',
41
+ },
42
+ },
43
+ },
44
+ },
45
+ });
46
+ ```
47
+
48
+ ## Configuration
49
+
50
+ | Name | Type | Description | Required | Example |
51
+ | ----------------- | --------------------- | --------------------------------------------------------- | -------- | ---------------------------------------------- |
52
+ | `accessToken` | `string` | Meta access token for Conversions API authentication | Yes | `'your_access_token'` |
53
+ | `pixelId` | `string` | Meta Pixel ID from your Facebook Business account | Yes | `'1234567890'` |
54
+ | `action_source` | `ActionSource` | Source of the event (website, app, phone_call, etc.) | No | `'website'` |
55
+ | `doNotHash` | `string[]` | Array of user_data fields that should not be hashed | No | `['client_ip_address', 'client_user_agent']` |
56
+ | `test_event_code` | `string` | Test event code for debugging Meta Conversions API events | No | `'TEST12345'` |
57
+ | `url` | `string` | Custom URL for Meta Conversions API endpoint | No | `'https://graph.facebook.com/v17.0'` |
58
+ | `user_data` | `WalkerOSMapping.Map` | Mapping configuration for user data fields | No | `{ email: 'user.email', phone: 'user.phone' }` |
59
+
60
+ ## Contribute
61
+
62
+ Feel free to contribute by submitting an
63
+ [issue](https://github.com/elbwalker/walkerOS/issues), starting a
64
+ [discussion](https://github.com/elbwalker/walkerOS/discussions), or getting in
65
+ [contact](https://calendly.com/elb-alexander/30min).
66
+
67
+ ## License
68
+
69
+ This project is licensed under the MIT License.
package/dist/dev.d.mts ADDED
@@ -0,0 +1,154 @@
1
+ import * as _walkeros_core_dev from '@walkeros/core/dev';
2
+ import { z } from '@walkeros/core/dev';
3
+ import { DestinationServer, sendServer } from '@walkeros/server-core';
4
+ import { Flow } from '@walkeros/core';
5
+
6
+ /** mParticle data pod (regional endpoint selector). */
7
+ declare const PodSchema: z.ZodEnum<{
8
+ us1: "us1";
9
+ us2: "us2";
10
+ eu1: "eu1";
11
+ au1: "au1";
12
+ }>;
13
+ /** Target environment for the batch. */
14
+ declare const EnvironmentSchema: z.ZodEnum<{
15
+ production: "production";
16
+ development: "development";
17
+ }>;
18
+ /** Supported mParticle event types emitted by this destination. */
19
+ declare const EventTypeSchema: z.ZodEnum<{
20
+ custom_event: "custom_event";
21
+ screen_view: "screen_view";
22
+ commerce_event: "commerce_event";
23
+ }>;
24
+ /** mParticle custom event category for `custom_event`. */
25
+ declare const CustomEventTypeSchema: z.ZodEnum<{
26
+ navigation: "navigation";
27
+ location: "location";
28
+ search: "search";
29
+ transaction: "transaction";
30
+ user_content: "user_content";
31
+ user_preference: "user_preference";
32
+ social: "social";
33
+ media: "media";
34
+ attribution: "attribution";
35
+ other: "other";
36
+ }>;
37
+
38
+ declare const SettingsSchema: z.ZodObject<{
39
+ apiKey: z.ZodString;
40
+ apiSecret: z.ZodString;
41
+ pod: z.ZodOptional<z.ZodEnum<{
42
+ us1: "us1";
43
+ us2: "us2";
44
+ eu1: "eu1";
45
+ au1: "au1";
46
+ }>>;
47
+ environment: z.ZodOptional<z.ZodEnum<{
48
+ production: "production";
49
+ development: "development";
50
+ }>>;
51
+ userIdentities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
52
+ userAttributes: z.ZodOptional<z.ZodUnknown>;
53
+ consent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
54
+ ip: z.ZodOptional<z.ZodUnknown>;
55
+ sourceRequestId: z.ZodOptional<z.ZodUnknown>;
56
+ }, z.core.$strip>;
57
+ type Settings = z.infer<typeof SettingsSchema>;
58
+
59
+ declare const MappingSchema: z.ZodObject<{
60
+ eventType: z.ZodOptional<z.ZodEnum<{
61
+ custom_event: "custom_event";
62
+ screen_view: "screen_view";
63
+ commerce_event: "commerce_event";
64
+ }>>;
65
+ customEventType: z.ZodOptional<z.ZodEnum<{
66
+ navigation: "navigation";
67
+ location: "location";
68
+ search: "search";
69
+ transaction: "transaction";
70
+ user_content: "user_content";
71
+ user_preference: "user_preference";
72
+ social: "social";
73
+ media: "media";
74
+ attribution: "attribution";
75
+ other: "other";
76
+ }>>;
77
+ commerce: z.ZodOptional<z.ZodUnknown>;
78
+ userIdentities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
79
+ userAttributes: z.ZodOptional<z.ZodUnknown>;
80
+ }, z.core.$strip>;
81
+ type Mapping = z.infer<typeof MappingSchema>;
82
+
83
+ declare const settings: _walkeros_core_dev.JSONSchema;
84
+ declare const mapping: _walkeros_core_dev.JSONSchema;
85
+
86
+ declare const index$1_CustomEventTypeSchema: typeof CustomEventTypeSchema;
87
+ declare const index$1_EnvironmentSchema: typeof EnvironmentSchema;
88
+ declare const index$1_EventTypeSchema: typeof EventTypeSchema;
89
+ type index$1_Mapping = Mapping;
90
+ declare const index$1_MappingSchema: typeof MappingSchema;
91
+ declare const index$1_PodSchema: typeof PodSchema;
92
+ type index$1_Settings = Settings;
93
+ declare const index$1_SettingsSchema: typeof SettingsSchema;
94
+ declare const index$1_mapping: typeof mapping;
95
+ declare const index$1_settings: typeof settings;
96
+ declare namespace index$1 {
97
+ export { index$1_CustomEventTypeSchema as CustomEventTypeSchema, index$1_EnvironmentSchema as EnvironmentSchema, index$1_EventTypeSchema as EventTypeSchema, type index$1_Mapping as Mapping, index$1_MappingSchema as MappingSchema, index$1_PodSchema as PodSchema, type index$1_Settings as Settings, index$1_SettingsSchema as SettingsSchema, index$1_mapping as mapping, index$1_settings as settings };
98
+ }
99
+
100
+ interface Env extends DestinationServer.Env {
101
+ sendServer?: typeof sendServer;
102
+ }
103
+
104
+ /**
105
+ * Standard mock environment for push operations.
106
+ */
107
+ declare const push: Env;
108
+ declare const simulation: string[];
109
+
110
+ declare const env_push: typeof push;
111
+ declare const env_simulation: typeof simulation;
112
+ declare namespace env {
113
+ export { env_push as push, env_simulation as simulation };
114
+ }
115
+
116
+ /**
117
+ * Default custom_event — a walkerOS event with no `eventType` mapping.
118
+ * mParticle wraps it as a `custom_event` with the default `other` category.
119
+ * user_identities are resolved at the batch level from
120
+ * `settings.userIdentities`.
121
+ */
122
+ declare const customEvent: Flow.StepExample;
123
+ /**
124
+ * screen_view event — mapping.settings.eventType switches the mParticle
125
+ * event shape. Uses event name as the `screen_name`.
126
+ */
127
+ declare const screenView: Flow.StepExample;
128
+ /**
129
+ * commerce_event — mapping.settings.eventType: 'commerce_event' plus a
130
+ * `commerce` mapping resolves a ProductAction block. Products, currency,
131
+ * and transaction metadata are all driven by the commerce mapping value.
132
+ */
133
+ declare const commercePurchase: Flow.StepExample;
134
+ /**
135
+ * Identity + attributes — verifies `user_identities` and `user_attributes`
136
+ * come from the batch-level settings mappings, not the event payload.
137
+ */
138
+ declare const identityAndAttributes: Flow.StepExample;
139
+
140
+ declare const step_commercePurchase: typeof commercePurchase;
141
+ declare const step_customEvent: typeof customEvent;
142
+ declare const step_identityAndAttributes: typeof identityAndAttributes;
143
+ declare const step_screenView: typeof screenView;
144
+ declare namespace step {
145
+ export { step_commercePurchase as commercePurchase, step_customEvent as customEvent, step_identityAndAttributes as identityAndAttributes, step_screenView as screenView };
146
+ }
147
+
148
+ declare const index_env: typeof env;
149
+ declare const index_step: typeof step;
150
+ declare namespace index {
151
+ export { index_env as env, index_step as step };
152
+ }
153
+
154
+ export { index as examples, index$1 as schemas };
package/dist/dev.d.ts ADDED
@@ -0,0 +1,154 @@
1
+ import * as _walkeros_core_dev from '@walkeros/core/dev';
2
+ import { z } from '@walkeros/core/dev';
3
+ import { DestinationServer, sendServer } from '@walkeros/server-core';
4
+ import { Flow } from '@walkeros/core';
5
+
6
+ /** mParticle data pod (regional endpoint selector). */
7
+ declare const PodSchema: z.ZodEnum<{
8
+ us1: "us1";
9
+ us2: "us2";
10
+ eu1: "eu1";
11
+ au1: "au1";
12
+ }>;
13
+ /** Target environment for the batch. */
14
+ declare const EnvironmentSchema: z.ZodEnum<{
15
+ production: "production";
16
+ development: "development";
17
+ }>;
18
+ /** Supported mParticle event types emitted by this destination. */
19
+ declare const EventTypeSchema: z.ZodEnum<{
20
+ custom_event: "custom_event";
21
+ screen_view: "screen_view";
22
+ commerce_event: "commerce_event";
23
+ }>;
24
+ /** mParticle custom event category for `custom_event`. */
25
+ declare const CustomEventTypeSchema: z.ZodEnum<{
26
+ navigation: "navigation";
27
+ location: "location";
28
+ search: "search";
29
+ transaction: "transaction";
30
+ user_content: "user_content";
31
+ user_preference: "user_preference";
32
+ social: "social";
33
+ media: "media";
34
+ attribution: "attribution";
35
+ other: "other";
36
+ }>;
37
+
38
+ declare const SettingsSchema: z.ZodObject<{
39
+ apiKey: z.ZodString;
40
+ apiSecret: z.ZodString;
41
+ pod: z.ZodOptional<z.ZodEnum<{
42
+ us1: "us1";
43
+ us2: "us2";
44
+ eu1: "eu1";
45
+ au1: "au1";
46
+ }>>;
47
+ environment: z.ZodOptional<z.ZodEnum<{
48
+ production: "production";
49
+ development: "development";
50
+ }>>;
51
+ userIdentities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
52
+ userAttributes: z.ZodOptional<z.ZodUnknown>;
53
+ consent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
54
+ ip: z.ZodOptional<z.ZodUnknown>;
55
+ sourceRequestId: z.ZodOptional<z.ZodUnknown>;
56
+ }, z.core.$strip>;
57
+ type Settings = z.infer<typeof SettingsSchema>;
58
+
59
+ declare const MappingSchema: z.ZodObject<{
60
+ eventType: z.ZodOptional<z.ZodEnum<{
61
+ custom_event: "custom_event";
62
+ screen_view: "screen_view";
63
+ commerce_event: "commerce_event";
64
+ }>>;
65
+ customEventType: z.ZodOptional<z.ZodEnum<{
66
+ navigation: "navigation";
67
+ location: "location";
68
+ search: "search";
69
+ transaction: "transaction";
70
+ user_content: "user_content";
71
+ user_preference: "user_preference";
72
+ social: "social";
73
+ media: "media";
74
+ attribution: "attribution";
75
+ other: "other";
76
+ }>>;
77
+ commerce: z.ZodOptional<z.ZodUnknown>;
78
+ userIdentities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
79
+ userAttributes: z.ZodOptional<z.ZodUnknown>;
80
+ }, z.core.$strip>;
81
+ type Mapping = z.infer<typeof MappingSchema>;
82
+
83
+ declare const settings: _walkeros_core_dev.JSONSchema;
84
+ declare const mapping: _walkeros_core_dev.JSONSchema;
85
+
86
+ declare const index$1_CustomEventTypeSchema: typeof CustomEventTypeSchema;
87
+ declare const index$1_EnvironmentSchema: typeof EnvironmentSchema;
88
+ declare const index$1_EventTypeSchema: typeof EventTypeSchema;
89
+ type index$1_Mapping = Mapping;
90
+ declare const index$1_MappingSchema: typeof MappingSchema;
91
+ declare const index$1_PodSchema: typeof PodSchema;
92
+ type index$1_Settings = Settings;
93
+ declare const index$1_SettingsSchema: typeof SettingsSchema;
94
+ declare const index$1_mapping: typeof mapping;
95
+ declare const index$1_settings: typeof settings;
96
+ declare namespace index$1 {
97
+ export { index$1_CustomEventTypeSchema as CustomEventTypeSchema, index$1_EnvironmentSchema as EnvironmentSchema, index$1_EventTypeSchema as EventTypeSchema, type index$1_Mapping as Mapping, index$1_MappingSchema as MappingSchema, index$1_PodSchema as PodSchema, type index$1_Settings as Settings, index$1_SettingsSchema as SettingsSchema, index$1_mapping as mapping, index$1_settings as settings };
98
+ }
99
+
100
+ interface Env extends DestinationServer.Env {
101
+ sendServer?: typeof sendServer;
102
+ }
103
+
104
+ /**
105
+ * Standard mock environment for push operations.
106
+ */
107
+ declare const push: Env;
108
+ declare const simulation: string[];
109
+
110
+ declare const env_push: typeof push;
111
+ declare const env_simulation: typeof simulation;
112
+ declare namespace env {
113
+ export { env_push as push, env_simulation as simulation };
114
+ }
115
+
116
+ /**
117
+ * Default custom_event — a walkerOS event with no `eventType` mapping.
118
+ * mParticle wraps it as a `custom_event` with the default `other` category.
119
+ * user_identities are resolved at the batch level from
120
+ * `settings.userIdentities`.
121
+ */
122
+ declare const customEvent: Flow.StepExample;
123
+ /**
124
+ * screen_view event — mapping.settings.eventType switches the mParticle
125
+ * event shape. Uses event name as the `screen_name`.
126
+ */
127
+ declare const screenView: Flow.StepExample;
128
+ /**
129
+ * commerce_event — mapping.settings.eventType: 'commerce_event' plus a
130
+ * `commerce` mapping resolves a ProductAction block. Products, currency,
131
+ * and transaction metadata are all driven by the commerce mapping value.
132
+ */
133
+ declare const commercePurchase: Flow.StepExample;
134
+ /**
135
+ * Identity + attributes — verifies `user_identities` and `user_attributes`
136
+ * come from the batch-level settings mappings, not the event payload.
137
+ */
138
+ declare const identityAndAttributes: Flow.StepExample;
139
+
140
+ declare const step_commercePurchase: typeof commercePurchase;
141
+ declare const step_customEvent: typeof customEvent;
142
+ declare const step_identityAndAttributes: typeof identityAndAttributes;
143
+ declare const step_screenView: typeof screenView;
144
+ declare namespace step {
145
+ export { step_commercePurchase as commercePurchase, step_customEvent as customEvent, step_identityAndAttributes as identityAndAttributes, step_screenView as screenView };
146
+ }
147
+
148
+ declare const index_env: typeof env;
149
+ declare const index_step: typeof step;
150
+ declare namespace index {
151
+ export { index_env as env, index_step as step };
152
+ }
153
+
154
+ export { index as examples, index$1 as schemas };
package/dist/dev.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,o=(e,r)=>{for(var i in r)t(e,i,{get:r[i],enumerable:!0})},s={};o(s,{examples:()=>f,schemas:()=>a}),module.exports=(e=s,((e,o,s,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let c of i(o))n.call(e,c)||c===s||t(e,c,{get:()=>o[c],enumerable:!(a=r(o,c))||a.enumerable});return e})(t({},"__esModule",{value:!0}),e));var a={};o(a,{CustomEventTypeSchema:()=>l,EnvironmentSchema:()=>d,EventTypeSchema:()=>v,MappingSchema:()=>h,PodSchema:()=>m,SettingsSchema:()=>_,mapping:()=>b,settings:()=>y});var c=require("@walkeros/core/dev"),u=require("@walkeros/core/dev"),p=require("@walkeros/core/dev"),m=p.z.enum(["us1","us2","eu1","au1"]),d=p.z.enum(["production","development"]),v=p.z.enum(["custom_event","screen_view","commerce_event"]),l=p.z.enum(["navigation","location","search","transaction","user_content","user_preference","social","media","attribution","other"]),_=u.z.object({apiKey:u.z.string().min(1).describe("mParticle input feed API key from the mParticle dashboard (Setup > Inputs > Feeds)."),apiSecret:u.z.string().min(1).describe("mParticle input feed API secret paired with apiKey. Used for HTTP Basic auth."),pod:m.describe("mParticle data pod selecting the regional endpoint. Default: 'us1'.").optional(),environment:d.describe("Environment the batch targets. Default: 'production'.").optional(),userIdentities:u.z.record(u.z.string(),u.z.unknown()).describe("Mapping that resolves to user_identities per batch. Keys are mParticle identity types (like customer_id, email); values are walkerOS mapping values.").optional(),userAttributes:u.z.unknown().describe("Mapping value that resolves to the user_attributes object placed on the batch.").optional(),consent:u.z.record(u.z.string(),u.z.unknown()).describe("Static consent_state envelope forwarded verbatim on the batch. See mParticle consent_state docs.").optional(),ip:u.z.unknown().describe("Mapping value resolving to the client IP for the batch.").optional(),sourceRequestId:u.z.unknown().describe("Mapping value resolving to the source_request_id for the batch. Falls back to event.id when unset.").optional()}),g=require("@walkeros/core/dev"),h=g.z.object({eventType:v.describe("Per-event mParticle event type. Default: 'custom_event'.").optional(),customEventType:l.describe("Custom event type category for 'custom_event'. Default: 'other'.").optional(),commerce:g.z.unknown().describe("Mapping value resolving to the commerce fields (product_action, currency_code, products, ...) for a commerce_event.").optional(),userIdentities:g.z.record(g.z.string(),g.z.unknown()).describe("Per-event override mapping for user_identities. Merged over settings.userIdentities.").optional(),userAttributes:g.z.unknown().describe("Per-event override mapping for user_attributes.").optional()}),y=(0,c.zodToSchema)(_),b=(0,c.zodToSchema)(h),f={};o(f,{env:()=>w,step:()=>k});var w={};o(w,{push:()=>S,simulation:()=>z});var S={sendServer:async()=>({ok:!0,data:{}})},z=["sendServer"],k={};o(k,{commercePurchase:()=>T,customEvent:()=>E,identityAndAttributes:()=>j,screenView:()=>q});var P=require("@walkeros/core"),O="https://s2s.mparticle.com/v2/events",x={headers:{Authorization:"Basic a2V5OnNlY3JldA==","Content-Type":"application/json"}},E={in:(0,P.getEvent)("product view",{timestamp:17000001e5,data:{id:"SKU-A1",name:"Shoe",price:129.99},user:{id:"user-123"},source:{type:"server",id:"https://shop.example.com",previous_id:""}}),mapping:void 0,out:[["sendServer",O,JSON.stringify({events:[{event_type:"custom_event",data:{event_name:"product view",custom_event_type:"other",timestamp_unixtime_ms:17000001e5,source_message_id:"1700000100000-gr0up-1"}}],environment:"production",user_identities:{customer_id:"user-123"},source_request_id:"1700000100000-gr0up-1"}),x]]},q={in:(0,P.getEvent)("page view",{timestamp:17000002e5,data:{title:"Checkout",path:"/checkout"},user:{id:"user-123"},source:{type:"server",id:"https://shop.example.com",previous_id:""}}),mapping:{settings:{eventType:"screen_view"}},out:[["sendServer",O,JSON.stringify({events:[{event_type:"screen_view",data:{screen_name:"page view",timestamp_unixtime_ms:17000002e5,source_message_id:"1700000200000-gr0up-1"}}],environment:"production",user_identities:{customer_id:"user-123"},source_request_id:"1700000200000-gr0up-1"}),x]]},T={in:(0,P.getEvent)("order complete",{timestamp:17000003e5,data:{id:"ORD-300",total:249.99,currency:"EUR"},user:{id:"user-123"},source:{type:"server",id:"https://shop.example.com",previous_id:""}}),mapping:{settings:{eventType:"commerce_event",commerce:{map:{currency_code:"data.currency",product_action:{map:{action:{value:"purchase"},transaction_id:"data.id",total_amount:"data.total"}}}}}},out:[["sendServer",O,JSON.stringify({events:[{event_type:"commerce_event",data:{currency_code:"EUR",product_action:{action:"purchase",transaction_id:"ORD-300",total_amount:249.99},timestamp_unixtime_ms:17000003e5,source_message_id:"1700000300000-gr0up-1"}}],environment:"production",user_identities:{customer_id:"user-123"},source_request_id:"1700000300000-gr0up-1"}),x]]},j={in:(0,P.getEvent)("form submit",{timestamp:17000004e5,data:{type:"newsletter"},user:{id:"user-123",email:"user@example.com"},source:{type:"server",id:"https://example.com",previous_id:""}}),mapping:void 0,out:[["sendServer",O,JSON.stringify({events:[{event_type:"custom_event",data:{event_name:"form submit",custom_event_type:"other",timestamp_unixtime_ms:17000004e5,source_message_id:"1700000400000-gr0up-1"}}],environment:"production",user_identities:{customer_id:"user-123",email:"user@example.com"},source_request_id:"1700000400000-gr0up-1"}),x]]};//# sourceMappingURL=dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/primitives.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 * from './primitives';\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';\nimport { EnvironmentSchema, PodSchema } from './primitives';\n\nexport const SettingsSchema = z.object({\n apiKey: z\n .string()\n .min(1)\n .describe(\n 'mParticle input feed API key from the mParticle dashboard (Setup > Inputs > Feeds).',\n ),\n apiSecret: z\n .string()\n .min(1)\n .describe(\n 'mParticle input feed API secret paired with apiKey. Used for HTTP Basic auth.',\n ),\n pod: PodSchema.describe(\n \"mParticle data pod selecting the regional endpoint. Default: 'us1'.\",\n ).optional(),\n environment: EnvironmentSchema.describe(\n \"Environment the batch targets. Default: 'production'.\",\n ).optional(),\n userIdentities: z\n .record(z.string(), z.unknown())\n .describe(\n 'Mapping that resolves to user_identities per batch. Keys are mParticle identity types (like customer_id, email); values are walkerOS mapping values.',\n )\n .optional(),\n userAttributes: z\n .unknown()\n .describe(\n 'Mapping value that resolves to the user_attributes object placed on the batch.',\n )\n .optional(),\n consent: z\n .record(z.string(), z.unknown())\n .describe(\n 'Static consent_state envelope forwarded verbatim on the batch. See mParticle consent_state docs.',\n )\n .optional(),\n ip: z\n .unknown()\n .describe('Mapping value resolving to the client IP for the batch.')\n .optional(),\n sourceRequestId: z\n .unknown()\n .describe(\n 'Mapping value resolving to the source_request_id for the batch. Falls back to event.id when unset.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/** mParticle data pod (regional endpoint selector). */\nexport const PodSchema = z.enum(['us1', 'us2', 'eu1', 'au1']);\n\n/** Target environment for the batch. */\nexport const EnvironmentSchema = z.enum(['production', 'development']);\n\n/** Supported mParticle event types emitted by this destination. */\nexport const EventTypeSchema = z.enum([\n 'custom_event',\n 'screen_view',\n 'commerce_event',\n]);\n\n/** mParticle custom event category for `custom_event`. */\nexport const CustomEventTypeSchema = z.enum([\n 'navigation',\n 'location',\n 'search',\n 'transaction',\n 'user_content',\n 'user_preference',\n 'social',\n 'media',\n 'attribution',\n 'other',\n]);\n","import { z } from '@walkeros/core/dev';\nimport { CustomEventTypeSchema, EventTypeSchema } from './primitives';\n\nexport const MappingSchema = z.object({\n eventType: EventTypeSchema.describe(\n \"Per-event mParticle event type. Default: 'custom_event'.\",\n ).optional(),\n customEventType: CustomEventTypeSchema.describe(\n \"Custom event type category for 'custom_event'. Default: 'other'.\",\n ).optional(),\n commerce: z\n .unknown()\n .describe(\n 'Mapping value resolving to the commerce fields (product_action, currency_code, products, ...) for a commerce_event.',\n )\n .optional(),\n userIdentities: z\n .record(z.string(), z.unknown())\n .describe(\n 'Per-event override mapping for user_identities. Merged over settings.userIdentities.',\n )\n .optional(),\n userAttributes: z\n .unknown()\n .describe('Per-event override mapping for user_attributes.')\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 { SendDataValue, SendResponse } from '@walkeros/core';\nimport type { SendServerOptions } from '@walkeros/server-core';\nimport type { Env } from '../types';\n\n/**\n * Example environment configurations for mParticle Events API destination.\n *\n * Provides a standardized mock `sendServer` so tests and simulations can\n * run without making real HTTP calls to mParticle.\n */\n\ntype MockSendServer = (\n url: string,\n data?: SendDataValue,\n options?: SendServerOptions,\n) => Promise<SendResponse>;\n\nconst mockSendServer: MockSendServer = async () => {\n // Simulates mParticle's typical 202 Accepted response for the Events API.\n return {\n ok: true,\n data: {},\n };\n};\n\n/**\n * Standard mock environment for push operations.\n */\nexport const push: Env = {\n sendServer: mockSendServer,\n};\n\nexport const simulation = ['sendServer'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\n/**\n * mParticle Events API step examples.\n *\n * At push time, the destination calls\n * `env.sendServer(endpoint, JSON.stringify(batch), options)` where\n * endpoint = `buildEndpoint(pod)` (default pod `us1` → `https://s2s.mparticle.com/v2/events`)\n * batch = the mParticle v2 batch envelope\n *\n * Test fixture pins `apiKey = 'key'`, `apiSecret = 'secret'`, pod `us1`, so\n * every call targets that endpoint with `Authorization: Basic a2V5OnNlY3JldA==`.\n *\n * The batch keys appear in the order the destination constructs them:\n * 1. events (always a single-element array)\n * 2. environment ('production' by default)\n * 3. user_identities (only when resolved)\n * 4. user_attributes (only when resolved)\n * 5. ip (only when mapped)\n * 6. source_request_id (falls back to `event.id`)\n * 7. consent_state, context (unused here)\n *\n * `options` carries Authorization + Content-Type headers.\n */\nconst ENDPOINT = 'https://s2s.mparticle.com/v2/events';\nconst OPTIONS = {\n headers: {\n // Basic base64('key:secret')\n Authorization: 'Basic a2V5OnNlY3JldA==',\n 'Content-Type': 'application/json',\n },\n};\n\n/**\n * Default custom_event — a walkerOS event with no `eventType` mapping.\n * mParticle wraps it as a `custom_event` with the default `other` category.\n * user_identities are resolved at the batch level from\n * `settings.userIdentities`.\n */\nexport const customEvent: Flow.StepExample = {\n in: getEvent('product view', {\n timestamp: 1700000100000,\n data: { id: 'SKU-A1', name: 'Shoe', price: 129.99 },\n user: { id: 'user-123' },\n source: { type: 'server', id: 'https://shop.example.com', previous_id: '' },\n }),\n mapping: undefined,\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n events: [\n {\n event_type: 'custom_event',\n data: {\n event_name: 'product view',\n custom_event_type: 'other',\n timestamp_unixtime_ms: 1700000100000,\n source_message_id: '1700000100000-gr0up-1',\n },\n },\n ],\n environment: 'production',\n user_identities: {\n customer_id: 'user-123',\n },\n source_request_id: '1700000100000-gr0up-1',\n }),\n OPTIONS,\n ],\n ],\n};\n\n/**\n * screen_view event — mapping.settings.eventType switches the mParticle\n * event shape. Uses event name as the `screen_name`.\n */\nexport const screenView: Flow.StepExample = {\n in: getEvent('page view', {\n timestamp: 1700000200000,\n data: { title: 'Checkout', path: '/checkout' },\n user: { id: 'user-123' },\n source: { type: 'server', id: 'https://shop.example.com', previous_id: '' },\n }),\n mapping: {\n settings: { eventType: 'screen_view' },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n events: [\n {\n event_type: 'screen_view',\n data: {\n screen_name: 'page view',\n timestamp_unixtime_ms: 1700000200000,\n source_message_id: '1700000200000-gr0up-1',\n },\n },\n ],\n environment: 'production',\n user_identities: {\n customer_id: 'user-123',\n },\n source_request_id: '1700000200000-gr0up-1',\n }),\n OPTIONS,\n ],\n ],\n};\n\n/**\n * commerce_event — mapping.settings.eventType: 'commerce_event' plus a\n * `commerce` mapping resolves a ProductAction block. Products, currency,\n * and transaction metadata are all driven by the commerce mapping value.\n */\nexport const commercePurchase: Flow.StepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000300000,\n data: { id: 'ORD-300', total: 249.99, currency: 'EUR' },\n user: { id: 'user-123' },\n source: { type: 'server', id: 'https://shop.example.com', previous_id: '' },\n }),\n mapping: {\n settings: {\n eventType: 'commerce_event',\n commerce: {\n map: {\n currency_code: 'data.currency',\n product_action: {\n map: {\n action: { value: 'purchase' },\n transaction_id: 'data.id',\n total_amount: 'data.total',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n events: [\n {\n event_type: 'commerce_event',\n data: {\n currency_code: 'EUR',\n product_action: {\n action: 'purchase',\n transaction_id: 'ORD-300',\n total_amount: 249.99,\n },\n timestamp_unixtime_ms: 1700000300000,\n source_message_id: '1700000300000-gr0up-1',\n },\n },\n ],\n environment: 'production',\n user_identities: {\n customer_id: 'user-123',\n },\n source_request_id: '1700000300000-gr0up-1',\n }),\n OPTIONS,\n ],\n ],\n};\n\n/**\n * Identity + attributes — verifies `user_identities` and `user_attributes`\n * come from the batch-level settings mappings, not the event payload.\n */\nexport const identityAndAttributes: Flow.StepExample = {\n in: getEvent('form submit', {\n timestamp: 1700000400000,\n data: { type: 'newsletter' },\n user: {\n id: 'user-123',\n email: 'user@example.com',\n },\n source: { type: 'server', id: 'https://example.com', previous_id: '' },\n }),\n mapping: undefined,\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n events: [\n {\n event_type: 'custom_event',\n data: {\n event_name: 'form submit',\n custom_event_type: 'other',\n timestamp_unixtime_ms: 1700000400000,\n source_message_id: '1700000400000-gr0up-1',\n },\n },\n ],\n environment: 'production',\n user_identities: {\n customer_id: 'user-123',\n email: 'user@example.com',\n },\n source_request_id: '1700000400000-gr0up-1',\n }),\n OPTIONS,\n ],\n ],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,IAAAC,cAAkB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AAmB;AAAA,MACrB,CAAC;AAAA,MACD;AAAA,IACF;AAAA,EACF;AACF;","names":["import_dev","import_dev","import_dev"]}
package/dist/dev.mjs ADDED
@@ -0,0 +1 @@
1
+ var e=Object.defineProperty,t=(t,r)=>{for(var i in r)e(t,i,{get:r[i],enumerable:!0})},r={};t(r,{CustomEventTypeSchema:()=>u,EnvironmentSchema:()=>a,EventTypeSchema:()=>c,MappingSchema:()=>d,PodSchema:()=>o,SettingsSchema:()=>p,mapping:()=>_,settings:()=>v});import{zodToSchema as i}from"@walkeros/core/dev";import{z as n}from"@walkeros/core/dev";import{z as s}from"@walkeros/core/dev";var o=s.enum(["us1","us2","eu1","au1"]),a=s.enum(["production","development"]),c=s.enum(["custom_event","screen_view","commerce_event"]),u=s.enum(["navigation","location","search","transaction","user_content","user_preference","social","media","attribution","other"]),p=n.object({apiKey:n.string().min(1).describe("mParticle input feed API key from the mParticle dashboard (Setup > Inputs > Feeds)."),apiSecret:n.string().min(1).describe("mParticle input feed API secret paired with apiKey. Used for HTTP Basic auth."),pod:o.describe("mParticle data pod selecting the regional endpoint. Default: 'us1'.").optional(),environment:a.describe("Environment the batch targets. Default: 'production'.").optional(),userIdentities:n.record(n.string(),n.unknown()).describe("Mapping that resolves to user_identities per batch. Keys are mParticle identity types (like customer_id, email); values are walkerOS mapping values.").optional(),userAttributes:n.unknown().describe("Mapping value that resolves to the user_attributes object placed on the batch.").optional(),consent:n.record(n.string(),n.unknown()).describe("Static consent_state envelope forwarded verbatim on the batch. See mParticle consent_state docs.").optional(),ip:n.unknown().describe("Mapping value resolving to the client IP for the batch.").optional(),sourceRequestId:n.unknown().describe("Mapping value resolving to the source_request_id for the batch. Falls back to event.id when unset.").optional()});import{z as m}from"@walkeros/core/dev";var d=m.object({eventType:c.describe("Per-event mParticle event type. Default: 'custom_event'.").optional(),customEventType:u.describe("Custom event type category for 'custom_event'. Default: 'other'.").optional(),commerce:m.unknown().describe("Mapping value resolving to the commerce fields (product_action, currency_code, products, ...) for a commerce_event.").optional(),userIdentities:m.record(m.string(),m.unknown()).describe("Per-event override mapping for user_identities. Merged over settings.userIdentities.").optional(),userAttributes:m.unknown().describe("Per-event override mapping for user_attributes.").optional()}),v=i(p),_=i(d),l={};t(l,{env:()=>h,step:()=>b});var h={};t(h,{push:()=>g,simulation:()=>y});var g={sendServer:async()=>({ok:!0,data:{}})},y=["sendServer"],b={};t(b,{commercePurchase:()=>x,customEvent:()=>k,identityAndAttributes:()=>A,screenView:()=>P});import{getEvent as f}from"@walkeros/core";var w="https://s2s.mparticle.com/v2/events",S={headers:{Authorization:"Basic a2V5OnNlY3JldA==","Content-Type":"application/json"}},k={in:f("product view",{timestamp:17000001e5,data:{id:"SKU-A1",name:"Shoe",price:129.99},user:{id:"user-123"},source:{type:"server",id:"https://shop.example.com",previous_id:""}}),mapping:void 0,out:[["sendServer",w,JSON.stringify({events:[{event_type:"custom_event",data:{event_name:"product view",custom_event_type:"other",timestamp_unixtime_ms:17000001e5,source_message_id:"1700000100000-gr0up-1"}}],environment:"production",user_identities:{customer_id:"user-123"},source_request_id:"1700000100000-gr0up-1"}),S]]},P={in:f("page view",{timestamp:17000002e5,data:{title:"Checkout",path:"/checkout"},user:{id:"user-123"},source:{type:"server",id:"https://shop.example.com",previous_id:""}}),mapping:{settings:{eventType:"screen_view"}},out:[["sendServer",w,JSON.stringify({events:[{event_type:"screen_view",data:{screen_name:"page view",timestamp_unixtime_ms:17000002e5,source_message_id:"1700000200000-gr0up-1"}}],environment:"production",user_identities:{customer_id:"user-123"},source_request_id:"1700000200000-gr0up-1"}),S]]},x={in:f("order complete",{timestamp:17000003e5,data:{id:"ORD-300",total:249.99,currency:"EUR"},user:{id:"user-123"},source:{type:"server",id:"https://shop.example.com",previous_id:""}}),mapping:{settings:{eventType:"commerce_event",commerce:{map:{currency_code:"data.currency",product_action:{map:{action:{value:"purchase"},transaction_id:"data.id",total_amount:"data.total"}}}}}},out:[["sendServer",w,JSON.stringify({events:[{event_type:"commerce_event",data:{currency_code:"EUR",product_action:{action:"purchase",transaction_id:"ORD-300",total_amount:249.99},timestamp_unixtime_ms:17000003e5,source_message_id:"1700000300000-gr0up-1"}}],environment:"production",user_identities:{customer_id:"user-123"},source_request_id:"1700000300000-gr0up-1"}),S]]},A={in:f("form submit",{timestamp:17000004e5,data:{type:"newsletter"},user:{id:"user-123",email:"user@example.com"},source:{type:"server",id:"https://example.com",previous_id:""}}),mapping:void 0,out:[["sendServer",w,JSON.stringify({events:[{event_type:"custom_event",data:{event_name:"form submit",custom_event_type:"other",timestamp_unixtime_ms:17000004e5,source_message_id:"1700000400000-gr0up-1"}}],environment:"production",user_identities:{customer_id:"user-123",email:"user@example.com"},source_request_id:"1700000400000-gr0up-1"}),S]]};export{l as examples,r as schemas};//# sourceMappingURL=dev.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/primitives.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 * from './primitives';\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';\nimport { EnvironmentSchema, PodSchema } from './primitives';\n\nexport const SettingsSchema = z.object({\n apiKey: z\n .string()\n .min(1)\n .describe(\n 'mParticle input feed API key from the mParticle dashboard (Setup > Inputs > Feeds).',\n ),\n apiSecret: z\n .string()\n .min(1)\n .describe(\n 'mParticle input feed API secret paired with apiKey. Used for HTTP Basic auth.',\n ),\n pod: PodSchema.describe(\n \"mParticle data pod selecting the regional endpoint. Default: 'us1'.\",\n ).optional(),\n environment: EnvironmentSchema.describe(\n \"Environment the batch targets. Default: 'production'.\",\n ).optional(),\n userIdentities: z\n .record(z.string(), z.unknown())\n .describe(\n 'Mapping that resolves to user_identities per batch. Keys are mParticle identity types (like customer_id, email); values are walkerOS mapping values.',\n )\n .optional(),\n userAttributes: z\n .unknown()\n .describe(\n 'Mapping value that resolves to the user_attributes object placed on the batch.',\n )\n .optional(),\n consent: z\n .record(z.string(), z.unknown())\n .describe(\n 'Static consent_state envelope forwarded verbatim on the batch. See mParticle consent_state docs.',\n )\n .optional(),\n ip: z\n .unknown()\n .describe('Mapping value resolving to the client IP for the batch.')\n .optional(),\n sourceRequestId: z\n .unknown()\n .describe(\n 'Mapping value resolving to the source_request_id for the batch. Falls back to event.id when unset.',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/** mParticle data pod (regional endpoint selector). */\nexport const PodSchema = z.enum(['us1', 'us2', 'eu1', 'au1']);\n\n/** Target environment for the batch. */\nexport const EnvironmentSchema = z.enum(['production', 'development']);\n\n/** Supported mParticle event types emitted by this destination. */\nexport const EventTypeSchema = z.enum([\n 'custom_event',\n 'screen_view',\n 'commerce_event',\n]);\n\n/** mParticle custom event category for `custom_event`. */\nexport const CustomEventTypeSchema = z.enum([\n 'navigation',\n 'location',\n 'search',\n 'transaction',\n 'user_content',\n 'user_preference',\n 'social',\n 'media',\n 'attribution',\n 'other',\n]);\n","import { z } from '@walkeros/core/dev';\nimport { CustomEventTypeSchema, EventTypeSchema } from './primitives';\n\nexport const MappingSchema = z.object({\n eventType: EventTypeSchema.describe(\n \"Per-event mParticle event type. Default: 'custom_event'.\",\n ).optional(),\n customEventType: CustomEventTypeSchema.describe(\n \"Custom event type category for 'custom_event'. Default: 'other'.\",\n ).optional(),\n commerce: z\n .unknown()\n .describe(\n 'Mapping value resolving to the commerce fields (product_action, currency_code, products, ...) for a commerce_event.',\n )\n .optional(),\n userIdentities: z\n .record(z.string(), z.unknown())\n .describe(\n 'Per-event override mapping for user_identities. Merged over settings.userIdentities.',\n )\n .optional(),\n userAttributes: z\n .unknown()\n .describe('Per-event override mapping for user_attributes.')\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 { SendDataValue, SendResponse } from '@walkeros/core';\nimport type { SendServerOptions } from '@walkeros/server-core';\nimport type { Env } from '../types';\n\n/**\n * Example environment configurations for mParticle Events API destination.\n *\n * Provides a standardized mock `sendServer` so tests and simulations can\n * run without making real HTTP calls to mParticle.\n */\n\ntype MockSendServer = (\n url: string,\n data?: SendDataValue,\n options?: SendServerOptions,\n) => Promise<SendResponse>;\n\nconst mockSendServer: MockSendServer = async () => {\n // Simulates mParticle's typical 202 Accepted response for the Events API.\n return {\n ok: true,\n data: {},\n };\n};\n\n/**\n * Standard mock environment for push operations.\n */\nexport const push: Env = {\n sendServer: mockSendServer,\n};\n\nexport const simulation = ['sendServer'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\n/**\n * mParticle Events API step examples.\n *\n * At push time, the destination calls\n * `env.sendServer(endpoint, JSON.stringify(batch), options)` where\n * endpoint = `buildEndpoint(pod)` (default pod `us1` → `https://s2s.mparticle.com/v2/events`)\n * batch = the mParticle v2 batch envelope\n *\n * Test fixture pins `apiKey = 'key'`, `apiSecret = 'secret'`, pod `us1`, so\n * every call targets that endpoint with `Authorization: Basic a2V5OnNlY3JldA==`.\n *\n * The batch keys appear in the order the destination constructs them:\n * 1. events (always a single-element array)\n * 2. environment ('production' by default)\n * 3. user_identities (only when resolved)\n * 4. user_attributes (only when resolved)\n * 5. ip (only when mapped)\n * 6. source_request_id (falls back to `event.id`)\n * 7. consent_state, context (unused here)\n *\n * `options` carries Authorization + Content-Type headers.\n */\nconst ENDPOINT = 'https://s2s.mparticle.com/v2/events';\nconst OPTIONS = {\n headers: {\n // Basic base64('key:secret')\n Authorization: 'Basic a2V5OnNlY3JldA==',\n 'Content-Type': 'application/json',\n },\n};\n\n/**\n * Default custom_event — a walkerOS event with no `eventType` mapping.\n * mParticle wraps it as a `custom_event` with the default `other` category.\n * user_identities are resolved at the batch level from\n * `settings.userIdentities`.\n */\nexport const customEvent: Flow.StepExample = {\n in: getEvent('product view', {\n timestamp: 1700000100000,\n data: { id: 'SKU-A1', name: 'Shoe', price: 129.99 },\n user: { id: 'user-123' },\n source: { type: 'server', id: 'https://shop.example.com', previous_id: '' },\n }),\n mapping: undefined,\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n events: [\n {\n event_type: 'custom_event',\n data: {\n event_name: 'product view',\n custom_event_type: 'other',\n timestamp_unixtime_ms: 1700000100000,\n source_message_id: '1700000100000-gr0up-1',\n },\n },\n ],\n environment: 'production',\n user_identities: {\n customer_id: 'user-123',\n },\n source_request_id: '1700000100000-gr0up-1',\n }),\n OPTIONS,\n ],\n ],\n};\n\n/**\n * screen_view event — mapping.settings.eventType switches the mParticle\n * event shape. Uses event name as the `screen_name`.\n */\nexport const screenView: Flow.StepExample = {\n in: getEvent('page view', {\n timestamp: 1700000200000,\n data: { title: 'Checkout', path: '/checkout' },\n user: { id: 'user-123' },\n source: { type: 'server', id: 'https://shop.example.com', previous_id: '' },\n }),\n mapping: {\n settings: { eventType: 'screen_view' },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n events: [\n {\n event_type: 'screen_view',\n data: {\n screen_name: 'page view',\n timestamp_unixtime_ms: 1700000200000,\n source_message_id: '1700000200000-gr0up-1',\n },\n },\n ],\n environment: 'production',\n user_identities: {\n customer_id: 'user-123',\n },\n source_request_id: '1700000200000-gr0up-1',\n }),\n OPTIONS,\n ],\n ],\n};\n\n/**\n * commerce_event — mapping.settings.eventType: 'commerce_event' plus a\n * `commerce` mapping resolves a ProductAction block. Products, currency,\n * and transaction metadata are all driven by the commerce mapping value.\n */\nexport const commercePurchase: Flow.StepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000300000,\n data: { id: 'ORD-300', total: 249.99, currency: 'EUR' },\n user: { id: 'user-123' },\n source: { type: 'server', id: 'https://shop.example.com', previous_id: '' },\n }),\n mapping: {\n settings: {\n eventType: 'commerce_event',\n commerce: {\n map: {\n currency_code: 'data.currency',\n product_action: {\n map: {\n action: { value: 'purchase' },\n transaction_id: 'data.id',\n total_amount: 'data.total',\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n events: [\n {\n event_type: 'commerce_event',\n data: {\n currency_code: 'EUR',\n product_action: {\n action: 'purchase',\n transaction_id: 'ORD-300',\n total_amount: 249.99,\n },\n timestamp_unixtime_ms: 1700000300000,\n source_message_id: '1700000300000-gr0up-1',\n },\n },\n ],\n environment: 'production',\n user_identities: {\n customer_id: 'user-123',\n },\n source_request_id: '1700000300000-gr0up-1',\n }),\n OPTIONS,\n ],\n ],\n};\n\n/**\n * Identity + attributes — verifies `user_identities` and `user_attributes`\n * come from the batch-level settings mappings, not the event payload.\n */\nexport const identityAndAttributes: Flow.StepExample = {\n in: getEvent('form submit', {\n timestamp: 1700000400000,\n data: { type: 'newsletter' },\n user: {\n id: 'user-123',\n email: 'user@example.com',\n },\n source: { type: 'server', id: 'https://example.com', previous_id: '' },\n }),\n mapping: undefined,\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n events: [\n {\n event_type: 'custom_event',\n data: {\n event_name: 'form submit',\n custom_event_type: 'other',\n timestamp_unixtime_ms: 1700000400000,\n source_message_id: '1700000400000-gr0up-1',\n },\n },\n ],\n environment: 'production',\n user_identities: {\n customer_id: 'user-123',\n email: 'user@example.com',\n },\n source_request_id: '1700000400000-gr0up-1',\n }),\n OPTIONS,\n ],\n ],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,KAAAA,UAAS;;;ACAlB,SAAS,SAAS;AAGX,IAAM,YAAY,EAAE,KAAK,CAAC,OAAO,OAAO,OA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AAA,EACF;AACF;","names":["z","z","z","z"]}
@@ -0,0 +1,52 @@
1
+ import { DestinationServer, sendServer } from '@walkeros/server-core';
2
+ import { Flow } from '@walkeros/core';
3
+
4
+ interface Env extends DestinationServer.Env {
5
+ sendServer?: typeof sendServer;
6
+ }
7
+
8
+ /**
9
+ * Standard mock environment for push operations.
10
+ */
11
+ declare const push: Env;
12
+ declare const simulation: string[];
13
+
14
+ declare const env_push: typeof push;
15
+ declare const env_simulation: typeof simulation;
16
+ declare namespace env {
17
+ export { env_push as push, env_simulation as simulation };
18
+ }
19
+
20
+ /**
21
+ * Default custom_event — a walkerOS event with no `eventType` mapping.
22
+ * mParticle wraps it as a `custom_event` with the default `other` category.
23
+ * user_identities are resolved at the batch level from
24
+ * `settings.userIdentities`.
25
+ */
26
+ declare const customEvent: Flow.StepExample;
27
+ /**
28
+ * screen_view event — mapping.settings.eventType switches the mParticle
29
+ * event shape. Uses event name as the `screen_name`.
30
+ */
31
+ declare const screenView: Flow.StepExample;
32
+ /**
33
+ * commerce_event — mapping.settings.eventType: 'commerce_event' plus a
34
+ * `commerce` mapping resolves a ProductAction block. Products, currency,
35
+ * and transaction metadata are all driven by the commerce mapping value.
36
+ */
37
+ declare const commercePurchase: Flow.StepExample;
38
+ /**
39
+ * Identity + attributes — verifies `user_identities` and `user_attributes`
40
+ * come from the batch-level settings mappings, not the event payload.
41
+ */
42
+ declare const identityAndAttributes: Flow.StepExample;
43
+
44
+ declare const step_commercePurchase: typeof commercePurchase;
45
+ declare const step_customEvent: typeof customEvent;
46
+ declare const step_identityAndAttributes: typeof identityAndAttributes;
47
+ declare const step_screenView: typeof screenView;
48
+ declare namespace step {
49
+ export { step_commercePurchase as commercePurchase, step_customEvent as customEvent, step_identityAndAttributes as identityAndAttributes, step_screenView as screenView };
50
+ }
51
+
52
+ export { env, step };
@@ -0,0 +1,52 @@
1
+ import { DestinationServer, sendServer } from '@walkeros/server-core';
2
+ import { Flow } from '@walkeros/core';
3
+
4
+ interface Env extends DestinationServer.Env {
5
+ sendServer?: typeof sendServer;
6
+ }
7
+
8
+ /**
9
+ * Standard mock environment for push operations.
10
+ */
11
+ declare const push: Env;
12
+ declare const simulation: string[];
13
+
14
+ declare const env_push: typeof push;
15
+ declare const env_simulation: typeof simulation;
16
+ declare namespace env {
17
+ export { env_push as push, env_simulation as simulation };
18
+ }
19
+
20
+ /**
21
+ * Default custom_event — a walkerOS event with no `eventType` mapping.
22
+ * mParticle wraps it as a `custom_event` with the default `other` category.
23
+ * user_identities are resolved at the batch level from
24
+ * `settings.userIdentities`.
25
+ */
26
+ declare const customEvent: Flow.StepExample;
27
+ /**
28
+ * screen_view event — mapping.settings.eventType switches the mParticle
29
+ * event shape. Uses event name as the `screen_name`.
30
+ */
31
+ declare const screenView: Flow.StepExample;
32
+ /**
33
+ * commerce_event — mapping.settings.eventType: 'commerce_event' plus a
34
+ * `commerce` mapping resolves a ProductAction block. Products, currency,
35
+ * and transaction metadata are all driven by the commerce mapping value.
36
+ */
37
+ declare const commercePurchase: Flow.StepExample;
38
+ /**
39
+ * Identity + attributes — verifies `user_identities` and `user_attributes`
40
+ * come from the batch-level settings mappings, not the event payload.
41
+ */
42
+ declare const identityAndAttributes: Flow.StepExample;
43
+
44
+ declare const step_commercePurchase: typeof commercePurchase;
45
+ declare const step_customEvent: typeof customEvent;
46
+ declare const step_identityAndAttributes: typeof identityAndAttributes;
47
+ declare const step_screenView: typeof screenView;
48
+ declare namespace step {
49
+ export { step_commercePurchase as commercePurchase, step_customEvent as customEvent, step_identityAndAttributes as identityAndAttributes, step_screenView as screenView };
50
+ }
51
+
52
+ export { env, step };