@walkeros/server-destination-criteo 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/README.md +131 -0
- package/dist/dev.d.mts +100 -0
- package/dist/dev.d.ts +100 -0
- package/dist/dev.js +1 -0
- package/dist/dev.js.map +1 -0
- package/dist/dev.mjs +1 -0
- package/dist/dev.mjs.map +1 -0
- package/dist/examples/index.d.mts +36 -0
- package/dist/examples/index.d.ts +36 -0
- package/dist/examples/index.js +295 -0
- package/dist/examples/index.mjs +273 -0
- package/dist/index.d.mts +120 -0
- package/dist/index.d.ts +120 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -0
- package/dist/walkerOS.json +427 -0
- package/package.json +75 -0
package/README.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# @walkeros/server-destination-criteo
|
|
2
|
+
|
|
3
|
+
Server-side Criteo Events API destination for walkerOS. Sends retargeting events
|
|
4
|
+
directly to Criteo's Events API (S2S v0) via HTTP POST for reliable
|
|
5
|
+
server-to-server tracking.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @walkeros/server-destination-criteo
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"destinations": {
|
|
18
|
+
"criteo": {
|
|
19
|
+
"package": "@walkeros/server-destination-criteo",
|
|
20
|
+
"config": {
|
|
21
|
+
"settings": {
|
|
22
|
+
"partnerId": "YOUR_PARTNER_ID",
|
|
23
|
+
"callerId": "YOUR_CALLER_ID"
|
|
24
|
+
},
|
|
25
|
+
"mapping": {
|
|
26
|
+
"order": {
|
|
27
|
+
"complete": {
|
|
28
|
+
"name": "trackTransaction",
|
|
29
|
+
"data": {
|
|
30
|
+
"map": {
|
|
31
|
+
"id": "data.id",
|
|
32
|
+
"item": {
|
|
33
|
+
"loop": [
|
|
34
|
+
"nested",
|
|
35
|
+
{
|
|
36
|
+
"map": {
|
|
37
|
+
"id": "data.id",
|
|
38
|
+
"price": "data.price",
|
|
39
|
+
"quantity": "data.quantity"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Settings
|
|
56
|
+
|
|
57
|
+
| Setting | Type | Required | Default | Description |
|
|
58
|
+
| ----------- | ------ | -------- | -------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
59
|
+
| `partnerId` | string | Yes | -- | Criteo Partner ID (numeric, provided by Criteo) |
|
|
60
|
+
| `callerId` | string | Yes | -- | Caller ID for user mapping (provided by Criteo) |
|
|
61
|
+
| `siteType` | string | No | `d` | One of `d` (desktop), `m` (mobile web), `t` (tablet) |
|
|
62
|
+
| `country` | string | No | -- | ISO 3166-1 alpha-2 country code |
|
|
63
|
+
| `language` | string | No | -- | 2-letter language code |
|
|
64
|
+
| `url` | string | No | `https://widget.criteo.com/m/event?version=s2s_v0` | API endpoint override |
|
|
65
|
+
| `user_data` | object | No | -- | Identity mapping (`mapped_user_id`, `email`, `retailer_visitor_id`, `ip`, `useragent`) |
|
|
66
|
+
|
|
67
|
+
## Event Mapping
|
|
68
|
+
|
|
69
|
+
| walkerOS Event | Criteo Event Name |
|
|
70
|
+
| ------------------ | ----------------------- |
|
|
71
|
+
| `page view` | `viewHome` / `viewPage` |
|
|
72
|
+
| `product view` | `viewItem` |
|
|
73
|
+
| `product list` | `viewList` |
|
|
74
|
+
| `product add` | `addToCart` |
|
|
75
|
+
| `cart view` | `viewBasket` |
|
|
76
|
+
| `checkout start` | `beginCheckout` |
|
|
77
|
+
| `checkout payment` | `addPaymentInfo` |
|
|
78
|
+
| `order complete` | `trackTransaction` |
|
|
79
|
+
| `user login` | `login` |
|
|
80
|
+
|
|
81
|
+
Set the Criteo event name via each rule's `name` field. Arbitrary string names
|
|
82
|
+
are accepted in addition to the standard names above.
|
|
83
|
+
|
|
84
|
+
## User Identity
|
|
85
|
+
|
|
86
|
+
Criteo matches users via three signals. Wire them through `user_data`:
|
|
87
|
+
|
|
88
|
+
| Field | Description |
|
|
89
|
+
| --------------------- | --------------------------------------------------- |
|
|
90
|
+
| `mapped_user_id` | Criteo GUM ID |
|
|
91
|
+
| `email` | Raw email — hashed to MD5, SHA-256 and SHA-256(MD5) |
|
|
92
|
+
| `retailer_visitor_id` | Stable retailer visitor identifier |
|
|
93
|
+
| `ip` | Client IP address (optional) |
|
|
94
|
+
| `useragent` | Client user agent (optional) |
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"settings": {
|
|
99
|
+
"partnerId": "YOUR_PARTNER_ID",
|
|
100
|
+
"callerId": "YOUR_CALLER_ID",
|
|
101
|
+
"user_data": {
|
|
102
|
+
"mapped_user_id": "user.id",
|
|
103
|
+
"email": "user.email",
|
|
104
|
+
"retailer_visitor_id": "user.device"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Email Hashing
|
|
111
|
+
|
|
112
|
+
Raw email addresses are lowercased and trimmed, then hashed into all three
|
|
113
|
+
Criteo-expected formats before sending:
|
|
114
|
+
|
|
115
|
+
- `md5` — MD5 hex digest
|
|
116
|
+
- `sha256` — SHA-256 hex digest
|
|
117
|
+
- `sha256_md5` — SHA-256 hex of the MD5 hex string
|
|
118
|
+
|
|
119
|
+
If a pre-hashed value is passed instead of a raw email, it is detected by hex
|
|
120
|
+
length (32 for MD5, 64 for SHA-256) and passed through without re-hashing.
|
|
121
|
+
|
|
122
|
+
## Deduplication
|
|
123
|
+
|
|
124
|
+
Criteo Events API supports deduplication with Criteo OneTag via the
|
|
125
|
+
`deduplication_page_view_id` field on each event. Wire it through the mapping's
|
|
126
|
+
`data.map.deduplication_page_view_id`.
|
|
127
|
+
|
|
128
|
+
## Links
|
|
129
|
+
|
|
130
|
+
- [Criteo Events API Guide](https://guides.criteotilt.com/events-api/)
|
|
131
|
+
- [walkerOS Documentation](https://www.walkeros.io)
|
package/dist/dev.d.mts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
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
|
+
* Standard Criteo Events API event names.
|
|
8
|
+
* https://guides.criteotilt.com/events-api/
|
|
9
|
+
*/
|
|
10
|
+
declare const CriteoEventNameSchema: z.ZodUnion<readonly [z.ZodEnum<{
|
|
11
|
+
viewHome: "viewHome";
|
|
12
|
+
viewPage: "viewPage";
|
|
13
|
+
viewItem: "viewItem";
|
|
14
|
+
viewList: "viewList";
|
|
15
|
+
addToCart: "addToCart";
|
|
16
|
+
viewBasket: "viewBasket";
|
|
17
|
+
beginCheckout: "beginCheckout";
|
|
18
|
+
trackTransaction: "trackTransaction";
|
|
19
|
+
addPaymentInfo: "addPaymentInfo";
|
|
20
|
+
login: "login";
|
|
21
|
+
}>, z.ZodString]>;
|
|
22
|
+
|
|
23
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
24
|
+
partnerId: z.ZodString;
|
|
25
|
+
callerId: z.ZodString;
|
|
26
|
+
siteType: z.ZodOptional<z.ZodEnum<{
|
|
27
|
+
d: "d";
|
|
28
|
+
m: "m";
|
|
29
|
+
t: "t";
|
|
30
|
+
}>>;
|
|
31
|
+
country: z.ZodOptional<z.ZodString>;
|
|
32
|
+
language: z.ZodOptional<z.ZodString>;
|
|
33
|
+
url: z.ZodOptional<z.ZodString>;
|
|
34
|
+
user_data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
type Settings = z.infer<typeof SettingsSchema>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Criteo Events API Mapping Schema
|
|
40
|
+
* Criteo has no event-level mapping configuration beyond name + data
|
|
41
|
+
*/
|
|
42
|
+
declare const MappingSchema: z.ZodObject<{}, z.core.$strip>;
|
|
43
|
+
/**
|
|
44
|
+
* Type inference from MappingSchema
|
|
45
|
+
*/
|
|
46
|
+
type Mapping = z.infer<typeof MappingSchema>;
|
|
47
|
+
|
|
48
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
49
|
+
declare const mapping: _walkeros_core_dev.JSONSchema;
|
|
50
|
+
|
|
51
|
+
declare const index$1_CriteoEventNameSchema: typeof CriteoEventNameSchema;
|
|
52
|
+
type index$1_Mapping = Mapping;
|
|
53
|
+
declare const index$1_MappingSchema: typeof MappingSchema;
|
|
54
|
+
type index$1_Settings = Settings;
|
|
55
|
+
declare const index$1_SettingsSchema: typeof SettingsSchema;
|
|
56
|
+
declare const index$1_mapping: typeof mapping;
|
|
57
|
+
declare const index$1_settings: typeof settings;
|
|
58
|
+
declare namespace index$1 {
|
|
59
|
+
export { index$1_CriteoEventNameSchema as CriteoEventNameSchema, 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 };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface Env extends DestinationServer.Env {
|
|
63
|
+
sendServer?: typeof sendServer;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Standard mock environment for push operations.
|
|
68
|
+
*
|
|
69
|
+
* Use this for testing Criteo Events API pushes without making
|
|
70
|
+
* actual HTTP requests to Criteo's servers.
|
|
71
|
+
*/
|
|
72
|
+
declare const push: Env;
|
|
73
|
+
declare const simulation: string[];
|
|
74
|
+
|
|
75
|
+
declare const env_push: typeof push;
|
|
76
|
+
declare const env_simulation: typeof simulation;
|
|
77
|
+
declare namespace env {
|
|
78
|
+
export { env_push as push, env_simulation as simulation };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
declare const purchase: Flow.StepExample;
|
|
82
|
+
declare const addToCart: Flow.StepExample;
|
|
83
|
+
declare const viewItem: Flow.StepExample;
|
|
84
|
+
declare const pageView: Flow.StepExample;
|
|
85
|
+
|
|
86
|
+
declare const step_addToCart: typeof addToCart;
|
|
87
|
+
declare const step_pageView: typeof pageView;
|
|
88
|
+
declare const step_purchase: typeof purchase;
|
|
89
|
+
declare const step_viewItem: typeof viewItem;
|
|
90
|
+
declare namespace step {
|
|
91
|
+
export { step_addToCart as addToCart, step_pageView as pageView, step_purchase as purchase, step_viewItem as viewItem };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
declare const index_env: typeof env;
|
|
95
|
+
declare const index_step: typeof step;
|
|
96
|
+
declare namespace index {
|
|
97
|
+
export { index_env as env, index_step as step };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export { index as examples, index$1 as schemas };
|
package/dist/dev.d.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
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
|
+
* Standard Criteo Events API event names.
|
|
8
|
+
* https://guides.criteotilt.com/events-api/
|
|
9
|
+
*/
|
|
10
|
+
declare const CriteoEventNameSchema: z.ZodUnion<readonly [z.ZodEnum<{
|
|
11
|
+
viewHome: "viewHome";
|
|
12
|
+
viewPage: "viewPage";
|
|
13
|
+
viewItem: "viewItem";
|
|
14
|
+
viewList: "viewList";
|
|
15
|
+
addToCart: "addToCart";
|
|
16
|
+
viewBasket: "viewBasket";
|
|
17
|
+
beginCheckout: "beginCheckout";
|
|
18
|
+
trackTransaction: "trackTransaction";
|
|
19
|
+
addPaymentInfo: "addPaymentInfo";
|
|
20
|
+
login: "login";
|
|
21
|
+
}>, z.ZodString]>;
|
|
22
|
+
|
|
23
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
24
|
+
partnerId: z.ZodString;
|
|
25
|
+
callerId: z.ZodString;
|
|
26
|
+
siteType: z.ZodOptional<z.ZodEnum<{
|
|
27
|
+
d: "d";
|
|
28
|
+
m: "m";
|
|
29
|
+
t: "t";
|
|
30
|
+
}>>;
|
|
31
|
+
country: z.ZodOptional<z.ZodString>;
|
|
32
|
+
language: z.ZodOptional<z.ZodString>;
|
|
33
|
+
url: z.ZodOptional<z.ZodString>;
|
|
34
|
+
user_data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
type Settings = z.infer<typeof SettingsSchema>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Criteo Events API Mapping Schema
|
|
40
|
+
* Criteo has no event-level mapping configuration beyond name + data
|
|
41
|
+
*/
|
|
42
|
+
declare const MappingSchema: z.ZodObject<{}, z.core.$strip>;
|
|
43
|
+
/**
|
|
44
|
+
* Type inference from MappingSchema
|
|
45
|
+
*/
|
|
46
|
+
type Mapping = z.infer<typeof MappingSchema>;
|
|
47
|
+
|
|
48
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
49
|
+
declare const mapping: _walkeros_core_dev.JSONSchema;
|
|
50
|
+
|
|
51
|
+
declare const index$1_CriteoEventNameSchema: typeof CriteoEventNameSchema;
|
|
52
|
+
type index$1_Mapping = Mapping;
|
|
53
|
+
declare const index$1_MappingSchema: typeof MappingSchema;
|
|
54
|
+
type index$1_Settings = Settings;
|
|
55
|
+
declare const index$1_SettingsSchema: typeof SettingsSchema;
|
|
56
|
+
declare const index$1_mapping: typeof mapping;
|
|
57
|
+
declare const index$1_settings: typeof settings;
|
|
58
|
+
declare namespace index$1 {
|
|
59
|
+
export { index$1_CriteoEventNameSchema as CriteoEventNameSchema, 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 };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface Env extends DestinationServer.Env {
|
|
63
|
+
sendServer?: typeof sendServer;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Standard mock environment for push operations.
|
|
68
|
+
*
|
|
69
|
+
* Use this for testing Criteo Events API pushes without making
|
|
70
|
+
* actual HTTP requests to Criteo's servers.
|
|
71
|
+
*/
|
|
72
|
+
declare const push: Env;
|
|
73
|
+
declare const simulation: string[];
|
|
74
|
+
|
|
75
|
+
declare const env_push: typeof push;
|
|
76
|
+
declare const env_simulation: typeof simulation;
|
|
77
|
+
declare namespace env {
|
|
78
|
+
export { env_push as push, env_simulation as simulation };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
declare const purchase: Flow.StepExample;
|
|
82
|
+
declare const addToCart: Flow.StepExample;
|
|
83
|
+
declare const viewItem: Flow.StepExample;
|
|
84
|
+
declare const pageView: Flow.StepExample;
|
|
85
|
+
|
|
86
|
+
declare const step_addToCart: typeof addToCart;
|
|
87
|
+
declare const step_pageView: typeof pageView;
|
|
88
|
+
declare const step_purchase: typeof purchase;
|
|
89
|
+
declare const step_viewItem: typeof viewItem;
|
|
90
|
+
declare namespace step {
|
|
91
|
+
export { step_addToCart as addToCart, step_pageView as pageView, step_purchase as purchase, step_viewItem as viewItem };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
declare const index_env: typeof env;
|
|
95
|
+
declare const index_step: typeof step;
|
|
96
|
+
declare namespace index {
|
|
97
|
+
export { index_env as env, index_step as step };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export { index as examples, index$1 as schemas };
|
package/dist/dev.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,i)=>{for(var r in i)t(e,r,{get:i[r],enumerable:!0})},n={};o(n,{examples:()=>y,schemas:()=>s}),module.exports=(e=n,((e,o,n,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let p of r(o))a.call(e,p)||p===n||t(e,p,{get:()=>o[p],enumerable:!(s=i(o,p))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s={};o(s,{CriteoEventNameSchema:()=>l,MappingSchema:()=>m,SettingsSchema:()=>c,mapping:()=>g,settings:()=>v});var p=require("@walkeros/core/dev"),d=require("@walkeros/core/dev"),c=d.z.object({partnerId:d.z.string().min(1).describe("Criteo Partner ID (numeric string, provided by Criteo)"),callerId:d.z.string().min(1).describe("Caller ID for user mapping (provided by Criteo)"),siteType:d.z.enum(["d","m","t"]).describe("Site type: d (desktop), m (mobile web), t (tablet)").optional(),country:d.z.string().length(2).describe("ISO 3166-1 alpha-2 country code").optional(),language:d.z.string().length(2).describe("2-letter language code").optional(),url:d.z.string().url().describe("Custom Events API endpoint (default https://widget.criteo.com/m/event?version=s2s_v0)").optional(),user_data:d.z.record(d.z.string(),d.z.string()).describe("Mapping for identity fields (like { email: 'user.email', mapped_user_id: 'user.id' })").optional()}),m=require("@walkeros/core/dev").z.object({}),u=require("@walkeros/core/dev"),l=u.z.union([u.z.enum(["viewHome","viewPage","viewItem","viewList","addToCart","viewBasket","beginCheckout","trackTransaction","addPaymentInfo","login"]),u.z.string()]),v=(0,p.zodToSchema)(c),g=(0,p.zodToSchema)(m),y={};o(y,{env:()=>_,step:()=>w});var _={};o(_,{push:()=>h,simulation:()=>k});var h={sendServer:async()=>({ok:!0,data:"OK"})},k=["sendServer"],w={};o(w,{addToCart:()=>C,pageView:()=>O,purchase:()=>b,viewItem:()=>I});var S=require("@walkeros/core"),f="https://widget.criteo.com/m/event?version=s2s_v0",b={in:(0,S.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:"https://shop.example.com/cart"}}),mapping:{name:"trackTransaction",data:{map:{id:"data.id",item:{loop:["nested",{condition:e=>(0,S.isObject)(e)&&"product"===e.entity,map:{id:"data.id",price:"data.price",quantity:{key:"data.quantity",value:1}}}]}}}},out:[["sendServer",f,JSON.stringify({version:"walkeros_criteo_1.0.0",site_type:"d",account:"PARTNER_ID",id:{mapping_key:"CALLER_ID"},events:[{event:"trackTransaction",timestamp:"2023-11-14T22:28:20.000Z",id:"ORD-300",item:[{id:"SKU-A1",price:124.99,quantity:2}]}],full_url:"https://shop.example.com/checkout/complete",previous_url:"https://shop.example.com/cart"})]]},C={in:(0,S.getEvent)("product add",{timestamp:1700000901e3,data:{id:"SKU-B2",name:"Running Shoes",price:89.99},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:"addToCart",data:{map:{item:{loop:["nested",{condition:e=>(0,S.isObject)(e)&&"product"===e.entity,map:{id:"data.id",price:"data.price",quantity:{key:"data.quantity",value:1}}}]}}}},out:[["sendServer",f,JSON.stringify({version:"walkeros_criteo_1.0.0",site_type:"d",account:"PARTNER_ID",id:{mapping_key:"CALLER_ID"},events:[{event:"addToCart",timestamp:"2023-11-14T22:28:21.000Z",item:[{id:"SKU-B2",price:89.99,quantity:1}]}],full_url:"https://shop.example.com/products/running-shoes"})]]},I={in:(0,S.getEvent)("product view",{timestamp:1700000902e3,data:{id:"SKU-C3",name:"Coffee Maker"},nested:[{entity:"product",data:{id:"SKU-C3"}}],source:{type:"server",id:"https://shop.example.com/products/coffee-maker",previous_id:""}}),mapping:{name:"viewItem",data:{map:{item:{loop:["nested",{condition:e=>(0,S.isObject)(e)&&"product"===e.entity,map:{id:"data.id"}}]}}}},out:[["sendServer",f,JSON.stringify({version:"walkeros_criteo_1.0.0",site_type:"d",account:"PARTNER_ID",id:{mapping_key:"CALLER_ID"},events:[{event:"viewItem",timestamp:"2023-11-14T22:28:22.000Z",item:[{id:"SKU-C3"}]}],full_url:"https://shop.example.com/products/coffee-maker"})]]},O={in:(0,S.getEvent)("page view",{timestamp:1700000903e3,source:{type:"server",id:"https://example.com/",previous_id:""}}),mapping:{name:"viewHome"},out:[["sendServer",f,JSON.stringify({version:"walkeros_criteo_1.0.0",site_type:"d",account:"PARTNER_ID",id:{mapping_key:"CALLER_ID"},events:[{event:"viewHome",timestamp:"2023-11-14T22:28:23.000Z"}],full_url:"https://example.com/"})]]};//# sourceMappingURL=dev.js.map
|
package/dist/dev.js.map
ADDED
|
@@ -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 partnerId: z\n .string()\n .min(1)\n .describe('Criteo Partner ID (numeric string, provided by Criteo)'),\n callerId: z\n .string()\n .min(1)\n .describe('Caller ID for user mapping (provided by Criteo)'),\n siteType: z\n .enum(['d', 'm', 't'])\n .describe('Site type: d (desktop), m (mobile web), t (tablet)')\n .optional(),\n country: z\n .string()\n .length(2)\n .describe('ISO 3166-1 alpha-2 country code')\n .optional(),\n language: z.string().length(2).describe('2-letter language code').optional(),\n url: z\n .string()\n .url()\n .describe(\n 'Custom Events API endpoint (default https://widget.criteo.com/m/event?version=s2s_v0)',\n )\n .optional(),\n user_data: z\n .record(z.string(), z.string())\n .describe(\n \"Mapping for identity fields (like { email: 'user.email', mapped_user_id: 'user.id' })\",\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * Criteo Events API Mapping Schema\n * Criteo has no event-level mapping configuration beyond name + data\n */\nexport const MappingSchema = z.object({});\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 * Standard Criteo Events API event names.\n * https://guides.criteotilt.com/events-api/\n */\nexport const CriteoEventNameSchema = z.union([\n z.enum([\n 'viewHome',\n 'viewPage',\n 'viewItem',\n 'viewList',\n 'addToCart',\n 'viewBasket',\n 'beginCheckout',\n 'trackTransaction',\n 'addPaymentInfo',\n 'login',\n ]),\n z.string(), // Allow custom event names\n]);\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 Criteo Events API 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: 'OK',\n});\n\n/**\n * Standard mock environment for push operations.\n *\n * Use this for testing Criteo Events API pushes without making\n * actual HTTP requests to Criteo'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 * Criteo Events API step examples.\n *\n * At push time, the destination calls `env.sendServer(url, body)` where\n * `url` is the configured Criteo endpoint (default:\n * `https://widget.criteo.com/m/event?version=s2s_v0`) and `body` is the\n * JSON-stringified request payload.\n *\n * Test fixture pins `partnerId = 'PARTNER_ID'` and `callerId = 'CALLER_ID'`,\n * so every call targets the default URL above.\n *\n * Body is emitted with keys in the order the destination assembles them:\n * 1. version\n * 2. site_type\n * 3. account\n * 4. id (identity block)\n * 5. events (always a single-element array)\n * 6. full_url (only when event.source.id is set)\n * 7. previous_url (only when event.source.previous_id is set)\n */\nconst ENDPOINT = 'https://widget.criteo.com/m/event?version=s2s_v0';\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: 'https://shop.example.com/cart',\n },\n }),\n mapping: {\n name: 'trackTransaction',\n data: {\n map: {\n id: 'data.id',\n item: {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n id: 'data.id',\n price: 'data.price',\n quantity: { key: 'data.quantity', value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n version: 'walkeros_criteo_1.0.0',\n site_type: 'd',\n account: 'PARTNER_ID',\n id: {\n mapping_key: 'CALLER_ID',\n },\n events: [\n {\n event: 'trackTransaction',\n timestamp: '2023-11-14T22:28:20.000Z',\n id: 'ORD-300',\n item: [\n {\n id: 'SKU-A1',\n price: 124.99,\n quantity: 2,\n },\n ],\n },\n ],\n full_url: 'https://shop.example.com/checkout/complete',\n previous_url: 'https://shop.example.com/cart',\n }),\n ],\n ],\n};\n\nexport const addToCart: Flow.StepExample = {\n in: getEvent('product add', {\n timestamp: 1700000901000,\n data: {\n id: 'SKU-B2',\n name: 'Running Shoes',\n price: 89.99,\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: 'addToCart',\n data: {\n map: {\n item: {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n id: 'data.id',\n price: 'data.price',\n quantity: { key: 'data.quantity', value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n version: 'walkeros_criteo_1.0.0',\n site_type: 'd',\n account: 'PARTNER_ID',\n id: {\n mapping_key: 'CALLER_ID',\n },\n events: [\n {\n event: 'addToCart',\n timestamp: '2023-11-14T22:28:21.000Z',\n item: [\n {\n id: 'SKU-B2',\n price: 89.99,\n quantity: 1,\n },\n ],\n },\n ],\n full_url: 'https://shop.example.com/products/running-shoes',\n }),\n ],\n ],\n};\n\nexport const viewItem: Flow.StepExample = {\n in: getEvent('product view', {\n timestamp: 1700000902000,\n data: { id: 'SKU-C3', name: 'Coffee Maker' },\n nested: [\n {\n entity: 'product',\n data: { id: 'SKU-C3' },\n },\n ],\n source: {\n type: 'server',\n id: 'https://shop.example.com/products/coffee-maker',\n previous_id: '',\n },\n }),\n mapping: {\n name: 'viewItem',\n data: {\n map: {\n item: {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n id: 'data.id',\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n version: 'walkeros_criteo_1.0.0',\n site_type: 'd',\n account: 'PARTNER_ID',\n id: {\n mapping_key: 'CALLER_ID',\n },\n events: [\n {\n event: 'viewItem',\n timestamp: '2023-11-14T22:28:22.000Z',\n item: [\n {\n id: 'SKU-C3',\n },\n ],\n },\n ],\n full_url: 'https://shop.example.com/products/coffee-maker',\n }),\n ],\n ],\n};\n\nexport const pageView: Flow.StepExample = {\n in: getEvent('page view', {\n timestamp: 1700000903000,\n source: {\n type: 'server',\n id: 'https://example.com/',\n previous_id: '',\n },\n }),\n mapping: {\n name: 'viewHome',\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n version: 'walkeros_criteo_1.0.0',\n site_type: 'd',\n account: 'PARTNER_ID',\n id: {\n mapping_key: 'CALLER_ID',\n },\n events: [\n {\n event: 'viewHome',\n timestamp: '2023-11-14T22:28:23.000Z',\n },\n ],\n full_url: 'https://example.com/',\n }),\n ],\n ],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAAE,OAAO;AAAA,EACrC,WAAW,aACR,OAAO,EACP,IAAI,CAAC,EACL,SAAS,wDAAwD;AAAA,EACpE,UAAU,aACP,OAAO,EACP,IAAI,CAAC,EACL,SAAS,iDAAiD;AAAA,EAC7D,UAAU,aACP,KAAK,CAAC,KAAK,KAAK,GAAG,CAAC,EACpB,SAAS,oDAAoD,EAC7D,SAAS;AAAA,EACZ,SAAS,aACN,OAAO,EACP,OAAO,CAAC,EACR,SAAS,iCAAiC,EAC1C,SAAS;AAAA,EACZ,UAAU,aAAE,OAAO,EAAE,OAAO,CAAC,EAAE,SAAS,wBAAwB,EAAE,SAAS;AAAA,EAC3E,KAAK,aACF,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EACZ,W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E,WAAW,CAAC,eACV,sBAAS,MAAM,KAAK,OAAO,WAAW;AAAA,cACxC,KAAK;AAAA,gBACH,IAAI;AAAA,cACN;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,SAAS;AAAA,QACT,WAAW;AAAA,QACX,SAAS;AAAA,QACT,IAAI;AAAA,UACF,aAAa;AAAA,QACf;AAAA,QACA,QAAQ;AAAA,UACN;AAAA,YACE,OAAO;AAAA,YACP,WAAW;AAAA,YACX,MAAM;AAAA,cACJ;AAAA,gBACE,IAAI;AAAA,cACN;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,QACA,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAEO,IAAM,WAA6B;AAAA,EACxC,QAAI,sBAAS,aAAa;AAAA,IACxB,WAAW;AAAA,IACX,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,aAAa;AAAA,IACf;AAAA,EACF,CAAC;AAAA,EACD,SAAS;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA,KAAK,UAAU;AAAA,QACb,SAAS;AAAA,QACT,WAAW;AAAA,QACX,SAAS;AAAA,QACT,IAAI;AAAA,UACF,aAAa;AAAA,QACf;AAAA,QACA,QAAQ;AAAA,UACN;AAAA,YACE,OAAO;AAAA,YACP,WAAW;AAAA,UACb;AAAA,QACF;AAAA,QACA,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":["import_dev","import_dev","import_dev"]}
|
package/dist/dev.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty,t=(t,i)=>{for(var a in i)e(t,a,{get:i[a],enumerable:!0})},i={};t(i,{CriteoEventNameSchema:()=>d,MappingSchema:()=>s,SettingsSchema:()=>o,mapping:()=>c,settings:()=>m});import{zodToSchema as a}from"@walkeros/core/dev";import{z as r}from"@walkeros/core/dev";var o=r.object({partnerId:r.string().min(1).describe("Criteo Partner ID (numeric string, provided by Criteo)"),callerId:r.string().min(1).describe("Caller ID for user mapping (provided by Criteo)"),siteType:r.enum(["d","m","t"]).describe("Site type: d (desktop), m (mobile web), t (tablet)").optional(),country:r.string().length(2).describe("ISO 3166-1 alpha-2 country code").optional(),language:r.string().length(2).describe("2-letter language code").optional(),url:r.string().url().describe("Custom Events API endpoint (default https://widget.criteo.com/m/event?version=s2s_v0)").optional(),user_data:r.record(r.string(),r.string()).describe("Mapping for identity fields (like { email: 'user.email', mapped_user_id: 'user.id' })").optional()});import{z as n}from"@walkeros/core/dev";var s=n.object({});import{z as p}from"@walkeros/core/dev";var d=p.union([p.enum(["viewHome","viewPage","viewItem","viewList","addToCart","viewBasket","beginCheckout","trackTransaction","addPaymentInfo","login"]),p.string()]),m=a(o),c=a(s),u={};t(u,{env:()=>l,step:()=>y});var l={};t(l,{push:()=>v,simulation:()=>g});var v={sendServer:async()=>({ok:!0,data:"OK"})},g=["sendServer"],y={};t(y,{addToCart:()=>S,pageView:()=>C,purchase:()=>f,viewItem:()=>w});import{getEvent as _,isObject as h}from"@walkeros/core";var k="https://widget.criteo.com/m/event?version=s2s_v0",f={in:_("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:"https://shop.example.com/cart"}}),mapping:{name:"trackTransaction",data:{map:{id:"data.id",item:{loop:["nested",{condition:e=>h(e)&&"product"===e.entity,map:{id:"data.id",price:"data.price",quantity:{key:"data.quantity",value:1}}}]}}}},out:[["sendServer",k,JSON.stringify({version:"walkeros_criteo_1.0.0",site_type:"d",account:"PARTNER_ID",id:{mapping_key:"CALLER_ID"},events:[{event:"trackTransaction",timestamp:"2023-11-14T22:28:20.000Z",id:"ORD-300",item:[{id:"SKU-A1",price:124.99,quantity:2}]}],full_url:"https://shop.example.com/checkout/complete",previous_url:"https://shop.example.com/cart"})]]},S={in:_("product add",{timestamp:1700000901e3,data:{id:"SKU-B2",name:"Running Shoes",price:89.99},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:"addToCart",data:{map:{item:{loop:["nested",{condition:e=>h(e)&&"product"===e.entity,map:{id:"data.id",price:"data.price",quantity:{key:"data.quantity",value:1}}}]}}}},out:[["sendServer",k,JSON.stringify({version:"walkeros_criteo_1.0.0",site_type:"d",account:"PARTNER_ID",id:{mapping_key:"CALLER_ID"},events:[{event:"addToCart",timestamp:"2023-11-14T22:28:21.000Z",item:[{id:"SKU-B2",price:89.99,quantity:1}]}],full_url:"https://shop.example.com/products/running-shoes"})]]},w={in:_("product view",{timestamp:1700000902e3,data:{id:"SKU-C3",name:"Coffee Maker"},nested:[{entity:"product",data:{id:"SKU-C3"}}],source:{type:"server",id:"https://shop.example.com/products/coffee-maker",previous_id:""}}),mapping:{name:"viewItem",data:{map:{item:{loop:["nested",{condition:e=>h(e)&&"product"===e.entity,map:{id:"data.id"}}]}}}},out:[["sendServer",k,JSON.stringify({version:"walkeros_criteo_1.0.0",site_type:"d",account:"PARTNER_ID",id:{mapping_key:"CALLER_ID"},events:[{event:"viewItem",timestamp:"2023-11-14T22:28:22.000Z",item:[{id:"SKU-C3"}]}],full_url:"https://shop.example.com/products/coffee-maker"})]]},C={in:_("page view",{timestamp:1700000903e3,source:{type:"server",id:"https://example.com/",previous_id:""}}),mapping:{name:"viewHome"},out:[["sendServer",k,JSON.stringify({version:"walkeros_criteo_1.0.0",site_type:"d",account:"PARTNER_ID",id:{mapping_key:"CALLER_ID"},events:[{event:"viewHome",timestamp:"2023-11-14T22:28:23.000Z"}],full_url:"https://example.com/"})]]};export{u as examples,i as schemas};//# sourceMappingURL=dev.mjs.map
|
package/dist/dev.mjs.map
ADDED
|
@@ -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 partnerId: z\n .string()\n .min(1)\n .describe('Criteo Partner ID (numeric string, provided by Criteo)'),\n callerId: z\n .string()\n .min(1)\n .describe('Caller ID for user mapping (provided by Criteo)'),\n siteType: z\n .enum(['d', 'm', 't'])\n .describe('Site type: d (desktop), m (mobile web), t (tablet)')\n .optional(),\n country: z\n .string()\n .length(2)\n .describe('ISO 3166-1 alpha-2 country code')\n .optional(),\n language: z.string().length(2).describe('2-letter language code').optional(),\n url: z\n .string()\n .url()\n .describe(\n 'Custom Events API endpoint (default https://widget.criteo.com/m/event?version=s2s_v0)',\n )\n .optional(),\n user_data: z\n .record(z.string(), z.string())\n .describe(\n \"Mapping for identity fields (like { email: 'user.email', mapped_user_id: 'user.id' })\",\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * Criteo Events API Mapping Schema\n * Criteo has no event-level mapping configuration beyond name + data\n */\nexport const MappingSchema = z.object({});\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 * Standard Criteo Events API event names.\n * https://guides.criteotilt.com/events-api/\n */\nexport const CriteoEventNameSchema = z.union([\n z.enum([\n 'viewHome',\n 'viewPage',\n 'viewItem',\n 'viewList',\n 'addToCart',\n 'viewBasket',\n 'beginCheckout',\n 'trackTransaction',\n 'addPaymentInfo',\n 'login',\n ]),\n z.string(), // Allow custom event names\n]);\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 Criteo Events API 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: 'OK',\n});\n\n/**\n * Standard mock environment for push operations.\n *\n * Use this for testing Criteo Events API pushes without making\n * actual HTTP requests to Criteo'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 * Criteo Events API step examples.\n *\n * At push time, the destination calls `env.sendServer(url, body)` where\n * `url` is the configured Criteo endpoint (default:\n * `https://widget.criteo.com/m/event?version=s2s_v0`) and `body` is the\n * JSON-stringified request payload.\n *\n * Test fixture pins `partnerId = 'PARTNER_ID'` and `callerId = 'CALLER_ID'`,\n * so every call targets the default URL above.\n *\n * Body is emitted with keys in the order the destination assembles them:\n * 1. version\n * 2. site_type\n * 3. account\n * 4. id (identity block)\n * 5. events (always a single-element array)\n * 6. full_url (only when event.source.id is set)\n * 7. previous_url (only when event.source.previous_id is set)\n */\nconst ENDPOINT = 'https://widget.criteo.com/m/event?version=s2s_v0';\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: 'https://shop.example.com/cart',\n },\n }),\n mapping: {\n name: 'trackTransaction',\n data: {\n map: {\n id: 'data.id',\n item: {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n id: 'data.id',\n price: 'data.price',\n quantity: { key: 'data.quantity', value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n version: 'walkeros_criteo_1.0.0',\n site_type: 'd',\n account: 'PARTNER_ID',\n id: {\n mapping_key: 'CALLER_ID',\n },\n events: [\n {\n event: 'trackTransaction',\n timestamp: '2023-11-14T22:28:20.000Z',\n id: 'ORD-300',\n item: [\n {\n id: 'SKU-A1',\n price: 124.99,\n quantity: 2,\n },\n ],\n },\n ],\n full_url: 'https://shop.example.com/checkout/complete',\n previous_url: 'https://shop.example.com/cart',\n }),\n ],\n ],\n};\n\nexport const addToCart: Flow.StepExample = {\n in: getEvent('product add', {\n timestamp: 1700000901000,\n data: {\n id: 'SKU-B2',\n name: 'Running Shoes',\n price: 89.99,\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: 'addToCart',\n data: {\n map: {\n item: {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n id: 'data.id',\n price: 'data.price',\n quantity: { key: 'data.quantity', value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n version: 'walkeros_criteo_1.0.0',\n site_type: 'd',\n account: 'PARTNER_ID',\n id: {\n mapping_key: 'CALLER_ID',\n },\n events: [\n {\n event: 'addToCart',\n timestamp: '2023-11-14T22:28:21.000Z',\n item: [\n {\n id: 'SKU-B2',\n price: 89.99,\n quantity: 1,\n },\n ],\n },\n ],\n full_url: 'https://shop.example.com/products/running-shoes',\n }),\n ],\n ],\n};\n\nexport const viewItem: Flow.StepExample = {\n in: getEvent('product view', {\n timestamp: 1700000902000,\n data: { id: 'SKU-C3', name: 'Coffee Maker' },\n nested: [\n {\n entity: 'product',\n data: { id: 'SKU-C3' },\n },\n ],\n source: {\n type: 'server',\n id: 'https://shop.example.com/products/coffee-maker',\n previous_id: '',\n },\n }),\n mapping: {\n name: 'viewItem',\n data: {\n map: {\n item: {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n id: 'data.id',\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n version: 'walkeros_criteo_1.0.0',\n site_type: 'd',\n account: 'PARTNER_ID',\n id: {\n mapping_key: 'CALLER_ID',\n },\n events: [\n {\n event: 'viewItem',\n timestamp: '2023-11-14T22:28:22.000Z',\n item: [\n {\n id: 'SKU-C3',\n },\n ],\n },\n ],\n full_url: 'https://shop.example.com/products/coffee-maker',\n }),\n ],\n ],\n};\n\nexport const pageView: Flow.StepExample = {\n in: getEvent('page view', {\n timestamp: 1700000903000,\n source: {\n type: 'server',\n id: 'https://example.com/',\n previous_id: '',\n },\n }),\n mapping: {\n name: 'viewHome',\n },\n out: [\n [\n 'sendServer',\n ENDPOINT,\n JSON.stringify({\n version: 'walkeros_criteo_1.0.0',\n site_type: 'd',\n account: 'PARTNER_ID',\n id: {\n mapping_key: 'CALLER_ID',\n },\n events: [\n {\n event: 'viewHome',\n timestamp: '2023-11-14T22:28:23.000Z',\n },\n ],\n full_url: 'https://example.com/',\n }),\n ],\n ],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AAA,IACxB,WAAW;AAAA,IACX,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,aAAa;AAAA,IACf;AAAA,EACF,CAAC;AAAA,EACD,SAAS;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA,KAAK,UAAU;AAAA,QACb,SAAS;AAAA,QACT,WAAW;AAAA,QACX,SAAS;AAAA,QACT,IAAI;AAAA,UACF,aAAa;AAAA,QACf;AAAA,QACA,QAAQ;AAAA,UACN;AAAA,YACE,OAAO;AAAA,YACP,WAAW;AAAA,UACb;AAAA,QACF;AAAA,QACA,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":["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 Criteo Events API pushes without making
|
|
12
|
+
* actual HTTP requests to Criteo'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 addToCart: Flow.StepExample;
|
|
25
|
+
declare const viewItem: Flow.StepExample;
|
|
26
|
+
declare const pageView: Flow.StepExample;
|
|
27
|
+
|
|
28
|
+
declare const step_addToCart: typeof addToCart;
|
|
29
|
+
declare const step_pageView: typeof pageView;
|
|
30
|
+
declare const step_purchase: typeof purchase;
|
|
31
|
+
declare const step_viewItem: typeof viewItem;
|
|
32
|
+
declare namespace step {
|
|
33
|
+
export { step_addToCart as addToCart, step_pageView as pageView, step_purchase as purchase, step_viewItem as viewItem };
|
|
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 Criteo Events API pushes without making
|
|
12
|
+
* actual HTTP requests to Criteo'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 addToCart: Flow.StepExample;
|
|
25
|
+
declare const viewItem: Flow.StepExample;
|
|
26
|
+
declare const pageView: Flow.StepExample;
|
|
27
|
+
|
|
28
|
+
declare const step_addToCart: typeof addToCart;
|
|
29
|
+
declare const step_pageView: typeof pageView;
|
|
30
|
+
declare const step_purchase: typeof purchase;
|
|
31
|
+
declare const step_viewItem: typeof viewItem;
|
|
32
|
+
declare namespace step {
|
|
33
|
+
export { step_addToCart as addToCart, step_pageView as pageView, step_purchase as purchase, step_viewItem as viewItem };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { env, step };
|