@walkeros/web-destination-d8a 4.1.0
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 +124 -0
- package/dist/dev.d.mts +115 -0
- package/dist/dev.d.ts +115 -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 +47 -0
- package/dist/examples/index.d.ts +47 -0
- package/dist/examples/index.js +273 -0
- package/dist/examples/index.mjs +251 -0
- package/dist/index.browser.js +1 -0
- package/dist/index.d.mts +63 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.es5.js +1 -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 +633 -0
- package/package.json +77 -0
package/README.md
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# @walkeros/web-destination-d8a
|
|
2
|
+
|
|
3
|
+
d8a web destination for walkerOS. It sends walkerOS events to the d8a web
|
|
4
|
+
tracker using the GA4 gtag-style `d8a()` API.
|
|
5
|
+
|
|
6
|
+
[Source Code](https://github.com/elbwalker/walkerOS/tree/main/packages/web/destinations/d8a)
|
|
7
|
+
•
|
|
8
|
+
[NPM Package](https://www.npmjs.com/package/@walkeros/web-destination-d8a)
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @walkeros/web-destination-d8a
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { startFlow } from '@walkeros/collector';
|
|
20
|
+
import { destinationD8a } from '@walkeros/web-destination-d8a';
|
|
21
|
+
|
|
22
|
+
await startFlow({
|
|
23
|
+
destinations: {
|
|
24
|
+
d8a: {
|
|
25
|
+
code: destinationD8a,
|
|
26
|
+
config: {
|
|
27
|
+
settings: {
|
|
28
|
+
property_id: '80e1d6d0-560d-419f-ac2a-fe9281e93386',
|
|
29
|
+
server_container_url:
|
|
30
|
+
'https://global.t.d8a.tech/80e1d6d0-560d-419f-ac2a-fe9281e93386/d/c',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Configuration
|
|
39
|
+
|
|
40
|
+
| Name | Type | Required | Description |
|
|
41
|
+
| ---------------------- | ------------------- | -------- | ------------------------------------------- |
|
|
42
|
+
| `property_id` | `string` | Yes | d8a property ID |
|
|
43
|
+
| `server_container_url` | `string` | Yes | d8a collector URL for the property |
|
|
44
|
+
| `send_page_view` | `boolean` | No | Set `false` to disable automatic page views |
|
|
45
|
+
| `debug_mode` | `boolean` | No | Enable d8a debug mode |
|
|
46
|
+
| `dataLayerName` | `string` | No | Queue name, defaults to `d8aLayer` |
|
|
47
|
+
| `globalName` | `string` | No | Global function name, defaults to `d8a` |
|
|
48
|
+
| `snakeCase` | `boolean` | No | Convert walkerOS event names to snake_case |
|
|
49
|
+
| `como` | `boolean \| object` | No | Consent mode mapping, defaults to `true` |
|
|
50
|
+
|
|
51
|
+
The destination follows d8a behavior for page views: automatic page views are
|
|
52
|
+
preserved by default and disabled only when `send_page_view: false` is
|
|
53
|
+
configured.
|
|
54
|
+
|
|
55
|
+
## Event Mapping
|
|
56
|
+
|
|
57
|
+
By default, walkerOS event names are converted to snake_case and sent with the
|
|
58
|
+
configured property ID as `send_to`.
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
mapping: {
|
|
62
|
+
order: {
|
|
63
|
+
complete: {
|
|
64
|
+
name: 'purchase',
|
|
65
|
+
data: {
|
|
66
|
+
map: {
|
|
67
|
+
transaction_id: 'data.id',
|
|
68
|
+
value: 'data.total',
|
|
69
|
+
currency: { key: 'data.currency', value: 'EUR' },
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
This produces:
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
d8a('event', 'purchase', {
|
|
81
|
+
transaction_id: '0rd3r1d',
|
|
82
|
+
value: 555,
|
|
83
|
+
currency: 'EUR',
|
|
84
|
+
send_to: '80e1d6d0-560d-419f-ac2a-fe9281e93386',
|
|
85
|
+
});
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Consent Mode
|
|
89
|
+
|
|
90
|
+
The destination supports d8a's gtag-compatible consent mode. By default, the
|
|
91
|
+
mapping is:
|
|
92
|
+
|
|
93
|
+
| walkerOS consent key | d8a consent fields |
|
|
94
|
+
| -------------------- | -------------------------------------------------- |
|
|
95
|
+
| `marketing` | `ad_storage`, `ad_user_data`, `ad_personalization` |
|
|
96
|
+
| `functional` | `analytics_storage` |
|
|
97
|
+
|
|
98
|
+
Disable consent mode with:
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
settings: {
|
|
102
|
+
como: false,
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Or provide a custom mapping:
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
settings: {
|
|
110
|
+
como: {
|
|
111
|
+
analytics: 'analytics_storage',
|
|
112
|
+
marketing: ['ad_storage', 'ad_personalization'],
|
|
113
|
+
},
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Related
|
|
118
|
+
|
|
119
|
+
- [d8a web tracker docs](https://docs.d8a.tech/articles/sources/web-tracker/)
|
|
120
|
+
- [Destination interface](../../../core/src/types/destination.ts)
|
|
121
|
+
|
|
122
|
+
## License
|
|
123
|
+
|
|
124
|
+
MIT
|
package/dist/dev.d.mts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
2
|
+
import { z } from '@walkeros/core/dev';
|
|
3
|
+
import { DestinationWeb } from '@walkeros/web-core';
|
|
4
|
+
import { D8aFn, InstallD8aOptions, InstallD8aResult } from '@d8a-tech/wt';
|
|
5
|
+
import { Flow } from '@walkeros/core';
|
|
6
|
+
|
|
7
|
+
declare const MappingSchema: z.ZodObject<{}, z.core.$strip>;
|
|
8
|
+
type Mapping = z.infer<typeof MappingSchema>;
|
|
9
|
+
|
|
10
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
11
|
+
property_id: z.ZodString;
|
|
12
|
+
server_container_url: z.ZodString;
|
|
13
|
+
como: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>]>>;
|
|
14
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
15
|
+
dataLayerName: z.ZodOptional<z.ZodString>;
|
|
16
|
+
globalName: z.ZodOptional<z.ZodString>;
|
|
17
|
+
send_page_view: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
snakeCase: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
debug_mode: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
cookie_domain: z.ZodOptional<z.ZodString>;
|
|
21
|
+
cookie_path: z.ZodOptional<z.ZodString>;
|
|
22
|
+
cookie_expires: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
cookie_flags: z.ZodOptional<z.ZodString>;
|
|
24
|
+
cookie_prefix: z.ZodOptional<z.ZodString>;
|
|
25
|
+
cookie_update: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
session_timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
session_engagement_time_sec: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
flush_interval_ms: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
max_batch_size: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
31
|
+
client_id: z.ZodOptional<z.ZodString>;
|
|
32
|
+
campaign_id: z.ZodOptional<z.ZodString>;
|
|
33
|
+
campaign_source: z.ZodOptional<z.ZodString>;
|
|
34
|
+
campaign_medium: z.ZodOptional<z.ZodString>;
|
|
35
|
+
campaign_name: z.ZodOptional<z.ZodString>;
|
|
36
|
+
campaign_term: z.ZodOptional<z.ZodString>;
|
|
37
|
+
campaign_content: z.ZodOptional<z.ZodString>;
|
|
38
|
+
page_location: z.ZodOptional<z.ZodString>;
|
|
39
|
+
page_title: z.ZodOptional<z.ZodString>;
|
|
40
|
+
page_referrer: z.ZodOptional<z.ZodString>;
|
|
41
|
+
content_group: z.ZodOptional<z.ZodString>;
|
|
42
|
+
language: z.ZodOptional<z.ZodString>;
|
|
43
|
+
screen_resolution: z.ZodOptional<z.ZodString>;
|
|
44
|
+
ignore_referrer: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
site_search_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
site_search_query_params: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
47
|
+
outbound_clicks_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
outbound_exclude_domains: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
49
|
+
file_downloads_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
file_download_extensions: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
type Settings = z.infer<typeof SettingsSchema>;
|
|
53
|
+
|
|
54
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
55
|
+
declare const mapping: _walkeros_core_dev.JSONSchema;
|
|
56
|
+
|
|
57
|
+
type index$1_Mapping = Mapping;
|
|
58
|
+
declare const index$1_MappingSchema: typeof MappingSchema;
|
|
59
|
+
type index$1_Settings = Settings;
|
|
60
|
+
declare const index$1_SettingsSchema: typeof SettingsSchema;
|
|
61
|
+
declare const index$1_mapping: typeof mapping;
|
|
62
|
+
declare const index$1_settings: typeof settings;
|
|
63
|
+
declare namespace index$1 {
|
|
64
|
+
export { 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 };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
declare global {
|
|
68
|
+
interface Window {
|
|
69
|
+
d8a?: D8aFn;
|
|
70
|
+
d8aLayer?: unknown[];
|
|
71
|
+
d8aDataLayerName?: string;
|
|
72
|
+
d8aGlobalName?: string;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
interface Env extends DestinationWeb.Env {
|
|
76
|
+
installD8a?: (opts?: InstallD8aOptions) => InstallD8aResult;
|
|
77
|
+
window: DestinationWeb.Env['window'] & {
|
|
78
|
+
d8a?: D8aFn;
|
|
79
|
+
d8aLayer?: unknown[];
|
|
80
|
+
[key: string]: unknown;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
declare const init$1: Env;
|
|
85
|
+
declare const push: Env;
|
|
86
|
+
declare const simulation: string[];
|
|
87
|
+
|
|
88
|
+
declare const env_push: typeof push;
|
|
89
|
+
declare const env_simulation: typeof simulation;
|
|
90
|
+
declare namespace env {
|
|
91
|
+
export { init$1 as init, env_push as push, env_simulation as simulation };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
declare const init: Flow.StepExample;
|
|
95
|
+
declare const pageView: Flow.StepExample;
|
|
96
|
+
declare const addToCart: Flow.StepExample;
|
|
97
|
+
declare const purchase: Flow.StepExample;
|
|
98
|
+
declare const consentMode: Flow.StepExample;
|
|
99
|
+
|
|
100
|
+
declare const step_addToCart: typeof addToCart;
|
|
101
|
+
declare const step_consentMode: typeof consentMode;
|
|
102
|
+
declare const step_init: typeof init;
|
|
103
|
+
declare const step_pageView: typeof pageView;
|
|
104
|
+
declare const step_purchase: typeof purchase;
|
|
105
|
+
declare namespace step {
|
|
106
|
+
export { step_addToCart as addToCart, step_consentMode as consentMode, step_init as init, step_pageView as pageView, step_purchase as purchase };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
declare const index_env: typeof env;
|
|
110
|
+
declare const index_step: typeof step;
|
|
111
|
+
declare namespace index {
|
|
112
|
+
export { index_env as env, index_step as step };
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export { index as examples, index$1 as schemas };
|
package/dist/dev.d.ts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
2
|
+
import { z } from '@walkeros/core/dev';
|
|
3
|
+
import { DestinationWeb } from '@walkeros/web-core';
|
|
4
|
+
import { D8aFn, InstallD8aOptions, InstallD8aResult } from '@d8a-tech/wt';
|
|
5
|
+
import { Flow } from '@walkeros/core';
|
|
6
|
+
|
|
7
|
+
declare const MappingSchema: z.ZodObject<{}, z.core.$strip>;
|
|
8
|
+
type Mapping = z.infer<typeof MappingSchema>;
|
|
9
|
+
|
|
10
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
11
|
+
property_id: z.ZodString;
|
|
12
|
+
server_container_url: z.ZodString;
|
|
13
|
+
como: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>]>>;
|
|
14
|
+
data: z.ZodOptional<z.ZodUnknown>;
|
|
15
|
+
dataLayerName: z.ZodOptional<z.ZodString>;
|
|
16
|
+
globalName: z.ZodOptional<z.ZodString>;
|
|
17
|
+
send_page_view: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
snakeCase: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
debug_mode: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
cookie_domain: z.ZodOptional<z.ZodString>;
|
|
21
|
+
cookie_path: z.ZodOptional<z.ZodString>;
|
|
22
|
+
cookie_expires: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
cookie_flags: z.ZodOptional<z.ZodString>;
|
|
24
|
+
cookie_prefix: z.ZodOptional<z.ZodString>;
|
|
25
|
+
cookie_update: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
session_timeout_ms: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
session_engagement_time_sec: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
flush_interval_ms: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
max_batch_size: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
31
|
+
client_id: z.ZodOptional<z.ZodString>;
|
|
32
|
+
campaign_id: z.ZodOptional<z.ZodString>;
|
|
33
|
+
campaign_source: z.ZodOptional<z.ZodString>;
|
|
34
|
+
campaign_medium: z.ZodOptional<z.ZodString>;
|
|
35
|
+
campaign_name: z.ZodOptional<z.ZodString>;
|
|
36
|
+
campaign_term: z.ZodOptional<z.ZodString>;
|
|
37
|
+
campaign_content: z.ZodOptional<z.ZodString>;
|
|
38
|
+
page_location: z.ZodOptional<z.ZodString>;
|
|
39
|
+
page_title: z.ZodOptional<z.ZodString>;
|
|
40
|
+
page_referrer: z.ZodOptional<z.ZodString>;
|
|
41
|
+
content_group: z.ZodOptional<z.ZodString>;
|
|
42
|
+
language: z.ZodOptional<z.ZodString>;
|
|
43
|
+
screen_resolution: z.ZodOptional<z.ZodString>;
|
|
44
|
+
ignore_referrer: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
site_search_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
site_search_query_params: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
47
|
+
outbound_clicks_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
outbound_exclude_domains: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
49
|
+
file_downloads_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
file_download_extensions: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
type Settings = z.infer<typeof SettingsSchema>;
|
|
53
|
+
|
|
54
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
55
|
+
declare const mapping: _walkeros_core_dev.JSONSchema;
|
|
56
|
+
|
|
57
|
+
type index$1_Mapping = Mapping;
|
|
58
|
+
declare const index$1_MappingSchema: typeof MappingSchema;
|
|
59
|
+
type index$1_Settings = Settings;
|
|
60
|
+
declare const index$1_SettingsSchema: typeof SettingsSchema;
|
|
61
|
+
declare const index$1_mapping: typeof mapping;
|
|
62
|
+
declare const index$1_settings: typeof settings;
|
|
63
|
+
declare namespace index$1 {
|
|
64
|
+
export { 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 };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
declare global {
|
|
68
|
+
interface Window {
|
|
69
|
+
d8a?: D8aFn;
|
|
70
|
+
d8aLayer?: unknown[];
|
|
71
|
+
d8aDataLayerName?: string;
|
|
72
|
+
d8aGlobalName?: string;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
interface Env extends DestinationWeb.Env {
|
|
76
|
+
installD8a?: (opts?: InstallD8aOptions) => InstallD8aResult;
|
|
77
|
+
window: DestinationWeb.Env['window'] & {
|
|
78
|
+
d8a?: D8aFn;
|
|
79
|
+
d8aLayer?: unknown[];
|
|
80
|
+
[key: string]: unknown;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
declare const init$1: Env;
|
|
85
|
+
declare const push: Env;
|
|
86
|
+
declare const simulation: string[];
|
|
87
|
+
|
|
88
|
+
declare const env_push: typeof push;
|
|
89
|
+
declare const env_simulation: typeof simulation;
|
|
90
|
+
declare namespace env {
|
|
91
|
+
export { init$1 as init, env_push as push, env_simulation as simulation };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
declare const init: Flow.StepExample;
|
|
95
|
+
declare const pageView: Flow.StepExample;
|
|
96
|
+
declare const addToCart: Flow.StepExample;
|
|
97
|
+
declare const purchase: Flow.StepExample;
|
|
98
|
+
declare const consentMode: Flow.StepExample;
|
|
99
|
+
|
|
100
|
+
declare const step_addToCart: typeof addToCart;
|
|
101
|
+
declare const step_consentMode: typeof consentMode;
|
|
102
|
+
declare const step_init: typeof init;
|
|
103
|
+
declare const step_pageView: typeof pageView;
|
|
104
|
+
declare const step_purchase: typeof purchase;
|
|
105
|
+
declare namespace step {
|
|
106
|
+
export { step_addToCart as addToCart, step_consentMode as consentMode, step_init as init, step_pageView as pageView, step_purchase as purchase };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
declare const index_env: typeof env;
|
|
110
|
+
declare const index_step: typeof step;
|
|
111
|
+
declare namespace index {
|
|
112
|
+
export { index_env as env, index_step as step };
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export { index as examples, index$1 as schemas };
|
package/dist/dev.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e,a=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,o=(e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},r={};o(r,{examples:()=>b,schemas:()=>d}),module.exports=(e=r,((e,o,r,d)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let s of n(o))i.call(e,s)||s===r||a(e,s,{get:()=>o[s],enumerable:!(d=t(o,s))||d.enumerable});return e})(a({},"__esModule",{value:!0}),e));var d={};o(d,{MappingSchema:()=>c,SettingsSchema:()=>m,mapping:()=>_,settings:()=>g});var s=require("@walkeros/core/dev"),c=require("@walkeros/core/dev").z.object({}),l=require("@walkeros/core/dev"),p=l.z.union([l.z.boolean(),l.z.record(l.z.string(),l.z.union([l.z.string(),l.z.array(l.z.string())]))]),u=l.z.union([l.z.string(),l.z.array(l.z.string())]),m=l.z.object({property_id:l.z.string().describe("d8a property ID"),server_container_url:l.z.string().url().describe("d8a collector URL for the property"),como:p.describe("Consent mode configuration: false (disabled), true (use defaults), or custom mapping").optional(),data:l.z.unknown().describe("Custom data mapping configuration").optional(),dataLayerName:l.z.string().describe("Name of the d8a command queue (default: d8aLayer)").optional(),globalName:l.z.string().describe("Name of the global d8a function (default: d8a)").optional(),send_page_view:l.z.boolean().describe("Enable automatic pageview tracking").optional(),snakeCase:l.z.boolean().describe("Convert event names to snake_case (like true)").optional(),debug_mode:l.z.boolean().describe("Enable debug mode").optional(),cookie_domain:l.z.string().describe("Cookie domain strategy: auto, none, or a specific domain").optional(),cookie_path:l.z.string().describe("Cookie path").optional(),cookie_expires:l.z.number().describe("Cookie lifetime in seconds").optional(),cookie_flags:l.z.string().describe("Raw cookie flags").optional(),cookie_prefix:l.z.string().describe("Cookie name prefix").optional(),cookie_update:l.z.boolean().describe("Refresh cookie expirations on activity").optional(),session_timeout_ms:l.z.number().describe("Session timeout window in milliseconds").optional(),session_engagement_time_sec:l.z.number().describe("Minimum engaged time in seconds").optional(),flush_interval_ms:l.z.number().describe("Flush interval in milliseconds").optional(),max_batch_size:l.z.number().describe("Maximum batch size").optional(),user_id:l.z.string().describe("GA4-style user ID").optional(),client_id:l.z.string().describe("Client ID override").optional(),campaign_id:l.z.string().optional(),campaign_source:l.z.string().optional(),campaign_medium:l.z.string().optional(),campaign_name:l.z.string().optional(),campaign_term:l.z.string().optional(),campaign_content:l.z.string().optional(),page_location:l.z.string().optional(),page_title:l.z.string().optional(),page_referrer:l.z.string().optional(),content_group:l.z.string().optional(),language:l.z.string().optional(),screen_resolution:l.z.string().optional(),ignore_referrer:l.z.boolean().optional(),site_search_enabled:l.z.boolean().optional(),site_search_query_params:u.optional(),outbound_clicks_enabled:l.z.boolean().optional(),outbound_exclude_domains:u.optional(),file_downloads_enabled:l.z.boolean().optional(),file_download_extensions:u.optional()}),g=(0,s.zodToSchema)(m),_=(0,s.zodToSchema)(c),b={};o(b,{env:()=>v,step:()=>k});var v={};function z(){const e=()=>{};return e.js=()=>{},e.config=()=>{},e.event=()=>{},e.set=()=>{},e.consent=()=>{},e}o(v,{init:()=>f,push:()=>h,simulation:()=>w});var y=e=>{const a=null==e?void 0:e.windowRef,t=(null==e?void 0:e.globalName)||"d8a",n=(null==e?void 0:e.dataLayerName)||"d8aLayer";return a&&(a[n]=a[n]||[],a[t]=a[t]||z()),{dataLayerName:n,globalName:t,consumer:{start:()=>{},stop:()=>{},getState:()=>({}),setOnEvent:()=>{},setOnConfig:()=>{}},dispatcher:{enqueueEvent:()=>{},flush:async()=>({sent:0}),flushNow:async()=>({sent:0}),attachLifecycleFlush:()=>{}}}},f={installD8a:y,window:{}},h={installD8a:y,window:{d8a:z(),d8aLayer:[]}},w=["call:window.d8a"],k={};o(k,{addToCart:()=>j,consentMode:()=>O,init:()=>E,pageView:()=>R,purchase:()=>N});var x=require("@walkeros/core"),q="80e1d6d0-560d-419f-ac2a-fe9281e93386",C="https://global.t.d8a.tech/80e1d6d0-560d-419f-ac2a-fe9281e93386/d/c",E={title:"Initialization",description:"The destination installs d8a and configures a property with its server container URL.",in:{settings:{property_id:q,server_container_url:C}},out:[["d8a","js",new Date(17e11)],["d8a","config",q,{server_container_url:C}]]},R={title:"Page view",description:"A page view event is forwarded as a d8a page_view event.",in:(0,x.getEvent)("page view",{timestamp:1700000300}),mapping:void 0,out:[["d8a","event","page_view",{send_to:q}]]},j={title:"Add to cart",description:"A product add event is mapped to the d8a add_to_cart event with item details and value.",in:(0,x.getEvent)("product add",{timestamp:1700000301}),mapping:{name:"add_to_cart",include:["data"],data:{map:{currency:{value:"EUR",key:"data.currency"},value:"data.price",items:{loop:["this",{map:{item_id:"data.id",item_variant:"data.color",quantity:{value:1,key:"data.quantity"}}}]}}}},out:[["d8a","event","add_to_cart",{currency:"EUR",value:420,items:[{item_id:"ers",item_variant:"black",quantity:1}],data_id:"ers",data_name:"Everyday Ruck Snack",data_color:"black",data_size:"l",data_price:420,send_to:q}]]},N={title:"Purchase",description:"An order complete event is mapped to the d8a purchase event with transaction details and nested product items.",in:(0,x.getEvent)("order complete",{timestamp:1700000302}),mapping:{name:"purchase",include:["data","context"],data:{map:{transaction_id:"data.id",value:"data.total",tax:"data.taxes",shipping:"data.shipping",currency:{key:"data.currency",value:"EUR"},items:{loop:["nested",{condition:e=>{const a=e;return(0,x.isObject)(e)&&"product"===a.entity},map:{item_id:"data.id",item_name:"data.name",quantity:{key:"data.quantity",value:1}}}]}}}},out:[["d8a","event","purchase",{transaction_id:"0rd3r1d",value:555,tax:73.76,shipping:5.22,currency:"EUR",items:[{item_id:"ers",item_name:"Everyday Ruck Snack",quantity:1},{item_id:"cc",item_name:"Cool Cap",quantity:1}],data_id:"0rd3r1d",data_currency:"EUR",data_shipping:5.22,data_taxes:73.76,data_total:555,context_shopping:"complete",send_to:q}]]},O={title:"Consent mode",description:"A walker consent command updates d8a using gtag consent mode parameters.",command:"consent",in:{marketing:!0,functional:!0},out:[["d8a","consent","default",{ad_storage:"denied",ad_user_data:"denied",ad_personalization:"denied",analytics_storage:"denied"}],["d8a","consent","update",{ad_storage:"granted",ad_user_data:"granted",ad_personalization:"granted",analytics_storage:"granted"}]]};//# 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/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 { MappingSchema } from './mapping';\nimport { SettingsSchema } from './settings';\n\nexport { MappingSchema, type Mapping } from './mapping';\nexport { SettingsSchema, type Settings } from './settings';\n\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const ConsentModeSchema = z.union([\n z.boolean(),\n z.record(z.string(), z.union([z.string(), z.array(z.string())])),\n]);\n\nconst csvOrArray = z.union([z.string(), z.array(z.string())]);\n\nexport const SettingsSchema = z.object({\n property_id: z.string().describe('d8a property ID'),\n server_container_url: z\n .string()\n .url()\n .describe('d8a collector URL for the property'),\n como: ConsentModeSchema.describe(\n 'Consent mode configuration: false (disabled), true (use defaults), or custom mapping',\n ).optional(),\n data: z.unknown().describe('Custom data mapping configuration').optional(),\n dataLayerName: z\n .string()\n .describe('Name of the d8a command queue (default: d8aLayer)')\n .optional(),\n globalName: z\n .string()\n .describe('Name of the global d8a function (default: d8a)')\n .optional(),\n send_page_view: z\n .boolean()\n .describe('Enable automatic pageview tracking')\n .optional(),\n snakeCase: z\n .boolean()\n .describe('Convert event names to snake_case (like true)')\n .optional(),\n debug_mode: z.boolean().describe('Enable debug mode').optional(),\n cookie_domain: z\n .string()\n .describe('Cookie domain strategy: auto, none, or a specific domain')\n .optional(),\n cookie_path: z.string().describe('Cookie path').optional(),\n cookie_expires: z.number().describe('Cookie lifetime in seconds').optional(),\n cookie_flags: z.string().describe('Raw cookie flags').optional(),\n cookie_prefix: z.string().describe('Cookie name prefix').optional(),\n cookie_update: z\n .boolean()\n .describe('Refresh cookie expirations on activity')\n .optional(),\n session_timeout_ms: z\n .number()\n .describe('Session timeout window in milliseconds')\n .optional(),\n session_engagement_time_sec: z\n .number()\n .describe('Minimum engaged time in seconds')\n .optional(),\n flush_interval_ms: z\n .number()\n .describe('Flush interval in milliseconds')\n .optional(),\n max_batch_size: z.number().describe('Maximum batch size').optional(),\n user_id: z.string().describe('GA4-style user ID').optional(),\n client_id: z.string().describe('Client ID override').optional(),\n campaign_id: z.string().optional(),\n campaign_source: z.string().optional(),\n campaign_medium: z.string().optional(),\n campaign_name: z.string().optional(),\n campaign_term: z.string().optional(),\n campaign_content: z.string().optional(),\n page_location: z.string().optional(),\n page_title: z.string().optional(),\n page_referrer: z.string().optional(),\n content_group: z.string().optional(),\n language: z.string().optional(),\n screen_resolution: z.string().optional(),\n ignore_referrer: z.boolean().optional(),\n site_search_enabled: z.boolean().optional(),\n site_search_query_params: csvOrArray.optional(),\n outbound_clicks_enabled: z.boolean().optional(),\n outbound_exclude_domains: csvOrArray.optional(),\n file_downloads_enabled: z.boolean().optional(),\n file_download_extensions: csvOrArray.optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { D8aFn, InstallD8aOptions, InstallD8aResult } from '@d8a-tech/wt';\nimport type { Env } from '../types';\n\nfunction createD8a(): D8aFn {\n const d8a = (() => {}) as D8aFn;\n d8a.js = () => {};\n d8a.config = () => {};\n d8a.event = () => {};\n d8a.set = () => {};\n d8a.consent = () => {};\n return d8a;\n}\n\nconst installD8a = (opts?: InstallD8aOptions): InstallD8aResult => {\n const windowRef = opts?.windowRef as Env['window'] | undefined;\n const globalName = opts?.globalName || 'd8a';\n const dataLayerName = opts?.dataLayerName || 'd8aLayer';\n\n if (windowRef) {\n windowRef[dataLayerName] = windowRef[dataLayerName] || [];\n windowRef[globalName] = windowRef[globalName] || createD8a();\n }\n\n return {\n dataLayerName,\n globalName,\n consumer: {\n start: () => {},\n stop: () => {},\n getState: () => ({}),\n setOnEvent: () => {},\n setOnConfig: () => {},\n },\n dispatcher: {\n enqueueEvent: () => {},\n flush: async () => ({ sent: 0 }),\n flushNow: async () => ({ sent: 0 }),\n attachLifecycleFlush: () => {},\n },\n };\n};\n\nexport const init: Env = {\n installD8a,\n window: {},\n};\n\nexport const push: Env = {\n installD8a,\n window: {\n d8a: createD8a(),\n d8aLayer: [],\n },\n};\n\nexport const simulation = ['call:window.d8a'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent, isObject } from '@walkeros/core';\n\nconst INIT_DATE_MS = 1700000000000;\nconst INIT_DATE = new Date(INIT_DATE_MS);\nconst PROPERTY_ID = '80e1d6d0-560d-419f-ac2a-fe9281e93386';\nconst SERVER_CONTAINER_URL =\n 'https://global.t.d8a.tech/80e1d6d0-560d-419f-ac2a-fe9281e93386/d/c';\n\nexport const init: Flow.StepExample = {\n title: 'Initialization',\n description:\n 'The destination installs d8a and configures a property with its server container URL.',\n in: {\n settings: {\n property_id: PROPERTY_ID,\n server_container_url: SERVER_CONTAINER_URL,\n },\n },\n out: [\n ['d8a', 'js', INIT_DATE],\n [\n 'd8a',\n 'config',\n PROPERTY_ID,\n { server_container_url: SERVER_CONTAINER_URL },\n ],\n ],\n};\n\nexport const pageView: Flow.StepExample = {\n title: 'Page view',\n description: 'A page view event is forwarded as a d8a page_view event.',\n in: getEvent('page view', { timestamp: 1700000300 }),\n mapping: undefined,\n out: [['d8a', 'event', 'page_view', { send_to: PROPERTY_ID }]],\n};\n\nexport const addToCart: Flow.StepExample = {\n title: 'Add to cart',\n description:\n 'A product add event is mapped to the d8a add_to_cart event with item details and value.',\n in: getEvent('product add', { timestamp: 1700000301 }),\n mapping: {\n name: 'add_to_cart',\n include: ['data'],\n data: {\n map: {\n currency: { value: 'EUR', key: 'data.currency' },\n value: 'data.price',\n items: {\n loop: [\n 'this',\n {\n map: {\n item_id: 'data.id',\n item_variant: 'data.color',\n quantity: { value: 1, key: 'data.quantity' },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'd8a',\n 'event',\n 'add_to_cart',\n {\n currency: 'EUR',\n value: 420,\n items: [{ item_id: 'ers', item_variant: 'black', quantity: 1 }],\n data_id: 'ers',\n data_name: 'Everyday Ruck Snack',\n data_color: 'black',\n data_size: 'l',\n data_price: 420,\n send_to: PROPERTY_ID,\n },\n ],\n ],\n};\n\nexport const purchase: Flow.StepExample = {\n title: 'Purchase',\n description:\n 'An order complete event is mapped to the d8a purchase event with transaction details and nested product items.',\n in: getEvent('order complete', { timestamp: 1700000302 }),\n mapping: {\n name: 'purchase',\n include: ['data', 'context'],\n data: {\n map: {\n transaction_id: 'data.id',\n value: 'data.total',\n tax: 'data.taxes',\n shipping: 'data.shipping',\n currency: { key: 'data.currency', value: 'EUR' },\n items: {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) => {\n const candidate = entity as { entity?: unknown };\n return isObject(entity) && candidate.entity === 'product';\n },\n map: {\n item_id: 'data.id',\n item_name: 'data.name',\n quantity: { key: 'data.quantity', value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'd8a',\n 'event',\n 'purchase',\n {\n transaction_id: '0rd3r1d',\n value: 555,\n tax: 73.76,\n shipping: 5.22,\n currency: 'EUR',\n items: [\n { item_id: 'ers', item_name: 'Everyday Ruck Snack', quantity: 1 },\n { item_id: 'cc', item_name: 'Cool Cap', quantity: 1 },\n ],\n data_id: '0rd3r1d',\n data_currency: 'EUR',\n data_shipping: 5.22,\n data_taxes: 73.76,\n data_total: 555,\n context_shopping: 'complete',\n send_to: PROPERTY_ID,\n },\n ],\n ],\n};\n\nexport const consentMode: Flow.StepExample = {\n title: 'Consent mode',\n description:\n 'A walker consent command updates d8a using gtag consent mode parameters.',\n command: 'consent',\n in: { marketing: true, functional: true },\n out: [\n [\n 'd8a',\n 'consent',\n 'default',\n {\n ad_storage: 'denied',\n ad_user_data: 'denied',\n ad_personalization: 'denied',\n analytics_storage: 'denied',\n },\n ],\n [\n 'd8a',\n 'consent',\n 'update',\n {\n ad_storage: 'granted',\n ad_user_data: 'granted',\n ad_personalization: 'granted',\n analytics_storage: 'granted',\n },\n ],\n ],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AA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V,UAAU;AAAA,QACV,OAAO;AAAA,UACL,EAAE,SAAS,OAAO,WAAW,uBAAuB,UAAU,EAAE;AAAA,UAChE,EAAE,SAAS,MAAM,WAAW,YAAY,UAAU,EAAE;AAAA,QACtD;AAAA,QACA,SAAS;AAAA,QACT,eAAe;AAAA,QACf,eAAe;AAAA,QACf,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,kBAAkB;AAAA,QAClB,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF;AAEO,IAAM,cAAgC;AAAA,EAC3C,OAAO;AAAA,EACP,aACE;AAAA,EACF,SAAS;AAAA,EACT,IAAI,EAAE,WAAW,MAAM,YAAY,KAAK;AAAA,EACxC,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,QACE,YAAY;AAAA,QACZ,cAAc;AAAA,QACd,oBAAoB;AAAA,QACpB,mBAAmB;AAAA,MACrB;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,QACE,YAAY;AAAA,QACZ,cAAc;AAAA,QACd,oBAAoB;AAAA,QACpB,mBAAmB;AAAA,MACrB;AAAA,IACF;AAAA,EACF;AACF;","names":["import_dev","import_dev","init"]}
|
package/dist/dev.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty,a=(a,t)=>{for(var i in t)e(a,i,{get:t[i],enumerable:!0})},t={};a(t,{MappingSchema:()=>o,SettingsSchema:()=>c,mapping:()=>p,settings:()=>l});import{zodToSchema as i}from"@walkeros/core/dev";import{z as n}from"@walkeros/core/dev";var o=n.object({});import{z as r}from"@walkeros/core/dev";var d=r.union([r.boolean(),r.record(r.string(),r.union([r.string(),r.array(r.string())]))]),s=r.union([r.string(),r.array(r.string())]),c=r.object({property_id:r.string().describe("d8a property ID"),server_container_url:r.string().url().describe("d8a collector URL for the property"),como:d.describe("Consent mode configuration: false (disabled), true (use defaults), or custom mapping").optional(),data:r.unknown().describe("Custom data mapping configuration").optional(),dataLayerName:r.string().describe("Name of the d8a command queue (default: d8aLayer)").optional(),globalName:r.string().describe("Name of the global d8a function (default: d8a)").optional(),send_page_view:r.boolean().describe("Enable automatic pageview tracking").optional(),snakeCase:r.boolean().describe("Convert event names to snake_case (like true)").optional(),debug_mode:r.boolean().describe("Enable debug mode").optional(),cookie_domain:r.string().describe("Cookie domain strategy: auto, none, or a specific domain").optional(),cookie_path:r.string().describe("Cookie path").optional(),cookie_expires:r.number().describe("Cookie lifetime in seconds").optional(),cookie_flags:r.string().describe("Raw cookie flags").optional(),cookie_prefix:r.string().describe("Cookie name prefix").optional(),cookie_update:r.boolean().describe("Refresh cookie expirations on activity").optional(),session_timeout_ms:r.number().describe("Session timeout window in milliseconds").optional(),session_engagement_time_sec:r.number().describe("Minimum engaged time in seconds").optional(),flush_interval_ms:r.number().describe("Flush interval in milliseconds").optional(),max_batch_size:r.number().describe("Maximum batch size").optional(),user_id:r.string().describe("GA4-style user ID").optional(),client_id:r.string().describe("Client ID override").optional(),campaign_id:r.string().optional(),campaign_source:r.string().optional(),campaign_medium:r.string().optional(),campaign_name:r.string().optional(),campaign_term:r.string().optional(),campaign_content:r.string().optional(),page_location:r.string().optional(),page_title:r.string().optional(),page_referrer:r.string().optional(),content_group:r.string().optional(),language:r.string().optional(),screen_resolution:r.string().optional(),ignore_referrer:r.boolean().optional(),site_search_enabled:r.boolean().optional(),site_search_query_params:s.optional(),outbound_clicks_enabled:r.boolean().optional(),outbound_exclude_domains:s.optional(),file_downloads_enabled:r.boolean().optional(),file_download_extensions:s.optional()}),l=i(c),p=i(o),m={};a(m,{env:()=>u,step:()=>f});var u={};function g(){const e=()=>{};return e.js=()=>{},e.config=()=>{},e.event=()=>{},e.set=()=>{},e.consent=()=>{},e}a(u,{init:()=>b,push:()=>v,simulation:()=>y});var _=e=>{const a=null==e?void 0:e.windowRef,t=(null==e?void 0:e.globalName)||"d8a",i=(null==e?void 0:e.dataLayerName)||"d8aLayer";return a&&(a[i]=a[i]||[],a[t]=a[t]||g()),{dataLayerName:i,globalName:t,consumer:{start:()=>{},stop:()=>{},getState:()=>({}),setOnEvent:()=>{},setOnConfig:()=>{}},dispatcher:{enqueueEvent:()=>{},flush:async()=>({sent:0}),flushNow:async()=>({sent:0}),attachLifecycleFlush:()=>{}}}},b={installD8a:_,window:{}},v={installD8a:_,window:{d8a:g(),d8aLayer:[]}},y=["call:window.d8a"],f={};a(f,{addToCart:()=>E,consentMode:()=>L,init:()=>C,pageView:()=>R,purchase:()=>q});import{getEvent as h,isObject as k}from"@walkeros/core";var w="80e1d6d0-560d-419f-ac2a-fe9281e93386",x="https://global.t.d8a.tech/80e1d6d0-560d-419f-ac2a-fe9281e93386/d/c",C={title:"Initialization",description:"The destination installs d8a and configures a property with its server container URL.",in:{settings:{property_id:w,server_container_url:x}},out:[["d8a","js",new Date(17e11)],["d8a","config",w,{server_container_url:x}]]},R={title:"Page view",description:"A page view event is forwarded as a d8a page_view event.",in:h("page view",{timestamp:1700000300}),mapping:void 0,out:[["d8a","event","page_view",{send_to:w}]]},E={title:"Add to cart",description:"A product add event is mapped to the d8a add_to_cart event with item details and value.",in:h("product add",{timestamp:1700000301}),mapping:{name:"add_to_cart",include:["data"],data:{map:{currency:{value:"EUR",key:"data.currency"},value:"data.price",items:{loop:["this",{map:{item_id:"data.id",item_variant:"data.color",quantity:{value:1,key:"data.quantity"}}}]}}}},out:[["d8a","event","add_to_cart",{currency:"EUR",value:420,items:[{item_id:"ers",item_variant:"black",quantity:1}],data_id:"ers",data_name:"Everyday Ruck Snack",data_color:"black",data_size:"l",data_price:420,send_to:w}]]},q={title:"Purchase",description:"An order complete event is mapped to the d8a purchase event with transaction details and nested product items.",in:h("order complete",{timestamp:1700000302}),mapping:{name:"purchase",include:["data","context"],data:{map:{transaction_id:"data.id",value:"data.total",tax:"data.taxes",shipping:"data.shipping",currency:{key:"data.currency",value:"EUR"},items:{loop:["nested",{condition:e=>{const a=e;return k(e)&&"product"===a.entity},map:{item_id:"data.id",item_name:"data.name",quantity:{key:"data.quantity",value:1}}}]}}}},out:[["d8a","event","purchase",{transaction_id:"0rd3r1d",value:555,tax:73.76,shipping:5.22,currency:"EUR",items:[{item_id:"ers",item_name:"Everyday Ruck Snack",quantity:1},{item_id:"cc",item_name:"Cool Cap",quantity:1}],data_id:"0rd3r1d",data_currency:"EUR",data_shipping:5.22,data_taxes:73.76,data_total:555,context_shopping:"complete",send_to:w}]]},L={title:"Consent mode",description:"A walker consent command updates d8a using gtag consent mode parameters.",command:"consent",in:{marketing:!0,functional:!0},out:[["d8a","consent","default",{ad_storage:"denied",ad_user_data:"denied",ad_personalization:"denied",analytics_storage:"denied"}],["d8a","consent","update",{ad_storage:"granted",ad_user_data:"granted",ad_personalization:"granted",analytics_storage:"granted"}]]};export{m as examples,t 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/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 { MappingSchema } from './mapping';\nimport { SettingsSchema } from './settings';\n\nexport { MappingSchema, type Mapping } from './mapping';\nexport { SettingsSchema, type Settings } from './settings';\n\nexport const settings = zodToSchema(SettingsSchema);\nexport const mapping = zodToSchema(MappingSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const MappingSchema = z.object({});\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const ConsentModeSchema = z.union([\n z.boolean(),\n z.record(z.string(), z.union([z.string(), z.array(z.string())])),\n]);\n\nconst csvOrArray = z.union([z.string(), z.array(z.string())]);\n\nexport const SettingsSchema = z.object({\n property_id: z.string().describe('d8a property ID'),\n server_container_url: z\n .string()\n .url()\n .describe('d8a collector URL for the property'),\n como: ConsentModeSchema.describe(\n 'Consent mode configuration: false (disabled), true (use defaults), or custom mapping',\n ).optional(),\n data: z.unknown().describe('Custom data mapping configuration').optional(),\n dataLayerName: z\n .string()\n .describe('Name of the d8a command queue (default: d8aLayer)')\n .optional(),\n globalName: z\n .string()\n .describe('Name of the global d8a function (default: d8a)')\n .optional(),\n send_page_view: z\n .boolean()\n .describe('Enable automatic pageview tracking')\n .optional(),\n snakeCase: z\n .boolean()\n .describe('Convert event names to snake_case (like true)')\n .optional(),\n debug_mode: z.boolean().describe('Enable debug mode').optional(),\n cookie_domain: z\n .string()\n .describe('Cookie domain strategy: auto, none, or a specific domain')\n .optional(),\n cookie_path: z.string().describe('Cookie path').optional(),\n cookie_expires: z.number().describe('Cookie lifetime in seconds').optional(),\n cookie_flags: z.string().describe('Raw cookie flags').optional(),\n cookie_prefix: z.string().describe('Cookie name prefix').optional(),\n cookie_update: z\n .boolean()\n .describe('Refresh cookie expirations on activity')\n .optional(),\n session_timeout_ms: z\n .number()\n .describe('Session timeout window in milliseconds')\n .optional(),\n session_engagement_time_sec: z\n .number()\n .describe('Minimum engaged time in seconds')\n .optional(),\n flush_interval_ms: z\n .number()\n .describe('Flush interval in milliseconds')\n .optional(),\n max_batch_size: z.number().describe('Maximum batch size').optional(),\n user_id: z.string().describe('GA4-style user ID').optional(),\n client_id: z.string().describe('Client ID override').optional(),\n campaign_id: z.string().optional(),\n campaign_source: z.string().optional(),\n campaign_medium: z.string().optional(),\n campaign_name: z.string().optional(),\n campaign_term: z.string().optional(),\n campaign_content: z.string().optional(),\n page_location: z.string().optional(),\n page_title: z.string().optional(),\n page_referrer: z.string().optional(),\n content_group: z.string().optional(),\n language: z.string().optional(),\n screen_resolution: z.string().optional(),\n ignore_referrer: z.boolean().optional(),\n site_search_enabled: z.boolean().optional(),\n site_search_query_params: csvOrArray.optional(),\n outbound_clicks_enabled: z.boolean().optional(),\n outbound_exclude_domains: csvOrArray.optional(),\n file_downloads_enabled: z.boolean().optional(),\n file_download_extensions: csvOrArray.optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","export * as env from './env';\nexport * as step from './step';\n","import type { D8aFn, InstallD8aOptions, InstallD8aResult } from '@d8a-tech/wt';\nimport type { Env } from '../types';\n\nfunction createD8a(): D8aFn {\n const d8a = (() => {}) as D8aFn;\n d8a.js = () => {};\n d8a.config = () => {};\n d8a.event = () => {};\n d8a.set = () => {};\n d8a.consent = () => {};\n return d8a;\n}\n\nconst installD8a = (opts?: InstallD8aOptions): InstallD8aResult => {\n const windowRef = opts?.windowRef as Env['window'] | undefined;\n const globalName = opts?.globalName || 'd8a';\n const dataLayerName = opts?.dataLayerName || 'd8aLayer';\n\n if (windowRef) {\n windowRef[dataLayerName] = windowRef[dataLayerName] || [];\n windowRef[globalName] = windowRef[globalName] || createD8a();\n }\n\n return {\n dataLayerName,\n globalName,\n consumer: {\n start: () => {},\n stop: () => {},\n getState: () => ({}),\n setOnEvent: () => {},\n setOnConfig: () => {},\n },\n dispatcher: {\n enqueueEvent: () => {},\n flush: async () => ({ sent: 0 }),\n flushNow: async () => ({ sent: 0 }),\n attachLifecycleFlush: () => {},\n },\n };\n};\n\nexport const init: Env = {\n installD8a,\n window: {},\n};\n\nexport const push: Env = {\n installD8a,\n window: {\n d8a: createD8a(),\n d8aLayer: [],\n },\n};\n\nexport const simulation = ['call:window.d8a'];\n","import type { Flow } from '@walkeros/core';\nimport { getEvent, isObject } from '@walkeros/core';\n\nconst INIT_DATE_MS = 1700000000000;\nconst INIT_DATE = new Date(INIT_DATE_MS);\nconst PROPERTY_ID = '80e1d6d0-560d-419f-ac2a-fe9281e93386';\nconst SERVER_CONTAINER_URL =\n 'https://global.t.d8a.tech/80e1d6d0-560d-419f-ac2a-fe9281e93386/d/c';\n\nexport const init: Flow.StepExample = {\n title: 'Initialization',\n description:\n 'The destination installs d8a and configures a property with its server container URL.',\n in: {\n settings: {\n property_id: PROPERTY_ID,\n server_container_url: SERVER_CONTAINER_URL,\n },\n },\n out: [\n ['d8a', 'js', INIT_DATE],\n [\n 'd8a',\n 'config',\n PROPERTY_ID,\n { server_container_url: SERVER_CONTAINER_URL },\n ],\n ],\n};\n\nexport const pageView: Flow.StepExample = {\n title: 'Page view',\n description: 'A page view event is forwarded as a d8a page_view event.',\n in: getEvent('page view', { timestamp: 1700000300 }),\n mapping: undefined,\n out: [['d8a', 'event', 'page_view', { send_to: PROPERTY_ID }]],\n};\n\nexport const addToCart: Flow.StepExample = {\n title: 'Add to cart',\n description:\n 'A product add event is mapped to the d8a add_to_cart event with item details and value.',\n in: getEvent('product add', { timestamp: 1700000301 }),\n mapping: {\n name: 'add_to_cart',\n include: ['data'],\n data: {\n map: {\n currency: { value: 'EUR', key: 'data.currency' },\n value: 'data.price',\n items: {\n loop: [\n 'this',\n {\n map: {\n item_id: 'data.id',\n item_variant: 'data.color',\n quantity: { value: 1, key: 'data.quantity' },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'd8a',\n 'event',\n 'add_to_cart',\n {\n currency: 'EUR',\n value: 420,\n items: [{ item_id: 'ers', item_variant: 'black', quantity: 1 }],\n data_id: 'ers',\n data_name: 'Everyday Ruck Snack',\n data_color: 'black',\n data_size: 'l',\n data_price: 420,\n send_to: PROPERTY_ID,\n },\n ],\n ],\n};\n\nexport const purchase: Flow.StepExample = {\n title: 'Purchase',\n description:\n 'An order complete event is mapped to the d8a purchase event with transaction details and nested product items.',\n in: getEvent('order complete', { timestamp: 1700000302 }),\n mapping: {\n name: 'purchase',\n include: ['data', 'context'],\n data: {\n map: {\n transaction_id: 'data.id',\n value: 'data.total',\n tax: 'data.taxes',\n shipping: 'data.shipping',\n currency: { key: 'data.currency', value: 'EUR' },\n items: {\n loop: [\n 'nested',\n {\n condition: (entity: unknown) => {\n const candidate = entity as { entity?: unknown };\n return isObject(entity) && candidate.entity === 'product';\n },\n map: {\n item_id: 'data.id',\n item_name: 'data.name',\n quantity: { key: 'data.quantity', value: 1 },\n },\n },\n ],\n },\n },\n },\n },\n out: [\n [\n 'd8a',\n 'event',\n 'purchase',\n {\n transaction_id: '0rd3r1d',\n value: 555,\n tax: 73.76,\n shipping: 5.22,\n currency: 'EUR',\n items: [\n { item_id: 'ers', item_name: 'Everyday Ruck Snack', quantity: 1 },\n { item_id: 'cc', item_name: 'Cool Cap', quantity: 1 },\n ],\n data_id: '0rd3r1d',\n data_currency: 'EUR',\n data_shipping: 5.22,\n data_taxes: 73.76,\n data_total: 555,\n context_shopping: 'complete',\n send_to: PROPERTY_ID,\n },\n ],\n ],\n};\n\nexport const consentMode: Flow.StepExample = {\n title: 'Consent mode',\n description:\n 'A walker consent command updates d8a using gtag consent mode parameters.',\n command: 'consent',\n in: { marketing: true, functional: true },\n out: [\n [\n 'd8a',\n 'consent',\n 'default',\n {\n ad_storage: 'denied',\n ad_user_data: 'denied',\n ad_personalization: 'denied',\n analytics_storage: 'denied',\n },\n ],\n [\n 'd8a',\n 'consent',\n 'update',\n {\n ad_storage: 'granted',\n ad_user_data: 'granted',\n ad_personalization: 'granted',\n analytics_storage: 'granted',\n },\n ],\n ],\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,gBAAgB,EAAE,OAAO,CAAC,CAAC;;;ACFxC,SAAS,KAAAA,UAAS;AAEX,IAAM,oBAAoBA,GAAE,MAAM;AAAA,EACvCA,GAAE,QAAQ;AAAA,EACVA,GAAE,OAAOA,GAAE,OAAO,GAAGA,GAAE,MAAM,CAACA,GAAE,OAAO,GAAGA,GAAE,MAAMA,GAAE,OAAO,CAAC,CAAC,CAAC,CAAC;AACjE,CAAC;AAED,IAAM,aAAaA,GAAE,MAAM,CAACA,GAAE,OAAO,GAAGA,GAAE,MAAMA,GAAE,OAAO,CAAC,CAAC,CAAC;AAErD,IAAM,iBAAiBA,GAAE,OAAO;AAAA,EACrC,aAAaA,GAAE,OAAO,EAAE,SAAS,iBAAi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AAI,EAAE,WAAW,MAAM,YAAY,KAAK;AAAA,EACxC,KAAK;AAAA,IACH;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,QACE,YAAY;AAAA,QACZ,cAAc;AAAA,QACd,oBAAoB;AAAA,QACpB,mBAAmB;AAAA,MACrB;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,QACE,YAAY;AAAA,QACZ,cAAc;AAAA,QACd,oBAAoB;AAAA,QACpB,mBAAmB;AAAA,MACrB;AAAA,IACF;AAAA,EACF;AACF;","names":["z","init"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { DestinationWeb } from '@walkeros/web-core';
|
|
2
|
+
import { D8aFn, InstallD8aOptions, InstallD8aResult } from '@d8a-tech/wt';
|
|
3
|
+
import { Flow } from '@walkeros/core';
|
|
4
|
+
|
|
5
|
+
declare global {
|
|
6
|
+
interface Window {
|
|
7
|
+
d8a?: D8aFn;
|
|
8
|
+
d8aLayer?: unknown[];
|
|
9
|
+
d8aDataLayerName?: string;
|
|
10
|
+
d8aGlobalName?: string;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
interface Env extends DestinationWeb.Env {
|
|
14
|
+
installD8a?: (opts?: InstallD8aOptions) => InstallD8aResult;
|
|
15
|
+
window: DestinationWeb.Env['window'] & {
|
|
16
|
+
d8a?: D8aFn;
|
|
17
|
+
d8aLayer?: unknown[];
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare const init$1: Env;
|
|
23
|
+
declare const push: Env;
|
|
24
|
+
declare const simulation: string[];
|
|
25
|
+
|
|
26
|
+
declare const env_push: typeof push;
|
|
27
|
+
declare const env_simulation: typeof simulation;
|
|
28
|
+
declare namespace env {
|
|
29
|
+
export { init$1 as init, env_push as push, env_simulation as simulation };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare const init: Flow.StepExample;
|
|
33
|
+
declare const pageView: Flow.StepExample;
|
|
34
|
+
declare const addToCart: Flow.StepExample;
|
|
35
|
+
declare const purchase: Flow.StepExample;
|
|
36
|
+
declare const consentMode: Flow.StepExample;
|
|
37
|
+
|
|
38
|
+
declare const step_addToCart: typeof addToCart;
|
|
39
|
+
declare const step_consentMode: typeof consentMode;
|
|
40
|
+
declare const step_init: typeof init;
|
|
41
|
+
declare const step_pageView: typeof pageView;
|
|
42
|
+
declare const step_purchase: typeof purchase;
|
|
43
|
+
declare namespace step {
|
|
44
|
+
export { step_addToCart as addToCart, step_consentMode as consentMode, step_init as init, step_pageView as pageView, step_purchase as purchase };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { env, step };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { DestinationWeb } from '@walkeros/web-core';
|
|
2
|
+
import { D8aFn, InstallD8aOptions, InstallD8aResult } from '@d8a-tech/wt';
|
|
3
|
+
import { Flow } from '@walkeros/core';
|
|
4
|
+
|
|
5
|
+
declare global {
|
|
6
|
+
interface Window {
|
|
7
|
+
d8a?: D8aFn;
|
|
8
|
+
d8aLayer?: unknown[];
|
|
9
|
+
d8aDataLayerName?: string;
|
|
10
|
+
d8aGlobalName?: string;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
interface Env extends DestinationWeb.Env {
|
|
14
|
+
installD8a?: (opts?: InstallD8aOptions) => InstallD8aResult;
|
|
15
|
+
window: DestinationWeb.Env['window'] & {
|
|
16
|
+
d8a?: D8aFn;
|
|
17
|
+
d8aLayer?: unknown[];
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare const init$1: Env;
|
|
23
|
+
declare const push: Env;
|
|
24
|
+
declare const simulation: string[];
|
|
25
|
+
|
|
26
|
+
declare const env_push: typeof push;
|
|
27
|
+
declare const env_simulation: typeof simulation;
|
|
28
|
+
declare namespace env {
|
|
29
|
+
export { init$1 as init, env_push as push, env_simulation as simulation };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare const init: Flow.StepExample;
|
|
33
|
+
declare const pageView: Flow.StepExample;
|
|
34
|
+
declare const addToCart: Flow.StepExample;
|
|
35
|
+
declare const purchase: Flow.StepExample;
|
|
36
|
+
declare const consentMode: Flow.StepExample;
|
|
37
|
+
|
|
38
|
+
declare const step_addToCart: typeof addToCart;
|
|
39
|
+
declare const step_consentMode: typeof consentMode;
|
|
40
|
+
declare const step_init: typeof init;
|
|
41
|
+
declare const step_pageView: typeof pageView;
|
|
42
|
+
declare const step_purchase: typeof purchase;
|
|
43
|
+
declare namespace step {
|
|
44
|
+
export { step_addToCart as addToCart, step_consentMode as consentMode, step_init as init, step_pageView as pageView, step_purchase as purchase };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { env, step };
|