@walkeros/web-source-cmp-usercentrics 4.2.0 → 4.2.1-next-1781538735002

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.
@@ -22,100 +22,77 @@ var examples_exports = {};
22
22
  __export(examples_exports, {
23
23
  createMockElbFn: () => createMockElbFn,
24
24
  createTrigger: () => createTrigger,
25
- fullConsent: () => fullConsent,
26
25
  fullConsentCustomMapped: () => fullConsentCustomMapped,
27
26
  fullConsentMapped: () => fullConsentMapped,
28
- fullConsentUpperCase: () => fullConsentUpperCase,
29
- implicitConsent: () => implicitConsent,
30
- minimalConsent: () => minimalConsent,
31
27
  minimalConsentMapped: () => minimalConsentMapped,
32
- nonConsentEvent: () => nonConsentEvent,
33
28
  noopLogger: () => noopLogger,
34
- partialConsent: () => partialConsent,
35
29
  partialConsentMapped: () => partialConsentMapped,
36
- serviceLevelConsent: () => serviceLevelConsent,
37
- serviceLevelMapped: () => serviceLevelMapped,
30
+ servicesFirstVisitImplicit: () => servicesFirstVisitImplicit,
31
+ servicesFullExplicit: () => servicesFullExplicit,
32
+ servicesMinimalExplicit: () => servicesMinimalExplicit,
33
+ servicesPartialExplicit: () => servicesPartialExplicit,
38
34
  step: () => step_exports,
39
35
  trigger: () => trigger
40
36
  });
41
37
  module.exports = __toCommonJS(examples_exports);
42
38
 
43
39
  // src/examples/inputs.ts
