@walkeros/server-destination-pinterest 3.3.0-next-1776098542393
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +134 -0
- package/dist/dev.d.mts +128 -0
- package/dist/dev.d.ts +128 -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 +38 -0
- package/dist/examples/index.d.ts +38 -0
- package/dist/examples/index.js +317 -0
- package/dist/examples/index.mjs +295 -0
- package/dist/index.d.mts +137 -0
- package/dist/index.d.ts +137 -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 +598 -0
- package/package.json +75 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 elbWalker GmbH
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# @walkeros/server-destination-pinterest
|
|
2
|
+
|
|
3
|
+
Server-side Pinterest Conversions API destination for walkerOS.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @walkeros/server-destination-pinterest
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Configuration
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"destinations": {
|
|
16
|
+
"pinterest": {
|
|
17
|
+
"package": "@walkeros/server-destination-pinterest",
|
|
18
|
+
"config": {
|
|
19
|
+
"settings": {
|
|
20
|
+
"accessToken": "pina_...",
|
|
21
|
+
"adAccountId": "123456789"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Settings
|
|
30
|
+
|
|
31
|
+
| Setting | Type | Required | Default | Description |
|
|
32
|
+
| --------------- | -------- | -------- | ------------------------------- | -------------------------------------------------------- |
|
|
33
|
+
| `accessToken` | string | yes | - | Pinterest conversion access token (Bearer auth) |
|
|
34
|
+
| `adAccountId` | string | yes | - | Pinterest ad account ID (numeric string) |
|
|
35
|
+
| `action_source` | string | no | `"web"` | Event source: `web`, `app_android`, `app_ios`, `offline` |
|
|
36
|
+
| `doNotHash` | string[] | no | - | User data fields to skip hashing |
|
|
37
|
+
| `test` | boolean | no | `false` | Enable test mode (`?test=true` query param) |
|
|
38
|
+
| `url` | string | no | `https://api.pinterest.com/v5/` | Custom API base URL |
|
|
39
|
+
| `user_data` | object | no | - | Default user_data mapping for all events |
|
|
40
|
+
| `partner_name` | string | no | - | Third-party partner name for attribution |
|
|
41
|
+
|
|
42
|
+
## Event Mapping
|
|
43
|
+
|
|
44
|
+
| walkerOS Event | Pinterest CAPI Event |
|
|
45
|
+
| ---------------- | -------------------- |
|
|
46
|
+
| `page view` | `page_visit` |
|
|
47
|
+
| `order complete` | `checkout` |
|
|
48
|
+
| `product add` | `add_to_cart` |
|
|
49
|
+
| `product view` | `view_content` |
|
|
50
|
+
| `user signup` | `signup` |
|
|
51
|
+
| `site search` | `search` |
|
|
52
|
+
| `checkout start` | `initiate_checkout` |
|
|
53
|
+
| `form submit` | `lead` |
|
|
54
|
+
|
|
55
|
+
## User Data
|
|
56
|
+
|
|
57
|
+
### Hashed Fields (SHA-256)
|
|
58
|
+
|
|
59
|
+
| Field | Key | Description |
|
|
60
|
+
| ------------- | -------------- | ----------------------------- |
|
|
61
|
+
| Email | `em` | Lowercase, trimmed |
|
|
62
|
+
| Phone | `ph` | Digits only with country code |
|
|
63
|
+
| First name | `fn` | Lowercase |
|
|
64
|
+
| Last name | `ln` | Lowercase |
|
|
65
|
+
| Date of birth | `db` | YYYYMMDD format |
|
|
66
|
+
| Gender | `ge` | Single letter: f, m, n |
|
|
67
|
+
| City | `ct` | Lowercase, no spaces |
|
|
68
|
+
| State | `st` | Two-letter code, lowercase |
|
|
69
|
+
| Zip code | `zp` | Digits only |
|
|
70
|
+
| Country | `country` | ISO 3166-1 alpha-2, lowercase |
|
|
71
|
+
| External ID | `external_id` | Advertiser user identifier |
|
|
72
|
+
| Mobile ad IDs | `hashed_maids` | GAID or IDFA |
|
|
73
|
+
|
|
74
|
+
### Pass-through Fields (not hashed)
|
|
75
|
+
|
|
76
|
+
| Field | Key |
|
|
77
|
+
| ---------- | ------------------- |
|
|
78
|
+
| Client IP | `client_ip_address` |
|
|
79
|
+
| User agent | `client_user_agent` |
|
|
80
|
+
| Click ID | `click_id` |
|
|
81
|
+
| Partner ID | `partner_id` |
|
|
82
|
+
|
|
83
|
+
Use `doNotHash` to skip hashing for pre-hashed fields.
|
|
84
|
+
|
|
85
|
+
## Custom Data
|
|
86
|
+
|
|
87
|
+
Ecommerce data is nested under `custom_data`:
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"data": {
|
|
92
|
+
"map": {
|
|
93
|
+
"custom_data": {
|
|
94
|
+
"map": {
|
|
95
|
+
"value": "data.total",
|
|
96
|
+
"currency": { "key": "data.currency", "value": "USD" },
|
|
97
|
+
"order_id": "data.id",
|
|
98
|
+
"contents": {
|
|
99
|
+
"loop": [
|
|
100
|
+
"nested",
|
|
101
|
+
{
|
|
102
|
+
"condition": { "$code": "e => e.entity === 'product'" },
|
|
103
|
+
"map": {
|
|
104
|
+
"id": "data.id",
|
|
105
|
+
"item_name": "data.name",
|
|
106
|
+
"item_price": "data.price",
|
|
107
|
+
"quantity": { "key": "data.quantity", "value": 1 }
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Deduplication
|
|
120
|
+
|
|
121
|
+
The destination automatically sets `event_id` from `event.id`. When using both
|
|
122
|
+
the web Pinterest destination and this server destination, deduplication works
|
|
123
|
+
automatically since both receive the same walkerOS event with the same
|
|
124
|
+
`event.id`.
|
|
125
|
+
|
|
126
|
+
## Test Mode
|
|
127
|
+
|
|
128
|
+
Set `test: true` in settings to append `?test=true` to the API URL. Events will
|
|
129
|
+
appear in Pinterest Ads Manager under the test events section.
|
|
130
|
+
|
|
131
|
+
## Links
|
|
132
|
+
|
|
133
|
+
- [Pinterest Conversions API docs](https://developers.pinterest.com/docs/conversions/conversions/)
|
|
134
|
+
- [walkerOS documentation](https://www.walkeros.io/docs/destinations/server/pinterest-capi)
|
package/dist/dev.d.mts
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
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
|
+
* Action Source Enum
|
|
8
|
+
* Where the conversion event took place
|
|
9
|
+
* https://developers.pinterest.com/docs/conversions/conversions/
|
|
10
|
+
*/
|
|
11
|
+
declare const ActionSourceSchema: z.ZodEnum<{
|
|
12
|
+
app_android: "app_android";
|
|
13
|
+
app_ios: "app_ios";
|
|
14
|
+
web: "web";
|
|
15
|
+
offline: "offline";
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Event Name
|
|
19
|
+
* Standard Pinterest CAPI event names or custom event identifiers
|
|
20
|
+
*/
|
|
21
|
+
declare const EventNameSchema: z.ZodUnion<readonly [z.ZodEnum<{
|
|
22
|
+
custom: "custom";
|
|
23
|
+
add_payment_info: "add_payment_info";
|
|
24
|
+
add_to_cart: "add_to_cart";
|
|
25
|
+
add_to_wishlist: "add_to_wishlist";
|
|
26
|
+
app_install: "app_install";
|
|
27
|
+
app_open: "app_open";
|
|
28
|
+
checkout: "checkout";
|
|
29
|
+
contact: "contact";
|
|
30
|
+
customize_product: "customize_product";
|
|
31
|
+
find_location: "find_location";
|
|
32
|
+
initiate_checkout: "initiate_checkout";
|
|
33
|
+
lead: "lead";
|
|
34
|
+
page_visit: "page_visit";
|
|
35
|
+
schedule: "schedule";
|
|
36
|
+
search: "search";
|
|
37
|
+
signup: "signup";
|
|
38
|
+
start_trial: "start_trial";
|
|
39
|
+
submit_application: "submit_application";
|
|
40
|
+
subscribe: "subscribe";
|
|
41
|
+
view_category: "view_category";
|
|
42
|
+
view_content: "view_content";
|
|
43
|
+
watch_video: "watch_video";
|
|
44
|
+
}>, z.ZodString]>;
|
|
45
|
+
|
|
46
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
47
|
+
accessToken: z.ZodString;
|
|
48
|
+
adAccountId: z.ZodString;
|
|
49
|
+
action_source: z.ZodOptional<z.ZodEnum<{
|
|
50
|
+
app_android: "app_android";
|
|
51
|
+
app_ios: "app_ios";
|
|
52
|
+
web: "web";
|
|
53
|
+
offline: "offline";
|
|
54
|
+
}>>;
|
|
55
|
+
doNotHash: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
56
|
+
test: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
+
url: z.ZodOptional<z.ZodString>;
|
|
58
|
+
user_data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
59
|
+
partner_name: z.ZodOptional<z.ZodString>;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
type Settings = z.infer<typeof SettingsSchema>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Pinterest Conversions API Mapping Schema
|
|
65
|
+
* Pinterest CAPI has no event-level mapping configuration
|
|
66
|
+
*/
|
|
67
|
+
declare const MappingSchema: z.ZodObject<{}, z.core.$strip>;
|
|
68
|
+
/**
|
|
69
|
+
* Type inference from MappingSchema
|
|
70
|
+
*/
|
|
71
|
+
type Mapping = z.infer<typeof MappingSchema>;
|
|
72
|
+
|
|
73
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
74
|
+
declare const mapping: _walkeros_core_dev.JSONSchema;
|
|
75
|
+
|
|
76
|
+
declare const index$1_ActionSourceSchema: typeof ActionSourceSchema;
|
|
77
|
+
declare const index$1_EventNameSchema: typeof EventNameSchema;
|
|
78
|
+
type index$1_Mapping = Mapping;
|
|
79
|
+
declare const index$1_MappingSchema: typeof MappingSchema;
|
|
80
|
+
type index$1_Settings = Settings;
|
|
81
|
+
declare const index$1_SettingsSchema: typeof SettingsSchema;
|
|
82
|
+
declare const index$1_mapping: typeof mapping;
|
|
83
|
+
declare const index$1_settings: typeof settings;
|
|
84
|
+
declare namespace index$1 {
|
|
85
|
+
export { index$1_ActionSourceSchema as ActionSourceSchema, index$1_EventNameSchema as EventNameSchema, 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 };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
interface Env extends DestinationServer.Env {
|
|
89
|
+
sendServer?: typeof sendServer;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Standard mock environment for push operations
|
|
94
|
+
*
|
|
95
|
+
* Use this for testing Pinterest Conversions API events without making
|
|
96
|
+
* actual HTTP requests to Pinterest's servers.
|
|
97
|
+
*/
|
|
98
|
+
declare const push: Env;
|
|
99
|
+
declare const simulation: string[];
|
|
100
|
+
|
|
101
|
+
declare const env_push: typeof push;
|
|
102
|
+
declare const env_simulation: typeof simulation;
|
|
103
|
+
declare namespace env {
|
|
104
|
+
export { env_push as push, env_simulation as simulation };
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
declare const checkout: Flow.StepExample;
|
|
108
|
+
declare const addToCart: Flow.StepExample;
|
|
109
|
+
declare const pageVisit: Flow.StepExample;
|
|
110
|
+
declare const search: Flow.StepExample;
|
|
111
|
+
declare const signup: Flow.StepExample;
|
|
112
|
+
|
|
113
|
+
declare const step_addToCart: typeof addToCart;
|
|
114
|
+
declare const step_checkout: typeof checkout;
|
|
115
|
+
declare const step_pageVisit: typeof pageVisit;
|
|
116
|
+
declare const step_search: typeof search;
|
|
117
|
+
declare const step_signup: typeof signup;
|
|
118
|
+
declare namespace step {
|
|
119
|
+
export { step_addToCart as addToCart, step_checkout as checkout, step_pageVisit as pageVisit, step_search as search, step_signup as signup };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
declare const index_env: typeof env;
|
|
123
|
+
declare const index_step: typeof step;
|
|
124
|
+
declare namespace index {
|
|
125
|
+
export { index_env as env, index_step as step };
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export { index as examples, index$1 as schemas };
|
package/dist/dev.d.ts
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
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
|
+
* Action Source Enum
|
|
8
|
+
* Where the conversion event took place
|
|
9
|
+
* https://developers.pinterest.com/docs/conversions/conversions/
|
|
10
|
+
*/
|
|
11
|
+
declare const ActionSourceSchema: z.ZodEnum<{
|
|
12
|
+
app_android: "app_android";
|
|
13
|
+
app_ios: "app_ios";
|
|
14
|
+
web: "web";
|
|
15
|
+
offline: "offline";
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Event Name
|
|
19
|
+
* Standard Pinterest CAPI event names or custom event identifiers
|
|
20
|
+
*/
|
|
21
|
+
declare const EventNameSchema: z.ZodUnion<readonly [z.ZodEnum<{
|
|
22
|
+
custom: "custom";
|
|
23
|
+
add_payment_info: "add_payment_info";
|
|
24
|
+
add_to_cart: "add_to_cart";
|
|
25
|
+
add_to_wishlist: "add_to_wishlist";
|
|
26
|
+
app_install: "app_install";
|
|
27
|
+
app_open: "app_open";
|
|
28
|
+
checkout: "checkout";
|
|
29
|
+
contact: "contact";
|
|
30
|
+
customize_product: "customize_product";
|
|
31
|
+
find_location: "find_location";
|
|
32
|
+
initiate_checkout: "initiate_checkout";
|
|
33
|
+
lead: "lead";
|
|
34
|
+
page_visit: "page_visit";
|
|
35
|
+
schedule: "schedule";
|
|
36
|
+
search: "search";
|
|
37
|
+
signup: "signup";
|
|
38
|
+
start_trial: "start_trial";
|
|
39
|
+
submit_application: "submit_application";
|
|
40
|
+
subscribe: "subscribe";
|
|
41
|
+
view_category: "view_category";
|
|
42
|
+
view_content: "view_content";
|
|
43
|
+
watch_video: "watch_video";
|
|
44
|
+
}>, z.ZodString]>;
|
|
45
|
+
|
|
46
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
47
|
+
accessToken: z.ZodString;
|
|
48
|
+
adAccountId: z.ZodString;
|
|
49
|
+
action_source: z.ZodOptional<z.ZodEnum<{
|
|
50
|
+
app_android: "app_android";
|
|
51
|
+
app_ios: "app_ios";
|
|
52
|
+
web: "web";
|
|
53
|
+
offline: "offline";
|
|
54
|
+
}>>;
|
|
55
|
+
doNotHash: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
56
|
+
test: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
+
url: z.ZodOptional<z.ZodString>;
|
|
58
|
+
user_data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
59
|
+
partner_name: z.ZodOptional<z.ZodString>;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
type Settings = z.infer<typeof SettingsSchema>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Pinterest Conversions API Mapping Schema
|
|
65
|
+
* Pinterest CAPI has no event-level mapping configuration
|
|
66
|
+
*/
|
|
67
|
+
declare const MappingSchema: z.ZodObject<{}, z.core.$strip>;
|
|
68
|
+
/**
|
|
69
|
+
* Type inference from MappingSchema
|
|
70
|
+
*/
|
|
71
|
+
type Mapping = z.infer<typeof MappingSchema>;
|
|
72
|
+
|
|
73
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
74
|
+
declare const mapping: _walkeros_core_dev.JSONSchema;
|
|
75
|
+
|
|
76
|
+
declare const index$1_ActionSourceSchema: typeof ActionSourceSchema;
|
|
77
|
+
declare const index$1_EventNameSchema: typeof EventNameSchema;
|
|
78
|
+
type index$1_Mapping = Mapping;
|
|
79
|
+
declare const index$1_MappingSchema: typeof MappingSchema;
|
|
80
|
+
type index$1_Settings = Settings;
|
|
81
|
+
declare const index$1_SettingsSchema: typeof SettingsSchema;
|
|
82
|
+
declare const index$1_mapping: typeof mapping;
|
|
83
|
+
declare const index$1_settings: typeof settings;
|
|
84
|
+
declare namespace index$1 {
|
|
85
|
+
export { index$1_ActionSourceSchema as ActionSourceSchema, index$1_EventNameSchema as EventNameSchema, 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 };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
interface Env extends DestinationServer.Env {
|
|
89
|
+
sendServer?: typeof sendServer;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Standard mock environment for push operations
|
|
94
|
+
*
|
|
95
|
+
* Use this for testing Pinterest Conversions API events without making
|
|
96
|
+
* actual HTTP requests to Pinterest's servers.
|
|
97
|
+
*/
|
|
98
|
+
declare const push: Env;
|
|
99
|
+
declare const simulation: string[];
|
|
100
|
+
|
|
101
|
+
declare const env_push: typeof push;
|
|
102
|
+
declare const env_simulation: typeof simulation;
|
|
103
|
+
declare namespace env {
|
|
104
|
+
export { env_push as push, env_simulation as simulation };
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
declare const checkout: Flow.StepExample;
|
|
108
|
+
declare const addToCart: Flow.StepExample;
|
|
109
|
+
declare const pageVisit: Flow.StepExample;
|
|
110
|
+
declare const search: Flow.StepExample;
|
|
111
|
+
declare const signup: Flow.StepExample;
|
|
112
|
+
|
|
113
|
+
declare const step_addToCart: typeof addToCart;
|
|
114
|
+
declare const step_checkout: typeof checkout;
|
|
115
|
+
declare const step_pageVisit: typeof pageVisit;
|
|
116
|
+
declare const step_search: typeof search;
|
|
117
|
+
declare const step_signup: typeof signup;
|
|
118
|
+
declare namespace step {
|
|
119
|
+
export { step_addToCart as addToCart, step_checkout as checkout, step_pageVisit as pageVisit, step_search as search, step_signup as signup };
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
declare const index_env: typeof env;
|
|
123
|
+
declare const index_step: typeof step;
|
|
124
|
+
declare namespace index {
|
|
125
|
+
export { index_env as env, index_step as step };
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export { index as examples, index$1 as schemas };
|
package/dist/dev.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,n=(e,a)=>{for(var r in a)t(e,r,{get:a[r],enumerable:!0})},s={};n(s,{examples:()=>g,schemas:()=>o}),module.exports=(e=s,((e,n,s,o)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let c of r(n))i.call(e,c)||c===s||t(e,c,{get:()=>n[c],enumerable:!(o=a(n,c))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o={};n(o,{ActionSourceSchema:()=>p,EventNameSchema:()=>m,MappingSchema:()=>l,SettingsSchema:()=>_,mapping:()=>h,settings:()=>v});var c=require("@walkeros/core/dev"),d=require("@walkeros/core/dev"),u=require("@walkeros/core/dev"),p=u.z.enum(["app_android","app_ios","web","offline"]),m=u.z.union([u.z.enum(["add_payment_info","add_to_cart","add_to_wishlist","app_install","app_open","checkout","contact","custom","customize_product","find_location","initiate_checkout","lead","page_visit","schedule","search","signup","start_trial","submit_application","subscribe","view_category","view_content","watch_video"]),u.z.string()]),_=d.z.object({accessToken:d.z.string().min(1).describe("Pinterest conversion access token for Bearer authentication (like pina_ABC123...)"),adAccountId:d.z.string().regex(/^[0-9]+$/,"Ad account ID must contain only digits").describe("Pinterest ad account ID from Ads Manager (like 123456789)"),action_source:p.describe("Source of the event (web, app_android, app_ios, offline) (like web)").optional(),doNotHash:d.z.array(d.z.string()).describe("Array of user_data fields that should not be hashed (like ['external_id'])").optional(),test:d.z.boolean().describe("Enable test mode by appending ?test=true to the API URL (like true)").optional(),url:d.z.string().url().describe("Custom URL for Pinterest Conversions API endpoint (like https://api.pinterest.com/v5/)").optional(),user_data:d.z.record(d.z.string(),d.z.string()).describe("Mapping configuration for user data fields (like { em: 'user.email', ph: 'user.phone' })").optional(),partner_name:d.z.string().describe("Third-party partner name for attribution (like ss-walkeros)").optional()}),l=require("@walkeros/core/dev").z.object({}),v=(0,c.zodToSchema)(_),h=(0,c.zodToSchema)(l),g={};n(g,{env:()=>y,step:()=>k});var y={};n(y,{push:()=>w,simulation:()=>b});var w={sendServer:async function(e,t,a){return{ok:!0,data:{num_events_received:1,num_events_processed:1,events:[{status:"processed"}]}}}},b=["sendServer"],k={};n(k,{addToCart:()=>z,checkout:()=>x,pageVisit:()=>S,search:()=>q,signup:()=>E});var f=require("@walkeros/core"),x={in:(0,f.getEvent)("order complete",{timestamp:1700000900,data:{id:"ORD-300",total:249.99,currency:"EUR"},nested:[{entity:"product",data:{id:"SKU-A1",name:"Everyday Ruck Snack",price:"129.99",quantity:2}}],user:{id:"user-123",device:"device-456"},source:{type:"server",id:"https://shop.example.com",previous_id:""}}),mapping:{name:"checkout",data:{map:{custom_data:{map:{value:"data.total",currency:{key:"data.currency",value:"EUR"},order_id:"data.id",num_items:{fn:e=>e.nested.filter(e=>"product"===e.entity).length},contents:{loop:["nested",{condition:e=>(0,f.isObject)(e)&&"product"===e.entity,map:{id:"data.id",item_name:"data.name",item_price:"data.price",quantity:{key:"data.quantity",value:1}}}]}}}}}},out:{data:[{event_name:"checkout",event_time:1700000900,event_id:"1700000900-gr0up-1",event_source_url:"https://shop.example.com",action_source:"web",user_data:{external_id:["user-123"]},custom_data:{value:249.99,currency:"EUR",order_id:"ORD-300",num_items:1,contents:[{id:"SKU-A1",item_name:"Everyday Ruck Snack",item_price:"129.99",quantity:2}]}}]}},z={in:(0,f.getEvent)("product add",{timestamp:1700000901,data:{id:"SKU-B2",name:"Cool Cap",price:"42.00",quantity:1},user:{id:"user-456"},source:{type:"server",id:"https://shop.example.com/products",previous_id:""}}),mapping:{name:"add_to_cart",data:{map:{custom_data:{map:{value:"data.price",currency:{value:"EUR"},contents:{set:[{map:{id:"data.id",item_name:"data.name",item_price:"data.price",quantity:{key:"data.quantity",value:1}}}]}}}}}},out:{data:[{event_name:"add_to_cart",event_time:1700000901,event_id:"1700000901-gr0up-1",event_source_url:"https://shop.example.com/products",action_source:"web",user_data:{external_id:["user-456"]},custom_data:{value:"42.00",currency:"EUR",contents:[{id:"SKU-B2",item_name:"Cool Cap",item_price:"42.00",quantity:1}]}}]}},S={in:(0,f.getEvent)("page view",{timestamp:1700000902,user:{id:"user-789"},source:{type:"server",id:"https://www.example.com/docs/",previous_id:""}}),mapping:{name:"page_visit"},out:{data:[{event_name:"page_visit",event_time:1700000902,event_id:"1700000902-gr0up-1",event_source_url:"https://www.example.com/docs/",action_source:"web",user_data:{external_id:["user-789"]}}]}},q={in:(0,f.getEvent)("entity action",{timestamp:1700000903,name:"site search",data:{query:"walkerOS destinations"},user:{id:"user-101"},source:{type:"server",id:"https://www.example.com/search",previous_id:""}}),mapping:{name:"search",data:{map:{custom_data:{map:{search_string:"data.query"}}}}},out:{data:[{event_name:"search",event_time:1700000903,event_id:"1700000903-gr0up-1",event_source_url:"https://www.example.com/search",action_source:"web",user_data:{external_id:["user-101"]},custom_data:{search_string:"walkerOS destinations"}}]}},E={in:(0,f.getEvent)("entity action",{timestamp:1700000904,name:"user signup",data:{method:"email"},user:{id:"new-user-1",email:"new@example.com"},source:{type:"server",id:"https://www.example.com/register",previous_id:""}}),mapping:{name:"signup",data:{map:{user_data:{map:{em:{set:["user.email"]},external_id:{set:["user.id"]}}}}}},out:{data:[{event_name:"signup",event_time:1700000904,event_id:"1700000904-gr0up-1",event_source_url:"https://www.example.com/register",action_source:"web",user_data:{em:["new@example.com"],external_id:["new-user-1"]}}]}};//# 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/primitives.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport * from './primitives';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\nimport { ActionSourceSchema } from './primitives';\n\nexport const SettingsSchema = z.object({\n accessToken: z\n .string()\n .min(1)\n .describe(\n 'Pinterest conversion access token for Bearer authentication (like pina_ABC123...)',\n ),\n adAccountId: z\n .string()\n .regex(/^[0-9]+$/, 'Ad account ID must contain only digits')\n .describe('Pinterest ad account ID from Ads Manager (like 123456789)'),\n action_source: ActionSourceSchema.describe(\n 'Source of the event (web, app_android, app_ios, offline) (like web)',\n ).optional(),\n doNotHash: z\n .array(z.string())\n .describe(\n \"Array of user_data fields that should not be hashed (like ['external_id'])\",\n )\n .optional(),\n test: z\n .boolean()\n .describe(\n 'Enable test mode by appending ?test=true to the API URL (like true)',\n )\n .optional(),\n url: z\n .string()\n .url()\n .describe(\n 'Custom URL for Pinterest Conversions API endpoint (like https://api.pinterest.com/v5/)',\n )\n .optional(),\n user_data: z\n .record(z.string(), z.string())\n .describe(\n \"Mapping configuration for user data fields (like { em: 'user.email', ph: 'user.phone' })\",\n )\n .optional(),\n partner_name: z\n .string()\n .describe('Third-party partner name for attribution (like ss-walkeros)')\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * Action Source Enum\n * Where the conversion event took place\n * https://developers.pinterest.com/docs/conversions/conversions/\n */\nexport const ActionSourceSchema = z.enum([\n 'app_android',\n 'app_ios',\n 'web',\n 'offline',\n]);\n\n/**\n * Event Name\n * Standard Pinterest CAPI event names or custom event identifiers\n */\nexport const EventNameSchema = z.union([\n z.enum([\n 'add_payment_info',\n 'add_to_cart',\n 'add_to_wishlist',\n 'app_install',\n 'app_open',\n 'checkout',\n 'contact',\n 'custom',\n 'customize_product',\n 'find_location',\n 'initiate_checkout',\n 'lead',\n 'page_visit',\n 'schedule',\n 'search',\n 'signup',\n 'start_trial',\n 'submit_application',\n 'subscribe',\n 'view_category',\n 'view_content',\n 'watch_video',\n ]),\n z.string(), // Allow custom event names\n]);\n","import { z } from '@walkeros/core/dev';\n\n/**\n * Pinterest Conversions API Mapping Schema\n * Pinterest CAPI has no event-level mapping configuration\n */\nexport const MappingSchema = z.object({});\n\n/**\n * Type inference from MappingSchema\n */\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { SendDataValue, SendResponse } from '@walkeros/core';\nimport type { SendServerOptions } from '@walkeros/server-core';\nimport type { Env } from '../types';\n\n/**\n * Example environment configurations for Pinterest Conversions API destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring actual HTTP requests.\n */\n\n/**\n * Mock sendServer function that simulates successful HTTP responses\n */\nasync function mockSendServer(\n url: string,\n data?: SendDataValue,\n options?: SendServerOptions,\n): Promise<SendResponse> {\n // Simulate successful Pinterest API response\n return {\n ok: true,\n data: {\n num_events_received: 1,\n num_events_processed: 1,\n events: [{ status: 'processed' }],\n },\n };\n}\n\n/**\n * Standard mock environment for push operations\n *\n * Use this for testing Pinterest Conversions API events without making\n * actual HTTP requests to Pinterest's servers.\n */\nexport const push: Env = {\n sendServer: mockSendServer,\n};\n\nexport const simulation = ['sendServer'];\n","import type { Flow, WalkerOS } from '@walkeros/core';\nimport { getEvent, isObject } from '@walkeros/core';\n\nexport const checkout: Flow.StepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000900,\n data: { id: 'ORD-300', total: 249.99, currency: 'EUR' },\n nested: [\n {\n entity: 'product',\n data: {\n id: 'SKU-A1',\n name: 'Everyday Ruck Snack',\n price: '129.99',\n quantity: 2,\n },\n },\n ],\n user: { id: 'user-123', device: 'device-456' },\n source: { type: 'server', id: 'https://shop.example.com', previous_id: '' },\n }),\n mapping: {\n name: 'checkout',\n data: {\n map: {\n custom_data: {\n map: {\n value: 'data.total',\n currency: { key: 'data.currency', value: 'EUR' },\n order_id: 'data.id',\n num_items: {\n fn: (event: unknown) =>\n (event as WalkerOS.Event).nested.filter(\n (item) => item.entity === 'product',\n ).length,\n },\n contents: {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n id: 'data.id',\n item_name: 'data.name',\n item_price: 'data.price',\n quantity: { key: 'data.quantity', value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n },\n },\n out: {\n data: [\n {\n event_name: 'checkout',\n event_time: 1700000900,\n event_id: '1700000900-gr0up-1',\n event_source_url: 'https://shop.example.com',\n action_source: 'web',\n user_data: {\n external_id: ['user-123'],\n },\n custom_data: {\n value: 249.99,\n currency: 'EUR',\n order_id: 'ORD-300',\n num_items: 1,\n contents: [\n {\n id: 'SKU-A1',\n item_name: 'Everyday Ruck Snack',\n item_price: '129.99',\n quantity: 2,\n },\n ],\n },\n },\n ],\n },\n};\n\nexport const addToCart: Flow.StepExample = {\n in: getEvent('product add', {\n timestamp: 1700000901,\n data: { id: 'SKU-B2', name: 'Cool Cap', price: '42.00', quantity: 1 },\n user: { id: 'user-456' },\n source: {\n type: 'server',\n id: 'https://shop.example.com/products',\n previous_id: '',\n },\n }),\n mapping: {\n name: 'add_to_cart',\n data: {\n map: {\n custom_data: {\n map: {\n value: 'data.price',\n currency: { value: 'EUR' },\n contents: {\n set: [\n {\n map: {\n id: 'data.id',\n item_name: 'data.name',\n item_price: 'data.price',\n quantity: { key: 'data.quantity', value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n },\n },\n out: {\n data: [\n {\n event_name: 'add_to_cart',\n event_time: 1700000901,\n event_id: '1700000901-gr0up-1',\n event_source_url: 'https://shop.example.com/products',\n action_source: 'web',\n user_data: {\n external_id: ['user-456'],\n },\n custom_data: {\n value: '42.00',\n currency: 'EUR',\n contents: [\n {\n id: 'SKU-B2',\n item_name: 'Cool Cap',\n item_price: '42.00',\n quantity: 1,\n },\n ],\n },\n },\n ],\n },\n};\n\nexport const pageVisit: Flow.StepExample = {\n in: getEvent('page view', {\n timestamp: 1700000902,\n user: { id: 'user-789' },\n source: {\n type: 'server',\n id: 'https://www.example.com/docs/',\n previous_id: '',\n },\n }),\n mapping: {\n name: 'page_visit',\n },\n out: {\n data: [\n {\n event_name: 'page_visit',\n event_time: 1700000902,\n event_id: '1700000902-gr0up-1',\n event_source_url: 'https://www.example.com/docs/',\n action_source: 'web',\n user_data: {\n external_id: ['user-789'],\n },\n },\n ],\n },\n};\n\nexport const search: Flow.StepExample = {\n in: getEvent('entity action', {\n timestamp: 1700000903,\n name: 'site search',\n data: { query: 'walkerOS destinations' },\n user: { id: 'user-101' },\n source: {\n type: 'server',\n id: 'https://www.example.com/search',\n previous_id: '',\n },\n }),\n mapping: {\n name: 'search',\n data: {\n map: {\n custom_data: {\n map: {\n search_string: 'data.query',\n },\n },\n },\n },\n },\n out: {\n data: [\n {\n event_name: 'search',\n event_time: 1700000903,\n event_id: '1700000903-gr0up-1',\n event_source_url: 'https://www.example.com/search',\n action_source: 'web',\n user_data: {\n external_id: ['user-101'],\n },\n custom_data: {\n search_string: 'walkerOS destinations',\n },\n },\n ],\n },\n};\n\nexport const signup: Flow.StepExample = {\n in: getEvent('entity action', {\n timestamp: 1700000904,\n name: 'user signup',\n data: { method: 'email' },\n user: { id: 'new-user-1', email: 'new@example.com' },\n source: {\n type: 'server',\n id: 'https://www.example.com/register',\n previous_id: '',\n },\n }),\n mapping: {\n name: 'signup',\n data: {\n map: {\n user_data: {\n map: {\n em: { set: ['user.email'] },\n external_id: { set: ['user.id'] },\n },\n },\n },\n },\n },\n out: {\n data: [\n {\n event_name: 'signup',\n event_time: 1700000904,\n event_id: '1700000904-gr0up-1',\n event_source_url: 'https://www.example.com/register',\n action_source: 'web',\n user_data: {\n em: ['new@example.com'],\n external_id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AAC,SAAS,EAAE;AAAA,UAClC;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,KAAK;AAAA,IACH,MAAM;AAAA,MACJ;AAAA,QACE,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,UAAU;AAAA,QACV,kBAAkB;AAAA,QAClB,eAAe;AAAA,QACf,WAAW;AAAA,UACT,IAAI,CAAC,iBAAiB;AAAA,UACtB,aAAa,CAAC,YAAY;AAAA,QAC5B;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":["import_dev","import_dev","import_dev"]}
|
package/dist/dev.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty,t=(t,a)=>{for(var r in a)e(t,r,{get:a[r],enumerable:!0})},a={};t(a,{ActionSourceSchema:()=>s,EventNameSchema:()=>o,MappingSchema:()=>p,SettingsSchema:()=>c,mapping:()=>m,settings:()=>u});import{zodToSchema as r}from"@walkeros/core/dev";import{z as i}from"@walkeros/core/dev";import{z as n}from"@walkeros/core/dev";var s=n.enum(["app_android","app_ios","web","offline"]),o=n.union([n.enum(["add_payment_info","add_to_cart","add_to_wishlist","app_install","app_open","checkout","contact","custom","customize_product","find_location","initiate_checkout","lead","page_visit","schedule","search","signup","start_trial","submit_application","subscribe","view_category","view_content","watch_video"]),n.string()]),c=i.object({accessToken:i.string().min(1).describe("Pinterest conversion access token for Bearer authentication (like pina_ABC123...)"),adAccountId:i.string().regex(/^[0-9]+$/,"Ad account ID must contain only digits").describe("Pinterest ad account ID from Ads Manager (like 123456789)"),action_source:s.describe("Source of the event (web, app_android, app_ios, offline) (like web)").optional(),doNotHash:i.array(i.string()).describe("Array of user_data fields that should not be hashed (like ['external_id'])").optional(),test:i.boolean().describe("Enable test mode by appending ?test=true to the API URL (like true)").optional(),url:i.string().url().describe("Custom URL for Pinterest Conversions API endpoint (like https://api.pinterest.com/v5/)").optional(),user_data:i.record(i.string(),i.string()).describe("Mapping configuration for user data fields (like { em: 'user.email', ph: 'user.phone' })").optional(),partner_name:i.string().describe("Third-party partner name for attribution (like ss-walkeros)").optional()});import{z as d}from"@walkeros/core/dev";var p=d.object({}),u=r(c),m=r(p),_={};t(_,{env:()=>l,step:()=>g});var l={};t(l,{push:()=>v,simulation:()=>h});var v={sendServer:async function(e,t,a){return{ok:!0,data:{num_events_received:1,num_events_processed:1,events:[{status:"processed"}]}}}},h=["sendServer"],g={};t(g,{addToCart:()=>b,checkout:()=>k,pageVisit:()=>f,search:()=>x,signup:()=>S});import{getEvent as w,isObject as y}from"@walkeros/core";var k={in:w("order complete",{timestamp:1700000900,data:{id:"ORD-300",total:249.99,currency:"EUR"},nested:[{entity:"product",data:{id:"SKU-A1",name:"Everyday Ruck Snack",price:"129.99",quantity:2}}],user:{id:"user-123",device:"device-456"},source:{type:"server",id:"https://shop.example.com",previous_id:""}}),mapping:{name:"checkout",data:{map:{custom_data:{map:{value:"data.total",currency:{key:"data.currency",value:"EUR"},order_id:"data.id",num_items:{fn:e=>e.nested.filter(e=>"product"===e.entity).length},contents:{loop:["nested",{condition:e=>y(e)&&"product"===e.entity,map:{id:"data.id",item_name:"data.name",item_price:"data.price",quantity:{key:"data.quantity",value:1}}}]}}}}}},out:{data:[{event_name:"checkout",event_time:1700000900,event_id:"1700000900-gr0up-1",event_source_url:"https://shop.example.com",action_source:"web",user_data:{external_id:["user-123"]},custom_data:{value:249.99,currency:"EUR",order_id:"ORD-300",num_items:1,contents:[{id:"SKU-A1",item_name:"Everyday Ruck Snack",item_price:"129.99",quantity:2}]}}]}},b={in:w("product add",{timestamp:1700000901,data:{id:"SKU-B2",name:"Cool Cap",price:"42.00",quantity:1},user:{id:"user-456"},source:{type:"server",id:"https://shop.example.com/products",previous_id:""}}),mapping:{name:"add_to_cart",data:{map:{custom_data:{map:{value:"data.price",currency:{value:"EUR"},contents:{set:[{map:{id:"data.id",item_name:"data.name",item_price:"data.price",quantity:{key:"data.quantity",value:1}}}]}}}}}},out:{data:[{event_name:"add_to_cart",event_time:1700000901,event_id:"1700000901-gr0up-1",event_source_url:"https://shop.example.com/products",action_source:"web",user_data:{external_id:["user-456"]},custom_data:{value:"42.00",currency:"EUR",contents:[{id:"SKU-B2",item_name:"Cool Cap",item_price:"42.00",quantity:1}]}}]}},f={in:w("page view",{timestamp:1700000902,user:{id:"user-789"},source:{type:"server",id:"https://www.example.com/docs/",previous_id:""}}),mapping:{name:"page_visit"},out:{data:[{event_name:"page_visit",event_time:1700000902,event_id:"1700000902-gr0up-1",event_source_url:"https://www.example.com/docs/",action_source:"web",user_data:{external_id:["user-789"]}}]}},x={in:w("entity action",{timestamp:1700000903,name:"site search",data:{query:"walkerOS destinations"},user:{id:"user-101"},source:{type:"server",id:"https://www.example.com/search",previous_id:""}}),mapping:{name:"search",data:{map:{custom_data:{map:{search_string:"data.query"}}}}},out:{data:[{event_name:"search",event_time:1700000903,event_id:"1700000903-gr0up-1",event_source_url:"https://www.example.com/search",action_source:"web",user_data:{external_id:["user-101"]},custom_data:{search_string:"walkerOS destinations"}}]}},S={in:w("entity action",{timestamp:1700000904,name:"user signup",data:{method:"email"},user:{id:"new-user-1",email:"new@example.com"},source:{type:"server",id:"https://www.example.com/register",previous_id:""}}),mapping:{name:"signup",data:{map:{user_data:{map:{em:{set:["user.email"]},external_id:{set:["user.id"]}}}}}},out:{data:[{event_name:"signup",event_time:1700000904,event_id:"1700000904-gr0up-1",event_source_url:"https://www.example.com/register",action_source:"web",user_data:{em:["new@example.com"],external_id:["new-user-1"]}}]}};export{_ as examples,a 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/primitives.ts","../src/schemas/mapping.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { MappingSchema } from './mapping';\n\nexport * from './primitives';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { MappingSchema, type Mapping } from './mapping';\n\n// JSON Schema\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\nimport { ActionSourceSchema } from './primitives';\n\nexport const SettingsSchema = z.object({\n accessToken: z\n .string()\n .min(1)\n .describe(\n 'Pinterest conversion access token for Bearer authentication (like pina_ABC123...)',\n ),\n adAccountId: z\n .string()\n .regex(/^[0-9]+$/, 'Ad account ID must contain only digits')\n .describe('Pinterest ad account ID from Ads Manager (like 123456789)'),\n action_source: ActionSourceSchema.describe(\n 'Source of the event (web, app_android, app_ios, offline) (like web)',\n ).optional(),\n doNotHash: z\n .array(z.string())\n .describe(\n \"Array of user_data fields that should not be hashed (like ['external_id'])\",\n )\n .optional(),\n test: z\n .boolean()\n .describe(\n 'Enable test mode by appending ?test=true to the API URL (like true)',\n )\n .optional(),\n url: z\n .string()\n .url()\n .describe(\n 'Custom URL for Pinterest Conversions API endpoint (like https://api.pinterest.com/v5/)',\n )\n .optional(),\n user_data: z\n .record(z.string(), z.string())\n .describe(\n \"Mapping configuration for user data fields (like { em: 'user.email', ph: 'user.phone' })\",\n )\n .optional(),\n partner_name: z\n .string()\n .describe('Third-party partner name for attribution (like ss-walkeros)')\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * Action Source Enum\n * Where the conversion event took place\n * https://developers.pinterest.com/docs/conversions/conversions/\n */\nexport const ActionSourceSchema = z.enum([\n 'app_android',\n 'app_ios',\n 'web',\n 'offline',\n]);\n\n/**\n * Event Name\n * Standard Pinterest CAPI event names or custom event identifiers\n */\nexport const EventNameSchema = z.union([\n z.enum([\n 'add_payment_info',\n 'add_to_cart',\n 'add_to_wishlist',\n 'app_install',\n 'app_open',\n 'checkout',\n 'contact',\n 'custom',\n 'customize_product',\n 'find_location',\n 'initiate_checkout',\n 'lead',\n 'page_visit',\n 'schedule',\n 'search',\n 'signup',\n 'start_trial',\n 'submit_application',\n 'subscribe',\n 'view_category',\n 'view_content',\n 'watch_video',\n ]),\n z.string(), // Allow custom event names\n]);\n","import { z } from '@walkeros/core/dev';\n\n/**\n * Pinterest Conversions API Mapping Schema\n * Pinterest CAPI has no event-level mapping configuration\n */\nexport const MappingSchema = z.object({});\n\n/**\n * Type inference from MappingSchema\n */\nexport type Mapping = z.infer<typeof MappingSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { SendDataValue, SendResponse } from '@walkeros/core';\nimport type { SendServerOptions } from '@walkeros/server-core';\nimport type { Env } from '../types';\n\n/**\n * Example environment configurations for Pinterest Conversions API destination\n *\n * These environments provide standardized mock structures for testing\n * and development without requiring actual HTTP requests.\n */\n\n/**\n * Mock sendServer function that simulates successful HTTP responses\n */\nasync function mockSendServer(\n url: string,\n data?: SendDataValue,\n options?: SendServerOptions,\n): Promise<SendResponse> {\n // Simulate successful Pinterest API response\n return {\n ok: true,\n data: {\n num_events_received: 1,\n num_events_processed: 1,\n events: [{ status: 'processed' }],\n },\n };\n}\n\n/**\n * Standard mock environment for push operations\n *\n * Use this for testing Pinterest Conversions API events without making\n * actual HTTP requests to Pinterest's servers.\n */\nexport const push: Env = {\n sendServer: mockSendServer,\n};\n\nexport const simulation = ['sendServer'];\n","import type { Flow, WalkerOS } from '@walkeros/core';\nimport { getEvent, isObject } from '@walkeros/core';\n\nexport const checkout: Flow.StepExample = {\n in: getEvent('order complete', {\n timestamp: 1700000900,\n data: { id: 'ORD-300', total: 249.99, currency: 'EUR' },\n nested: [\n {\n entity: 'product',\n data: {\n id: 'SKU-A1',\n name: 'Everyday Ruck Snack',\n price: '129.99',\n quantity: 2,\n },\n },\n ],\n user: { id: 'user-123', device: 'device-456' },\n source: { type: 'server', id: 'https://shop.example.com', previous_id: '' },\n }),\n mapping: {\n name: 'checkout',\n data: {\n map: {\n custom_data: {\n map: {\n value: 'data.total',\n currency: { key: 'data.currency', value: 'EUR' },\n order_id: 'data.id',\n num_items: {\n fn: (event: unknown) =>\n (event as WalkerOS.Event).nested.filter(\n (item) => item.entity === 'product',\n ).length,\n },\n contents: {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) =>\n isObject(entity) && entity.entity === 'product',\n map: {\n id: 'data.id',\n item_name: 'data.name',\n item_price: 'data.price',\n quantity: { key: 'data.quantity', value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n },\n },\n out: {\n data: [\n {\n event_name: 'checkout',\n event_time: 1700000900,\n event_id: '1700000900-gr0up-1',\n event_source_url: 'https://shop.example.com',\n action_source: 'web',\n user_data: {\n external_id: ['user-123'],\n },\n custom_data: {\n value: 249.99,\n currency: 'EUR',\n order_id: 'ORD-300',\n num_items: 1,\n contents: [\n {\n id: 'SKU-A1',\n item_name: 'Everyday Ruck Snack',\n item_price: '129.99',\n quantity: 2,\n },\n ],\n },\n },\n ],\n },\n};\n\nexport const addToCart: Flow.StepExample = {\n in: getEvent('product add', {\n timestamp: 1700000901,\n data: { id: 'SKU-B2', name: 'Cool Cap', price: '42.00', quantity: 1 },\n user: { id: 'user-456' },\n source: {\n type: 'server',\n id: 'https://shop.example.com/products',\n previous_id: '',\n },\n }),\n mapping: {\n name: 'add_to_cart',\n data: {\n map: {\n custom_data: {\n map: {\n value: 'data.price',\n currency: { value: 'EUR' },\n contents: {\n set: [\n {\n map: {\n id: 'data.id',\n item_name: 'data.name',\n item_price: 'data.price',\n quantity: { key: 'data.quantity', value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n },\n },\n out: {\n data: [\n {\n event_name: 'add_to_cart',\n event_time: 1700000901,\n event_id: '1700000901-gr0up-1',\n event_source_url: 'https://shop.example.com/products',\n action_source: 'web',\n user_data: {\n external_id: ['user-456'],\n },\n custom_data: {\n value: '42.00',\n currency: 'EUR',\n contents: [\n {\n id: 'SKU-B2',\n item_name: 'Cool Cap',\n item_price: '42.00',\n quantity: 1,\n },\n ],\n },\n },\n ],\n },\n};\n\nexport const pageVisit: Flow.StepExample = {\n in: getEvent('page view', {\n timestamp: 1700000902,\n user: { id: 'user-789' },\n source: {\n type: 'server',\n id: 'https://www.example.com/docs/',\n previous_id: '',\n },\n }),\n mapping: {\n name: 'page_visit',\n },\n out: {\n data: [\n {\n event_name: 'page_visit',\n event_time: 1700000902,\n event_id: '1700000902-gr0up-1',\n event_source_url: 'https://www.example.com/docs/',\n action_source: 'web',\n user_data: {\n external_id: ['user-789'],\n },\n },\n ],\n },\n};\n\nexport const search: Flow.StepExample = {\n in: getEvent('entity action', {\n timestamp: 1700000903,\n name: 'site search',\n data: { query: 'walkerOS destinations' },\n user: { id: 'user-101' },\n source: {\n type: 'server',\n id: 'https://www.example.com/search',\n previous_id: '',\n },\n }),\n mapping: {\n name: 'search',\n data: {\n map: {\n custom_data: {\n map: {\n search_string: 'data.query',\n },\n },\n },\n },\n },\n out: {\n data: [\n {\n event_name: 'search',\n event_time: 1700000903,\n event_id: '1700000903-gr0up-1',\n event_source_url: 'https://www.example.com/search',\n action_source: 'web',\n user_data: {\n external_id: ['user-101'],\n },\n custom_data: {\n search_string: 'walkerOS destinations',\n },\n },\n ],\n },\n};\n\nexport const signup: Flow.StepExample = {\n in: getEvent('entity action', {\n timestamp: 1700000904,\n name: 'user signup',\n data: { method: 'email' },\n user: { id: 'new-user-1', email: 'new@example.com' },\n source: {\n type: 'server',\n id: 'https://www.example.com/register',\n previous_id: '',\n },\n }),\n mapping: {\n name: 'signup',\n data: {\n map: {\n user_data: {\n map: {\n em: { set: ['user.email'] },\n external_id: { set: ['user.id'] },\n },\n },\n },\n },\n },\n out: {\n data: [\n {\n event_name: 'signup',\n event_time: 1700000904,\n event_id: '1700000904-gr0up-1',\n event_source_url: 'https://www.example.com/register',\n action_source: 'web',\n user_data: {\n em: ['new@example.com'],\n external_id: ['new-user-1'],\n },\n },\n ],\n },\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AA,QACE,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,UAAU;AAAA,QACV,kBAAkB;AAAA,QAClB,eAAe;AAAA,QACf,WAAW;AAAA,UACT,IAAI,CAAC,iBAAiB;AAAA,UACtB,aAAa,CAAC,YAAY;AAAA,QAC5B;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":["z","z","z"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 Pinterest Conversions API events without making
|
|
12
|
+
* actual HTTP requests to Pinterest'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 checkout: Flow.StepExample;
|
|
24
|
+
declare const addToCart: Flow.StepExample;
|
|
25
|
+
declare const pageVisit: Flow.StepExample;
|
|
26
|
+
declare const search: Flow.StepExample;
|
|
27
|
+
declare const signup: Flow.StepExample;
|
|
28
|
+
|
|
29
|
+
declare const step_addToCart: typeof addToCart;
|
|
30
|
+
declare const step_checkout: typeof checkout;
|
|
31
|
+
declare const step_pageVisit: typeof pageVisit;
|
|
32
|
+
declare const step_search: typeof search;
|
|
33
|
+
declare const step_signup: typeof signup;
|
|
34
|
+
declare namespace step {
|
|
35
|
+
export { step_addToCart as addToCart, step_checkout as checkout, step_pageVisit as pageVisit, step_search as search, step_signup as signup };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { env, step };
|
|
@@ -0,0 +1,38 @@
|
|
|
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 Pinterest Conversions API events without making
|
|
12
|
+
* actual HTTP requests to Pinterest'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 checkout: Flow.StepExample;
|
|
24
|
+
declare const addToCart: Flow.StepExample;
|
|
25
|
+
declare const pageVisit: Flow.StepExample;
|
|
26
|
+
declare const search: Flow.StepExample;
|
|
27
|
+
declare const signup: Flow.StepExample;
|
|
28
|
+
|
|
29
|
+
declare const step_addToCart: typeof addToCart;
|
|
30
|
+
declare const step_checkout: typeof checkout;
|
|
31
|
+
declare const step_pageVisit: typeof pageVisit;
|
|
32
|
+
declare const step_search: typeof search;
|
|
33
|
+
declare const step_signup: typeof signup;
|
|
34
|
+
declare namespace step {
|
|
35
|
+
export { step_addToCart as addToCart, step_checkout as checkout, step_pageVisit as pageVisit, step_search as search, step_signup as signup };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { env, step };
|