@walkeros/server-destination-bing 3.4.0 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/examples/index.js +8 -0
- package/dist/examples/index.mjs +8 -0
- package/dist/walkerOS.json +13 -5
- package/package.json +4 -4
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,o=(e,a)=>{for(var r in a)t(e,r,{get:a[r],enumerable:!0})},n={};o(n,{examples:()=>S,schemas:()=>s}),module.exports=(e=n,((e,o,n,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let d of r(o))i.call(e,d)||d===n||t(e,d,{get:()=>o[d],enumerable:!(s=a(o,d))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s={};o(s,{AdStorageConsentSchema:()=>v,EventTypeSchema:()=>l,MappingSchema:()=>g,SettingsSchema:()=>p,mapping:()=>y,settings:()=>h});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()}),h=(0,d.zodToSchema)(p),y=(0,d.zodToSchema)(g),S={};o(S,{env:()=>f,step:()=>w});var f={};o(f,{push:()=>b,simulation:()=>T});var b={sendServer:async()=>({ok:!0,data:{status:"OK",requestId:"mock-123"}})},T=["sendServer"],w={};o(w,{addToCart:()=>A,lead:()=>P,pageView:()=>z,purchase:()=>E});var U=require("@walkeros/core"),O="https://capi.uet.microsoft.com/v1/UET-12345/events",k={headers:{Authorization:"Bearer s3cr3t","Content-Type":"application/json"}},E={title:"Purchase",description:"A completed order is sent to the Bing UET CAPI with transaction id, value, items, and hashed user data.",in:(0,U.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,U.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",O,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"}),k]]},z={title:"Page view",description:"A page view is sent to the Bing UET CAPI with eventType pageLoad and the source URL.",in:(0,U.getEvent)("page view",{timestamp:1700000901e3,source:{type:"server",id:"https://example.com/docs/",previous_id:""}}),mapping:{settings:{eventType:"pageLoad"}},out:[["sendServer",O,JSON.stringify({data:[{eventType:"pageLoad",eventId:"1700000901000-gr0up-1",eventTime:1700000901,adStorageConsent:"G",userData:{},eventSourceUrl:"https://example.com/docs/"}],dataProvider:"walkerOS"}),k]]},P={title:"Lead",description:"A newsletter form submission is sent to Bing UET as a lead event with the SHA-256 hashed email.",in:(0,U.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",O,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"}),k]]},A={title:"Add to cart",description:"A product add is sent to Bing UET as an add_to_cart event with value, currency, and item details.",in:(0,U.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,U.isObject)(e)&&"product"===e.entity,map:{id:"data.id",name:"data.name",price:"data.price",quantity:{key:"data.quantity",value:1}}}]}}}}}},out:[["sendServer",O,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"}),k]]};//# sourceMappingURL=dev.js.map
|
package/dist/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/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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ACX,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":["import_dev","import_dev","import_dev"]}
|
|
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 title: 'Purchase',\n description:\n 'A completed order is sent to the Bing UET CAPI with transaction id, value, items, and hashed user data.',\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 title: 'Page view',\n description:\n 'A page view is sent to the Bing UET CAPI with eventType pageLoad and the source URL.',\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 title: 'Lead',\n description:\n 'A newsletter form submission is sent to Bing UET as a lead event with the SHA-256 hashed email.',\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 title: 'Add to cart',\n description:\n 'A product add is sent to Bing UET as an add_to_cart event with value, currency, and item details.',\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;A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,IACf;AAAA,EACF,CAAC;AAAA,EACD,SAAS;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,MACJ,KAAK;AAAA,QACH,YAAY;AAAA,UACV,KAAK;AAAA,YACH,OAAO;AAAA,YACP,UAAU,EAAE,OAAO,MAAM;AAAA,YACzB,OAAO;AAAA,cACL,MAAM;AAAA,gBACJ;AAAA,gBACA;AAAA,kBACE,WAAW,CAAC,eACV,sBAAS,MAAM,KAAK,OAAO,WAAW;AAAA,kBACxC,KAAK;AAAA,oBACH,IAAI;AAAA,oBACJ,MAAM;AAAA,oBACN,OAAO;AAAA,oBACP,UAAU,EAAE,KAAK,iBAAiB,OAAO,EAAE;AAAA,kBAC7C;AAAA,gBACF;AAAA,cACF;AAAA,YACF;AAAA,UACF;AAAA,QACF;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":["import_dev","import_dev","import_dev"]}
|
package/dist/dev.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(t,a)=>{for(var r in a)e(t,r,{get:a[r],enumerable:!0})},a={};t(a,{AdStorageConsentSchema:()=>
|
|
1
|
+
var e=Object.defineProperty,t=(t,a)=>{for(var r in a)e(t,r,{get:a[r],enumerable:!0})},a={};t(a,{AdStorageConsentSchema:()=>c,EventTypeSchema:()=>d,MappingSchema:()=>p,SettingsSchema:()=>o,mapping:()=>u,settings:()=>m});import{zodToSchema as r}from"@walkeros/core/dev";import{z as i}from"@walkeros/core/dev";var o=i.object({accessToken:i.string().min(1).describe("Long-lived Bing UET CAPI access token from Microsoft Advertising"),tagId:i.string().min(1).describe("Microsoft Advertising UET tag ID"),url:i.string().url().describe("Custom Bing UET CAPI base URL (default https://capi.uet.microsoft.com/v1/)").optional(),doNotHash:i.array(i.string()).describe("User data fields to skip hashing (like ['em', 'ph'])").optional(),user_data:i.record(i.string(),i.string()).describe("Mapping for user data fields (like { em: 'user.email' })").optional(),dataProvider:i.string().describe('Identifier of the data source (default "walkerOS")').optional(),continueOnValidationError:i.boolean().describe("When true, Microsoft continues to ingest events despite validation errors").optional()});import{z as s}from"@walkeros/core/dev";import{z as n}from"@walkeros/core/dev";var d=n.enum(["pageLoad","custom"]),c=n.enum(["G","D"]),p=s.object({eventType:d.describe('Override event type: "pageLoad" for page views, "custom" (default) otherwise').optional()}),m=r(o),u=r(p),l={};t(l,{env:()=>v,step:()=>y});var v={};t(v,{push:()=>g,simulation:()=>h});var g={sendServer:async()=>({ok:!0,data:{status:"OK",requestId:"mock-123"}})},h=["sendServer"],y={};t(y,{addToCart:()=>A,lead:()=>w,pageView:()=>k,purchase:()=>b});import{getEvent as S,isObject as f}from"@walkeros/core";var T="https://capi.uet.microsoft.com/v1/UET-12345/events",U={headers:{Authorization:"Bearer s3cr3t","Content-Type":"application/json"}},b={title:"Purchase",description:"A completed order is sent to the Bing UET CAPI with transaction id, value, items, and hashed user data.",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",T,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"}),U]]},k={title:"Page view",description:"A page view is sent to the Bing UET CAPI with eventType pageLoad and the source URL.",in:S("page view",{timestamp:1700000901e3,source:{type:"server",id:"https://example.com/docs/",previous_id:""}}),mapping:{settings:{eventType:"pageLoad"}},out:[["sendServer",T,JSON.stringify({data:[{eventType:"pageLoad",eventId:"1700000901000-gr0up-1",eventTime:1700000901,adStorageConsent:"G",userData:{},eventSourceUrl:"https://example.com/docs/"}],dataProvider:"walkerOS"}),U]]},w={title:"Lead",description:"A newsletter form submission is sent to Bing UET as a lead event with the SHA-256 hashed email.",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",T,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"}),U]]},A={title:"Add to cart",description:"A product add is sent to Bing UET as an add_to_cart event with value, currency, and item details.",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",T,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"}),U]]};export{l as examples,a as schemas};//# sourceMappingURL=dev.mjs.map
|
package/dist/dev.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/mapping.ts","../src/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,E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E,WAAW,CAAC,WACV,SAAS,MAAM,KAAK,OAAO,WAAW;AAAA,kBACxC,KAAK;AAAA,oBACH,IAAI;AAAA,oBACJ,MAAM;AAAA,oBACN,OAAO;AAAA,oBACP,UAAU,EAAE,KAAK,iBAAiB,OAAO,EAAE;AAAA,kBAC7C;AAAA,gBACF;AAAA,cACF;AAAA,YACF;AAAA,UACF;AAAA,QACF;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"]}
|
|
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 title: 'Purchase',\n description:\n 'A completed order is sent to the Bing UET CAPI with transaction id, value, items, and hashed user data.',\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 title: 'Page view',\n description:\n 'A page view is sent to the Bing UET CAPI with eventType pageLoad and the source URL.',\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 title: 'Lead',\n description:\n 'A newsletter form submission is sent to Bing UET as a lead event with the SHA-256 hashed email.',\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 title: 'Add to cart',\n description:\n 'A product add is sent to Bing UET as an add_to_cart event with value, currency, and item details.',\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,WAAW,EACR,MAAM,EAAE,OAAO,CAAC,EAChB,SAAS,sDAAsD,EAC/D,SAAS;AAAA,EACZ,WAAW,EACR,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,EAC7B,SAAS,0DAA0D,EACnE,SAAS;AAAA,EACZ,cAAc,EACX,OAAO,EACP,SAAS,oDAAoD,EAC7D,SAAS;AAAA,EACZ,2BAA2B,EACxB,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;ACnCD,SAAS,KAAAA,UAAS;;;ACAlB,SAAS,KAAAC,UAAS;AAOX,IAAM,kBAAkBA,GAAE,KAAK,CAAC,YAAY,QAAQ,CAAC;AAMrD,IAAM,yBAAyBA,GAAE,KAAK,CAAC,KAAK,GAAG,CAAC;;;ADNhD,IAAM,gBAAgBC,GAAE,OAAO;AAAA,EACpC,WAAW,gBAAgB;AAAA,IACzB;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;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"]}
|
package/dist/examples/index.js
CHANGED
|
@@ -60,6 +60,8 @@ var OPTIONS = {
|
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
var purchase = {
|
|
63
|
+
title: "Purchase",
|
|
64
|
+
description: "A completed order is sent to the Bing UET CAPI with transaction id, value, items, and hashed user data.",
|
|
63
65
|
in: (0, import_core.getEvent)("order complete", {
|
|
64
66
|
timestamp: 17000009e5,
|
|
65
67
|
data: { id: "ORD-300", total: 249.99, currency: "EUR" },
|
|
@@ -149,6 +151,8 @@ var purchase = {
|
|
|
149
151
|
]
|
|
150
152
|
};
|
|
151
153
|
var pageView = {
|
|
154
|
+
title: "Page view",
|
|
155
|
+
description: "A page view is sent to the Bing UET CAPI with eventType pageLoad and the source URL.",
|
|
152
156
|
in: (0, import_core.getEvent)("page view", {
|
|
153
157
|
timestamp: 1700000901e3,
|
|
154
158
|
source: {
|
|
@@ -182,6 +186,8 @@ var pageView = {
|
|
|
182
186
|
]
|
|
183
187
|
};
|
|
184
188
|
var lead = {
|
|
189
|
+
title: "Lead",
|
|
190
|
+
description: "A newsletter form submission is sent to Bing UET as a lead event with the SHA-256 hashed email.",
|
|
185
191
|
in: (0, import_core.getEvent)("form submit", {
|
|
186
192
|
timestamp: 1700000902e3,
|
|
187
193
|
data: { type: "newsletter" },
|
|
@@ -230,6 +236,8 @@ var lead = {
|
|
|
230
236
|
]
|
|
231
237
|
};
|
|
232
238
|
var addToCart = {
|
|
239
|
+
title: "Add to cart",
|
|
240
|
+
description: "A product add is sent to Bing UET as an add_to_cart event with value, currency, and item details.",
|
|
233
241
|
in: (0, import_core.getEvent)("product add", {
|
|
234
242
|
timestamp: 1700000903e3,
|
|
235
243
|
data: {
|
package/dist/examples/index.mjs
CHANGED
|
@@ -39,6 +39,8 @@ var OPTIONS = {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
var purchase = {
|
|
42
|
+
title: "Purchase",
|
|
43
|
+
description: "A completed order is sent to the Bing UET CAPI with transaction id, value, items, and hashed user data.",
|
|
42
44
|
in: getEvent("order complete", {
|
|
43
45
|
timestamp: 17000009e5,
|
|
44
46
|
data: { id: "ORD-300", total: 249.99, currency: "EUR" },
|
|
@@ -128,6 +130,8 @@ var purchase = {
|
|
|
128
130
|
]
|
|
129
131
|
};
|
|
130
132
|
var pageView = {
|
|
133
|
+
title: "Page view",
|
|
134
|
+
description: "A page view is sent to the Bing UET CAPI with eventType pageLoad and the source URL.",
|
|
131
135
|
in: getEvent("page view", {
|
|
132
136
|
timestamp: 1700000901e3,
|
|
133
137
|
source: {
|
|
@@ -161,6 +165,8 @@ var pageView = {
|
|
|
161
165
|
]
|
|
162
166
|
};
|
|
163
167
|
var lead = {
|
|
168
|
+
title: "Lead",
|
|
169
|
+
description: "A newsletter form submission is sent to Bing UET as a lead event with the SHA-256 hashed email.",
|
|
164
170
|
in: getEvent("form submit", {
|
|
165
171
|
timestamp: 1700000902e3,
|
|
166
172
|
data: { type: "newsletter" },
|
|
@@ -209,6 +215,8 @@ var lead = {
|
|
|
209
215
|
]
|
|
210
216
|
};
|
|
211
217
|
var addToCart = {
|
|
218
|
+
title: "Add to cart",
|
|
219
|
+
description: "A product add is sent to Bing UET as an add_to_cart event with value, currency, and item details.",
|
|
212
220
|
in: getEvent("product add", {
|
|
213
221
|
timestamp: 1700000903e3,
|
|
214
222
|
data: {
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/server-destination-bing",
|
|
4
|
-
"version": "3.4.
|
|
4
|
+
"version": "3.4.1",
|
|
5
5
|
"type": "destination",
|
|
6
6
|
"platform": [
|
|
7
7
|
"server"
|
|
@@ -90,6 +90,8 @@
|
|
|
90
90
|
},
|
|
91
91
|
"step": {
|
|
92
92
|
"addToCart": {
|
|
93
|
+
"title": "Add to cart",
|
|
94
|
+
"description": "A product add is sent to Bing UET as an add_to_cart event with value, currency, and item details.",
|
|
93
95
|
"in": {
|
|
94
96
|
"name": "product add",
|
|
95
97
|
"data": {
|
|
@@ -138,7 +140,7 @@
|
|
|
138
140
|
"group": "gr0up",
|
|
139
141
|
"count": 1,
|
|
140
142
|
"version": {
|
|
141
|
-
"source": "3.4.
|
|
143
|
+
"source": "3.4.1",
|
|
142
144
|
"tagging": 1
|
|
143
145
|
},
|
|
144
146
|
"source": {
|
|
@@ -196,6 +198,8 @@
|
|
|
196
198
|
]
|
|
197
199
|
},
|
|
198
200
|
"lead": {
|
|
201
|
+
"title": "Lead",
|
|
202
|
+
"description": "A newsletter form submission is sent to Bing UET as a lead event with the SHA-256 hashed email.",
|
|
199
203
|
"in": {
|
|
200
204
|
"name": "form submit",
|
|
201
205
|
"data": {
|
|
@@ -243,7 +247,7 @@
|
|
|
243
247
|
"group": "gr0up",
|
|
244
248
|
"count": 1,
|
|
245
249
|
"version": {
|
|
246
|
-
"source": "3.4.
|
|
250
|
+
"source": "3.4.1",
|
|
247
251
|
"tagging": 1
|
|
248
252
|
},
|
|
249
253
|
"source": {
|
|
@@ -279,6 +283,8 @@
|
|
|
279
283
|
]
|
|
280
284
|
},
|
|
281
285
|
"pageView": {
|
|
286
|
+
"title": "Page view",
|
|
287
|
+
"description": "A page view is sent to the Bing UET CAPI with eventType pageLoad and the source URL.",
|
|
282
288
|
"in": {
|
|
283
289
|
"name": "page view",
|
|
284
290
|
"data": {
|
|
@@ -333,7 +339,7 @@
|
|
|
333
339
|
"group": "gr0up",
|
|
334
340
|
"count": 1,
|
|
335
341
|
"version": {
|
|
336
|
-
"source": "3.4.
|
|
342
|
+
"source": "3.4.1",
|
|
337
343
|
"tagging": 1
|
|
338
344
|
},
|
|
339
345
|
"source": {
|
|
@@ -362,6 +368,8 @@
|
|
|
362
368
|
]
|
|
363
369
|
},
|
|
364
370
|
"purchase": {
|
|
371
|
+
"title": "Purchase",
|
|
372
|
+
"description": "A completed order is sent to the Bing UET CAPI with transaction id, value, items, and hashed user data.",
|
|
365
373
|
"in": {
|
|
366
374
|
"name": "order complete",
|
|
367
375
|
"data": {
|
|
@@ -408,7 +416,7 @@
|
|
|
408
416
|
"group": "gr0up",
|
|
409
417
|
"count": 1,
|
|
410
418
|
"version": {
|
|
411
|
-
"source": "3.4.
|
|
419
|
+
"source": "3.4.1",
|
|
412
420
|
"tagging": 1
|
|
413
421
|
},
|
|
414
422
|
"source": {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/server-destination-bing",
|
|
3
3
|
"description": "Microsoft Advertising (Bing UET CAPI) server destination for walkerOS",
|
|
4
|
-
"version": "3.4.
|
|
4
|
+
"version": "3.4.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"update": "npx npm-check-updates -u && npm update"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@walkeros/core": "3.4.
|
|
38
|
-
"@walkeros/server-core": "3.4.
|
|
37
|
+
"@walkeros/core": "3.4.1",
|
|
38
|
+
"@walkeros/server-core": "3.4.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@walkeros/collector": "3.4.
|
|
41
|
+
"@walkeros/collector": "3.4.1"
|
|
42
42
|
},
|
|
43
43
|
"repository": {
|
|
44
44
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|