@walkeros/server-destination-bing 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,172 @@
1
+ # @walkeros/server-destination-bing
2
+
3
+ Server-side Microsoft Advertising (Bing UET) Conversions API destination for
4
+ walkerOS. Sends conversion events directly to Microsoft's UET CAPI via HTTP POST
5
+ for reliable server-to-server tracking.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @walkeros/server-destination-bing
11
+ ```
12
+
13
+ ## Quick Start
14
+
15
+ ```json
16
+ {
17
+ "destinations": {
18
+ "bing": {
19
+ "package": "@walkeros/server-destination-bing",
20
+ "config": {
21
+ "settings": {
22
+ "tagId": "YOUR_UET_TAG_ID",
23
+ "accessToken": "YOUR_ACCESS_TOKEN"
24
+ },
25
+ "mapping": {
26
+ "order": {
27
+ "complete": {
28
+ "name": "purchase",
29
+ "data": {
30
+ "map": {
31
+ "customData": {
32
+ "map": {
33
+ "value": "data.total",
34
+ "currency": "data.currency",
35
+ "transactionId": "data.id",
36
+ "pageType": { "value": "purchase" }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
42
+ },
43
+ "page": {
44
+ "view": {
45
+ "settings": { "eventType": "pageLoad" }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ ```
54
+
55
+ ## Settings
56
+
57
+ | Setting | Type | Required | Default | Description |
58
+ | --------------------------- | -------- | -------- | ------------------------------------ | ------------------------------------------------------------------- |
59
+ | `accessToken` | string | Yes | -- | Long-lived UET CAPI token from Microsoft Advertising |
60
+ | `tagId` | string | Yes | -- | Microsoft Advertising UET tag ID |
61
+ | `url` | string | No | `https://capi.uet.microsoft.com/v1/` | Custom Bing UET CAPI base URL |
62
+ | `doNotHash` | string[] | No | `[]` | User data fields to skip SHA-256 hashing |
63
+ | `user_data` | object | No | -- | Default user data mapping (e.g. `{ em: 'user.email' }`) |
64
+ | `dataProvider` | string | No | `walkerOS` | Identifier of the data source |
65
+ | `continueOnValidationError` | boolean | No | -- | When true, Microsoft continues ingesting events despite soft errors |
66
+
67
+ ## Event Types
68
+
69
+ Bing UET distinguishes two event types:
70
+
71
+ | `eventType` | When to Use |
72
+ | ----------- | ------------------------------------------------------ |
73
+ | `pageLoad` | Page views — no `eventName` required |
74
+ | `custom` | All other conversions (default) — `eventName` required |
75
+
76
+ Override per event via `mapping.settings.eventType`:
77
+
78
+ ```json
79
+ {
80
+ "mapping": {
81
+ "page": {
82
+ "view": { "settings": { "eventType": "pageLoad" } }
83
+ }
84
+ }
85
+ }
86
+ ```
87
+
88
+ For `custom` events, the `eventName` defaults to the walkerOS event name;
89
+ override it via the rule's `name` field.
90
+
91
+ ## User Data & Hashing
92
+
93
+ Only `em` and `ph` are SHA-256 hashed before sending. All other identity fields
94
+ pass through as-is:
95
+
96
+ | Field | Hashed | Description |
97
+ | ----------------- | ------ | ------------------------------------------------------- |
98
+ | `em` | Yes | Email — normalized (dots/alias removed) then lowercased |
99
+ | `ph` | Yes | Phone number (trimmed) |
100
+ | `anonymousId` | No | Anonymous ID |
101
+ | `externalId` | No | External / customer ID |
102
+ | `msclkid` | No | Microsoft click ID |
103
+ | `clientIpAddress` | No | Client IP address (IPv4 or IPv6) |
104
+ | `clientUserAgent` | No | Browser user agent string |
105
+ | `idfa` | No | iOS IDFA |
106
+ | `gaid` | No | Android advertising ID (GAID) |
107
+
108
+ ### Microsoft-specific email normalization
109
+
110
+ Before hashing, emails are normalized as follows:
111
+
112
+ 1. Trim whitespace
113
+ 2. Lowercase
114
+ 3. Remove dots from the user portion (e.g. `a.b.c@example.com` →
115
+ `abc@example.com`)
116
+ 4. Strip `+alias` suffix (e.g. `user+promo@example.com` → `user@example.com`)
117
+
118
+ Use the `doNotHash` setting to skip hashing for pre-hashed values.
119
+
120
+ ## customData Structure
121
+
122
+ Properties must be nested under `customData`:
123
+
124
+ ```json
125
+ {
126
+ "data": {
127
+ "map": {
128
+ "customData": {
129
+ "map": {
130
+ "value": "data.total",
131
+ "currency": "data.currency",
132
+ "transactionId": "data.id",
133
+ "items": {
134
+ "loop": [
135
+ "nested",
136
+ {
137
+ "map": {
138
+ "id": "data.id",
139
+ "name": "data.name",
140
+ "price": "data.price",
141
+ "quantity": { "key": "data.quantity", "value": 1 }
142
+ }
143
+ }
144
+ ]
145
+ }
146
+ }
147
+ }
148
+ }
149
+ }
150
+ }
151
+ ```
152
+
153
+ Common `customData` fields: `value`, `currency`, `transactionId`, `items`,
154
+ `itemIds`, `pageType`, `eventCategory`, `eventLabel`, `eventValue`,
155
+ `searchTerm`, `ecommTotalValue`, `ecommCategory`, `hotelData`.
156
+
157
+ ## Deduplication
158
+
159
+ The destination uses `event.id` as UET's `eventId`. When using both the UET
160
+ JavaScript tag client-side and this server destination, Microsoft dedupes
161
+ matching events across channels by `eventId` + `eventName`.
162
+
163
+ ## Consent
164
+
165
+ All events sent to this destination include `adStorageConsent: "G"` (granted).
166
+ Gate the destination via walkerOS consent rules at the collector level rather
167
+ than sending denied events with `D`.
168
+
169
+ ## Links
170
+
171
+ - [Microsoft UET CAPI Documentation](https://learn.microsoft.com/en-us/advertising/guides/universal-event-tracking-capi)
172
+ - [walkerOS Documentation](https://www.walkeros.io)
package/dist/dev.d.mts ADDED
@@ -0,0 +1,103 @@
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
+ /**
7
+ * Bing UET CAPI event type. `pageLoad` for page views, `custom` for all
8
+ * other conversion events.
9
+ * https://learn.microsoft.com/en-us/advertising/guides/universal-event-tracking-capi
10
+ */
11
+ declare const EventTypeSchema: z.ZodEnum<{
12
+ custom: "custom";
13
+ pageLoad: "pageLoad";
14
+ }>;
15
+ /**
16
+ * adStorageConsent — `G` when granted, `D` when denied. Defaults to `G`
17
+ * when the event reaches the destination (pre-filtered via consent rules).
18
+ */
19
+ declare const AdStorageConsentSchema: z.ZodEnum<{
20
+ G: "G";
21
+ D: "D";
22
+ }>;
23
+
24
+ declare const SettingsSchema: z.ZodObject<{
25
+ accessToken: z.ZodString;
26
+ tagId: z.ZodString;
27
+ url: z.ZodOptional<z.ZodString>;
28
+ doNotHash: z.ZodOptional<z.ZodArray<z.ZodString>>;
29
+ user_data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
30
+ dataProvider: z.ZodOptional<z.ZodString>;
31
+ continueOnValidationError: z.ZodOptional<z.ZodBoolean>;
32
+ }, z.core.$strip>;
33
+ type Settings = z.infer<typeof SettingsSchema>;
34
+
35
+ /**
36
+ * Bing UET CAPI Mapping Schema
37
+ * Per-event overrides. Use `eventType: 'pageLoad'` for page view events.
38
+ */
39
+ declare const MappingSchema: z.ZodObject<{
40
+ eventType: z.ZodOptional<z.ZodEnum<{
41
+ custom: "custom";
42
+ pageLoad: "pageLoad";
43
+ }>>;
44
+ }, z.core.$strip>;
45
+ /**
46
+ * Type inference from MappingSchema
47
+ */
48
+ type Mapping = z.infer<typeof MappingSchema>;
49
+
50
+ declare const settings: _walkeros_core_dev.JSONSchema;
51
+ declare const mapping: _walkeros_core_dev.JSONSchema;
52
+
53
+ declare const index$1_AdStorageConsentSchema: typeof AdStorageConsentSchema;
54
+ declare const index$1_EventTypeSchema: typeof EventTypeSchema;
55
+ type index$1_Mapping = Mapping;
56
+ declare const index$1_MappingSchema: typeof MappingSchema;
57
+ type index$1_Settings = Settings;
58
+ declare const index$1_SettingsSchema: typeof SettingsSchema;
59
+ declare const index$1_mapping: typeof mapping;
60
+ declare const index$1_settings: typeof settings;
61
+ declare namespace index$1 {
62
+ export { index$1_AdStorageConsentSchema as AdStorageConsentSchema, index$1_EventTypeSchema as EventTypeSchema, type index$1_Mapping as Mapping, index$1_MappingSchema as MappingSchema, type index$1_Settings as Settings, index$1_SettingsSchema as SettingsSchema, index$1_mapping as mapping, index$1_settings as settings };
63
+ }
64
+
65
+ interface Env extends DestinationServer.Env {
66
+ sendServer?: typeof sendServer;
67
+ }
68
+
69
+ /**
70
+ * Standard mock environment for push operations.
71
+ *
72
+ * Use this for testing Bing UET CAPI events without making actual HTTP
73
+ * requests to Microsoft's servers.
74
+ */
75
+ declare const push: Env;
76
+ declare const simulation: string[];
77
+
78
+ declare const env_push: typeof push;
79
+ declare const env_simulation: typeof simulation;
80
+ declare namespace env {
81
+ export { env_push as push, env_simulation as simulation };
82
+ }
83
+
84
+ declare const purchase: Flow.StepExample;
85
+ declare const pageView: Flow.StepExample;
86
+ declare const lead: Flow.StepExample;
87
+ declare const addToCart: Flow.StepExample;
88
+
89
+ declare const step_addToCart: typeof addToCart;
90
+ declare const step_lead: typeof lead;
91
+ declare const step_pageView: typeof pageView;
92
+ declare const step_purchase: typeof purchase;
93
+ declare namespace step {
94
+ export { step_addToCart as addToCart, step_lead as lead, step_pageView as pageView, step_purchase as purchase };
95
+ }
96
+
97
+ declare const index_env: typeof env;
98
+ declare const index_step: typeof step;
99
+ declare namespace index {
100
+ export { index_env as env, index_step as step };
101
+ }
102
+
103
+ export { index as examples, index$1 as schemas };
package/dist/dev.d.ts ADDED
@@ -0,0 +1,103 @@
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
+ /**
7
+ * Bing UET CAPI event type. `pageLoad` for page views, `custom` for all
8
+ * other conversion events.
9
+ * https://learn.microsoft.com/en-us/advertising/guides/universal-event-tracking-capi
10
+ */
11
+ declare const EventTypeSchema: z.ZodEnum<{
12
+ custom: "custom";
13
+ pageLoad: "pageLoad";
14
+ }>;
15
+ /**
16
+ * adStorageConsent — `G` when granted, `D` when denied. Defaults to `G`
17
+ * when the event reaches the destination (pre-filtered via consent rules).
18
+ */
19
+ declare const AdStorageConsentSchema: z.ZodEnum<{
20
+ G: "G";
21
+ D: "D";
22
+ }>;
23
+
24
+ declare const SettingsSchema: z.ZodObject<{
25
+ accessToken: z.ZodString;
26
+ tagId: z.ZodString;
27
+ url: z.ZodOptional<z.ZodString>;
28
+ doNotHash: z.ZodOptional<z.ZodArray<z.ZodString>>;
29
+ user_data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
30
+ dataProvider: z.ZodOptional<z.ZodString>;
31
+ continueOnValidationError: z.ZodOptional<z.ZodBoolean>;
32
+ }, z.core.$strip>;
33
+ type Settings = z.infer<typeof SettingsSchema>;
34
+
35
+ /**
36
+ * Bing UET CAPI Mapping Schema
37
+ * Per-event overrides. Use `eventType: 'pageLoad'` for page view events.
38
+ */
39
+ declare const MappingSchema: z.ZodObject<{
40
+ eventType: z.ZodOptional<z.ZodEnum<{
41
+ custom: "custom";
42
+ pageLoad: "pageLoad";
43
+ }>>;
44
+ }, z.core.$strip>;
45
+ /**
46
+ * Type inference from MappingSchema
47
+ */
48
+ type Mapping = z.infer<typeof MappingSchema>;
49
+
50
+ declare const settings: _walkeros_core_dev.JSONSchema;
51
+ declare const mapping: _walkeros_core_dev.JSONSchema;
52
+
53
+ declare const index$1_AdStorageConsentSchema: typeof AdStorageConsentSchema;
54
+ declare const index$1_EventTypeSchema: typeof EventTypeSchema;
55
+ type index$1_Mapping = Mapping;
56
+ declare const index$1_MappingSchema: typeof MappingSchema;
57
+ type index$1_Settings = Settings;
58
+ declare const index$1_SettingsSchema: typeof SettingsSchema;
59
+ declare const index$1_mapping: typeof mapping;
60
+ declare const index$1_settings: typeof settings;
61
+ declare namespace index$1 {
62
+ export { index$1_AdStorageConsentSchema as AdStorageConsentSchema, index$1_EventTypeSchema as EventTypeSchema, type index$1_Mapping as Mapping, index$1_MappingSchema as MappingSchema, type index$1_Settings as Settings, index$1_SettingsSchema as SettingsSchema, index$1_mapping as mapping, index$1_settings as settings };
63
+ }
64
+
65
+ interface Env extends DestinationServer.Env {
66
+ sendServer?: typeof sendServer;
67
+ }
68
+
69
+ /**
70
+ * Standard mock environment for push operations.
71
+ *
72
+ * Use this for testing Bing UET CAPI events without making actual HTTP
73
+ * requests to Microsoft's servers.
74
+ */
75
+ declare const push: Env;
76
+ declare const simulation: string[];
77
+
78
+ declare const env_push: typeof push;
79
+ declare const env_simulation: typeof simulation;
80
+ declare namespace env {
81
+ export { env_push as push, env_simulation as simulation };
82
+ }
83
+
84
+ declare const purchase: Flow.StepExample;
85
+ declare const pageView: Flow.StepExample;
86
+ declare const lead: Flow.StepExample;
87
+ declare const addToCart: Flow.StepExample;
88
+
89
+ declare const step_addToCart: typeof addToCart;
90
+ declare const step_lead: typeof lead;
91
+ declare const step_pageView: typeof pageView;
92
+ declare const step_purchase: typeof purchase;
93
+ declare namespace step {
94
+ export { step_addToCart as addToCart, step_lead as lead, step_pageView as pageView, step_purchase as purchase };
95
+ }
96
+
97
+ declare const index_env: typeof env;
98
+ declare const index_step: typeof step;
99
+ declare namespace index {
100
+ export { index_env as env, index_step as step };
101
+ }
102
+
103
+ export { index as examples, index$1 as schemas };
package/dist/dev.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,i=(e,a)=>{for(var r in a)t(e,r,{get:a[r],enumerable:!0})},n={};i(n,{examples:()=>S,schemas:()=>s}),module.exports=(e=n,((e,i,n,s)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let d of r(i))o.call(e,d)||d===n||t(e,d,{get:()=>i[d],enumerable:!(s=a(i,d))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s={};i(s,{AdStorageConsentSchema:()=>v,EventTypeSchema:()=>l,MappingSchema:()=>g,SettingsSchema:()=>p,mapping:()=>h,settings:()=>y});var d=require("@walkeros/core/dev"),c=require("@walkeros/core/dev"),p=c.z.object({accessToken:c.z.string().min(1).describe("Long-lived Bing UET CAPI access token from Microsoft Advertising"),tagId:c.z.string().min(1).describe("Microsoft Advertising UET tag ID"),url:c.z.string().url().describe("Custom Bing UET CAPI base URL (default https://capi.uet.microsoft.com/v1/)").optional(),doNotHash:c.z.array(c.z.string()).describe("User data fields to skip hashing (like ['em', 'ph'])").optional(),user_data:c.z.record(c.z.string(),c.z.string()).describe("Mapping for user data fields (like { em: 'user.email' })").optional(),dataProvider:c.z.string().describe('Identifier of the data source (default "walkerOS")').optional(),continueOnValidationError:c.z.boolean().describe("When true, Microsoft continues to ingest events despite validation errors").optional()}),u=require("@walkeros/core/dev"),m=require("@walkeros/core/dev"),l=m.z.enum(["pageLoad","custom"]),v=m.z.enum(["G","D"]),g=u.z.object({eventType:l.describe('Override event type: "pageLoad" for page views, "custom" (default) otherwise').optional()}),y=(0,d.zodToSchema)(p),h=(0,d.zodToSchema)(g),S={};i(S,{env:()=>f,step:()=>k});var f={};i(f,{push:()=>b,simulation:()=>O});var b={sendServer:async()=>({ok:!0,data:{status:"OK",requestId:"mock-123"}})},O=["sendServer"],k={};i(k,{addToCart:()=>q,lead:()=>E,pageView:()=>D,purchase:()=>z});var T=require("@walkeros/core"),U="https://capi.uet.microsoft.com/v1/UET-12345/events",w={headers:{Authorization:"Bearer s3cr3t","Content-Type":"application/json"}},z={in:(0,T.getEvent)("order complete",{timestamp:17000009e5,data:{id:"ORD-300",total:249.99,currency:"EUR"},nested:[{entity:"product",data:{id:"SKU-A1",name:"Widget Pro",price:124.99,quantity:2}}],user:{id:"user-123",device:"device-456"},source:{type:"server",id:"https://shop.example.com/checkout/complete",previous_id:""}}),mapping:{name:"purchase",data:{map:{customData:{map:{value:"data.total",currency:{key:"data.currency",value:"EUR"},transactionId:"data.id",pageType:{value:"purchase"},items:{loop:["nested",{condition:e=>(0,T.isObject)(e)&&"product"===e.entity,map:{id:"data.id",name:"data.name",price:"data.price",quantity:{key:"data.quantity",value:1}}}]}}},userData:{map:{externalId:"user.id"}}}}},out:[["sendServer",U,JSON.stringify({data:[{eventType:"custom",eventId:"1700000900000-gr0up-1",eventTime:1700000900,adStorageConsent:"G",userData:{externalId:"user-123"},eventName:"purchase",eventSourceUrl:"https://shop.example.com/checkout/complete",customData:{value:249.99,currency:"EUR",transactionId:"ORD-300",pageType:"purchase",items:[{id:"SKU-A1",name:"Widget Pro",price:124.99,quantity:2}]}}],dataProvider:"walkerOS"}),w]]},D={in:(0,T.getEvent)("page view",{timestamp:1700000901e3,source:{type:"server",id:"https://example.com/docs/",previous_id:""}}),mapping:{settings:{eventType:"pageLoad"}},out:[["sendServer",U,JSON.stringify({data:[{eventType:"pageLoad",eventId:"1700000901000-gr0up-1",eventTime:1700000901,adStorageConsent:"G",userData:{},eventSourceUrl:"https://example.com/docs/"}],dataProvider:"walkerOS"}),w]]},E={in:(0,T.getEvent)("form submit",{timestamp:1700000902e3,data:{type:"newsletter"},user:{email:"user@example.com"},source:{type:"server",id:"https://example.com/contact",previous_id:""}}),mapping:{name:"lead",data:{map:{userData:{map:{em:"user.email"}}}}},out:[["sendServer",U,JSON.stringify({data:[{eventType:"custom",eventId:"1700000902000-gr0up-1",eventTime:1700000902,adStorageConsent:"G",userData:{em:"b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514"},eventName:"lead",eventSourceUrl:"https://example.com/contact"}],dataProvider:"walkerOS"}),w]]},q={in:(0,T.getEvent)("product add",{timestamp:1700000903e3,data:{id:"SKU-B2",name:"Running Shoes",price:89.99,color:"blue"},nested:[{entity:"product",data:{id:"SKU-B2",name:"Running Shoes",price:89.99,quantity:1}}],source:{type:"server",id:"https://shop.example.com/products/running-shoes",previous_id:""}}),mapping:{name:"add_to_cart",data:{map:{customData:{map:{value:"data.price",currency:{value:"EUR"},items:{loop:["nested",{condition:e=>(0,T.isObject)(e)&&"product"===e.entity,map:{id:"data.id",name:"data.name",price:"data.price",quantity:{key:"data.quantity",value:1}}}]}}}}}},out:[["sendServer",U,JSON.stringify({data:[{eventType:"custom",eventId:"1700000903000-gr0up-1",eventTime:1700000903,adStorageConsent:"G",userData:{},eventName:"add_to_cart",eventSourceUrl:"https://shop.example.com/products/running-shoes",customData:{value:89.99,currency:"EUR",items:[{id:"SKU-B2",name:"Running Shoes",price:89.99,quantity:1}]}}],dataProvider:"walkerOS"}),w]]};//# sourceMappingURL=dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/schemas/primitives.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';\n\nexport const SettingsSchema = z.object({\n accessToken: z\n .string()\n .min(1)\n .describe(\n 'Long-lived Bing UET CAPI access token from Microsoft Advertising',\n ),\n tagId: z.string().min(1).describe('Microsoft Advertising UET tag ID'),\n url: z\n .string()\n .url()\n .describe(\n 'Custom Bing UET CAPI base URL (default https://capi.uet.microsoft.com/v1/)',\n )\n .optional(),\n doNotHash: z\n .array(z.string())\n .describe(\"User data fields to skip hashing (like ['em', 'ph'])\")\n .optional(),\n user_data: z\n .record(z.string(), z.string())\n .describe(\"Mapping for user data fields (like { em: 'user.email' })\")\n .optional(),\n dataProvider: z\n .string()\n .describe('Identifier of the data source (default \"walkerOS\")')\n .optional(),\n continueOnValidationError: z\n .boolean()\n .describe(\n 'When true, Microsoft continues to ingest events despite validation errors',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\nimport { EventTypeSchema } from './primitives';\n\n/**\n * Bing UET CAPI Mapping Schema\n * Per-event overrides. Use `eventType: 'pageLoad'` for page view events.\n */\nexport const MappingSchema = z.object({\n eventType: EventTypeSchema.describe(\n 'Override event type: \"pageLoad\" for page views, \"custom\" (default) otherwise',\n ).optional(),\n});\n\n/**\n * Type inference from MappingSchema\n */\nexport type Mapping = z.infer<typeof MappingSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * Bing UET CAPI event type. `pageLoad` for page views, `custom` for all\n * other conversion events.\n * https://learn.microsoft.com/en-us/advertising/guides/universal-event-tracking-capi\n */\nexport const EventTypeSchema = z.enum(['pageLoad', 'custom']);\n\n/**\n * adStorageConsent — `G` when granted, `D` when denied. Defaults to `G`\n * when the event reaches the destination (pre-filtered via consent rules).\n */\nexport const AdStorageConsentSchema = z.enum(['G', 'D']);\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 the Bing UET CAPI destination.\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring actual HTTP requests.\n */\n\ntype MockSendServer = (\n url: string,\n data?: SendDataValue,\n options?: SendServerOptions,\n) => Promise<SendResponse>;\n\nconst mockSendServer: MockSendServer = async () => ({\n ok: true,\n data: {\n status: 'OK',\n requestId: 'mock-123',\n },\n});\n\n/**\n * Standard mock environment for push operations.\n *\n * Use this for testing Bing UET CAPI events without making actual HTTP\n * requests to Microsoft's servers.\n */\nexport const push: Env = {\n sendServer: mockSendServer,\n};\n\nexport const simulation = ['sendServer'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent, isObject } from '@walkeros/core';\n\n/**\n * Bing UET CAPI step examples.\n *\n * At push time, the destination calls\n * `env.sendServer(endpoint, JSON.stringify(body), options)` where\n * `endpoint = ${settings.url}${settings.tagId}/events`\n * and `body = { data: [capiEvent], dataProvider }`.\n *\n * Test fixture pins `tagId = 'UET-12345'` and the default url, so every\n * endpoint resolves to:\n * https://capi.uet.microsoft.com/v1/UET-12345/events\n *\n * Body is emitted with keys in the order the destination assembles them:\n * 1. eventType\n * 2. eventId\n * 3. eventTime (unix seconds; `Math.round(event.timestamp / 1000)`)\n * 4. adStorageConsent\n * 5. userData (hashed — only `em`, `ph` via SHA-256)\n * 6. eventName (only when eventType === 'custom')\n * 7. eventSourceUrl (only when event.source.id is set)\n * 8. customData (only when it has keys)\n *\n * The `options` argument carries the Authorization + Content-Type headers.\n */\nconst ENDPOINT = 'https://capi.uet.microsoft.com/v1/UET-12345/events';\nconst OPTIONS = {\n headers: {\n Authorization: 'Bearer s3cr3t',\n 'Content-Type': 'application/json',\n },\n};\n\nexport const purchase: Flow.StepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000900000,\n data: { id: 'ORD-300', total: 249.99, currency: 'EUR' },\n nested: [\n {\n entity: 'product',\n data: { id: 'SKU-A1', name: 'Widget Pro', price: 124.99, quantity: 2 },\n },\n ],\n user: { id: 'user-123', device: 'device-456' },\n source: {\n type: 'server',\n id: 'https://shop.example.com/checkout/complete',\n previous_id: '',\n },\n }),\n mapping: {\n name: 'purchase',\n data: {\n map: {\n customData: {\n map: {\n value: 'data.total',\n currency: { key: 'data.currency', value: 'EUR' },\n transactionId: 'data.id',\n pageType: { value: 'purchase' },\n items: {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n id: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { key: 'data.quantity', value: 1 },\n },\n },\n ],\n },\n },\n },\n userData: {\n map: {\n externalId: 'user.id',\n },\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n data: [\n {\n eventType: 'custom',\n eventId: '1700000900000-gr0up-1',\n eventTime: 1700000900,\n adStorageConsent: 'G',\n userData: {\n externalId: 'user-123',\n },\n eventName: 'purchase',\n eventSourceUrl: 'https://shop.example.com/checkout/complete',\n customData: {\n value: 249.99,\n currency: 'EUR',\n transactionId: 'ORD-300',\n pageType: 'purchase',\n items: [\n {\n id: 'SKU-A1',\n name: 'Widget Pro',\n price: 124.99,\n quantity: 2,\n },\n ],\n },\n },\n ],\n dataProvider: 'walkerOS',\n }),\n OPTIONS,\n ],\n ],\n};\n\nexport const pageView: Flow.StepExample = {\n in: getEvent('page view', {\n timestamp: 1700000901000,\n source: {\n type: 'server',\n id: 'https://example.com/docs/',\n previous_id: '',\n },\n }),\n mapping: {\n settings: { eventType: 'pageLoad' },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n data: [\n {\n eventType: 'pageLoad',\n eventId: '1700000901000-gr0up-1',\n eventTime: 1700000901,\n adStorageConsent: 'G',\n userData: {},\n eventSourceUrl: 'https://example.com/docs/',\n },\n ],\n dataProvider: 'walkerOS',\n }),\n OPTIONS,\n ],\n ],\n};\n\nexport const lead: Flow.StepExample = {\n in: getEvent('form submit', {\n timestamp: 1700000902000,\n data: { type: 'newsletter' },\n user: { email: 'user@example.com' },\n source: {\n type: 'server',\n id: 'https://example.com/contact',\n previous_id: '',\n },\n }),\n mapping: {\n name: 'lead',\n data: {\n map: {\n userData: {\n map: {\n em: 'user.email',\n },\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n data: [\n {\n eventType: 'custom',\n eventId: '1700000902000-gr0up-1',\n eventTime: 1700000902,\n adStorageConsent: 'G',\n userData: {\n // sha256(normalizeEmail('user@example.com'))\n em: 'b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514',\n },\n eventName: 'lead',\n eventSourceUrl: 'https://example.com/contact',\n },\n ],\n dataProvider: 'walkerOS',\n }),\n OPTIONS,\n ],\n ],\n};\n\nexport const addToCart: Flow.StepExample = {\n in: getEvent('product add', {\n timestamp: 1700000903000,\n data: {\n id: 'SKU-B2',\n name: 'Running Shoes',\n price: 89.99,\n color: 'blue',\n },\n nested: [\n {\n entity: 'product',\n data: {\n id: 'SKU-B2',\n name: 'Running Shoes',\n price: 89.99,\n quantity: 1,\n },\n },\n ],\n source: {\n type: 'server',\n id: 'https://shop.example.com/products/running-shoes',\n previous_id: '',\n },\n }),\n mapping: {\n name: 'add_to_cart',\n data: {\n map: {\n customData: {\n map: {\n value: 'data.price',\n currency: { value: 'EUR' },\n items: {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n id: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { key: 'data.quantity', value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n data: [\n {\n eventType: 'custom',\n eventId: '1700000903000-gr0up-1',\n eventTime: 1700000903,\n adStorageConsent: 'G',\n userData: {},\n eventName: 'add_to_cart',\n eventSourceUrl: 'https://shop.example.com/products/running-shoes',\n customData: {\n value: 89.99,\n currency: 'EUR',\n items: [\n {\n id: 'SKU-B2',\n name: 'Running Shoes',\n price: 89.99,\n quantity: 1,\n },\n ],\n },\n },\n ],\n dataProvider: 'walkerOS',\n }),\n OPTIONS,\n ],\n ],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,aAAa,aACV,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,OAAO,aAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,kCAAkC;AAAA,EACpE,KAAK,aACF,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,WAAW,aACR,MAAM,aAAE,OAAO,CAAC,EAChB,SAAS,sDAAsD,EAC/D,SAAS;AAAA,EACZ,WAAW,aACR,OAAO,aAAE,OAAO,GAAG,aAAE,OAAO,CAAC,EAC7B,SAAS,0DAA0D,EACnE,SAAS;AAAA,EACZ,cAAc,aACX,OAAO,EACP,SAAS,oDAAoD,EAC7D,SAAS;AAAA,EACZ,2BAA2B,aACxB,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;ACnCD,IAAAC,cAAkB;;;ACAlB,IAAAC,cAAkB;AAOX,IAAM,kBAAkB,cAAE,KAAK,CAAC,YAAY,QAAQ,CAAC;AAMrD,IAAM,yBAAyB,cAAE,KAAK,CAAC,KAAK,GAAG,CAAC;;;ADNhD,IAAM,gBAAgB,cAAE,OAAO;AAAA,EACpC,WAAW,gBAAgB;AAAA,IACzB;AAAA,EACF,EAAE,SAAS;AACb,CAAC;;;AFDM,IAAM,eAAW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var e=Object.defineProperty,t=(t,a)=>{for(var r in a)e(t,r,{get:a[r],enumerable:!0})},a={};t(a,{AdStorageConsentSchema:()=>p,EventTypeSchema:()=>d,MappingSchema:()=>c,SettingsSchema:()=>i,mapping:()=>u,settings:()=>m});import{zodToSchema as r}from"@walkeros/core/dev";import{z as o}from"@walkeros/core/dev";var i=o.object({accessToken:o.string().min(1).describe("Long-lived Bing UET CAPI access token from Microsoft Advertising"),tagId:o.string().min(1).describe("Microsoft Advertising UET tag ID"),url:o.string().url().describe("Custom Bing UET CAPI base URL (default https://capi.uet.microsoft.com/v1/)").optional(),doNotHash:o.array(o.string()).describe("User data fields to skip hashing (like ['em', 'ph'])").optional(),user_data:o.record(o.string(),o.string()).describe("Mapping for user data fields (like { em: 'user.email' })").optional(),dataProvider:o.string().describe('Identifier of the data source (default "walkerOS")').optional(),continueOnValidationError:o.boolean().describe("When true, Microsoft continues to ingest events despite validation errors").optional()});import{z as n}from"@walkeros/core/dev";import{z as s}from"@walkeros/core/dev";var d=s.enum(["pageLoad","custom"]),p=s.enum(["G","D"]),c=n.object({eventType:d.describe('Override event type: "pageLoad" for page views, "custom" (default) otherwise').optional()}),m=r(i),u=r(c),v={};t(v,{env:()=>l,step:()=>h});var l={};t(l,{push:()=>g,simulation:()=>y});var g={sendServer:async()=>({ok:!0,data:{status:"OK",requestId:"mock-123"}})},y=["sendServer"],h={};t(h,{addToCart:()=>O,lead:()=>w,pageView:()=>U,purchase:()=>T});import{getEvent as S,isObject as f}from"@walkeros/core";var k="https://capi.uet.microsoft.com/v1/UET-12345/events",b={headers:{Authorization:"Bearer s3cr3t","Content-Type":"application/json"}},T={in:S("order complete",{timestamp:17000009e5,data:{id:"ORD-300",total:249.99,currency:"EUR"},nested:[{entity:"product",data:{id:"SKU-A1",name:"Widget Pro",price:124.99,quantity:2}}],user:{id:"user-123",device:"device-456"},source:{type:"server",id:"https://shop.example.com/checkout/complete",previous_id:""}}),mapping:{name:"purchase",data:{map:{customData:{map:{value:"data.total",currency:{key:"data.currency",value:"EUR"},transactionId:"data.id",pageType:{value:"purchase"},items:{loop:["nested",{condition:e=>f(e)&&"product"===e.entity,map:{id:"data.id",name:"data.name",price:"data.price",quantity:{key:"data.quantity",value:1}}}]}}},userData:{map:{externalId:"user.id"}}}}},out:[["sendServer",k,JSON.stringify({data:[{eventType:"custom",eventId:"1700000900000-gr0up-1",eventTime:1700000900,adStorageConsent:"G",userData:{externalId:"user-123"},eventName:"purchase",eventSourceUrl:"https://shop.example.com/checkout/complete",customData:{value:249.99,currency:"EUR",transactionId:"ORD-300",pageType:"purchase",items:[{id:"SKU-A1",name:"Widget Pro",price:124.99,quantity:2}]}}],dataProvider:"walkerOS"}),b]]},U={in:S("page view",{timestamp:1700000901e3,source:{type:"server",id:"https://example.com/docs/",previous_id:""}}),mapping:{settings:{eventType:"pageLoad"}},out:[["sendServer",k,JSON.stringify({data:[{eventType:"pageLoad",eventId:"1700000901000-gr0up-1",eventTime:1700000901,adStorageConsent:"G",userData:{},eventSourceUrl:"https://example.com/docs/"}],dataProvider:"walkerOS"}),b]]},w={in:S("form submit",{timestamp:1700000902e3,data:{type:"newsletter"},user:{email:"user@example.com"},source:{type:"server",id:"https://example.com/contact",previous_id:""}}),mapping:{name:"lead",data:{map:{userData:{map:{em:"user.email"}}}}},out:[["sendServer",k,JSON.stringify({data:[{eventType:"custom",eventId:"1700000902000-gr0up-1",eventTime:1700000902,adStorageConsent:"G",userData:{em:"b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514"},eventName:"lead",eventSourceUrl:"https://example.com/contact"}],dataProvider:"walkerOS"}),b]]},O={in:S("product add",{timestamp:1700000903e3,data:{id:"SKU-B2",name:"Running Shoes",price:89.99,color:"blue"},nested:[{entity:"product",data:{id:"SKU-B2",name:"Running Shoes",price:89.99,quantity:1}}],source:{type:"server",id:"https://shop.example.com/products/running-shoes",previous_id:""}}),mapping:{name:"add_to_cart",data:{map:{customData:{map:{value:"data.price",currency:{value:"EUR"},items:{loop:["nested",{condition:e=>f(e)&&"product"===e.entity,map:{id:"data.id",name:"data.name",price:"data.price",quantity:{key:"data.quantity",value:1}}}]}}}}}},out:[["sendServer",k,JSON.stringify({data:[{eventType:"custom",eventId:"1700000903000-gr0up-1",eventTime:1700000903,adStorageConsent:"G",userData:{},eventName:"add_to_cart",eventSourceUrl:"https://shop.example.com/products/running-shoes",customData:{value:89.99,currency:"EUR",items:[{id:"SKU-B2",name:"Running Shoes",price:89.99,quantity:1}]}}],dataProvider:"walkerOS"}),b]]};export{v as examples,a as schemas};//# sourceMappingURL=dev.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/schemas/primitives.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';\n\nexport const SettingsSchema = z.object({\n accessToken: z\n .string()\n .min(1)\n .describe(\n 'Long-lived Bing UET CAPI access token from Microsoft Advertising',\n ),\n tagId: z.string().min(1).describe('Microsoft Advertising UET tag ID'),\n url: z\n .string()\n .url()\n .describe(\n 'Custom Bing UET CAPI base URL (default https://capi.uet.microsoft.com/v1/)',\n )\n .optional(),\n doNotHash: z\n .array(z.string())\n .describe(\"User data fields to skip hashing (like ['em', 'ph'])\")\n .optional(),\n user_data: z\n .record(z.string(), z.string())\n .describe(\"Mapping for user data fields (like { em: 'user.email' })\")\n .optional(),\n dataProvider: z\n .string()\n .describe('Identifier of the data source (default \"walkerOS\")')\n .optional(),\n continueOnValidationError: z\n .boolean()\n .describe(\n 'When true, Microsoft continues to ingest events despite validation errors',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\nimport { EventTypeSchema } from './primitives';\n\n/**\n * Bing UET CAPI Mapping Schema\n * Per-event overrides. Use `eventType: 'pageLoad'` for page view events.\n */\nexport const MappingSchema = z.object({\n eventType: EventTypeSchema.describe(\n 'Override event type: \"pageLoad\" for page views, \"custom\" (default) otherwise',\n ).optional(),\n});\n\n/**\n * Type inference from MappingSchema\n */\nexport type Mapping = z.infer<typeof MappingSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * Bing UET CAPI event type. `pageLoad` for page views, `custom` for all\n * other conversion events.\n * https://learn.microsoft.com/en-us/advertising/guides/universal-event-tracking-capi\n */\nexport const EventTypeSchema = z.enum(['pageLoad', 'custom']);\n\n/**\n * adStorageConsent — `G` when granted, `D` when denied. Defaults to `G`\n * when the event reaches the destination (pre-filtered via consent rules).\n */\nexport const AdStorageConsentSchema = z.enum(['G', 'D']);\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 the Bing UET CAPI destination.\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring actual HTTP requests.\n */\n\ntype MockSendServer = (\n url: string,\n data?: SendDataValue,\n options?: SendServerOptions,\n) => Promise<SendResponse>;\n\nconst mockSendServer: MockSendServer = async () => ({\n ok: true,\n data: {\n status: 'OK',\n requestId: 'mock-123',\n },\n});\n\n/**\n * Standard mock environment for push operations.\n *\n * Use this for testing Bing UET CAPI events without making actual HTTP\n * requests to Microsoft's servers.\n */\nexport const push: Env = {\n sendServer: mockSendServer,\n};\n\nexport const simulation = ['sendServer'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent, isObject } from '@walkeros/core';\n\n/**\n * Bing UET CAPI step examples.\n *\n * At push time, the destination calls\n * `env.sendServer(endpoint, JSON.stringify(body), options)` where\n * `endpoint = ${settings.url}${settings.tagId}/events`\n * and `body = { data: [capiEvent], dataProvider }`.\n *\n * Test fixture pins `tagId = 'UET-12345'` and the default url, so every\n * endpoint resolves to:\n * https://capi.uet.microsoft.com/v1/UET-12345/events\n *\n * Body is emitted with keys in the order the destination assembles them:\n * 1. eventType\n * 2. eventId\n * 3. eventTime (unix seconds; `Math.round(event.timestamp / 1000)`)\n * 4. adStorageConsent\n * 5. userData (hashed — only `em`, `ph` via SHA-256)\n * 6. eventName (only when eventType === 'custom')\n * 7. eventSourceUrl (only when event.source.id is set)\n * 8. customData (only when it has keys)\n *\n * The `options` argument carries the Authorization + Content-Type headers.\n */\nconst ENDPOINT = 'https://capi.uet.microsoft.com/v1/UET-12345/events';\nconst OPTIONS = {\n headers: {\n Authorization: 'Bearer s3cr3t',\n 'Content-Type': 'application/json',\n },\n};\n\nexport const purchase: Flow.StepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000900000,\n data: { id: 'ORD-300', total: 249.99, currency: 'EUR' },\n nested: [\n {\n entity: 'product',\n data: { id: 'SKU-A1', name: 'Widget Pro', price: 124.99, quantity: 2 },\n },\n ],\n user: { id: 'user-123', device: 'device-456' },\n source: {\n type: 'server',\n id: 'https://shop.example.com/checkout/complete',\n previous_id: '',\n },\n }),\n mapping: {\n name: 'purchase',\n data: {\n map: {\n customData: {\n map: {\n value: 'data.total',\n currency: { key: 'data.currency', value: 'EUR' },\n transactionId: 'data.id',\n pageType: { value: 'purchase' },\n items: {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n id: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { key: 'data.quantity', value: 1 },\n },\n },\n ],\n },\n },\n },\n userData: {\n map: {\n externalId: 'user.id',\n },\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n data: [\n {\n eventType: 'custom',\n eventId: '1700000900000-gr0up-1',\n eventTime: 1700000900,\n adStorageConsent: 'G',\n userData: {\n externalId: 'user-123',\n },\n eventName: 'purchase',\n eventSourceUrl: 'https://shop.example.com/checkout/complete',\n customData: {\n value: 249.99,\n currency: 'EUR',\n transactionId: 'ORD-300',\n pageType: 'purchase',\n items: [\n {\n id: 'SKU-A1',\n name: 'Widget Pro',\n price: 124.99,\n quantity: 2,\n },\n ],\n },\n },\n ],\n dataProvider: 'walkerOS',\n }),\n OPTIONS,\n ],\n ],\n};\n\nexport const pageView: Flow.StepExample = {\n in: getEvent('page view', {\n timestamp: 1700000901000,\n source: {\n type: 'server',\n id: 'https://example.com/docs/',\n previous_id: '',\n },\n }),\n mapping: {\n settings: { eventType: 'pageLoad' },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n data: [\n {\n eventType: 'pageLoad',\n eventId: '1700000901000-gr0up-1',\n eventTime: 1700000901,\n adStorageConsent: 'G',\n userData: {},\n eventSourceUrl: 'https://example.com/docs/',\n },\n ],\n dataProvider: 'walkerOS',\n }),\n OPTIONS,\n ],\n ],\n};\n\nexport const lead: Flow.StepExample = {\n in: getEvent('form submit', {\n timestamp: 1700000902000,\n data: { type: 'newsletter' },\n user: { email: 'user@example.com' },\n source: {\n type: 'server',\n id: 'https://example.com/contact',\n previous_id: '',\n },\n }),\n mapping: {\n name: 'lead',\n data: {\n map: {\n userData: {\n map: {\n em: 'user.email',\n },\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n data: [\n {\n eventType: 'custom',\n eventId: '1700000902000-gr0up-1',\n eventTime: 1700000902,\n adStorageConsent: 'G',\n userData: {\n // sha256(normalizeEmail('user@example.com'))\n em: 'b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514',\n },\n eventName: 'lead',\n eventSourceUrl: 'https://example.com/contact',\n },\n ],\n dataProvider: 'walkerOS',\n }),\n OPTIONS,\n ],\n ],\n};\n\nexport const addToCart: Flow.StepExample = {\n in: getEvent('product add', {\n timestamp: 1700000903000,\n data: {\n id: 'SKU-B2',\n name: 'Running Shoes',\n price: 89.99,\n color: 'blue',\n },\n nested: [\n {\n entity: 'product',\n data: {\n id: 'SKU-B2',\n name: 'Running Shoes',\n price: 89.99,\n quantity: 1,\n },\n },\n ],\n source: {\n type: 'server',\n id: 'https://shop.example.com/products/running-shoes',\n previous_id: '',\n },\n }),\n mapping: {\n name: 'add_to_cart',\n data: {\n map: {\n customData: {\n map: {\n value: 'data.price',\n currency: { value: 'EUR' },\n items: {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n id: 'data.id',\n name: 'data.name',\n price: 'data.price',\n quantity: { key: 'data.quantity', value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n data: [\n {\n eventType: 'custom',\n eventId: '1700000903000-gr0up-1',\n eventTime: 1700000903,\n adStorageConsent: 'G',\n userData: {},\n eventName: 'add_to_cart',\n eventSourceUrl: 'https://shop.example.com/products/running-shoes',\n customData: {\n value: 89.99,\n currency: 'EUR',\n items: [\n {\n id: 'SKU-B2',\n name: 'Running Shoes',\n price: 89.99,\n quantity: 1,\n },\n ],\n },\n },\n ],\n dataProvider: 'walkerOS',\n }),\n OPTIONS,\n ],\n ],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAAE,OAAO;AAAA,EACrC,aAAa,EACV,OAAO,EACP,IAAI,CAAC,EACL;AAAA,IACC;AAAA,EACF;AAAA,EACF,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,kCAAkC;AAAA,EACpE,KAAK,EACF,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,WA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;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA,KAAK,UAAU;AAAA,QACb,MAAM;AAAA,UACJ;AAAA,YACE,WAAW;AAAA,YACX,SAAS;AAAA,YACT,WAAW;AAAA,YACX,kBAAkB;AAAA,YAClB,UAAU,CAAC;AAAA,YACX,WAAW;AAAA,YACX,gBAAgB;AAAA,YAChB,YAAY;AAAA,cACV,OAAO;AAAA,cACP,UAAU;AAAA,cACV,OAAO;AAAA,gBACL;AAAA,kBACE,IAAI;AAAA,kBACJ,MAAM;AAAA,kBACN,OAAO;AAAA,kBACP,UAAU;AAAA,gBACZ;AAAA,cACF;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,QACA,cAAc;AAAA,MAChB,CAAC;AAAA,MACD;AAAA,IACF;AAAA,EACF;AACF;","names":["z","z","z"]}
@@ -0,0 +1,36 @@
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
+ * Use this for testing Bing UET CAPI events without making actual HTTP
12
+ * requests to Microsoft's servers.
13
+ */
14
+ declare const push: Env;
15
+ declare const simulation: string[];
16
+
17
+ declare const env_push: typeof push;
18
+ declare const env_simulation: typeof simulation;
19
+ declare namespace env {
20
+ export { env_push as push, env_simulation as simulation };
21
+ }
22
+
23
+ declare const purchase: Flow.StepExample;
24
+ declare const pageView: Flow.StepExample;
25
+ declare const lead: Flow.StepExample;
26
+ declare const addToCart: Flow.StepExample;
27
+
28
+ declare const step_addToCart: typeof addToCart;
29
+ declare const step_lead: typeof lead;
30
+ declare const step_pageView: typeof pageView;
31
+ declare const step_purchase: typeof purchase;
32
+ declare namespace step {
33
+ export { step_addToCart as addToCart, step_lead as lead, step_pageView as pageView, step_purchase as purchase };
34
+ }
35
+
36
+ export { env, step };
@@ -0,0 +1,36 @@
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
+ * Use this for testing Bing UET CAPI events without making actual HTTP
12
+ * requests to Microsoft's servers.
13
+ */
14
+ declare const push: Env;
15
+ declare const simulation: string[];
16
+
17
+ declare const env_push: typeof push;
18
+ declare const env_simulation: typeof simulation;
19
+ declare namespace env {
20
+ export { env_push as push, env_simulation as simulation };
21
+ }
22
+
23
+ declare const purchase: Flow.StepExample;
24
+ declare const pageView: Flow.StepExample;
25
+ declare const lead: Flow.StepExample;
26
+ declare const addToCart: Flow.StepExample;
27
+
28
+ declare const step_addToCart: typeof addToCart;
29
+ declare const step_lead: typeof lead;
30
+ declare const step_pageView: typeof pageView;
31
+ declare const step_purchase: typeof purchase;
32
+ declare namespace step {
33
+ export { step_addToCart as addToCart, step_lead as lead, step_pageView as pageView, step_purchase as purchase };
34
+ }
35
+
36
+ export { env, step };