@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.
@@ -0,0 +1,323 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/examples/index.ts
21
+ var examples_exports = {};
22
+ __export(examples_exports, {
23
+ env: () => env_exports,
24
+ step: () => step_exports
25
+ });
26
+ module.exports = __toCommonJS(examples_exports);
27
+
28
+ // src/examples/env.ts
29
+ var env_exports = {};
30
+ __export(env_exports, {
31
+ push: () => push,
32
+ simulation: () => simulation
33
+ });
34
+ var mockSendServer = async () => ({
35
+ ok: true,
36
+ data: {
37
+ status: "OK",
38
+ requestId: "mock-123"
39
+ }
40
+ });
41
+ var push = {
42
+ sendServer: mockSendServer
43
+ };
44
+ var simulation = ["sendServer"];
45
+
46
+ // src/examples/step.ts
47
+ var step_exports = {};
48
+ __export(step_exports, {
49
+ addToCart: () => addToCart,
50
+ lead: () => lead,
51
+ pageView: () => pageView,
52
+ purchase: () => purchase
53
+ });
54
+ var import_core = require("@walkeros/core");
55
+ var ENDPOINT = "https://capi.uet.microsoft.com/v1/UET-12345/events";
56
+ var OPTIONS = {
57
+ headers: {
58
+ Authorization: "Bearer s3cr3t",
59
+ "Content-Type": "application/json"
60
+ }
61
+ };
62
+ var purchase = {
63
+ in: (0, import_core.getEvent)("order complete", {
64
+ timestamp: 17000009e5,
65
+ data: { id: "ORD-300", total: 249.99, currency: "EUR" },
66
+ nested: [
67
+ {
68
+ entity: "product",
69
+ data: { id: "SKU-A1", name: "Widget Pro", price: 124.99, quantity: 2 }
70
+ }
71
+ ],
72
+ user: { id: "user-123", device: "device-456" },
73
+ source: {
74
+ type: "server",
75
+ id: "https://shop.example.com/checkout/complete",
76
+ previous_id: ""
77
+ }
78
+ }),
79
+ mapping: {
80
+ name: "purchase",
81
+ data: {
82
+ map: {
83
+ customData: {
84
+ map: {
85
+ value: "data.total",
86
+ currency: { key: "data.currency", value: "EUR" },
87
+ transactionId: "data.id",
88
+ pageType: { value: "purchase" },
89
+ items: {
90
+ loop: [
91
+ "nested",
92
+ {
93
+ condition: (entity) => (0, import_core.isObject)(entity) && entity.entity === "product",
94
+ map: {
95
+ id: "data.id",
96
+ name: "data.name",
97
+ price: "data.price",
98
+ quantity: { key: "data.quantity", value: 1 }
99
+ }
100
+ }
101
+ ]
102
+ }
103
+ }
104
+ },
105
+ userData: {
106
+ map: {
107
+ externalId: "user.id"
108
+ }
109
+ }
110
+ }
111
+ }
112
+ },
113
+ out: [
114
+ [
115
+ "sendServer",
116
+ ENDPOINT,
117
+ JSON.stringify({
118
+ data: [
119
+ {
120
+ eventType: "custom",
121
+ eventId: "1700000900000-gr0up-1",
122
+ eventTime: 1700000900,
123
+ adStorageConsent: "G",
124
+ userData: {
125
+ externalId: "user-123"
126
+ },
127
+ eventName: "purchase",
128
+ eventSourceUrl: "https://shop.example.com/checkout/complete",
129
+ customData: {
130
+ value: 249.99,
131
+ currency: "EUR",
132
+ transactionId: "ORD-300",
133
+ pageType: "purchase",
134
+ items: [
135
+ {
136
+ id: "SKU-A1",
137
+ name: "Widget Pro",
138
+ price: 124.99,
139
+ quantity: 2
140
+ }
141
+ ]
142
+ }
143
+ }
144
+ ],
145
+ dataProvider: "walkerOS"
146
+ }),
147
+ OPTIONS
148
+ ]
149
+ ]
150
+ };
151
+ var pageView = {
152
+ in: (0, import_core.getEvent)("page view", {
153
+ timestamp: 1700000901e3,
154
+ source: {
155
+ type: "server",
156
+ id: "https://example.com/docs/",
157
+ previous_id: ""
158
+ }
159
+ }),
160
+ mapping: {
161
+ settings: { eventType: "pageLoad" }
162
+ },
163
+ out: [
164
+ [
165
+ "sendServer",
166
+ ENDPOINT,
167
+ JSON.stringify({
168
+ data: [
169
+ {
170
+ eventType: "pageLoad",
171
+ eventId: "1700000901000-gr0up-1",
172
+ eventTime: 1700000901,
173
+ adStorageConsent: "G",
174
+ userData: {},
175
+ eventSourceUrl: "https://example.com/docs/"
176
+ }
177
+ ],
178
+ dataProvider: "walkerOS"
179
+ }),
180
+ OPTIONS
181
+ ]
182
+ ]
183
+ };
184
+ var lead = {
185
+ in: (0, import_core.getEvent)("form submit", {
186
+ timestamp: 1700000902e3,
187
+ data: { type: "newsletter" },
188
+ user: { email: "user@example.com" },
189
+ source: {
190
+ type: "server",
191
+ id: "https://example.com/contact",
192
+ previous_id: ""
193
+ }
194
+ }),
195
+ mapping: {
196
+ name: "lead",
197
+ data: {
198
+ map: {
199
+ userData: {
200
+ map: {
201
+ em: "user.email"
202
+ }
203
+ }
204
+ }
205
+ }
206
+ },
207
+ out: [
208
+ [
209
+ "sendServer",
210
+ ENDPOINT,
211
+ JSON.stringify({
212
+ data: [
213
+ {
214
+ eventType: "custom",
215
+ eventId: "1700000902000-gr0up-1",
216
+ eventTime: 1700000902,
217
+ adStorageConsent: "G",
218
+ userData: {
219
+ // sha256(normalizeEmail('user@example.com'))
220
+ em: "b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514"
221
+ },
222
+ eventName: "lead",
223
+ eventSourceUrl: "https://example.com/contact"
224
+ }
225
+ ],
226
+ dataProvider: "walkerOS"
227
+ }),
228
+ OPTIONS
229
+ ]
230
+ ]
231
+ };
232
+ var addToCart = {
233
+ in: (0, import_core.getEvent)("product add", {
234
+ timestamp: 1700000903e3,
235
+ data: {
236
+ id: "SKU-B2",
237
+ name: "Running Shoes",
238
+ price: 89.99,
239
+ color: "blue"
240
+ },
241
+ nested: [
242
+ {
243
+ entity: "product",
244
+ data: {
245
+ id: "SKU-B2",
246
+ name: "Running Shoes",
247
+ price: 89.99,
248
+ quantity: 1
249
+ }
250
+ }
251
+ ],
252
+ source: {
253
+ type: "server",
254
+ id: "https://shop.example.com/products/running-shoes",
255
+ previous_id: ""
256
+ }
257
+ }),
258
+ mapping: {
259
+ name: "add_to_cart",
260
+ data: {
261
+ map: {
262
+ customData: {
263
+ map: {
264
+ value: "data.price",
265
+ currency: { value: "EUR" },
266
+ items: {
267
+ loop: [
268
+ "nested",
269
+ {
270
+ condition: (entity) => (0, import_core.isObject)(entity) && entity.entity === "product",
271
+ map: {
272
+ id: "data.id",
273
+ name: "data.name",
274
+ price: "data.price",
275
+ quantity: { key: "data.quantity", value: 1 }
276
+ }
277
+ }
278
+ ]
279
+ }
280
+ }
281
+ }
282
+ }
283
+ }
284
+ },
285
+ out: [
286
+ [
287
+ "sendServer",
288
+ ENDPOINT,
289
+ JSON.stringify({
290
+ data: [
291
+ {
292
+ eventType: "custom",
293
+ eventId: "1700000903000-gr0up-1",
294
+ eventTime: 1700000903,
295
+ adStorageConsent: "G",
296
+ userData: {},
297
+ eventName: "add_to_cart",
298
+ eventSourceUrl: "https://shop.example.com/products/running-shoes",
299
+ customData: {
300
+ value: 89.99,
301
+ currency: "EUR",
302
+ items: [
303
+ {
304
+ id: "SKU-B2",
305
+ name: "Running Shoes",
306
+ price: 89.99,
307
+ quantity: 1
308
+ }
309
+ ]
310
+ }
311
+ }
312
+ ],
313
+ dataProvider: "walkerOS"
314
+ }),
315
+ OPTIONS
316
+ ]
317
+ ]
318
+ };
319
+ // Annotate the CommonJS export names for ESM import in node:
320
+ 0 && (module.exports = {
321
+ env,
322
+ step
323
+ });
@@ -0,0 +1,301 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ // src/examples/env.ts
8
+ var env_exports = {};
9
+ __export(env_exports, {
10
+ push: () => push,
11
+ simulation: () => simulation
12
+ });
13
+ var mockSendServer = async () => ({
14
+ ok: true,
15
+ data: {
16
+ status: "OK",
17
+ requestId: "mock-123"
18
+ }
19
+ });
20
+ var push = {
21
+ sendServer: mockSendServer
22
+ };
23
+ var simulation = ["sendServer"];
24
+
25
+ // src/examples/step.ts
26
+ var step_exports = {};
27
+ __export(step_exports, {
28
+ addToCart: () => addToCart,
29
+ lead: () => lead,
30
+ pageView: () => pageView,
31
+ purchase: () => purchase
32
+ });
33
+ import { getEvent, isObject } from "@walkeros/core";
34
+ var ENDPOINT = "https://capi.uet.microsoft.com/v1/UET-12345/events";
35
+ var OPTIONS = {
36
+ headers: {
37
+ Authorization: "Bearer s3cr3t",
38
+ "Content-Type": "application/json"
39
+ }
40
+ };
41
+ var purchase = {
42
+ in: getEvent("order complete", {
43
+ timestamp: 17000009e5,
44
+ data: { id: "ORD-300", total: 249.99, currency: "EUR" },
45
+ nested: [
46
+ {
47
+ entity: "product",
48
+ data: { id: "SKU-A1", name: "Widget Pro", price: 124.99, quantity: 2 }
49
+ }
50
+ ],
51
+ user: { id: "user-123", device: "device-456" },
52
+ source: {
53
+ type: "server",
54
+ id: "https://shop.example.com/checkout/complete",
55
+ previous_id: ""
56
+ }
57
+ }),
58
+ mapping: {
59
+ name: "purchase",
60
+ data: {
61
+ map: {
62
+ customData: {
63
+ map: {
64
+ value: "data.total",
65
+ currency: { key: "data.currency", value: "EUR" },
66
+ transactionId: "data.id",
67
+ pageType: { value: "purchase" },
68
+ items: {
69
+ loop: [
70
+ "nested",
71
+ {
72
+ condition: (entity) => isObject(entity) && entity.entity === "product",
73
+ map: {
74
+ id: "data.id",
75
+ name: "data.name",
76
+ price: "data.price",
77
+ quantity: { key: "data.quantity", value: 1 }
78
+ }
79
+ }
80
+ ]
81
+ }
82
+ }
83
+ },
84
+ userData: {
85
+ map: {
86
+ externalId: "user.id"
87
+ }
88
+ }
89
+ }
90
+ }
91
+ },
92
+ out: [
93
+ [
94
+ "sendServer",
95
+ ENDPOINT,
96
+ JSON.stringify({
97
+ data: [
98
+ {
99
+ eventType: "custom",
100
+ eventId: "1700000900000-gr0up-1",
101
+ eventTime: 1700000900,
102
+ adStorageConsent: "G",
103
+ userData: {
104
+ externalId: "user-123"
105
+ },
106
+ eventName: "purchase",
107
+ eventSourceUrl: "https://shop.example.com/checkout/complete",
108
+ customData: {
109
+ value: 249.99,
110
+ currency: "EUR",
111
+ transactionId: "ORD-300",
112
+ pageType: "purchase",
113
+ items: [
114
+ {
115
+ id: "SKU-A1",
116
+ name: "Widget Pro",
117
+ price: 124.99,
118
+ quantity: 2
119
+ }
120
+ ]
121
+ }
122
+ }
123
+ ],
124
+ dataProvider: "walkerOS"
125
+ }),
126
+ OPTIONS
127
+ ]
128
+ ]
129
+ };
130
+ var pageView = {
131
+ in: getEvent("page view", {
132
+ timestamp: 1700000901e3,
133
+ source: {
134
+ type: "server",
135
+ id: "https://example.com/docs/",
136
+ previous_id: ""
137
+ }
138
+ }),
139
+ mapping: {
140
+ settings: { eventType: "pageLoad" }
141
+ },
142
+ out: [
143
+ [
144
+ "sendServer",
145
+ ENDPOINT,
146
+ JSON.stringify({
147
+ data: [
148
+ {
149
+ eventType: "pageLoad",
150
+ eventId: "1700000901000-gr0up-1",
151
+ eventTime: 1700000901,
152
+ adStorageConsent: "G",
153
+ userData: {},
154
+ eventSourceUrl: "https://example.com/docs/"
155
+ }
156
+ ],
157
+ dataProvider: "walkerOS"
158
+ }),
159
+ OPTIONS
160
+ ]
161
+ ]
162
+ };
163
+ var lead = {
164
+ in: getEvent("form submit", {
165
+ timestamp: 1700000902e3,
166
+ data: { type: "newsletter" },
167
+ user: { email: "user@example.com" },
168
+ source: {
169
+ type: "server",
170
+ id: "https://example.com/contact",
171
+ previous_id: ""
172
+ }
173
+ }),
174
+ mapping: {
175
+ name: "lead",
176
+ data: {
177
+ map: {
178
+ userData: {
179
+ map: {
180
+ em: "user.email"
181
+ }
182
+ }
183
+ }
184
+ }
185
+ },
186
+ out: [
187
+ [
188
+ "sendServer",
189
+ ENDPOINT,
190
+ JSON.stringify({
191
+ data: [
192
+ {
193
+ eventType: "custom",
194
+ eventId: "1700000902000-gr0up-1",
195
+ eventTime: 1700000902,
196
+ adStorageConsent: "G",
197
+ userData: {
198
+ // sha256(normalizeEmail('user@example.com'))
199
+ em: "b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514"
200
+ },
201
+ eventName: "lead",
202
+ eventSourceUrl: "https://example.com/contact"
203
+ }
204
+ ],
205
+ dataProvider: "walkerOS"
206
+ }),
207
+ OPTIONS
208
+ ]
209
+ ]
210
+ };
211
+ var addToCart = {
212
+ in: getEvent("product add", {
213
+ timestamp: 1700000903e3,
214
+ data: {
215
+ id: "SKU-B2",
216
+ name: "Running Shoes",
217
+ price: 89.99,
218
+ color: "blue"
219
+ },
220
+ nested: [
221
+ {
222
+ entity: "product",
223
+ data: {
224
+ id: "SKU-B2",
225
+ name: "Running Shoes",
226
+ price: 89.99,
227
+ quantity: 1
228
+ }
229
+ }
230
+ ],
231
+ source: {
232
+ type: "server",
233
+ id: "https://shop.example.com/products/running-shoes",
234
+ previous_id: ""
235
+ }
236
+ }),
237
+ mapping: {
238
+ name: "add_to_cart",
239
+ data: {
240
+ map: {
241
+ customData: {
242
+ map: {
243
+ value: "data.price",
244
+ currency: { value: "EUR" },
245
+ items: {
246
+ loop: [
247
+ "nested",
248
+ {
249
+ condition: (entity) => isObject(entity) && entity.entity === "product",
250
+ map: {
251
+ id: "data.id",
252
+ name: "data.name",
253
+ price: "data.price",
254
+ quantity: { key: "data.quantity", value: 1 }
255
+ }
256
+ }
257
+ ]
258
+ }
259
+ }
260
+ }
261
+ }
262
+ }
263
+ },
264
+ out: [
265
+ [
266
+ "sendServer",
267
+ ENDPOINT,
268
+ JSON.stringify({
269
+ data: [
270
+ {
271
+ eventType: "custom",
272
+ eventId: "1700000903000-gr0up-1",
273
+ eventTime: 1700000903,
274
+ adStorageConsent: "G",
275
+ userData: {},
276
+ eventName: "add_to_cart",
277
+ eventSourceUrl: "https://shop.example.com/products/running-shoes",
278
+ customData: {
279
+ value: 89.99,
280
+ currency: "EUR",
281
+ items: [
282
+ {
283
+ id: "SKU-B2",
284
+ name: "Running Shoes",
285
+ price: 89.99,
286
+ quantity: 1
287
+ }
288
+ ]
289
+ }
290
+ }
291
+ ],
292
+ dataProvider: "walkerOS"
293
+ }),
294
+ OPTIONS
295
+ ]
296
+ ]
297
+ };
298
+ export {
299
+ env_exports as env,
300
+ step_exports as step
301
+ };