@walkeros/web-source-cmp-cookiefirst 3.0.2 → 3.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/dist/index.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- import { Source, Elb, WalkerOS, Logger, Flow } from '@walkeros/core';
1
+ import { Source, Elb, WalkerOS, Logger, Flow, Trigger } from '@walkeros/core';
2
2
 
3
3
  /**
4
4
  * CookieFirst consent object structure
5
5
  */
6
- interface CookieFirstConsent {
6
+ interface CookieFirstConsent$1 {
7
7
  necessary?: boolean;
8
8
  functional?: boolean;
9
9
  performance?: boolean;
@@ -14,7 +14,7 @@ interface CookieFirstConsent {
14
14
  * CookieFirst global API interface
15
15
  */
16
16
  interface CookieFirstAPI {
17
- consent: CookieFirstConsent | null;
17
+ consent: CookieFirstConsent$1 | null;
18
18
  }
19
19
  declare global {
20
20
  interface Window {
@@ -23,7 +23,7 @@ declare global {
23
23
  }
24
24
  interface WindowEventMap {
25
25
  cf_init: Event;
26
- cf_consent: CustomEvent<CookieFirstConsent>;
26
+ cf_consent: CustomEvent<CookieFirstConsent$1>;
27
27
  }
28
28
  }
29
29
  /**
@@ -88,7 +88,6 @@ type Config = Source.Config<Types>;
88
88
 
89
89
  type index_Config = Config;
90
90
  type index_CookieFirstAPI = CookieFirstAPI;
91
- type index_CookieFirstConsent = CookieFirstConsent;
92
91
  type index_Env = Env;
93
92
  type index_InitSettings = InitSettings;
94
93
  type index_Mapping = Mapping;
@@ -96,7 +95,7 @@ type index_Push = Push;
96
95
  type index_Settings = Settings;
97
96
  type index_Types = Types;
98
97
  declare namespace index {
99
- export type { index_Config as Config, index_CookieFirstAPI as CookieFirstAPI, index_CookieFirstConsent as CookieFirstConsent, index_Env as Env, index_InitSettings as InitSettings, index_Mapping as Mapping, index_Push as Push, index_Settings as Settings, index_Types as Types };
98
+ export type { index_Config as Config, index_CookieFirstAPI as CookieFirstAPI, CookieFirstConsent$1 as CookieFirstConsent, index_Env as Env, index_InitSettings as InitSettings, index_Mapping as Mapping, index_Push as Push, index_Settings as Settings, index_Types as Types };
100
99
  }
101
100
 
102
101
  /**
@@ -107,28 +106,28 @@ declare namespace index {
107
106
  /**
108
107
  * Full consent - user accepted all categories
109
108
  */
110
- declare const fullConsent$1: CookieFirstConsent;
109
+ declare const fullConsent$1: CookieFirstConsent$1;
111
110
  /**
112
111
  * Partial consent - user accepted only necessary and functional
113
112
  */
114
- declare const partialConsent$1: CookieFirstConsent;
113
+ declare const partialConsent$1: CookieFirstConsent$1;
115
114
  /**
116
115
  * Minimal consent - user accepted only necessary (required)
117
116
  */
118
- declare const minimalConsent: CookieFirstConsent;
117
+ declare const minimalConsent: CookieFirstConsent$1;
119
118
  /**
120
119
  * No consent - user hasn't made a choice yet
121
120
  * CookieFirst returns null when no explicit choice has been made
122
121
  */
123
- declare const noConsent: CookieFirstConsent | null;
122
+ declare const noConsent: CookieFirstConsent$1 | null;
124
123
  /**
125
124
  * Analytics only - user accepted performance tracking
126
125
  */
127
- declare const analyticsOnlyConsent: CookieFirstConsent;
126
+ declare const analyticsOnlyConsent: CookieFirstConsent$1;
128
127
  /**
129
128
  * Marketing only - user accepted advertising
130
129
  */
131
- declare const marketingOnlyConsent: CookieFirstConsent;
130
+ declare const marketingOnlyConsent: CookieFirstConsent$1;
132
131
 
133
132
  /**
134
133
  * Expected walkerOS consent outputs.
@@ -179,11 +178,11 @@ interface CookieFirstEnv extends Source.BaseEnv {
179
178
  /**
180
179
  * Create a mock CookieFirst API object
181
180
  */
182
- declare const createMockCookieFirstAPI: (consent?: CookieFirstConsent | null) => CookieFirstAPI;
181
+ declare const createMockCookieFirstAPI: (consent?: CookieFirstConsent$1 | null) => CookieFirstAPI;
183
182
  /**
184
183
  * Create a mock window object with CookieFirst
185
184
  */
186
- declare const createMockWindow: (consent?: CookieFirstConsent | null) => Partial<Window> & {
185
+ declare const createMockWindow: (consent?: CookieFirstConsent$1 | null) => Partial<Window> & {
187
186
  CookieFirst: CookieFirstAPI;
188
187
  };
189
188
  /**
@@ -207,8 +206,16 @@ declare namespace step {
207
206
  export { step_categoryMapOverride as categoryMapOverride, step_cfInitDetection as cfInitDetection, step_fullConsent as fullConsent, step_partialConsent as partialConsent };
208
207
  }
209
208
 
210
- /** Sets window.CookieFirst.consent before source init. */
211
- declare const setup: Source.SetupFn;
209
+ interface CookieFirstConsent {
210
+ necessary?: boolean;
211
+ functional?: boolean;
212
+ performance?: boolean;
213
+ advertising?: boolean;
214
+ [category: string]: boolean | undefined;
215
+ }
216
+ declare const createTrigger: Trigger.CreateFn<CookieFirstConsent, void>;
217
+ /** Sets window.CookieFirst.consent before source init (legacy). */
218
+ declare const trigger: (input: unknown, env: Record<string, unknown>) => void;
212
219
 
213
220
  /**
214
221
  * Default category mapping from CookieFirst to walkerOS consent groups.
@@ -247,4 +254,4 @@ declare const DEFAULT_CATEGORY_MAP: Record<string, string>;
247
254
  */
248
255
  declare const sourceCookieFirst: Source.Init<Types>;
249
256
 
250
- export { DEFAULT_CATEGORY_MAP, index as SourceCookieFirst, analyticsOnlyConsent, analyticsOnlyMapped, createMockCookieFirstAPI, createMockElbFn, createMockWindow, sourceCookieFirst as default, fullConsent$1 as fullConsent, fullConsentMapped, marketingOnlyConsent, marketingOnlyMapped, minimalConsent, minimalConsentMapped, mockEnv, noConsent, noopLogger, partialConsent$1 as partialConsent, partialConsentMapped, setup, sourceCookieFirst, step };
257
+ export { DEFAULT_CATEGORY_MAP, index as SourceCookieFirst, analyticsOnlyConsent, analyticsOnlyMapped, createMockCookieFirstAPI, createMockElbFn, createMockWindow, createTrigger, sourceCookieFirst as default, fullConsent$1 as fullConsent, fullConsentMapped, marketingOnlyConsent, marketingOnlyMapped, minimalConsent, minimalConsentMapped, mockEnv, noConsent, noopLogger, partialConsent$1 as partialConsent, partialConsentMapped, sourceCookieFirst, step, trigger };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { Source, Elb, WalkerOS, Logger, Flow } from '@walkeros/core';
1
+ import { Source, Elb, WalkerOS, Logger, Flow, Trigger } from '@walkeros/core';
2
2
 
3
3
  /**
4
4
  * CookieFirst consent object structure
5
5
  */
6
- interface CookieFirstConsent {
6
+ interface CookieFirstConsent$1 {
7
7
  necessary?: boolean;
8
8
  functional?: boolean;
9
9
  performance?: boolean;
@@ -14,7 +14,7 @@ interface CookieFirstConsent {
14
14
  * CookieFirst global API interface
15
15
  */
16
16
  interface CookieFirstAPI {
17
- consent: CookieFirstConsent | null;
17
+ consent: CookieFirstConsent$1 | null;
18
18
  }
19
19
  declare global {
20
20
  interface Window {
@@ -23,7 +23,7 @@ declare global {
23
23
  }
24
24
  interface WindowEventMap {
25
25
  cf_init: Event;
26
- cf_consent: CustomEvent<CookieFirstConsent>;
26
+ cf_consent: CustomEvent<CookieFirstConsent$1>;
27
27
  }
28
28
  }
29
29
  /**
@@ -88,7 +88,6 @@ type Config = Source.Config<Types>;
88
88
 
89
89
  type index_Config = Config;
90
90
  type index_CookieFirstAPI = CookieFirstAPI;
91
- type index_CookieFirstConsent = CookieFirstConsent;
92
91
  type index_Env = Env;
93
92
  type index_InitSettings = InitSettings;
94
93
  type index_Mapping = Mapping;
@@ -96,7 +95,7 @@ type index_Push = Push;
96
95
  type index_Settings = Settings;
97
96
  type index_Types = Types;
98
97
  declare namespace index {
99
- export type { index_Config as Config, index_CookieFirstAPI as CookieFirstAPI, index_CookieFirstConsent as CookieFirstConsent, index_Env as Env, index_InitSettings as InitSettings, index_Mapping as Mapping, index_Push as Push, index_Settings as Settings, index_Types as Types };
98
+ export type { index_Config as Config, index_CookieFirstAPI as CookieFirstAPI, CookieFirstConsent$1 as CookieFirstConsent, index_Env as Env, index_InitSettings as InitSettings, index_Mapping as Mapping, index_Push as Push, index_Settings as Settings, index_Types as Types };
100
99
  }
101
100
 
102
101
  /**
@@ -107,28 +106,28 @@ declare namespace index {
107
106
  /**
108
107
  * Full consent - user accepted all categories
109
108
  */
110
- declare const fullConsent$1: CookieFirstConsent;
109
+ declare const fullConsent$1: CookieFirstConsent$1;
111
110
  /**
112
111
  * Partial consent - user accepted only necessary and functional
113
112
  */
114
- declare const partialConsent$1: CookieFirstConsent;
113
+ declare const partialConsent$1: CookieFirstConsent$1;
115
114
  /**
116
115
  * Minimal consent - user accepted only necessary (required)
117
116
  */
118
- declare const minimalConsent: CookieFirstConsent;
117
+ declare const minimalConsent: CookieFirstConsent$1;
119
118
  /**
120
119
  * No consent - user hasn't made a choice yet
121
120
  * CookieFirst returns null when no explicit choice has been made
122
121
  */
123
- declare const noConsent: CookieFirstConsent | null;
122
+ declare const noConsent: CookieFirstConsent$1 | null;
124
123
  /**
125
124
  * Analytics only - user accepted performance tracking
126
125
  */
127
- declare const analyticsOnlyConsent: CookieFirstConsent;
126
+ declare const analyticsOnlyConsent: CookieFirstConsent$1;
128
127
  /**
129
128
  * Marketing only - user accepted advertising
130
129
  */
131
- declare const marketingOnlyConsent: CookieFirstConsent;
130
+ declare const marketingOnlyConsent: CookieFirstConsent$1;
132
131
 
133
132
  /**
134
133
  * Expected walkerOS consent outputs.
@@ -179,11 +178,11 @@ interface CookieFirstEnv extends Source.BaseEnv {
179
178
  /**
180
179
  * Create a mock CookieFirst API object
181
180
  */
182
- declare const createMockCookieFirstAPI: (consent?: CookieFirstConsent | null) => CookieFirstAPI;
181
+ declare const createMockCookieFirstAPI: (consent?: CookieFirstConsent$1 | null) => CookieFirstAPI;
183
182
  /**
184
183
  * Create a mock window object with CookieFirst
185
184
  */
186
- declare const createMockWindow: (consent?: CookieFirstConsent | null) => Partial<Window> & {
185
+ declare const createMockWindow: (consent?: CookieFirstConsent$1 | null) => Partial<Window> & {
187
186
  CookieFirst: CookieFirstAPI;
188
187
  };
189
188
  /**
@@ -207,8 +206,16 @@ declare namespace step {
207
206
  export { step_categoryMapOverride as categoryMapOverride, step_cfInitDetection as cfInitDetection, step_fullConsent as fullConsent, step_partialConsent as partialConsent };
208
207
  }
209
208
 
210
- /** Sets window.CookieFirst.consent before source init. */
211
- declare const setup: Source.SetupFn;
209
+ interface CookieFirstConsent {
210
+ necessary?: boolean;
211
+ functional?: boolean;
212
+ performance?: boolean;
213
+ advertising?: boolean;
214
+ [category: string]: boolean | undefined;
215
+ }
216
+ declare const createTrigger: Trigger.CreateFn<CookieFirstConsent, void>;
217
+ /** Sets window.CookieFirst.consent before source init (legacy). */
218
+ declare const trigger: (input: unknown, env: Record<string, unknown>) => void;
212
219
 
213
220
  /**
214
221
  * Default category mapping from CookieFirst to walkerOS consent groups.
@@ -247,4 +254,4 @@ declare const DEFAULT_CATEGORY_MAP: Record<string, string>;
247
254
  */
248
255
  declare const sourceCookieFirst: Source.Init<Types>;
249
256
 
250
- export { DEFAULT_CATEGORY_MAP, index as SourceCookieFirst, analyticsOnlyConsent, analyticsOnlyMapped, createMockCookieFirstAPI, createMockElbFn, createMockWindow, sourceCookieFirst as default, fullConsent$1 as fullConsent, fullConsentMapped, marketingOnlyConsent, marketingOnlyMapped, minimalConsent, minimalConsentMapped, mockEnv, noConsent, noopLogger, partialConsent$1 as partialConsent, partialConsentMapped, setup, sourceCookieFirst, step };
257
+ export { DEFAULT_CATEGORY_MAP, index as SourceCookieFirst, analyticsOnlyConsent, analyticsOnlyMapped, createMockCookieFirstAPI, createMockElbFn, createMockWindow, createTrigger, sourceCookieFirst as default, fullConsent$1 as fullConsent, fullConsentMapped, marketingOnlyConsent, marketingOnlyMapped, minimalConsent, minimalConsentMapped, mockEnv, noConsent, noopLogger, partialConsent$1 as partialConsent, partialConsentMapped, sourceCookieFirst, step, trigger };