44
- var fullConsent = {
45
- event: "consent_status",
46
- type: "explicit",
47
- action: "onAcceptAllServices",
48
- ucCategory: {
49
- essential: true,
50
- functional: true,
51
- marketing: true
40
+ var servicesFullExplicit = [
41
+ {
42
+ categorySlug: "essential",
43
+ consent: { status: true, history: [{ type: "explicit", status: true }] }
52
44
  },
53
- "Google Analytics": true,
54
- "Google Ads Remarketing": true
55
- };
56
- var partialConsent = {
57
- event: "consent_status",
58
- type: "explicit",
59
- action: "onUpdateServices",
60
- ucCategory: {
61
- essential: true,
62
- functional: true,
63
- marketing: false
45
+ {
46
+ categorySlug: "functional",
47
+ consent: { status: true, history: [{ type: "explicit", status: true }] }
64
48
  },
65
- "Google Analytics": true,
66
- "Google Ads Remarketing": false
67
- };
68
- var minimalConsent = {
69
- event: "consent_status",
70
- type: "explicit",
71
- action: "onDenyAllServices",
72
- ucCategory: {
73
- essential: true,
74
- functional: false,
75
- marketing: false
49
+ {
50
+ categorySlug: "marketing",
51
+ consent: { status: true, history: [{ type: "explicit", status: true }] }
52
+ }
53
+ ];
54
+ var servicesMinimalExplicit = [
55
+ {
56
+ categorySlug: "essential",
57
+ consent: { status: true, history: [{ type: "explicit", status: true }] }
76
58
  },
77
- "Google Analytics": false,
78
- "Google Ads Remarketing": false
79
- };
80
- var implicitConsent = {
81
- event: "consent_status",
82
- type: "implicit",
83
- ucCategory: {
84
- essential: true,
85
- functional: false,
86
- marketing: false
59
+ {
60
+ categorySlug: "functional",
61
+ consent: { status: false, history: [{ type: "explicit", status: false }] }
87
62
  },
88
- "Google Analytics": false,
89
- "Google Ads Remarketing": false
90
- };
91
- var fullConsentUpperCase = {
92
- event: "consent_status",
93
- type: "EXPLICIT",
94
- action: "onAcceptAllServices",
95
- ucCategory: {
96
- essential: true,
97
- functional: true,
98
- marketing: true
63
+ {
64
+ categorySlug: "marketing",
65
+ consent: { status: false, history: [{ type: "explicit", status: false }] }
99
66
  }
100
- };
101
- var serviceLevelConsent = {
102
- event: "consent_status",
103
- type: "explicit",
104
- action: "onUpdateServices",
105
- ucCategory: {
106
- essential: true,
107
- functional: "partial",
108
- // Non-boolean indicates mixed service choices
109
- marketing: "partial"
67
+ ];
68
+ var servicesPartialExplicit = [
69
+ {
70
+ categorySlug: "essential",
71
+ consent: { status: true, history: [{ type: "explicit", status: true }] }
110
72
  },
111
- "Google Analytics": true,
112
- "Google Ads Remarketing": false,
113
- Hotjar: true
114
- };
115
- var nonConsentEvent = {
116
- event: "other_event",
117
- type: "explicit"
118
- };
73
+ {
74
+ categorySlug: "functional",
75
+ consent: { status: true, history: [{ type: "explicit", status: true }] }
76
+ },
77
+ {
78
+ categorySlug: "marketing",
79
+ consent: { status: false, history: [{ type: "explicit", status: false }] }
80
+ }
81
+ ];
82
+ var servicesFirstVisitImplicit = [
83
+ {
84
+ categorySlug: "essential",
85
+ consent: { status: true, history: [{ type: "implicit", status: true }] }
86
+ },
87
+ {
88
+ categorySlug: "functional",
89
+ consent: { status: false, history: [{ type: "implicit", status: false }] }
90
+ },
91
+ {
92
+ categorySlug: "marketing",
93
+ consent: { status: false, history: [{ type: "implicit", status: false }] }
94
+ }
95
+ ];
119
96
 
120
97
  // src/examples/outputs.ts
121
98
  var fullConsentMapped = {
@@ -135,14 +112,9 @@ var minimalConsentMapped = {
135
112
  };
136
113
  var fullConsentCustomMapped = {
137
114
  functional: true,
115
+ analytics: true,
138
116
  marketing: true
139
117
  };
140
- var serviceLevelMapped = {
141
- essential: true,
142
- google_analytics: true,
143
- google_ads_remarketing: false,
144
- hotjar: true
145
- };
146
118
 
147
119
  // src/examples/env.ts
148
120
  var noop = () => {
@@ -169,115 +141,68 @@ var noopLogger = {
169
141
  var step_exports = {};
170
142
  __export(step_exports, {
171
143
  categoryMapOverride: () => categoryMapOverride,
172
- customEventName: () => customEventName,
173
- fullConsent: () => fullConsent2,
174
- minimalConsent: () => minimalConsent2
144
+ consentChange: () => consentChange,
145
+ firstVisitImplicit: () => firstVisitImplicit,
146
+ fullConsent: () => fullConsent,
147
+ minimalConsent: () => minimalConsent,
148
+ returningVisitor: () => returningVisitor
175
149
  });
176
- var fullConsent2 = {
150
+ var fullConsent = {
177
151
  title: "Full consent",
178
- description: "A Usercentrics onAcceptAllServices event emits a walker consent command with essential, functional, and marketing granted.",
179
- trigger: { type: "consent" },
180
- in: {
181
- event: "consent_status",
182
- type: "explicit",
183
- action: "onAcceptAllServices",
184
- ucCategory: {
185
- essential: true,
186
- functional: true,
187
- marketing: true
188
- }
189
- },
190
- out: [
191
- [
192
- "elb",
193
- "walker consent",
194
- {
195
- essential: true,
196
- functional: true,
197
- marketing: true
198
- }
199
- ]
200
- ]
152
+ description: "Usercentrics reports every category accepted via an explicit decision; the source emits a walker consent command granting essential, functional, and marketing.",
153
+ trigger: { type: "consent", options: { dispatch: "init" } },
154
+ in: servicesFullExplicit,
155
+ out: [["elb", "walker consent", fullConsentMapped]]
201
156
  };
202
- var minimalConsent2 = {
157
+ var minimalConsent = {
203
158
  title: "Minimal consent",
204
- description: "A Usercentrics onDenyAllServices event emits a walker consent command with only essential granted.",
205
- trigger: { type: "consent" },
206
- in: {
207
- event: "consent_status",
208
- type: "explicit",
209
- action: "onDenyAllServices",
210
- ucCategory: {
211
- essential: true,
212
- functional: false,
213
- marketing: false
214
- }
215
- },
159
+ description: 'A "Deny all" explicit decision leaves only essential granted; functional and marketing are emitted as false.',
160
+ trigger: { type: "consent", options: { dispatch: "init" } },
161
+ in: servicesMinimalExplicit,
162
+ out: [["elb", "walker consent", minimalConsentMapped]]
163
+ };
164
+ var returningVisitor = {
165
+ title: "Returning visitor static read",
166
+ description: "When the CMP is already initialized with a stored explicit decision, the static read at init re-publishes that choice without any further event.",
167
+ trigger: { type: "consent", options: { dispatch: "init" } },
168
+ in: servicesPartialExplicit,
216
169
  out: [
217
170
  [
218
171
  "elb",
219
172
  "walker consent",
220
173
  {
221
174
  essential: true,
222
- functional: false,
175
+ functional: true,
223
176
  marketing: false
224
177
  }
225
178
  ]
226
179
  ]
227
180
  };
181
+ var firstVisitImplicit = {
182
+ title: "First visit implicit (suppressed)",
183
+ description: "A first-visit snapshot carrying only implicit history is suppressed by the default explicitOnly gate, so no consent command is emitted.",
184
+ trigger: { type: "consent", options: { dispatch: "init" } },
185
+ in: servicesFirstVisitImplicit,
186
+ out: []
187
+ };
188
+ var consentChange = {
189
+ title: "Consent change via CMP event",
190
+ description: "An ACCEPT_ALL decision fires UC_UI_CMP_EVENT; the source re-reads the services and emits the updated consent.",
191
+ trigger: { type: "consent", options: { dispatch: "cmp" } },
192
+ in: servicesFullExplicit,
193
+ out: [["elb", "walker consent", fullConsentMapped]]
194
+ };
228
195
  var categoryMapOverride = {
229
196
  title: "Category map override",
230
- description: "Custom categoryMap remaps essential to functional and functional to analytics",
231
- trigger: { type: "consent" },
232
- in: {
233
- event: "consent_status",
234
- type: "explicit",
235
- ucCategory: {
236
- essential: true,
237
- functional: true,
238
- marketing: false
239
- }
240
- },
197
+ description: "A custom categoryMap remaps essential to functional and functional to analytics before emitting the walker consent command.",
198
+ trigger: { type: "consent", options: { dispatch: "init" } },
199
+ in: servicesFullExplicit,
241
200
  mapping: {
242
- categoryMap: { essential: "functional", functional: "analytics" }
243
- },
244
- out: [
245
- [
246
- "elb",
247
- "walker consent",
248
- {
249
- functional: true,
250
- analytics: true,
251
- marketing: false
252
- }
253
- ]
254
- ]
255
- };
256
- var customEventName = {
257
- title: "Custom event name",
258
- description: "Using UC_SDK_EVENT instead of ucEvent for Usercentrics SDK v2",
259
- trigger: { type: "consent", options: { eventName: "UC_SDK_EVENT" } },
260
- in: {
261
- event: "consent_status",
262
- type: "explicit",
263
- ucCategory: {
264
- essential: true,
265
- functional: true,
266
- marketing: true
201
+ settings: {
202
+ categoryMap: { essential: "functional", functional: "analytics" }
267
203
  }
268
204
  },
269
- mapping: { eventName: "UC_SDK_EVENT" },
270
- out: [
271
- [
272
- "elb",
273
- "walker consent",
274
- {
275
- essential: true,
276
- functional: true,
277
- marketing: true
278
- }
279
- ]
280
- ]
205
+ out: [["elb", "walker consent", fullConsentCustomMapped]]
281
206
  };
282
207
 
283
208
  // src/examples/trigger.ts
@@ -312,19 +237,15 @@ var trigger = (input, env) => {
312
237
  0 && (module.exports = {
313
238
  createMockElbFn,
314
239
  createTrigger,
315
- fullConsent,
316
240
  fullConsentCustomMapped,
317
241
  fullConsentMapped,
318
- fullConsentUpperCase,
319
- implicitConsent,
320
- minimalConsent,
321
242
  minimalConsentMapped,
322
- nonConsentEvent,
323
243
  noopLogger,
324
- partialConsent,
325
244
  partialConsentMapped,
326
- serviceLevelConsent,
327
- serviceLevelMapped,
245
+ servicesFirstVisitImplicit,
246
+ servicesFullExplicit,
247
+ servicesMinimalExplicit,
248
+ servicesPartialExplicit,
328
249
  step,
329
250
  trigger
330
251
  });
@@ -5,81 +5,62 @@ var __export = (target, all) => {
5
5
  };
6
6
 
7
7
  // src/examples/inputs.ts
8
- var fullConsent = {
9
- event: "consent_status",
10
- type: "explicit",
11
- action: "onAcceptAllServices",
12
- ucCategory: {
13
- essential: true,
14
- functional: true,
15
- marketing: true
8
+ var servicesFullExplicit = [
9
+ {
10
+ categorySlug: "essential",
11
+ consent: { status: true, history: [{ type: "explicit", status: true }] }
16
12
  },
17
- "Google Analytics": true,
18
- "Google Ads Remarketing": true
19
- };
20
- var partialConsent = {
21
- event: "consent_status",
22
- type: "explicit",
23
- action: "onUpdateServices",
24
- ucCategory: {
25
- essential: true,
26
- functional: true,
27
- marketing: false
13
+ {
14
+ categorySlug: "functional",
15
+ consent: { status: true, history: [{ type: "explicit", status: true }] }
28
16
  },
29
- "Google Analytics": true,
30
- "Google Ads Remarketing": false
31
- };
32
- var minimalConsent = {
33
- event: "consent_status",
34
- type: "explicit",
35
- action: "onDenyAllServices",
36
- ucCategory: {
37
- essential: true,
38
- functional: false,
39
- marketing: false
17
+ {
18
+ categorySlug: "marketing",
19
+ consent: { status: true, history: [{ type: "explicit", status: true }] }
20
+ }
21
+ ];
22
+ var servicesMinimalExplicit = [
23
+ {
24
+ categorySlug: "essential",
25
+ consent: { status: true, history: [{ type: "explicit", status: true }] }
40
26
  },
41
- "Google Analytics": false,
42
- "Google Ads Remarketing": false
43
- };
44
- var implicitConsent = {
45
- event: "consent_status",
46
- type: "implicit",
47
- ucCategory: {
48
- essential: true,
49
- functional: false,
50
- marketing: false
27
+ {
28
+ categorySlug: "functional",
29
+ consent: { status: false, history: [{ type: "explicit", status: false }] }
51
30
  },
52
- "Google Analytics": false,
53
- "Google Ads Remarketing": false
54
- };
55
- var fullConsentUpperCase = {
56
- event: "consent_status",
57
- type: "EXPLICIT",
58
- action: "onAcceptAllServices",
59
- ucCategory: {
60
- essential: true,
61
- functional: true,
62
- marketing: true
31
+ {
32
+ categorySlug: "marketing",
33
+ consent: { status: false, history: [{ type: "explicit", status: false }] }
63
34
  }
64
- };
65
- var serviceLevelConsent = {
66
- event: "consent_status",
67
- type: "explicit",
68
- action: "onUpdateServices",
69
- ucCategory: {
70
- essential: true,
71
- functional: "partial",
72
- // Non-boolean indicates mixed service choices
73
- marketing: "partial"
35
+ ];
36
+ var servicesPartialExplicit = [
37
+ {
38
+ categorySlug: "essential",
39
+ consent: { status: true, history: [{ type: "explicit", status: true }] }
74
40
  },
75
- "Google Analytics": true,
76
- "Google Ads Remarketing": false,
77
- Hotjar: true
78
- };
79
- var nonConsentEvent = {
80
- event: "other_event",
81
- type: "explicit"
82
- };
41
+ {
42
+ categorySlug: "functional",
43
+ consent: { status: true, history: [{ type: "explicit", status: true }] }
44
+ },
45
+ {
46
+ categorySlug: "marketing",
47
+ consent: { status: false, history: [{ type: "explicit", status: false }] }
48
+ }
49
+ ];
50
+ var servicesFirstVisitImplicit = [
51
+ {
52
+ categorySlug: "essential",
53
+ consent: { status: true, history: [{ type: "implicit", status: true }] }
54
+ },
55
+ {
56
+ categorySlug: "functional",
57
+ consent: { status: false, history: [{ type: "implicit", status: false }] }
58
+ },
59
+ {
60
+ categorySlug: "marketing",
61
+ consent: { status: false, history: [{ type: "implicit", status: false }] }
62
+ }
63
+ ];
83
64
 
84
65
  // src/examples/outputs.ts
85
66
  var fullConsentMapped = {
@@ -99,14 +80,9 @@ var minimalConsentMapped = {
99
80
  };
100
81
  var fullConsentCustomMapped = {
101
82
  functional: true,
83
+ analytics: true,
102
84
  marketing: true
103
85
  };
104
- var serviceLevelMapped = {
105
- essential: true,
106
- google_analytics: true,
107
- google_ads_remarketing: false,
108
- hotjar: true
109
- };
110
86
 
111
87
  // src/examples/env.ts
112
88
  var noop = () => {
@@ -133,115 +109,68 @@ var noopLogger = {
133
109
  var step_exports = {};
134
110
  __export(step_exports, {
135
111
  categoryMapOverride: () => categoryMapOverride,
136
- customEventName: () => customEventName,
137
- fullConsent: () => fullConsent2,
138
- minimalConsent: () => minimalConsent2
112
+ consentChange: () => consentChange,
113
+ firstVisitImplicit: () => firstVisitImplicit,
114
+ fullConsent: () => fullConsent,
115
+ minimalConsent: () => minimalConsent,
116
+ returningVisitor: () => returningVisitor
139
117
  });
140
- var fullConsent2 = {
118
+ var fullConsent = {
141
119
  title: "Full consent",
142
- description: "A Usercentrics onAcceptAllServices event emits a walker consent command with essential, functional, and marketing granted.",
143
- trigger: { type: "consent" },
144
- in: {
145
- event: "consent_status",
146
- type: "explicit",
147
- action: "onAcceptAllServices",
148
- ucCategory: {
149
- essential: true,
150
- functional: true,
151
- marketing: true
152
- }
153
- },
154
- out: [
155
- [
156
- "elb",
157
- "walker consent",
158
- {
159
- essential: true,
160
- functional: true,
161
- marketing: true
162
- }
163
- ]
164
- ]
120
+ description: "Usercentrics reports every category accepted via an explicit decision; the source emits a walker consent command granting essential, functional, and marketing.",
121
+ trigger: { type: "consent", options: { dispatch: "init" } },
122
+ in: servicesFullExplicit,
123
+ out: [["elb", "walker consent", fullConsentMapped]]
165
124
  };
166
- var minimalConsent2 = {
125
+ var minimalConsent = {
167
126
  title: "Minimal consent",
168
- description: "A Usercentrics onDenyAllServices event emits a walker consent command with only essential granted.",
169
- trigger: { type: "consent" },
170
- in: {
171
- event: "consent_status",
172
- type: "explicit",
173
- action: "onDenyAllServices",
174
- ucCategory: {
175
- essential: true,
176
- functional: false,
177
- marketing: false
178
- }
179
- },
127
+ description: 'A "Deny all" explicit decision leaves only essential granted; functional and marketing are emitted as false.',
128
+ trigger: { type: "consent", options: { dispatch: "init" } },
129
+ in: servicesMinimalExplicit,
130
+ out: [["elb", "walker consent", minimalConsentMapped]]
131
+ };
132
+ var returningVisitor = {
133
+ title: "Returning visitor static read",
134
+ description: "When the CMP is already initialized with a stored explicit decision, the static read at init re-publishes that choice without any further event.",
135
+ trigger: { type: "consent", options: { dispatch: "init" } },
136
+ in: servicesPartialExplicit,
180
137
  out: [
181
138
  [
182
139
  "elb",
183
140
  "walker consent",
184
141
  {
185
142
  essential: true,
186
- functional: false,
143
+ functional: true,
187
144
  marketing: false
188
145
  }
189
146
  ]
190
147
  ]
191
148
  };
149
+ var firstVisitImplicit = {
150
+ title: "First visit implicit (suppressed)",
151
+ description: "A first-visit snapshot carrying only implicit history is suppressed by the default explicitOnly gate, so no consent command is emitted.",
152
+ trigger: { type: "consent", options: { dispatch: "init" } },
153
+ in: servicesFirstVisitImplicit,
154
+ out: []
155
+ };
156
+ var consentChange = {
157
+ title: "Consent change via CMP event",
158
+ description: "An ACCEPT_ALL decision fires UC_UI_CMP_EVENT; the source re-reads the services and emits the updated consent.",
159
+ trigger: { type: "consent", options: { dispatch: "cmp" } },
160
+ in: servicesFullExplicit,
161
+ out: [["elb", "walker consent", fullConsentMapped]]
162
+ };
192
163
  var categoryMapOverride = {
193
164
  title: "Category map override",
194
- description: "Custom categoryMap remaps essential to functional and functional to analytics",
195
- trigger: { type: "consent" },
196
- in: {
197
- event: "consent_status",
198
- type: "explicit",
199
- ucCategory: {
200
- essential: true,
201
- functional: true,
202
- marketing: false
203
- }
204
- },
165
+ description: "A custom categoryMap remaps essential to functional and functional to analytics before emitting the walker consent command.",
166
+ trigger: { type: "consent", options: { dispatch: "init" } },
167
+ in: servicesFullExplicit,
205
168
  mapping: {
206
- categoryMap: { essential: "functional", functional: "analytics" }
207
- },
208
- out: [
209
- [
210
- "elb",
211
- "walker consent",
212
- {
213
- functional: true,
214
- analytics: true,
215
- marketing: false
216
- }
217
- ]
218
- ]
219
- };
220
- var customEventName = {
221
- title: "Custom event name",
222
- description: "Using UC_SDK_EVENT instead of ucEvent for Usercentrics SDK v2",
223
- trigger: { type: "consent", options: { eventName: "UC_SDK_EVENT" } },
224
- in: {
225
- event: "consent_status",
226
- type: "explicit",
227
- ucCategory: {
228
- essential: true,
229
- functional: true,
230
- marketing: true
169
+ settings: {
170
+ categoryMap: { essential: "functional", functional: "analytics" }
231
171
  }
232
172
  },
233
- mapping: { eventName: "UC_SDK_EVENT" },
234
- out: [
235
- [
236
- "elb",
237
- "walker consent",
238
- {
239
- essential: true,
240
- functional: true,
241
- marketing: true
242
- }
243
- ]
244
- ]
173
+ out: [["elb", "walker consent", fullConsentCustomMapped]]
245
174
  };
246
175
 
247
176
  // src/examples/trigger.ts
@@ -275,19 +204,15 @@ var trigger = (input, env) => {
275
204
  export {
276
205
  createMockElbFn,
277
206
  createTrigger,
278
- fullConsent,
279
207
  fullConsentCustomMapped,
280
208
  fullConsentMapped,
281
- fullConsentUpperCase,
282
- implicitConsent,
283
- minimalConsent,
284
209
  minimalConsentMapped,
285
- nonConsentEvent,
286
210
  noopLogger,
287
- partialConsent,
288
211
  partialConsentMapped,
289
- serviceLevelConsent,
290
- serviceLevelMapped,
212
+ servicesFirstVisitImplicit,
213
+ servicesFullExplicit,
214
+ servicesMinimalExplicit,
215
+ servicesPartialExplicit,
291
216
  step_exports as step,
292
217
  trigger
293
218
  };