@walkeros/web-source-cmp-cookiebot 0.0.0-stage → 4.9.0-next-1793283841805
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/CHANGELOG.md +29 -0
- package/README.md +52 -2
- package/dist/dev.d.mts +184 -0
- package/dist/dev.d.ts +184 -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 +142 -0
- package/dist/examples/index.d.ts +142 -0
- package/dist/examples/index.js +246 -0
- package/dist/examples/index.mjs +214 -0
- package/dist/index.browser.js +1 -0
- package/dist/index.d.mts +163 -0
- package/dist/index.d.ts +163 -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 +407 -0
- package/package.json +76 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# @walkeros/web-source-cmp-cookiebot
|
|
2
|
+
|
|
3
|
+
## 4.9.0-next-1793283841805
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 29d2218: New Cookiebot consent source. It reads the visitor's choice from
|
|
8
|
+
`window.Cookiebot` and Cookiebot's accept and decline events, and maps
|
|
9
|
+
`preferences`, `statistics` and `marketing` to `functional`, `analytics` and
|
|
10
|
+
`marketing`. Strictly necessary cookies are reported as `necessary` and grant
|
|
11
|
+
no consent group. Implied consent is skipped unless `explicitOnly` is `false`,
|
|
12
|
+
so by default a visitor Cookiebot never asks sends no consent.
|
|
13
|
+
- Updated dependencies [5313635]
|
|
14
|
+
- Updated dependencies [5313635]
|
|
15
|
+
- Updated dependencies [34fd225]
|
|
16
|
+
- Updated dependencies [1306d8a]
|
|
17
|
+
- Updated dependencies [1306d8a]
|
|
18
|
+
- Updated dependencies [34fd225]
|
|
19
|
+
- Updated dependencies [5313635]
|
|
20
|
+
- Updated dependencies [1306d8a]
|
|
21
|
+
- Updated dependencies [5313635]
|
|
22
|
+
- Updated dependencies [5313635]
|
|
23
|
+
- Updated dependencies [5313635]
|
|
24
|
+
- Updated dependencies [5313635]
|
|
25
|
+
- Updated dependencies [34fd225]
|
|
26
|
+
- Updated dependencies [1306d8a]
|
|
27
|
+
- Updated dependencies [5313635]
|
|
28
|
+
- @walkeros/collector@4.9.0-next-1793283841805
|
|
29
|
+
- @walkeros/core@4.9.0-next-1793283841805
|
package/README.md
CHANGED
|
@@ -1,3 +1,53 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="left">
|
|
2
|
+
<a href="https://www.walkeros.io">
|
|
3
|
+
<img alt="walkerOS" title="walkerOS" src="https://www.walkeros.io/img/walkerOS_logo.svg" width="256px"/>
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
# @walkeros/web-source-cmp-cookiebot
|
|
8
|
+
|
|
9
|
+
Integrates Cookiebot consent management with walkerOS by mapping Cookiebot's
|
|
10
|
+
categories `preferences`, `statistics` and `marketing` to walkerOS consent
|
|
11
|
+
groups. Strictly necessary cookies are reported as `necessary`.
|
|
12
|
+
|
|
13
|
+
[Documentation](https://www.walkeros.io/docs/sources/web/cmps/cookiebot) •
|
|
14
|
+
[NPM Package](https://www.npmjs.com/package/@walkeros/web-source-cmp-cookiebot)
|
|
15
|
+
•
|
|
16
|
+
[Source Code](https://github.com/elbwalker/walkerOS/tree/main/packages/web/sources/cmps/cookiebot)
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @walkeros/web-source-cmp-cookiebot
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Quick start
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { startFlow } from '@walkeros/collector';
|
|
28
|
+
import { sourceCookiebot } from '@walkeros/web-source-cmp-cookiebot';
|
|
29
|
+
|
|
30
|
+
await startFlow({
|
|
31
|
+
sources: {
|
|
32
|
+
consent: {
|
|
33
|
+
code: sourceCookiebot,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Documentation
|
|
40
|
+
|
|
41
|
+
Full configuration, mapping, and examples live in the docs:
|
|
42
|
+
**https://www.walkeros.io/docs/sources/web/cmps/cookiebot**
|
|
43
|
+
|
|
44
|
+
## Contribute
|
|
45
|
+
|
|
46
|
+
Feel free to contribute by submitting an
|
|
47
|
+
[issue](https://github.com/elbwalker/walkerOS/issues), starting a
|
|
48
|
+
[discussion](https://github.com/elbwalker/walkerOS/discussions), or getting in
|
|
49
|
+
[contact](https://calendly.com/elb-alexander/30min).
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
MIT
|
package/dist/dev.d.mts
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { WalkerOS, Flow, Trigger, Hint } from '@walkeros/core';
|
|
2
|
+
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
3
|
+
import { z } from '@walkeros/core/dev';
|
|
4
|
+
|
|
5
|
+
declare module '@walkeros/core' {
|
|
6
|
+
interface SourceMap {
|
|
7
|
+
cookiebot: {
|
|
8
|
+
type: 'cookiebot';
|
|
9
|
+
platform?: 'web';
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Cookiebot consent object (`window.Cookiebot.consent`).
|
|
15
|
+
*
|
|
16
|
+
* The four categories are booleans Cookiebot always sets. `method` is
|
|
17
|
+
* `'explicit'` when the visitor actively decided, `'implied'` when Cookiebot
|
|
18
|
+
* consented on its own (outside a region that requires consent, an implied
|
|
19
|
+
* banner, or an old consent of unknown method) and `null` without consent.
|
|
20
|
+
*/
|
|
21
|
+
interface CookiebotConsent {
|
|
22
|
+
necessary?: boolean;
|
|
23
|
+
preferences?: boolean;
|
|
24
|
+
statistics?: boolean;
|
|
25
|
+
marketing?: boolean;
|
|
26
|
+
method?: string | null;
|
|
27
|
+
stamp?: string;
|
|
28
|
+
[category: string]: boolean | string | null | undefined;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The subset of the Cookiebot SDK (`window.Cookiebot`) the source reads.
|
|
32
|
+
*/
|
|
33
|
+
interface CookiebotAPI {
|
|
34
|
+
consent: CookiebotConsent;
|
|
35
|
+
/** The visitor accepted at least one category. */
|
|
36
|
+
consented?: boolean;
|
|
37
|
+
/** The visitor declined. */
|
|
38
|
+
declined?: boolean;
|
|
39
|
+
/** The visitor answered the banner, or Cookiebot consented for them. */
|
|
40
|
+
hasResponse?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Example `window.Cookiebot` states.
|
|
45
|
+
*
|
|
46
|
+
* Shapes follow what Cookiebot's uc.js sets: the four category booleans are
|
|
47
|
+
* always present, `method` is 'explicit', 'implied' or null, and `stamp`
|
|
48
|
+
* identifies the stored consent.
|
|
49
|
+
*/
|
|
50
|
+
/**
|
|
51
|
+
* Full consent - the visitor clicked "Allow all"
|
|
52
|
+
*/
|
|
53
|
+
declare const fullConsent: CookiebotAPI;
|
|
54
|
+
/**
|
|
55
|
+
* Partial consent - preferences and statistics allowed, marketing denied
|
|
56
|
+
*/
|
|
57
|
+
declare const partialConsent: CookiebotAPI;
|
|
58
|
+
/**
|
|
59
|
+
* Necessary only - the visitor clicked "Use necessary cookies only", or
|
|
60
|
+
* withdrew an earlier consent
|
|
61
|
+
*/
|
|
62
|
+
declare const necessaryOnly: CookiebotAPI;
|
|
63
|
+
/**
|
|
64
|
+
* Implied consent - Cookiebot consented on its own, for example for a visitor
|
|
65
|
+
* outside the regions where the site asks for consent
|
|
66
|
+
*/
|
|
67
|
+
declare const impliedConsent: CookiebotAPI;
|
|
68
|
+
/**
|
|
69
|
+
* No response - a first visit while the banner is still open
|
|
70
|
+
*/
|
|
71
|
+
declare const noResponse: CookiebotAPI;
|
|
72
|
+
/**
|
|
73
|
+
* Uppercase method - full consent with the method in a different casing
|
|
74
|
+
*/
|
|
75
|
+
declare const uppercaseMethod: CookiebotAPI;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Expected walkerOS consent states after mapping through the default
|
|
79
|
+
* categoryMap:
|
|
80
|
+
* - preferences -> functional
|
|
81
|
+
* - statistics -> analytics
|
|
82
|
+
* - marketing -> marketing
|
|
83
|
+
*
|
|
84
|
+
* `necessary` has no entry and keeps its own name. Denied groups carry an
|
|
85
|
+
* explicit false.
|
|
86
|
+
*/
|
|
87
|
+
/**
|
|
88
|
+
* Full consent mapped to walkerOS groups
|
|
89
|
+
*/
|
|
90
|
+
declare const fullConsentMapped: WalkerOS.Consent;
|
|
91
|
+
/**
|
|
92
|
+
* Partial consent - marketing denied
|
|
93
|
+
*/
|
|
94
|
+
declare const partialConsentMapped: WalkerOS.Consent;
|
|
95
|
+
/**
|
|
96
|
+
* Necessary only - functional, analytics and marketing denied
|
|
97
|
+
*/
|
|
98
|
+
declare const necessaryOnlyMapped: WalkerOS.Consent;
|
|
99
|
+
/**
|
|
100
|
+
* Partial consent with statistics mapped to a custom `statistics` group
|
|
101
|
+
*/
|
|
102
|
+
declare const partialConsentCustomMapped: WalkerOS.Consent;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Step examples for the Cookiebot source.
|
|
106
|
+
*
|
|
107
|
+
* `in` is the `window.Cookiebot` state. `trigger.options.dispatch` picks the
|
|
108
|
+
* path the source reacts to:
|
|
109
|
+
* - 'init' (default): Cookiebot already holds the state when the source
|
|
110
|
+
* starts, so the static read at init emits it.
|
|
111
|
+
* - 'event': Cookiebot reports the state after the source started, firing
|
|
112
|
+
* CookiebotOnAccept (consented) or CookiebotOnDecline (declined).
|
|
113
|
+
*/
|
|
114
|
+
declare const allowAll: Flow.StepExample;
|
|
115
|
+
declare const necessaryOnlyChoice: Flow.StepExample;
|
|
116
|
+
declare const returningVisitor: Flow.StepExample;
|
|
117
|
+
declare const firstVisit: Flow.StepExample;
|
|
118
|
+
declare const impliedSkipped: Flow.StepExample;
|
|
119
|
+
declare const impliedAllowed: Flow.StepExample;
|
|
120
|
+
declare const categoryMapOverride: Flow.StepExample;
|
|
121
|
+
|
|
122
|
+
declare const step_allowAll: typeof allowAll;
|
|
123
|
+
declare const step_categoryMapOverride: typeof categoryMapOverride;
|
|
124
|
+
declare const step_firstVisit: typeof firstVisit;
|
|
125
|
+
declare const step_impliedAllowed: typeof impliedAllowed;
|
|
126
|
+
declare const step_impliedSkipped: typeof impliedSkipped;
|
|
127
|
+
declare const step_necessaryOnlyChoice: typeof necessaryOnlyChoice;
|
|
128
|
+
declare const step_returningVisitor: typeof returningVisitor;
|
|
129
|
+
declare namespace step {
|
|
130
|
+
export { step_allowAll as allowAll, step_categoryMapOverride as categoryMapOverride, step_firstVisit as firstVisit, step_impliedAllowed as impliedAllowed, step_impliedSkipped as impliedSkipped, step_necessaryOnlyChoice as necessaryOnlyChoice, step_returningVisitor as returningVisitor };
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* `content` is the `window.Cookiebot` state. The `dispatch` option picks the
|
|
135
|
+
* path the source reacts to:
|
|
136
|
+
* - 'init' (default): Cookiebot holds the state before the source starts,
|
|
137
|
+
* so the static read at init publishes it.
|
|
138
|
+
* - 'event': Cookiebot reports the state after the source started and fires
|
|
139
|
+
* CookiebotOnAccept (consented) or CookiebotOnDecline (otherwise).
|
|
140
|
+
* Once the flow runs, every further trigger fires the event.
|
|
141
|
+
*/
|
|
142
|
+
declare const createTrigger: Trigger.CreateFn<unknown, void>;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Cookiebot source examples for testing and documentation.
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
declare const index$1_createTrigger: typeof createTrigger;
|
|
149
|
+
declare const index$1_fullConsent: typeof fullConsent;
|
|
150
|
+
declare const index$1_fullConsentMapped: typeof fullConsentMapped;
|
|
151
|
+
declare const index$1_impliedConsent: typeof impliedConsent;
|
|
152
|
+
declare const index$1_necessaryOnly: typeof necessaryOnly;
|
|
153
|
+
declare const index$1_necessaryOnlyMapped: typeof necessaryOnlyMapped;
|
|
154
|
+
declare const index$1_noResponse: typeof noResponse;
|
|
155
|
+
declare const index$1_partialConsent: typeof partialConsent;
|
|
156
|
+
declare const index$1_partialConsentCustomMapped: typeof partialConsentCustomMapped;
|
|
157
|
+
declare const index$1_partialConsentMapped: typeof partialConsentMapped;
|
|
158
|
+
declare const index$1_step: typeof step;
|
|
159
|
+
declare const index$1_uppercaseMethod: typeof uppercaseMethod;
|
|
160
|
+
declare namespace index$1 {
|
|
161
|
+
export { index$1_createTrigger as createTrigger, index$1_fullConsent as fullConsent, index$1_fullConsentMapped as fullConsentMapped, index$1_impliedConsent as impliedConsent, index$1_necessaryOnly as necessaryOnly, index$1_necessaryOnlyMapped as necessaryOnlyMapped, index$1_noResponse as noResponse, index$1_partialConsent as partialConsent, index$1_partialConsentCustomMapped as partialConsentCustomMapped, index$1_partialConsentMapped as partialConsentMapped, index$1_step as step, index$1_uppercaseMethod as uppercaseMethod };
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Cookiebot source settings schema
|
|
166
|
+
*/
|
|
167
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
168
|
+
categoryMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
169
|
+
explicitOnly: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
+
}, z.core.$strip>;
|
|
171
|
+
type Settings = z.infer<typeof SettingsSchema>;
|
|
172
|
+
|
|
173
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
174
|
+
|
|
175
|
+
type index_Settings = Settings;
|
|
176
|
+
declare const index_SettingsSchema: typeof SettingsSchema;
|
|
177
|
+
declare const index_settings: typeof settings;
|
|
178
|
+
declare namespace index {
|
|
179
|
+
export { type index_Settings as Settings, index_SettingsSchema as SettingsSchema, index_settings as settings };
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
declare const hints: Hint.Hints;
|
|
183
|
+
|
|
184
|
+
export { index$1 as examples, hints, index as schemas };
|
package/dist/dev.d.ts
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { WalkerOS, Flow, Trigger, Hint } from '@walkeros/core';
|
|
2
|
+
import * as _walkeros_core_dev from '@walkeros/core/dev';
|
|
3
|
+
import { z } from '@walkeros/core/dev';
|
|
4
|
+
|
|
5
|
+
declare module '@walkeros/core' {
|
|
6
|
+
interface SourceMap {
|
|
7
|
+
cookiebot: {
|
|
8
|
+
type: 'cookiebot';
|
|
9
|
+
platform?: 'web';
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Cookiebot consent object (`window.Cookiebot.consent`).
|
|
15
|
+
*
|
|
16
|
+
* The four categories are booleans Cookiebot always sets. `method` is
|
|
17
|
+
* `'explicit'` when the visitor actively decided, `'implied'` when Cookiebot
|
|
18
|
+
* consented on its own (outside a region that requires consent, an implied
|
|
19
|
+
* banner, or an old consent of unknown method) and `null` without consent.
|
|
20
|
+
*/
|
|
21
|
+
interface CookiebotConsent {
|
|
22
|
+
necessary?: boolean;
|
|
23
|
+
preferences?: boolean;
|
|
24
|
+
statistics?: boolean;
|
|
25
|
+
marketing?: boolean;
|
|
26
|
+
method?: string | null;
|
|
27
|
+
stamp?: string;
|
|
28
|
+
[category: string]: boolean | string | null | undefined;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The subset of the Cookiebot SDK (`window.Cookiebot`) the source reads.
|
|
32
|
+
*/
|
|
33
|
+
interface CookiebotAPI {
|
|
34
|
+
consent: CookiebotConsent;
|
|
35
|
+
/** The visitor accepted at least one category. */
|
|
36
|
+
consented?: boolean;
|
|
37
|
+
/** The visitor declined. */
|
|
38
|
+
declined?: boolean;
|
|
39
|
+
/** The visitor answered the banner, or Cookiebot consented for them. */
|
|
40
|
+
hasResponse?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Example `window.Cookiebot` states.
|
|
45
|
+
*
|
|
46
|
+
* Shapes follow what Cookiebot's uc.js sets: the four category booleans are
|
|
47
|
+
* always present, `method` is 'explicit', 'implied' or null, and `stamp`
|
|
48
|
+
* identifies the stored consent.
|
|
49
|
+
*/
|
|
50
|
+
/**
|
|
51
|
+
* Full consent - the visitor clicked "Allow all"
|
|
52
|
+
*/
|
|
53
|
+
declare const fullConsent: CookiebotAPI;
|
|
54
|
+
/**
|
|
55
|
+
* Partial consent - preferences and statistics allowed, marketing denied
|
|
56
|
+
*/
|
|
57
|
+
declare const partialConsent: CookiebotAPI;
|
|
58
|
+
/**
|
|
59
|
+
* Necessary only - the visitor clicked "Use necessary cookies only", or
|
|
60
|
+
* withdrew an earlier consent
|
|
61
|
+
*/
|
|
62
|
+
declare const necessaryOnly: CookiebotAPI;
|
|
63
|
+
/**
|
|
64
|
+
* Implied consent - Cookiebot consented on its own, for example for a visitor
|
|
65
|
+
* outside the regions where the site asks for consent
|
|
66
|
+
*/
|
|
67
|
+
declare const impliedConsent: CookiebotAPI;
|
|
68
|
+
/**
|
|
69
|
+
* No response - a first visit while the banner is still open
|
|
70
|
+
*/
|
|
71
|
+
declare const noResponse: CookiebotAPI;
|
|
72
|
+
/**
|
|
73
|
+
* Uppercase method - full consent with the method in a different casing
|
|
74
|
+
*/
|
|
75
|
+
declare const uppercaseMethod: CookiebotAPI;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Expected walkerOS consent states after mapping through the default
|
|
79
|
+
* categoryMap:
|
|
80
|
+
* - preferences -> functional
|
|
81
|
+
* - statistics -> analytics
|
|
82
|
+
* - marketing -> marketing
|
|
83
|
+
*
|
|
84
|
+
* `necessary` has no entry and keeps its own name. Denied groups carry an
|
|
85
|
+
* explicit false.
|
|
86
|
+
*/
|
|
87
|
+
/**
|
|
88
|
+
* Full consent mapped to walkerOS groups
|
|
89
|
+
*/
|
|
90
|
+
declare const fullConsentMapped: WalkerOS.Consent;
|
|
91
|
+
/**
|
|
92
|
+
* Partial consent - marketing denied
|
|
93
|
+
*/
|
|
94
|
+
declare const partialConsentMapped: WalkerOS.Consent;
|
|
95
|
+
/**
|
|
96
|
+
* Necessary only - functional, analytics and marketing denied
|
|
97
|
+
*/
|
|
98
|
+
declare const necessaryOnlyMapped: WalkerOS.Consent;
|
|
99
|
+
/**
|
|
100
|
+
* Partial consent with statistics mapped to a custom `statistics` group
|
|
101
|
+
*/
|
|
102
|
+
declare const partialConsentCustomMapped: WalkerOS.Consent;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Step examples for the Cookiebot source.
|
|
106
|
+
*
|
|
107
|
+
* `in` is the `window.Cookiebot` state. `trigger.options.dispatch` picks the
|
|
108
|
+
* path the source reacts to:
|
|
109
|
+
* - 'init' (default): Cookiebot already holds the state when the source
|
|
110
|
+
* starts, so the static read at init emits it.
|
|
111
|
+
* - 'event': Cookiebot reports the state after the source started, firing
|
|
112
|
+
* CookiebotOnAccept (consented) or CookiebotOnDecline (declined).
|
|
113
|
+
*/
|
|
114
|
+
declare const allowAll: Flow.StepExample;
|
|
115
|
+
declare const necessaryOnlyChoice: Flow.StepExample;
|
|
116
|
+
declare const returningVisitor: Flow.StepExample;
|
|
117
|
+
declare const firstVisit: Flow.StepExample;
|
|
118
|
+
declare const impliedSkipped: Flow.StepExample;
|
|
119
|
+
declare const impliedAllowed: Flow.StepExample;
|
|
120
|
+
declare const categoryMapOverride: Flow.StepExample;
|
|
121
|
+
|
|
122
|
+
declare const step_allowAll: typeof allowAll;
|
|
123
|
+
declare const step_categoryMapOverride: typeof categoryMapOverride;
|
|
124
|
+
declare const step_firstVisit: typeof firstVisit;
|
|
125
|
+
declare const step_impliedAllowed: typeof impliedAllowed;
|
|
126
|
+
declare const step_impliedSkipped: typeof impliedSkipped;
|
|
127
|
+
declare const step_necessaryOnlyChoice: typeof necessaryOnlyChoice;
|
|
128
|
+
declare const step_returningVisitor: typeof returningVisitor;
|
|
129
|
+
declare namespace step {
|
|
130
|
+
export { step_allowAll as allowAll, step_categoryMapOverride as categoryMapOverride, step_firstVisit as firstVisit, step_impliedAllowed as impliedAllowed, step_impliedSkipped as impliedSkipped, step_necessaryOnlyChoice as necessaryOnlyChoice, step_returningVisitor as returningVisitor };
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* `content` is the `window.Cookiebot` state. The `dispatch` option picks the
|
|
135
|
+
* path the source reacts to:
|
|
136
|
+
* - 'init' (default): Cookiebot holds the state before the source starts,
|
|
137
|
+
* so the static read at init publishes it.
|
|
138
|
+
* - 'event': Cookiebot reports the state after the source started and fires
|
|
139
|
+
* CookiebotOnAccept (consented) or CookiebotOnDecline (otherwise).
|
|
140
|
+
* Once the flow runs, every further trigger fires the event.
|
|
141
|
+
*/
|
|
142
|
+
declare const createTrigger: Trigger.CreateFn<unknown, void>;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Cookiebot source examples for testing and documentation.
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
declare const index$1_createTrigger: typeof createTrigger;
|
|
149
|
+
declare const index$1_fullConsent: typeof fullConsent;
|
|
150
|
+
declare const index$1_fullConsentMapped: typeof fullConsentMapped;
|
|
151
|
+
declare const index$1_impliedConsent: typeof impliedConsent;
|
|
152
|
+
declare const index$1_necessaryOnly: typeof necessaryOnly;
|
|
153
|
+
declare const index$1_necessaryOnlyMapped: typeof necessaryOnlyMapped;
|
|
154
|
+
declare const index$1_noResponse: typeof noResponse;
|
|
155
|
+
declare const index$1_partialConsent: typeof partialConsent;
|
|
156
|
+
declare const index$1_partialConsentCustomMapped: typeof partialConsentCustomMapped;
|
|
157
|
+
declare const index$1_partialConsentMapped: typeof partialConsentMapped;
|
|
158
|
+
declare const index$1_step: typeof step;
|
|
159
|
+
declare const index$1_uppercaseMethod: typeof uppercaseMethod;
|
|
160
|
+
declare namespace index$1 {
|
|
161
|
+
export { index$1_createTrigger as createTrigger, index$1_fullConsent as fullConsent, index$1_fullConsentMapped as fullConsentMapped, index$1_impliedConsent as impliedConsent, index$1_necessaryOnly as necessaryOnly, index$1_necessaryOnlyMapped as necessaryOnlyMapped, index$1_noResponse as noResponse, index$1_partialConsent as partialConsent, index$1_partialConsentCustomMapped as partialConsentCustomMapped, index$1_partialConsentMapped as partialConsentMapped, index$1_step as step, index$1_uppercaseMethod as uppercaseMethod };
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Cookiebot source settings schema
|
|
166
|
+
*/
|
|
167
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
168
|
+
categoryMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
169
|
+
explicitOnly: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
+
}, z.core.$strip>;
|
|
171
|
+
type Settings = z.infer<typeof SettingsSchema>;
|
|
172
|
+
|
|
173
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
174
|
+
|
|
175
|
+
type index_Settings = Settings;
|
|
176
|
+
declare const index_SettingsSchema: typeof SettingsSchema;
|
|
177
|
+
declare const index_settings: typeof settings;
|
|
178
|
+
declare namespace index {
|
|
179
|
+
export { type index_Settings as Settings, index_SettingsSchema as SettingsSchema, index_settings as settings };
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
declare const hints: Hint.Hints;
|
|
183
|
+
|
|
184
|
+
export { index$1 as examples, hints, index as schemas };
|
package/dist/dev.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,o=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,i=(e,o)=>{for(var n in o)t(e,n,{get:o[n],enumerable:!0})},a={};i(a,{examples:()=>c,hints:()=>q,schemas:()=>T}),module.exports=(e=a,((e,i,a,c)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let r of n(i))s.call(e,r)||r===a||t(e,r,{get:()=>i[r],enumerable:!(c=o(i,r))||c.enumerable});return e})(t({},"__esModule",{value:!0}),e));var c={};i(c,{createTrigger:()=>S,fullConsent:()=>r,fullConsentMapped:()=>h,impliedConsent:()=>d,necessaryOnly:()=>p,necessaryOnlyMapped:()=>y,noResponse:()=>g,partialConsent:()=>l,partialConsentCustomMapped:()=>k,partialConsentMapped:()=>u,step:()=>b,uppercaseMethod:()=>m});var r={consented:!0,declined:!1,hasResponse:!0,consent:{stamp:"example-stamp-full",necessary:!0,preferences:!0,statistics:!0,marketing:!0,method:"explicit"}},l={consented:!0,declined:!1,hasResponse:!0,consent:{stamp:"example-stamp-partial",necessary:!0,preferences:!0,statistics:!0,marketing:!1,method:"explicit"}},p={consented:!1,declined:!0,hasResponse:!0,consent:{stamp:"example-stamp-necessary",necessary:!0,preferences:!1,statistics:!1,marketing:!1,method:"explicit"}},d={consented:!0,declined:!1,hasResponse:!0,consent:{stamp:"-1",necessary:!0,preferences:!0,statistics:!0,marketing:!0,method:"implied"}},g={consented:!1,declined:!1,hasResponse:!1,consent:{stamp:"0",necessary:!0,preferences:!1,statistics:!1,marketing:!1,method:null}},m={...r,consent:{...r.consent,method:"EXPLICIT"}},h={necessary:!0,functional:!0,analytics:!0,marketing:!0},u={necessary:!0,functional:!0,analytics:!0,marketing:!1},y={necessary:!0,functional:!1,analytics:!1,marketing:!1},k={necessary:!0,functional:!0,statistics:!0,marketing:!1},b={};i(b,{allowAll:()=>f,categoryMapOverride:()=>j,firstVisit:()=>C,impliedAllowed:()=>x,impliedSkipped:()=>O,necessaryOnlyChoice:()=>w,returningVisitor:()=>v});var f={title:"Allow all",description:'The visitor clicks "Allow all". Cookiebot fires CookiebotOnAccept and the source emits a walker consent command granting functional, analytics and marketing.',trigger:{type:"consent",options:{dispatch:"event"}},in:r,out:[["elb","walker consent",h]]},w={title:"Necessary only",description:'The visitor clicks "Use necessary cookies only". Cookiebot fires CookiebotOnDecline and the source emits functional, analytics and marketing as false.',trigger:{type:"consent",options:{dispatch:"event"}},in:p,out:[["elb","walker consent",y]]},v={title:"Returning visitor",description:"Cookiebot already restored a stored choice when the source starts, so the static read at init publishes it at once.",trigger:{type:"consent",options:{dispatch:"init"}},in:l,out:[["elb","walker consent",u]]},C={title:"First visit",description:"The banner is still open and Cookiebot holds no response, so the source emits no consent command until the visitor decides.",trigger:{type:"consent",options:{dispatch:"init"}},in:g,out:[]},O={title:"Implied consent (skipped)",description:"Cookiebot consented on its own (consent.method implied), for example outside the regions where the site asks. The default explicitOnly publishes only an explicit decision, so no consent command is emitted, and a visitor Cookiebot never asks never sends one.",trigger:{type:"consent",options:{dispatch:"init"}},in:d,out:[]},x={title:"Implied consent (explicitOnly off)",description:"With explicitOnly set to false the source follows the consent Cookiebot implied and grants every group.",trigger:{type:"consent",options:{dispatch:"init"}},in:d,mapping:{settings:{explicitOnly:!1}},out:[["elb","walker consent",h]]},j={title:"Category map override",description:"A custom categoryMap reports Cookiebot statistics as a statistics group instead of analytics.",trigger:{type:"consent",options:{dispatch:"init"}},in:l,mapping:{settings:{categoryMap:{statistics:"statistics"}}},out:[["elb","walker consent",k]]},M=require("@walkeros/collector"),S=async e=>{let t;return{get flow(){return t},trigger:(o,n)=>async o=>{var s,i;if("object"!=typeof(i=o)||null===i||!("consent"in i)||"object"!=typeof i.consent||null===i.consent)throw new Error("Cookiebot trigger content is the window.Cookiebot state: { consent: { necessary, preferences, statistics, marketing, method } }");const a="object"==typeof n&&null!==n&&"dispatch"in n&&"event"===n.dispatch;if(t||a||Object.assign(window,{Cookiebot:o}),!t){const o=await(0,M.startFlow)({...e,run:null==(s=e.run)||s});if(t={collector:o.collector,elb:o.elb},!a)return}Object.assign(window,{Cookiebot:o}),window.dispatchEvent(new Event(o.consented?"CookiebotOnAccept":"CookiebotOnDecline"))}}};var T={};i(T,{SettingsSchema:()=>R,settings:()=>z});var A=require("@walkeros/core/dev"),P=require("@walkeros/core/dev"),R=P.z.object({categoryMap:P.z.record(P.z.string(),P.z.string()).describe("Map the CMP's consent categories (keys) to walkerOS consent groups (values).").optional(),explicitOnly:P.z.boolean().describe("Only process consent the visitor actively gave (Cookiebot consent.method 'explicit'). Implied consent, which Cookiebot sets on its own (outside a region that requires consent, an implied banner, or an old consent), is skipped. Default: true.").optional()}).meta({id:"CookiebotSettings",title:"Settings",description:"Settings for the Cookiebot CMP source."}),z=(0,A.zodToSchema)(R),q={"consent-implied":{text:"explicitOnly (default true) reports only consent the visitor actively gave, Cookiebot consent.method 'explicit'. Cookiebot sets implied consent on its own for visitors outside the regions where the site asks for consent, for an implied-consent banner, and for old consents of unknown method. For these visitors the source emits no walker consent command: destinations gated with consent queue their events until the visitor makes an explicit choice, and a visitor Cookiebot never asks never sends consent, so those destinations never deliver that visitor's events. Set explicitOnly to false to follow the consent Cookiebot implied.",code:[{lang:"json",code:'{ "settings": { "explicitOnly": false } }'}]},"troubleshoot-google-consent-mode":{text:'Cookiebot sends Google Consent Mode updates itself unless its script tag carries data-consentmode="disabled". The gtag destination does the same with its como setting, so with both on Google receives every update twice. Keep one: disable it on the Cookiebot script tag, or set "como": false on the gtag destination.',code:[{lang:"html",code:'<script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="00000000-0000-0000-0000-000000000000" data-consentmode="disabled"><\/script>'},{lang:"json",code:'{ "gtag": { "package": "@walkeros/web-destination-gtag", "config": { "settings": { "como": false } } } }'}]}};//# sourceMappingURL=dev.js.map
|
package/dist/dev.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/dev.ts","../src/examples/index.ts","../src/examples/inputs.ts","../src/examples/outputs.ts","../src/examples/step.ts","../src/examples/trigger.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/hints.ts"],"sourcesContent":["/**\n * Development exports for testing and tooling.\n */\nexport * as examples from './examples';\nexport * as schemas from './schemas';\nexport { hints } from './hints';\n","/**\n * Cookiebot source examples for testing and documentation.\n */\n\nexport * from './inputs';\nexport * from './outputs';\nexport * as step from './step';\nexport { createTrigger } from './trigger';\n","import type { CookiebotAPI } from '../types';\n\n/**\n * Example `window.Cookiebot` states.\n *\n * Shapes follow what Cookiebot's uc.js sets: the four category booleans are\n * always present, `method` is 'explicit', 'implied' or null, and `stamp`\n * identifies the stored consent.\n */\n\n/**\n * Full consent - the visitor clicked \"Allow all\"\n */\nexport const fullConsent: CookiebotAPI = {\n consented: true,\n declined: false,\n hasResponse: true,\n consent: {\n stamp: 'example-stamp-full',\n necessary: true,\n preferences: true,\n statistics: true,\n marketing: true,\n method: 'explicit',\n },\n};\n\n/**\n * Partial consent - preferences and statistics allowed, marketing denied\n */\nexport const partialConsent: CookiebotAPI = {\n consented: true,\n declined: false,\n hasResponse: true,\n consent: {\n stamp: 'example-stamp-partial',\n necessary: true,\n preferences: true,\n statistics: true,\n marketing: false,\n method: 'explicit',\n },\n};\n\n/**\n * Necessary only - the visitor clicked \"Use necessary cookies only\", or\n * withdrew an earlier consent\n */\nexport const necessaryOnly: CookiebotAPI = {\n consented: false,\n declined: true,\n hasResponse: true,\n consent: {\n stamp: 'example-stamp-necessary',\n necessary: true,\n preferences: false,\n statistics: false,\n marketing: false,\n method: 'explicit',\n },\n};\n\n/**\n * Implied consent - Cookiebot consented on its own, for example for a visitor\n * outside the regions where the site asks for consent\n */\nexport const impliedConsent: CookiebotAPI = {\n consented: true,\n declined: false,\n hasResponse: true,\n consent: {\n stamp: '-1',\n necessary: true,\n preferences: true,\n statistics: true,\n marketing: true,\n method: 'implied',\n },\n};\n\n/**\n * No response - a first visit while the banner is still open\n */\nexport const noResponse: CookiebotAPI = {\n consented: false,\n declined: false,\n hasResponse: false,\n consent: {\n stamp: '0',\n necessary: true,\n preferences: false,\n statistics: false,\n marketing: false,\n method: null,\n },\n};\n\n/**\n * Uppercase method - full consent with the method in a different casing\n */\nexport const uppercaseMethod: CookiebotAPI = {\n ...fullConsent,\n consent: { ...fullConsent.consent, method: 'EXPLICIT' },\n};\n","import type { WalkerOS } from '@walkeros/core';\n\n/**\n * Expected walkerOS consent states after mapping through the default\n * categoryMap:\n * - preferences -> functional\n * - statistics -> analytics\n * - marketing -> marketing\n *\n * `necessary` has no entry and keeps its own name. Denied groups carry an\n * explicit false.\n */\n\n/**\n * Full consent mapped to walkerOS groups\n */\nexport const fullConsentMapped: WalkerOS.Consent = {\n necessary: true,\n functional: true,\n analytics: true,\n marketing: true,\n};\n\n/**\n * Partial consent - marketing denied\n */\nexport const partialConsentMapped: WalkerOS.Consent = {\n necessary: true,\n functional: true,\n analytics: true,\n marketing: false,\n};\n\n/**\n * Necessary only - functional, analytics and marketing denied\n */\nexport const necessaryOnlyMapped: WalkerOS.Consent = {\n necessary: true,\n functional: false,\n analytics: false,\n marketing: false,\n};\n\n/**\n * Partial consent with statistics mapped to a custom `statistics` group\n */\nexport const partialConsentCustomMapped: WalkerOS.Consent = {\n necessary: true,\n functional: true,\n statistics: true,\n marketing: false,\n};\n","import type { Flow } from '@walkeros/core';\nimport {\n fullConsent,\n partialConsent,\n necessaryOnly,\n impliedConsent,\n noResponse,\n} from './inputs';\nimport {\n fullConsentMapped,\n partialConsentMapped,\n necessaryOnlyMapped,\n partialConsentCustomMapped,\n} from './outputs';\n\n/**\n * Step examples for the Cookiebot source.\n *\n * `in` is the `window.Cookiebot` state. `trigger.options.dispatch` picks the\n * path the source reacts to:\n * - 'init' (default): Cookiebot already holds the state when the source\n * starts, so the static read at init emits it.\n * - 'event': Cookiebot reports the state after the source started, firing\n * CookiebotOnAccept (consented) or CookiebotOnDecline (declined).\n */\n\nexport const allowAll: Flow.StepExample = {\n title: 'Allow all',\n description:\n 'The visitor clicks \"Allow all\". Cookiebot fires CookiebotOnAccept and the source emits a walker consent command granting functional, analytics and marketing.',\n trigger: { type: 'consent', options: { dispatch: 'event' } },\n in: fullConsent,\n out: [['elb', 'walker consent', fullConsentMapped]],\n};\n\nexport const necessaryOnlyChoice: Flow.StepExample = {\n title: 'Necessary only',\n description:\n 'The visitor clicks \"Use necessary cookies only\". Cookiebot fires CookiebotOnDecline and the source emits functional, analytics and marketing as false.',\n trigger: { type: 'consent', options: { dispatch: 'event' } },\n in: necessaryOnly,\n out: [['elb', 'walker consent', necessaryOnlyMapped]],\n};\n\nexport const returningVisitor: Flow.StepExample = {\n title: 'Returning visitor',\n description:\n 'Cookiebot already restored a stored choice when the source starts, so the static read at init publishes it at once.',\n trigger: { type: 'consent', options: { dispatch: 'init' } },\n in: partialConsent,\n out: [['elb', 'walker consent', partialConsentMapped]],\n};\n\nexport const firstVisit: Flow.StepExample = {\n title: 'First visit',\n description:\n 'The banner is still open and Cookiebot holds no response, so the source emits no consent command until the visitor decides.',\n trigger: { type: 'consent', options: { dispatch: 'init' } },\n in: noResponse,\n out: [],\n};\n\nexport const impliedSkipped: Flow.StepExample = {\n title: 'Implied consent (skipped)',\n description:\n 'Cookiebot consented on its own (consent.method implied), for example outside the regions where the site asks. The default explicitOnly publishes only an explicit decision, so no consent command is emitted, and a visitor Cookiebot never asks never sends one.',\n trigger: { type: 'consent', options: { dispatch: 'init' } },\n in: impliedConsent,\n out: [],\n};\n\nexport const impliedAllowed: Flow.StepExample = {\n title: 'Implied consent (explicitOnly off)',\n description:\n 'With explicitOnly set to false the source follows the consent Cookiebot implied and grants every group.',\n trigger: { type: 'consent', options: { dispatch: 'init' } },\n in: impliedConsent,\n mapping: { settings: { explicitOnly: false } },\n out: [['elb', 'walker consent', fullConsentMapped]],\n};\n\nexport const categoryMapOverride: Flow.StepExample = {\n title: 'Category map override',\n description:\n 'A custom categoryMap reports Cookiebot statistics as a statistics group instead of analytics.',\n trigger: { type: 'consent', options: { dispatch: 'init' } },\n in: partialConsent,\n mapping: { settings: { categoryMap: { statistics: 'statistics' } } },\n out: [['elb', 'walker consent', partialConsentCustomMapped]],\n};\n","import type { Trigger, Collector } from '@walkeros/core';\nimport { startFlow } from '@walkeros/collector';\nimport type { CookiebotAPI } from '../types';\n\n/**\n * `content` is the `window.Cookiebot` state. The `dispatch` option picks the\n * path the source reacts to:\n * - 'init' (default): Cookiebot holds the state before the source starts,\n * so the static read at init publishes it.\n * - 'event': Cookiebot reports the state after the source started and fires\n * CookiebotOnAccept (consented) or CookiebotOnDecline (otherwise).\n * Once the flow runs, every further trigger fires the event.\n */\nconst createTrigger: Trigger.CreateFn<unknown, void> = async (\n config: Collector.InitConfig,\n) => {\n let flow: Trigger.FlowHandle | undefined;\n\n const trigger: Trigger.Fn<unknown, void> =\n (_type?: string, opts?: unknown) => async (content: unknown) => {\n if (!isCookiebotState(content))\n throw new Error(\n 'Cookiebot trigger content is the window.Cookiebot state: { consent: { necessary, preferences, statistics, marketing, method } }',\n );\n const viaEvent =\n typeof opts === 'object' &&\n opts !== null &&\n 'dispatch' in opts &&\n opts.dispatch === 'event';\n\n if (!flow && !viaEvent) Object.assign(window, { Cookiebot: content });\n\n if (!flow) {\n const result = await startFlow({ ...config, run: config.run ?? true });\n flow = { collector: result.collector, elb: result.elb };\n if (!viaEvent) return;\n }\n\n Object.assign(window, { Cookiebot: content });\n window.dispatchEvent(\n new Event(\n content.consented ? 'CookiebotOnAccept' : 'CookiebotOnDecline',\n ),\n );\n };\n\n return {\n get flow() {\n return flow;\n },\n trigger,\n };\n};\n\nfunction isCookiebotState(value: unknown): value is CookiebotAPI {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'consent' in value &&\n typeof value.consent === 'object' &&\n value.consent !== null\n );\n}\n\nexport { createTrigger };\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\n\n// Export Zod schemas and types\nexport { SettingsSchema, type Settings } from './settings';\n\n// JSON Schema exports (for website PropertyTable and documentation tools)\nexport const settings = zodToSchema(SettingsSchema);\n","import { z } from '@walkeros/core/dev';\n\n/**\n * Cookiebot source settings schema\n */\nexport const SettingsSchema = z\n .object({\n categoryMap: z\n .record(z.string(), z.string())\n .describe(\n \"Map the CMP's consent categories (keys) to walkerOS consent groups (values).\",\n )\n .optional(),\n\n explicitOnly: z\n .boolean()\n .describe(\n \"Only process consent the visitor actively gave (Cookiebot consent.method 'explicit'). Implied consent, which Cookiebot sets on its own (outside a region that requires consent, an implied banner, or an old consent), is skipped. Default: true.\",\n )\n .optional(),\n })\n .meta({\n id: 'CookiebotSettings',\n title: 'Settings',\n description: 'Settings for the Cookiebot CMP source.',\n });\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import type { Hint } from '@walkeros/core';\n\nexport const hints: Hint.Hints = {\n 'consent-implied': {\n text: \"explicitOnly (default true) reports only consent the visitor actively gave, Cookiebot consent.method 'explicit'. Cookiebot sets implied consent on its own for visitors outside the regions where the site asks for consent, for an implied-consent banner, and for old consents of unknown method. For these visitors the source emits no walker consent command: destinations gated with consent queue their events until the visitor makes an explicit choice, and a visitor Cookiebot never asks never sends consent, so those destinations never deliver that visitor's events. Set explicitOnly to false to follow the consent Cookiebot implied.\",\n code: [{ lang: 'json', code: '{ \"settings\": { \"explicitOnly\": false } }' }],\n },\n 'troubleshoot-google-consent-mode': {\n text: 'Cookiebot sends Google Consent Mode updates itself unless its script tag carries data-consentmode=\"disabled\". The gtag destination does the same with its como setting, so with both on Google receives every update twice. Keep one: disable it on the Cookiebot script tag, or set \"como\": false on the gtag destination.',\n code: [\n {\n lang: 'html',\n code: '<script id=\"Cookiebot\" src=\"https://consent.cookiebot.com/uc.js\" data-cbid=\"00000000-0000-0000-0000-000000000000\" data-consentmode=\"disabled\"></script>',\n },\n {\n lang: 'json',\n code: '{ \"gtag\": { \"package\": \"@walkeros/web-destination-gtag\", \"config\": { \"settings\": { \"como\": false } } } }',\n },\n ],\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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C,WAAO;AAAA,MACL,IAAI;AAAA,QACF,QAAQ,YAAY,sBAAsB;AAAA,MAC5C;AAAA,IACF;AAAA,EACF;AAEF,SAAO;AAAA,IACL,IAAI,OAAO;AACT,aAAO;AAAA,IACT;AAAA,IACA;AAAA,EACF;AACF;AAEA,SAAS,iBAAiB,OAAuC;AAC/D,SACE,OAAO,UAAU,YACjB,UAAU,QACV,aAAa,SACb,OAAO,MAAM,YAAY,YACzB,MAAM,YAAY;AAEtB;;;AC9DA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAKX,IAAM,iBAAiB,aAC3B,OAAO;AAAA,EACN,aAAa,aACV,OAAO,aAAE,OAAO,GAAG,aAAE,OAAO,CAAC,EAC7B;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EAEZ,cAAc,aACX,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC,EACA,KAAK;AAAA,EACJ,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,aAAa;AACf,CAAC;;;ADlBI,IAAM,eAAW,yBAAY,cAAc;;;AEL3C,IAAM,QAAoB;AAAA,EAC/B,mBAAmB;AAAA,IACjB,MAAM;AAAA,IACN,MAAM,CAAC,EAAE,MAAM,QAAQ,MAAM,4CAA4C,CAAC;AAAA,EAC5E;AAAA,EACA,oCAAoC;AAAA,IAClC,MAAM;AAAA,IACN,MAAM;AAAA,MACJ;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;","names":["import_dev"]}
|
package/dist/dev.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty,t=(t,o)=>{for(var s in o)e(t,s,{get:o[s],enumerable:!0})},o={};t(o,{createTrigger:()=>C,fullConsent:()=>s,fullConsentMapped:()=>l,impliedConsent:()=>a,necessaryOnly:()=>i,necessaryOnlyMapped:()=>d,noResponse:()=>c,partialConsent:()=>n,partialConsentCustomMapped:()=>g,partialConsentMapped:()=>p,step:()=>m,uppercaseMethod:()=>r});var s={consented:!0,declined:!1,hasResponse:!0,consent:{stamp:"example-stamp-full",necessary:!0,preferences:!0,statistics:!0,marketing:!0,method:"explicit"}},n={consented:!0,declined:!1,hasResponse:!0,consent:{stamp:"example-stamp-partial",necessary:!0,preferences:!0,statistics:!0,marketing:!1,method:"explicit"}},i={consented:!1,declined:!0,hasResponse:!0,consent:{stamp:"example-stamp-necessary",necessary:!0,preferences:!1,statistics:!1,marketing:!1,method:"explicit"}},a={consented:!0,declined:!1,hasResponse:!0,consent:{stamp:"-1",necessary:!0,preferences:!0,statistics:!0,marketing:!0,method:"implied"}},c={consented:!1,declined:!1,hasResponse:!1,consent:{stamp:"0",necessary:!0,preferences:!1,statistics:!1,marketing:!1,method:null}},r={...s,consent:{...s.consent,method:"EXPLICIT"}},l={necessary:!0,functional:!0,analytics:!0,marketing:!0},p={necessary:!0,functional:!0,analytics:!0,marketing:!1},d={necessary:!0,functional:!1,analytics:!1,marketing:!1},g={necessary:!0,functional:!0,statistics:!0,marketing:!1},m={};t(m,{allowAll:()=>h,categoryMapOverride:()=>v,firstVisit:()=>y,impliedAllowed:()=>f,impliedSkipped:()=>b,necessaryOnlyChoice:()=>k,returningVisitor:()=>u});var h={title:"Allow all",description:'The visitor clicks "Allow all". Cookiebot fires CookiebotOnAccept and the source emits a walker consent command granting functional, analytics and marketing.',trigger:{type:"consent",options:{dispatch:"event"}},in:s,out:[["elb","walker consent",l]]},k={title:"Necessary only",description:'The visitor clicks "Use necessary cookies only". Cookiebot fires CookiebotOnDecline and the source emits functional, analytics and marketing as false.',trigger:{type:"consent",options:{dispatch:"event"}},in:i,out:[["elb","walker consent",d]]},u={title:"Returning visitor",description:"Cookiebot already restored a stored choice when the source starts, so the static read at init publishes it at once.",trigger:{type:"consent",options:{dispatch:"init"}},in:n,out:[["elb","walker consent",p]]},y={title:"First visit",description:"The banner is still open and Cookiebot holds no response, so the source emits no consent command until the visitor decides.",trigger:{type:"consent",options:{dispatch:"init"}},in:c,out:[]},b={title:"Implied consent (skipped)",description:"Cookiebot consented on its own (consent.method implied), for example outside the regions where the site asks. The default explicitOnly publishes only an explicit decision, so no consent command is emitted, and a visitor Cookiebot never asks never sends one.",trigger:{type:"consent",options:{dispatch:"init"}},in:a,out:[]},f={title:"Implied consent (explicitOnly off)",description:"With explicitOnly set to false the source follows the consent Cookiebot implied and grants every group.",trigger:{type:"consent",options:{dispatch:"init"}},in:a,mapping:{settings:{explicitOnly:!1}},out:[["elb","walker consent",l]]},v={title:"Category map override",description:"A custom categoryMap reports Cookiebot statistics as a statistics group instead of analytics.",trigger:{type:"consent",options:{dispatch:"init"}},in:n,mapping:{settings:{categoryMap:{statistics:"statistics"}}},out:[["elb","walker consent",g]]};import{startFlow as w}from"@walkeros/collector";var C=async e=>{let t;return{get flow(){return t},trigger:(o,s)=>async o=>{var n,i;if("object"!=typeof(i=o)||null===i||!("consent"in i)||"object"!=typeof i.consent||null===i.consent)throw new Error("Cookiebot trigger content is the window.Cookiebot state: { consent: { necessary, preferences, statistics, marketing, method } }");const a="object"==typeof s&&null!==s&&"dispatch"in s&&"event"===s.dispatch;if(t||a||Object.assign(window,{Cookiebot:o}),!t){const o=await w({...e,run:null==(n=e.run)||n});if(t={collector:o.collector,elb:o.elb},!a)return}Object.assign(window,{Cookiebot:o}),window.dispatchEvent(new Event(o.consented?"CookiebotOnAccept":"CookiebotOnDecline"))}}};var x={};t(x,{SettingsSchema:()=>j,settings:()=>S});import{zodToSchema as O}from"@walkeros/core/dev";import{z as M}from"@walkeros/core/dev";var j=M.object({categoryMap:M.record(M.string(),M.string()).describe("Map the CMP's consent categories (keys) to walkerOS consent groups (values).").optional(),explicitOnly:M.boolean().describe("Only process consent the visitor actively gave (Cookiebot consent.method 'explicit'). Implied consent, which Cookiebot sets on its own (outside a region that requires consent, an implied banner, or an old consent), is skipped. Default: true.").optional()}).meta({id:"CookiebotSettings",title:"Settings",description:"Settings for the Cookiebot CMP source."}),S=O(j),A={"consent-implied":{text:"explicitOnly (default true) reports only consent the visitor actively gave, Cookiebot consent.method 'explicit'. Cookiebot sets implied consent on its own for visitors outside the regions where the site asks for consent, for an implied-consent banner, and for old consents of unknown method. For these visitors the source emits no walker consent command: destinations gated with consent queue their events until the visitor makes an explicit choice, and a visitor Cookiebot never asks never sends consent, so those destinations never deliver that visitor's events. Set explicitOnly to false to follow the consent Cookiebot implied.",code:[{lang:"json",code:'{ "settings": { "explicitOnly": false } }'}]},"troubleshoot-google-consent-mode":{text:'Cookiebot sends Google Consent Mode updates itself unless its script tag carries data-consentmode="disabled". The gtag destination does the same with its como setting, so with both on Google receives every update twice. Keep one: disable it on the Cookiebot script tag, or set "como": false on the gtag destination.',code:[{lang:"html",code:'<script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="00000000-0000-0000-0000-000000000000" data-consentmode="disabled"><\/script>'},{lang:"json",code:'{ "gtag": { "package": "@walkeros/web-destination-gtag", "config": { "settings": { "como": false } } } }'}]}};export{o as examples,A as hints,x as schemas};//# sourceMappingURL=dev.mjs.map
|
package/dist/dev.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/examples/index.ts","../src/examples/inputs.ts","../src/examples/outputs.ts","../src/examples/step.ts","../src/examples/trigger.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/hints.ts"],"sourcesContent":["/**\n * Cookiebot source examples for testing and documentation.\n */\n\nexport * from './inputs';\nexport * from './outputs';\nexport * as step from './step';\nexport { createTrigger } from './trigger';\n","import type { CookiebotAPI } from '../types';\n\n/**\n * Example `window.Cookiebot` states.\n *\n * Shapes follow what Cookiebot's uc.js sets: the four category booleans are\n * always present, `method` is 'explicit', 'implied' or null, and `stamp`\n * identifies the stored consent.\n */\n\n/**\n * Full consent - the visitor clicked \"Allow all\"\n */\nexport const fullConsent: CookiebotAPI = {\n consented: true,\n declined: false,\n hasResponse: true,\n consent: {\n stamp: 'example-stamp-full',\n necessary: true,\n preferences: true,\n statistics: true,\n marketing: true,\n method: 'explicit',\n },\n};\n\n/**\n * Partial consent - preferences and statistics allowed, marketing denied\n */\nexport const partialConsent: CookiebotAPI = {\n consented: true,\n declined: false,\n hasResponse: true,\n consent: {\n stamp: 'example-stamp-partial',\n necessary: true,\n preferences: true,\n statistics: true,\n marketing: false,\n method: 'explicit',\n },\n};\n\n/**\n * Necessary only - the visitor clicked \"Use necessary cookies only\", or\n * withdrew an earlier consent\n */\nexport const necessaryOnly: CookiebotAPI = {\n consented: false,\n declined: true,\n hasResponse: true,\n consent: {\n stamp: 'example-stamp-necessary',\n necessary: true,\n preferences: false,\n statistics: false,\n marketing: false,\n method: 'explicit',\n },\n};\n\n/**\n * Implied consent - Cookiebot consented on its own, for example for a visitor\n * outside the regions where the site asks for consent\n */\nexport const impliedConsent: CookiebotAPI = {\n consented: true,\n declined: false,\n hasResponse: true,\n consent: {\n stamp: '-1',\n necessary: true,\n preferences: true,\n statistics: true,\n marketing: true,\n method: 'implied',\n },\n};\n\n/**\n * No response - a first visit while the banner is still open\n */\nexport const noResponse: CookiebotAPI = {\n consented: false,\n declined: false,\n hasResponse: false,\n consent: {\n stamp: '0',\n necessary: true,\n preferences: false,\n statistics: false,\n marketing: false,\n method: null,\n },\n};\n\n/**\n * Uppercase method - full consent with the method in a different casing\n */\nexport const uppercaseMethod: CookiebotAPI = {\n ...fullConsent,\n consent: { ...fullConsent.consent, method: 'EXPLICIT' },\n};\n","import type { WalkerOS } from '@walkeros/core';\n\n/**\n * Expected walkerOS consent states after mapping through the default\n * categoryMap:\n * - preferences -> functional\n * - statistics -> analytics\n * - marketing -> marketing\n *\n * `necessary` has no entry and keeps its own name. Denied groups carry an\n * explicit false.\n */\n\n/**\n * Full consent mapped to walkerOS groups\n */\nexport const fullConsentMapped: WalkerOS.Consent = {\n necessary: true,\n functional: true,\n analytics: true,\n marketing: true,\n};\n\n/**\n * Partial consent - marketing denied\n */\nexport const partialConsentMapped: WalkerOS.Consent = {\n necessary: true,\n functional: true,\n analytics: true,\n marketing: false,\n};\n\n/**\n * Necessary only - functional, analytics and marketing denied\n */\nexport const necessaryOnlyMapped: WalkerOS.Consent = {\n necessary: true,\n functional: false,\n analytics: false,\n marketing: false,\n};\n\n/**\n * Partial consent with statistics mapped to a custom `statistics` group\n */\nexport const partialConsentCustomMapped: WalkerOS.Consent = {\n necessary: true,\n functional: true,\n statistics: true,\n marketing: false,\n};\n","import type { Flow } from '@walkeros/core';\nimport {\n fullConsent,\n partialConsent,\n necessaryOnly,\n impliedConsent,\n noResponse,\n} from './inputs';\nimport {\n fullConsentMapped,\n partialConsentMapped,\n necessaryOnlyMapped,\n partialConsentCustomMapped,\n} from './outputs';\n\n/**\n * Step examples for the Cookiebot source.\n *\n * `in` is the `window.Cookiebot` state. `trigger.options.dispatch` picks the\n * path the source reacts to:\n * - 'init' (default): Cookiebot already holds the state when the source\n * starts, so the static read at init emits it.\n * - 'event': Cookiebot reports the state after the source started, firing\n * CookiebotOnAccept (consented) or CookiebotOnDecline (declined).\n */\n\nexport const allowAll: Flow.StepExample = {\n title: 'Allow all',\n description:\n 'The visitor clicks \"Allow all\". Cookiebot fires CookiebotOnAccept and the source emits a walker consent command granting functional, analytics and marketing.',\n trigger: { type: 'consent', options: { dispatch: 'event' } },\n in: fullConsent,\n out: [['elb', 'walker consent', fullConsentMapped]],\n};\n\nexport const necessaryOnlyChoice: Flow.StepExample = {\n title: 'Necessary only',\n description:\n 'The visitor clicks \"Use necessary cookies only\". Cookiebot fires CookiebotOnDecline and the source emits functional, analytics and marketing as false.',\n trigger: { type: 'consent', options: { dispatch: 'event' } },\n in: necessaryOnly,\n out: [['elb', 'walker consent', necessaryOnlyMapped]],\n};\n\nexport const returningVisitor: Flow.StepExample = {\n title: 'Returning visitor',\n description:\n 'Cookiebot already restored a stored choice when the source starts, so the static read at init publishes it at once.',\n trigger: { type: 'consent', options: { dispatch: 'init' } },\n in: partialConsent,\n out: [['elb', 'walker consent', partialConsentMapped]],\n};\n\nexport const firstVisit: Flow.StepExample = {\n title: 'First visit',\n description:\n 'The banner is still open and Cookiebot holds no response, so the source emits no consent command until the visitor decides.',\n trigger: { type: 'consent', options: { dispatch: 'init' } },\n in: noResponse,\n out: [],\n};\n\nexport const impliedSkipped: Flow.StepExample = {\n title: 'Implied consent (skipped)',\n description:\n 'Cookiebot consented on its own (consent.method implied), for example outside the regions where the site asks. The default explicitOnly publishes only an explicit decision, so no consent command is emitted, and a visitor Cookiebot never asks never sends one.',\n trigger: { type: 'consent', options: { dispatch: 'init' } },\n in: impliedConsent,\n out: [],\n};\n\nexport const impliedAllowed: Flow.StepExample = {\n title: 'Implied consent (explicitOnly off)',\n description:\n 'With explicitOnly set to false the source follows the consent Cookiebot implied and grants every group.',\n trigger: { type: 'consent', options: { dispatch: 'init' } },\n in: impliedConsent,\n mapping: { settings: { explicitOnly: false } },\n out: [['elb', 'walker consent', fullConsentMapped]],\n};\n\nexport const categoryMapOverride: Flow.StepExample = {\n title: 'Category map override',\n description:\n 'A custom categoryMap reports Cookiebot statistics as a statistics group instead of analytics.',\n trigger: { type: 'consent', options: { dispatch: 'init' } },\n in: partialConsent,\n mapping: { settings: { categoryMap: { statistics: 'statistics' } } },\n out: [['elb', 'walker consent', partialConsentCustomMapped]],\n};\n","import type { Trigger, Collector } from '@walkeros/core';\nimport { startFlow } from '@walkeros/collector';\nimport type { CookiebotAPI } from '../types';\n\n/**\n * `content` is the `window.Cookiebot` state. The `dispatch` option picks the\n * path the source reacts to:\n * - 'init' (default): Cookiebot holds the state before the source starts,\n * so the static read at init publishes it.\n * - 'event': Cookiebot reports the state after the source started and fires\n * CookiebotOnAccept (consented) or CookiebotOnDecline (otherwise).\n * Once the flow runs, every further trigger fires the event.\n */\nconst createTrigger: Trigger.CreateFn<unknown, void> = async (\n config: Collector.InitConfig,\n) => {\n let flow: Trigger.FlowHandle | undefined;\n\n const trigger: Trigger.Fn<unknown, void> =\n (_type?: string, opts?: unknown) => async (content: unknown) => {\n if (!isCookiebotState(content))\n throw new Error(\n 'Cookiebot trigger content is the window.Cookiebot state: { consent: { necessary, preferences, statistics, marketing, method } }',\n );\n const viaEvent =\n typeof opts === 'object' &&\n opts !== null &&\n 'dispatch' in opts &&\n opts.dispatch === 'event';\n\n if (!flow && !viaEvent) Object.assign(window, { Cookiebot: content });\n\n if (!flow) {\n const result = await startFlow({ ...config, run: config.run ?? true });\n flow = { collector: result.collector, elb: result.elb };\n if (!viaEvent) return;\n }\n\n Object.assign(window, { Cookiebot: content });\n window.dispatchEvent(\n new Event(\n content.consented ? 'CookiebotOnAccept' : 'CookiebotOnDecline',\n ),\n );\n };\n\n return {\n get flow() {\n return flow;\n },\n trigger,\n };\n};\n\nfunction isCookiebotState(value: unknown): value is CookiebotAPI {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'consent' in value &&\n typeof value.consent === 'object' &&\n value.consent !== null\n );\n}\n\nexport { createTrigger };\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\n\n// Export Zod schemas and types\nexport { SettingsSchema, type Settings } from './settings';\n\n// JSON Schema exports (for website PropertyTable and documentation tools)\nexport const settings = zodToSchema(SettingsSchema);\n","import { z } from '@walkeros/core/dev';\n\n/**\n * Cookiebot source settings schema\n */\nexport const SettingsSchema = z\n .object({\n categoryMap: z\n .record(z.string(), z.string())\n .describe(\n \"Map the CMP's consent categories (keys) to walkerOS consent groups (values).\",\n )\n .optional(),\n\n explicitOnly: z\n .boolean()\n .describe(\n \"Only process consent the visitor actively gave (Cookiebot consent.method 'explicit'). Implied consent, which Cookiebot sets on its own (outside a region that requires consent, an implied banner, or an old consent), is skipped. Default: true.\",\n )\n .optional(),\n })\n .meta({\n id: 'CookiebotSettings',\n title: 'Settings',\n description: 'Settings for the Cookiebot CMP source.',\n });\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import type { Hint } from '@walkeros/core';\n\nexport const hints: Hint.Hints = {\n 'consent-implied': {\n text: \"explicitOnly (default true) reports only consent the visitor actively gave, Cookiebot consent.method 'explicit'. Cookiebot sets implied consent on its own for visitors outside the regions where the site asks for consent, for an implied-consent banner, and for old consents of unknown method. For these visitors the source emits no walker consent command: destinations gated with consent queue their events until the visitor makes an explicit choice, and a visitor Cookiebot never asks never sends consent, so those destinations never deliver that visitor's events. Set explicitOnly to false to follow the consent Cookiebot implied.\",\n code: [{ lang: 'json', code: '{ \"settings\": { \"explicitOnly\": false } }' }],\n },\n 'troubleshoot-google-consent-mode': {\n text: 'Cookiebot sends Google Consent Mode updates itself unless its script tag carries data-consentmode=\"disabled\". The gtag destination does the same with its como setting, so with both on Google receives every update twice. Keep one: disable it on the Cookiebot script tag, or set \"como\": false on the gtag destination.',\n code: [\n {\n lang: 'html',\n code: '<script id=\"Cookiebot\" src=\"https://consent.cookiebot.com/uc.js\" data-cbid=\"00000000-0000-0000-0000-000000000000\" data-consentmode=\"disabled\"></script>',\n },\n {\n lang: 'json',\n code: '{ \"gtag\": { \"package\": \"@walkeros/web-destination-gtag\", \"config\": { \"settings\": { \"como\": false } } } }',\n },\n ],\n },\n};\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACaO,IAAM,cAA4B;AAAA,EACvC,WAAW;AAAA,EACX,UAAU;AAAA,EACV,aAAa;AAAA,EACb,SAAS;AAAA,IACP,OAAO;AAAA,IACP,WAAW;AAAA,IACX,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,QAAQ;AAAA,EACV;AACF;AAKO,IAAM,iBAA+B;AAAA,EAC1C,WAAW;AAAA,EACX,UAAU;AAAA,EACV,aAAa;AAAA,EACb,SAAS;AAAA,IACP,OAAO;AAAA,IACP,WAAW;AAAA,IACX,aAAa;AAAA,IACb,YAAY;AAAA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