@walkeros/web-source-cmp-cookiepro 3.3.1 → 3.4.0-next-1776749829492

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/dev.d.mts CHANGED
@@ -1,4 +1,6 @@
1
1
  import { WalkerOS, Elb, Logger, Flow, Trigger } from '@walkeros/core';
2
+ import * as _walkeros_core_dev from '@walkeros/core/dev';
3
+ import { z } from '@walkeros/core/dev';
2
4
 
3
5
  /**
4
6
  * Example CookiePro OptanonActiveGroups strings.
@@ -143,24 +145,43 @@ declare const createTrigger: Trigger.CreateFn<string, void>;
143
145
  /** Sets OptanonActiveGroups and OneTrust globals before source init. */
144
146
  declare const trigger: (input: unknown, env: Record<string, unknown>) => void;
145
147
 
146
- declare const index_analyticsOnlyConsent: typeof analyticsOnlyConsent;
147
- declare const index_analyticsOnlyMapped: typeof analyticsOnlyMapped;
148
- declare const index_createMockElbFn: typeof createMockElbFn;
149
- declare const index_createMockOneTrustAPI: typeof createMockOneTrustAPI;
150
- declare const index_createTrigger: typeof createTrigger;
151
- declare const index_customCategoryConsent: typeof customCategoryConsent;
152
- declare const index_emptyConsent: typeof emptyConsent;
153
- declare const index_fullConsentMapped: typeof fullConsentMapped;
154
- declare const index_marketingOnlyConsent: typeof marketingOnlyConsent;
155
- declare const index_marketingOnlyMapped: typeof marketingOnlyMapped;
156
- declare const index_minimalConsentMapped: typeof minimalConsentMapped;
157
- declare const index_noopLogger: typeof noopLogger;
158
- declare const index_partialConsent: typeof partialConsent;
159
- declare const index_partialConsentMapped: typeof partialConsentMapped;
160
- declare const index_step: typeof step;
161
- declare const index_trigger: typeof trigger;
148
+ declare const index$1_analyticsOnlyConsent: typeof analyticsOnlyConsent;
149
+ declare const index$1_analyticsOnlyMapped: typeof analyticsOnlyMapped;
150
+ declare const index$1_createMockElbFn: typeof createMockElbFn;
151
+ declare const index$1_createMockOneTrustAPI: typeof createMockOneTrustAPI;
152
+ declare const index$1_createTrigger: typeof createTrigger;
153
+ declare const index$1_customCategoryConsent: typeof customCategoryConsent;
154
+ declare const index$1_emptyConsent: typeof emptyConsent;
155
+ declare const index$1_fullConsentMapped: typeof fullConsentMapped;
156
+ declare const index$1_marketingOnlyConsent: typeof marketingOnlyConsent;
157
+ declare const index$1_marketingOnlyMapped: typeof marketingOnlyMapped;
158
+ declare const index$1_minimalConsentMapped: typeof minimalConsentMapped;
159
+ declare const index$1_noopLogger: typeof noopLogger;
160
+ declare const index$1_partialConsent: typeof partialConsent;
161
+ declare const index$1_partialConsentMapped: typeof partialConsentMapped;
162
+ declare const index$1_step: typeof step;
163
+ declare const index$1_trigger: typeof trigger;
164
+ declare namespace index$1 {
165
+ export { index$1_analyticsOnlyConsent as analyticsOnlyConsent, index$1_analyticsOnlyMapped as analyticsOnlyMapped, index$1_createMockElbFn as createMockElbFn, index$1_createMockOneTrustAPI as createMockOneTrustAPI, index$1_createTrigger as createTrigger, index$1_customCategoryConsent as customCategoryConsent, index$1_emptyConsent as emptyConsent, fullConsent$1 as fullConsent, index$1_fullConsentMapped as fullConsentMapped, index$1_marketingOnlyConsent as marketingOnlyConsent, index$1_marketingOnlyMapped as marketingOnlyMapped, minimalConsent$1 as minimalConsent, index$1_minimalConsentMapped as minimalConsentMapped, index$1_noopLogger as noopLogger, index$1_partialConsent as partialConsent, index$1_partialConsentMapped as partialConsentMapped, index$1_step as step, index$1_trigger as trigger };
166
+ }
167
+
168
+ /**
169
+ * CookiePro / OneTrust source settings schema
170
+ */
171
+ declare const SettingsSchema: z.ZodObject<{
172
+ categoryMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
173
+ explicitOnly: z.ZodOptional<z.ZodBoolean>;
174
+ globalName: z.ZodOptional<z.ZodString>;
175
+ }, z.core.$strip>;
176
+ type Settings = z.infer<typeof SettingsSchema>;
177
+
178
+ declare const settings: _walkeros_core_dev.JSONSchema;
179
+
180
+ type index_Settings = Settings;
181
+ declare const index_SettingsSchema: typeof SettingsSchema;
182
+ declare const index_settings: typeof settings;
162
183
  declare namespace index {
163
- export { index_analyticsOnlyConsent as analyticsOnlyConsent, index_analyticsOnlyMapped as analyticsOnlyMapped, index_createMockElbFn as createMockElbFn, index_createMockOneTrustAPI as createMockOneTrustAPI, index_createTrigger as createTrigger, index_customCategoryConsent as customCategoryConsent, index_emptyConsent as emptyConsent, fullConsent$1 as fullConsent, index_fullConsentMapped as fullConsentMapped, index_marketingOnlyConsent as marketingOnlyConsent, index_marketingOnlyMapped as marketingOnlyMapped, minimalConsent$1 as minimalConsent, index_minimalConsentMapped as minimalConsentMapped, index_noopLogger as noopLogger, index_partialConsent as partialConsent, index_partialConsentMapped as partialConsentMapped, index_step as step, index_trigger as trigger };
184
+ export { type index_Settings as Settings, index_SettingsSchema as SettingsSchema, index_settings as settings };
164
185
  }
165
186
 
166
- export { index as examples };
187
+ export { index$1 as examples, index as schemas };
package/dist/dev.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import { WalkerOS, Elb, Logger, Flow, Trigger } from '@walkeros/core';
2
+ import * as _walkeros_core_dev from '@walkeros/core/dev';
3
+ import { z } from '@walkeros/core/dev';
2
4
 
3
5
  /**
4
6
  * Example CookiePro OptanonActiveGroups strings.
@@ -143,24 +145,43 @@ declare const createTrigger: Trigger.CreateFn<string, void>;
143
145
  /** Sets OptanonActiveGroups and OneTrust globals before source init. */
144
146
  declare const trigger: (input: unknown, env: Record<string, unknown>) => void;
145
147
 
146
- declare const index_analyticsOnlyConsent: typeof analyticsOnlyConsent;
147
- declare const index_analyticsOnlyMapped: typeof analyticsOnlyMapped;
148
- declare const index_createMockElbFn: typeof createMockElbFn;
149
- declare const index_createMockOneTrustAPI: typeof createMockOneTrustAPI;
150
- declare const index_createTrigger: typeof createTrigger;
151
- declare const index_customCategoryConsent: typeof customCategoryConsent;
152
- declare const index_emptyConsent: typeof emptyConsent;
153
- declare const index_fullConsentMapped: typeof fullConsentMapped;
154
- declare const index_marketingOnlyConsent: typeof marketingOnlyConsent;
155
- declare const index_marketingOnlyMapped: typeof marketingOnlyMapped;
156
- declare const index_minimalConsentMapped: typeof minimalConsentMapped;
157
- declare const index_noopLogger: typeof noopLogger;
158
- declare const index_partialConsent: typeof partialConsent;
159
- declare const index_partialConsentMapped: typeof partialConsentMapped;
160
- declare const index_step: typeof step;
161
- declare const index_trigger: typeof trigger;
148
+ declare const index$1_analyticsOnlyConsent: typeof analyticsOnlyConsent;
149
+ declare const index$1_analyticsOnlyMapped: typeof analyticsOnlyMapped;
150
+ declare const index$1_createMockElbFn: typeof createMockElbFn;
151
+ declare const index$1_createMockOneTrustAPI: typeof createMockOneTrustAPI;
152
+ declare const index$1_createTrigger: typeof createTrigger;
153
+ declare const index$1_customCategoryConsent: typeof customCategoryConsent;
154
+ declare const index$1_emptyConsent: typeof emptyConsent;
155
+ declare const index$1_fullConsentMapped: typeof fullConsentMapped;
156
+ declare const index$1_marketingOnlyConsent: typeof marketingOnlyConsent;
157
+ declare const index$1_marketingOnlyMapped: typeof marketingOnlyMapped;
158
+ declare const index$1_minimalConsentMapped: typeof minimalConsentMapped;
159
+ declare const index$1_noopLogger: typeof noopLogger;
160
+ declare const index$1_partialConsent: typeof partialConsent;
161
+ declare const index$1_partialConsentMapped: typeof partialConsentMapped;
162
+ declare const index$1_step: typeof step;
163
+ declare const index$1_trigger: typeof trigger;
164
+ declare namespace index$1 {
165
+ export { index$1_analyticsOnlyConsent as analyticsOnlyConsent, index$1_analyticsOnlyMapped as analyticsOnlyMapped, index$1_createMockElbFn as createMockElbFn, index$1_createMockOneTrustAPI as createMockOneTrustAPI, index$1_createTrigger as createTrigger, index$1_customCategoryConsent as customCategoryConsent, index$1_emptyConsent as emptyConsent, fullConsent$1 as fullConsent, index$1_fullConsentMapped as fullConsentMapped, index$1_marketingOnlyConsent as marketingOnlyConsent, index$1_marketingOnlyMapped as marketingOnlyMapped, minimalConsent$1 as minimalConsent, index$1_minimalConsentMapped as minimalConsentMapped, index$1_noopLogger as noopLogger, index$1_partialConsent as partialConsent, index$1_partialConsentMapped as partialConsentMapped, index$1_step as step, index$1_trigger as trigger };
166
+ }
167
+
168
+ /**
169
+ * CookiePro / OneTrust source settings schema
170
+ */
171
+ declare const SettingsSchema: z.ZodObject<{
172
+ categoryMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
173
+ explicitOnly: z.ZodOptional<z.ZodBoolean>;
174
+ globalName: z.ZodOptional<z.ZodString>;
175
+ }, z.core.$strip>;
176
+ type Settings = z.infer<typeof SettingsSchema>;
177
+
178
+ declare const settings: _walkeros_core_dev.JSONSchema;
179
+
180
+ type index_Settings = Settings;
181
+ declare const index_SettingsSchema: typeof SettingsSchema;
182
+ declare const index_settings: typeof settings;
162
183
  declare namespace index {
163
- export { index_analyticsOnlyConsent as analyticsOnlyConsent, index_analyticsOnlyMapped as analyticsOnlyMapped, index_createMockElbFn as createMockElbFn, index_createMockOneTrustAPI as createMockOneTrustAPI, index_createTrigger as createTrigger, index_customCategoryConsent as customCategoryConsent, index_emptyConsent as emptyConsent, fullConsent$1 as fullConsent, index_fullConsentMapped as fullConsentMapped, index_marketingOnlyConsent as marketingOnlyConsent, index_marketingOnlyMapped as marketingOnlyMapped, minimalConsent$1 as minimalConsent, index_minimalConsentMapped as minimalConsentMapped, index_noopLogger as noopLogger, index_partialConsent as partialConsent, index_partialConsentMapped as partialConsentMapped, index_step as step, index_trigger as trigger };
184
+ export { type index_Settings as Settings, index_SettingsSchema as SettingsSchema, index_settings as settings };
164
185
  }
165
186
 
166
- export { index as examples };
187
+ export { index$1 as examples, index as schemas };
package/dist/dev.js CHANGED
@@ -1 +1 @@
1
- "use strict";var t,e=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})},i={};a(i,{examples:()=>s}),module.exports=(t=i,((t,a,i,s)=>{if(a&&"object"==typeof a||"function"==typeof a)for(let l of r(a))o.call(t,l)||l===i||e(t,l,{get:()=>a[l],enumerable:!(s=n(a,l))||s.enumerable});return t})(e({},"__esModule",{value:!0}),t));var s={};a(s,{analyticsOnlyConsent:()=>p,analyticsOnlyMapped:()=>O,createMockElbFn:()=>M,createMockOneTrustAPI:()=>v,createTrigger:()=>h,customCategoryConsent:()=>y,emptyConsent:()=>g,fullConsent:()=>l,fullConsentMapped:()=>m,marketingOnlyConsent:()=>u,marketingOnlyMapped:()=>w,minimalConsent:()=>C,minimalConsentMapped:()=>f,noopLogger:()=>b,partialConsent:()=>c,partialConsentMapped:()=>d,step:()=>A,trigger:()=>B});var l=",C0001,C0002,C0003,C0004,C0005,",c=",C0001,C0003,",C=",C0001,",p=",C0001,C0002,",u=",C0001,C0004,",g="",y=",C0001,CUSTOM01,CUSTOM02,",m={functional:!0,analytics:!0,marketing:!0},d={functional:!0,analytics:!1,marketing:!1},f={functional:!0,analytics:!1,marketing:!1},O={functional:!0,analytics:!0,marketing:!1},w={functional:!0,analytics:!1,marketing:!0},k=()=>{},M=()=>()=>Promise.resolve({ok:!0}),b={error:k,warn:k,info:k,debug:k,throw:t=>{throw"string"==typeof t?new Error(t):t},json:k,scope:()=>b},v=(t=!1)=>({IsAlertBoxClosed:()=>t}),A={};a(A,{categoryMapOverride:()=>x,fullConsent:()=>T,minimalConsent:()=>j,sdkLoadedDetection:()=>I});var T={trigger:{type:"consent"},in:",C0001,C0002,C0003,C0004,C0005,",out:{functional:!0,analytics:!0,marketing:!0}},j={trigger:{type:"consent"},in:",C0001,",out:{functional:!0,analytics:!1,marketing:!1}},x={description:"Custom categoryMap remaps C0002 from analytics to statistics",trigger:{type:"consent"},in:",C0001,C0002,",mapping:{categoryMap:{C0002:"statistics"}},out:{functional:!0,statistics:!0,marketing:!1}},I={description:"Immediate detection when OneTrust SDK is already loaded with IsAlertBoxClosed() = true",trigger:{type:"consent"},in:",C0001,C0003,C0004,",out:{functional:!0,analytics:!1,marketing:!0}},P=require("@walkeros/collector"),h=async t=>{let e;return{get flow(){return e},trigger:()=>async n=>{var r;const o=window;if(o.OptanonActiveGroups=n,o.OneTrust={IsAlertBoxClosed:()=>!0},!e){const n=await(0,P.startFlow)({...t,run:null==(r=t.run)||r});e={collector:n.collector,elb:n.elb}}}}},B=(t,e)=>{const n=e.window;"string"==typeof t&&(n.OptanonActiveGroups=t,n.OneTrust={IsAlertBoxClosed:()=>!0})};//# sourceMappingURL=dev.js.map
1
+ "use strict";var e,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,a=(e,n)=>{for(var o in n)t(e,o,{get:n[o],enumerable:!0})},s={};a(s,{examples:()=>i,schemas:()=>I}),module.exports=(e=s,((e,a,s,i)=>{if(a&&"object"==typeof a||"function"==typeof a)for(let l of o(a))r.call(e,l)||l===s||t(e,l,{get:()=>a[l],enumerable:!(i=n(a,l))||i.enumerable});return e})(t({},"__esModule",{value:!0}),e));var i={};a(i,{analyticsOnlyConsent:()=>p,analyticsOnlyMapped:()=>O,createMockElbFn:()=>b,createMockOneTrustAPI:()=>v,createTrigger:()=>j,customCategoryConsent:()=>y,emptyConsent:()=>C,fullConsent:()=>l,fullConsentMapped:()=>m,marketingOnlyConsent:()=>g,marketingOnlyMapped:()=>k,minimalConsent:()=>u,minimalConsentMapped:()=>f,noopLogger:()=>M,partialConsent:()=>c,partialConsentMapped:()=>d,step:()=>h,trigger:()=>z});var l=",C0001,C0002,C0003,C0004,C0005,",c=",C0001,C0003,",u=",C0001,",p=",C0001,C0002,",g=",C0001,C0004,",C="",y=",C0001,CUSTOM01,CUSTOM02,",m={functional:!0,analytics:!0,marketing:!0},d={functional:!0,analytics:!1,marketing:!1},f={functional:!0,analytics:!1,marketing:!1},O={functional:!0,analytics:!0,marketing:!1},k={functional:!0,analytics:!1,marketing:!0},w=()=>{},b=()=>()=>Promise.resolve({ok:!0}),M={error:w,warn:w,info:w,debug:w,throw:e=>{throw"string"==typeof e?new Error(e):e},json:w,scope:()=>M},v=(e=!1)=>({IsAlertBoxClosed:()=>e}),h={};a(h,{categoryMapOverride:()=>S,fullConsent:()=>T,minimalConsent:()=>P,sdkLoadedDetection:()=>x});var T={trigger:{type:"consent"},in:",C0001,C0002,C0003,C0004,C0005,",out:[["elb","walker consent",{functional:!0,analytics:!0,marketing:!0}]]},P={trigger:{type:"consent"},in:",C0001,",out:[["elb","walker consent",{functional:!0,analytics:!1,marketing:!1}]]},S={description:"Custom categoryMap remaps C0002 from analytics to statistics",trigger:{type:"consent"},in:",C0001,C0002,",mapping:{categoryMap:{C0002:"statistics"}},out:[["elb","walker consent",{functional:!0,statistics:!0,marketing:!1}]]},x={description:"Immediate detection when OneTrust SDK is already loaded with IsAlertBoxClosed() = true",trigger:{type:"consent"},in:",C0001,C0003,C0004,",out:[["elb","walker consent",{functional:!0,analytics:!1,marketing:!0}]]},A=require("@walkeros/collector"),j=async e=>{let t;return{get flow(){return t},trigger:()=>async n=>{var o;const r=window;if(r.OptanonActiveGroups=n,r.OneTrust={IsAlertBoxClosed:()=>!0},!t){const n=await(0,A.startFlow)({...e,run:null==(o=e.run)||o});t={collector:n.collector,elb:n.elb}}}}},z=(e,t)=>{const n=t.window;"string"==typeof e&&(n.OptanonActiveGroups=e,n.OneTrust={IsAlertBoxClosed:()=>!0})},I={};a(I,{SettingsSchema:()=>q,settings:()=>E});var B=require("@walkeros/core/dev"),D=require("@walkeros/core/dev"),q=D.z.object({categoryMap:D.z.record(D.z.string(),D.z.string()).describe("Map the CMP's consent categories (keys) to walkerOS consent groups (values).").optional(),explicitOnly:D.z.boolean().describe("Only process consent after the user closed the OneTrust banner (IsAlertBoxClosed). Default: true.").optional(),globalName:D.z.string().describe("Custom name for the OneTrust global on window. Default: 'OneTrust'.").optional()}).meta({id:"CookieProSettings",title:"Settings",description:"Settings for the CookiePro / OneTrust CMP source."}),E=(0,B.zodToSchema)(q);//# sourceMappingURL=dev.js.map
package/dist/dev.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/dev.ts","../src/examples/index.ts","../src/examples/inputs.ts","../src/examples/outputs.ts","../src/examples/env.ts","../src/examples/step.ts","../src/examples/trigger.ts"],"sourcesContent":["/**\n * Development exports for testing and tooling.\n */\nexport * as examples from './examples';\n","export * from './inputs';\nexport * from './outputs';\nexport * from './env';\nexport * as step from './step';\nexport { createTrigger, trigger } from './trigger';\n","/**\n * Example CookiePro OptanonActiveGroups strings.\n *\n * These represent real consent states from CookiePro/OneTrust CMP.\n * Format: comma-separated active category IDs with leading/trailing commas.\n * Only active groups are listed. Absence means denied.\n */\n\n/**\n * Full consent - user accepted all categories\n */\nexport const fullConsent = ',C0001,C0002,C0003,C0004,C0005,';\n\n/**\n * Partial consent - necessary + functional only\n */\nexport const partialConsent = ',C0001,C0003,';\n\n/**\n * Minimal consent - only strictly necessary (always active)\n */\nexport const minimalConsent = ',C0001,';\n\n/**\n * Analytics only - necessary + performance\n */\nexport const analyticsOnlyConsent = ',C0001,C0002,';\n\n/**\n * Marketing only - necessary + targeting\n */\nexport const marketingOnlyConsent = ',C0001,C0004,';\n\n/**\n * Empty string - no consent yet or cleared\n */\nexport const emptyConsent = '';\n\n/**\n * Custom category IDs - some installations use custom IDs\n */\nexport const customCategoryConsent = ',C0001,CUSTOM01,CUSTOM02,';\n","import type { WalkerOS } from '@walkeros/core';\n\n/**\n * Expected walkerOS consent outputs.\n *\n * These represent the consent state after parsing OptanonActiveGroups\n * and mapping through the default categoryMap.\n *\n * Default map:\n * - C0001 -> functional\n * - C0002 -> analytics\n * - C0003 -> functional\n * - C0004 -> marketing\n * - C0005 -> marketing\n *\n * All mapped walkerOS groups get explicit true/false values.\n * Active groups -> true, absent groups -> false.\n */\n\n/**\n * Full consent mapped to walkerOS groups\n */\nexport const fullConsentMapped: WalkerOS.Consent = {\n functional: true,\n analytics: true,\n marketing: true,\n};\n\n/**\n * Partial consent - necessary + functional mapped\n * C0001 -> functional (true), C0003 -> functional (true)\n * analytics and marketing absent -> false\n */\nexport const partialConsentMapped: WalkerOS.Consent = {\n functional: true,\n analytics: false,\n marketing: false,\n};\n\n/**\n * Minimal consent - only strictly necessary\n * C0001 -> functional (true)\n * analytics and marketing absent -> false\n */\nexport const minimalConsentMapped: WalkerOS.Consent = {\n functional: true,\n analytics: false,\n marketing: false,\n};\n\n/**\n * Analytics only - necessary + performance\n * C0001 -> functional (true), C0002 -> analytics (true)\n * marketing absent -> false\n */\nexport const analyticsOnlyMapped: WalkerOS.Consent = {\n functional: true,\n analytics: true,\n marketing: false,\n};\n\n/**\n * Marketing only - necessary + targeting\n * C0001 -> functional (true), C0004 -> marketing (true)\n * analytics absent -> false\n */\nexport const marketingOnlyMapped: WalkerOS.Consent = {\n functional: true,\n analytics: false,\n marketing: true,\n};\n","import type { Source, Elb, Logger } from '@walkeros/core';\nimport type { OneTrustAPI } from '../types';\n\n/**\n * Example environment configurations for CookiePro source testing.\n */\n\nconst noop = () => {};\n\n/**\n * Create a properly typed elb/push function mock\n */\nexport const createMockElbFn = (): Elb.Fn => {\n const fn = (() =>\n Promise.resolve({\n ok: true,\n })) as Elb.Fn;\n return fn;\n};\n\n/**\n * Simple no-op logger for demo purposes\n */\nexport const noopLogger: Logger.Instance = {\n error: noop,\n warn: noop,\n info: noop,\n debug: noop,\n throw: (message: string | Error) => {\n throw typeof message === 'string' ? new Error(message) : message;\n },\n json: noop,\n scope: () => noopLogger,\n};\n\n/**\n * Create a mock OneTrust API object\n */\nexport const createMockOneTrustAPI = (\n isAlertBoxClosed = false,\n): OneTrustAPI => ({\n IsAlertBoxClosed: () => isAlertBoxClosed,\n});\n","import type { Flow } from '@walkeros/core';\n\nexport const fullConsent: Flow.StepExample = {\n trigger: { type: 'consent' },\n in: ',C0001,C0002,C0003,C0004,C0005,',\n out: {\n functional: true,\n analytics: true,\n marketing: true,\n },\n};\n\nexport const minimalConsent: Flow.StepExample = {\n trigger: { type: 'consent' },\n in: ',C0001,',\n out: {\n functional: true,\n analytics: false,\n marketing: false,\n },\n};\n\nexport const categoryMapOverride: Flow.StepExample = {\n description: 'Custom categoryMap remaps C0002 from analytics to statistics',\n trigger: { type: 'consent' },\n in: ',C0001,C0002,',\n mapping: { categoryMap: { C0002: 'statistics' } },\n out: {\n functional: true,\n statistics: true,\n marketing: false,\n },\n};\n\nexport const sdkLoadedDetection: Flow.StepExample = {\n description:\n 'Immediate detection when OneTrust SDK is already loaded with IsAlertBoxClosed() = true',\n trigger: { type: 'consent' },\n in: ',C0001,C0003,C0004,',\n out: {\n functional: true,\n analytics: false,\n marketing: true,\n },\n};\n","import type { Trigger, Collector } from '@walkeros/core';\nimport { startFlow } from '@walkeros/collector';\n\nconst createTrigger: Trigger.CreateFn<string, void> = async (\n config: Collector.InitConfig,\n) => {\n let flow: Trigger.FlowHandle | undefined;\n\n const trigger: Trigger.Fn<string, void> = () => async (content: string) => {\n // Pre-init: set OneTrust globals (source reads these during init)\n const win = window as unknown as Record<string, unknown>;\n win.OptanonActiveGroups = content;\n win.OneTrust = { IsAlertBoxClosed: () => true };\n\n // Lazy startFlow — source checks globals immediately during init\n if (!flow) {\n const result = await startFlow({ ...config, run: config.run ?? true });\n flow = { collector: result.collector, elb: result.elb };\n }\n };\n\n return {\n get flow() {\n return flow;\n },\n trigger,\n };\n};\n\n/** Sets OptanonActiveGroups and OneTrust globals before source init. */\nconst trigger = (input: unknown, env: Record<string, unknown>): void => {\n const win = env.window as Window & Record<string, unknown>;\n if (typeof input !== 'string') return;\n win.OptanonActiveGroups = input;\n win.OneTrust = { IsAlertBoxClosed: () => true };\n};\n\nexport { createTrigger, trigger };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACWO,IAAM,cAAc;AAKpB,IAAM,iBAAiB;AAKvB,IAAM,iBAAiB;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,EAC3B,IAAI;AAAA,EACJ,KAAK;AAAA,IACH,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AACF;AAEO,IAAM,sBAAwC;AAAA,EACnD,aAAa;AAAA,EACb,SAAS,EAAE,MAAM,UAAU;AAAA,EAC3B,IAAI;AAAA,EACJ,SAAS,EAAE,aAAa,EAAE,OAAO,aAAa,EAAE;AAAA,EAChD,KAAK;AAAA,IACH,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,WAAW;AAAA,EACb;AACF;AAEO,IAAM,qBAAuC;AAAA,EAClD,aACE;AAAA,EACF,SAAS,EAAE,MAAM,UAAU;AAAA,EAC3B,IAAI;AAAA,EACJ,KAAK;AAAA,IACH,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AACF;;;AC3CA,uBAA0B;AAE1B,IAAM,gBAAgD,OACpD,WACG;AACH,MAAI;AAEJ,QAAMC,WAAoC,MAAM,OAAO,YAAoB;AAR7E;AAUI,UAAM,MAAM;AACZ,QAAI,sBAAsB;AAC1B,QAAI,WAAW,EAAE,kBAAkB,MAAM,KAAK;AAG9C,QAAI,CAAC,MAAM;AACT,YAAM,SAAS,UAAM,4BAAU,EAAE,GAAG,QAAQ,MAAK,YAAO,QAAP,YAAc,KAAK,CAAC;AACrE,aAAO,EAAE,WAAW,OAAO,WAAW,KAAK,OAAO,IAAI;AAAA,IACxD;AAAA,EACF;AAEA,SAAO;AAAA,IACL,IAAI,OAAO;AACT,aAAO;AAAA,IACT;AAAA,IACA,SAAAA;AAAA,EACF;AACF;AAGA,IAAM,UAAU,CAAC,OAAgB,QAAuC;AACtE,QAAM,MAAM,IAAI;AAChB,MAAI,OAAO,UAAU,SAAU;AAC/B,MAAI,sBAAsB;AAC1B,MAAI,WAAW,EAAE,kBAAkB,MAAM,KAAK;AAChD;","names":["fullConsent","minimalConsent","trigger"]}
1
+ {"version":3,"sources":["../src/dev.ts","../src/examples/index.ts","../src/examples/inputs.ts","../src/examples/outputs.ts","../src/examples/env.ts","../src/examples/step.ts","../src/examples/trigger.ts","../src/schemas/index.ts","../src/schemas/settings.ts"],"sourcesContent":["/**\n * Development exports for testing and tooling.\n */\nexport * as examples from './examples';\nexport * as schemas from './schemas';\n","export * from './inputs';\nexport * from './outputs';\nexport * from './env';\nexport * as step from './step';\nexport { createTrigger, trigger } from './trigger';\n","/**\n * Example CookiePro OptanonActiveGroups strings.\n *\n * These represent real consent states from CookiePro/OneTrust CMP.\n * Format: comma-separated active category IDs with leading/trailing commas.\n * Only active groups are listed. Absence means denied.\n */\n\n/**\n * Full consent - user accepted all categories\n */\nexport const fullConsent = ',C0001,C0002,C0003,C0004,C0005,';\n\n/**\n * Partial consent - necessary + functional only\n */\nexport const partialConsent = ',C0001,C0003,';\n\n/**\n * Minimal consent - only strictly necessary (always active)\n */\nexport const minimalConsent = ',C0001,';\n\n/**\n * Analytics only - necessary + performance\n */\nexport const analyticsOnlyConsent = ',C0001,C0002,';\n\n/**\n * Marketing only - necessary + targeting\n */\nexport const marketingOnlyConsent = ',C0001,C0004,';\n\n/**\n * Empty string - no consent yet or cleared\n */\nexport const emptyConsent = '';\n\n/**\n * Custom category IDs - some installations use custom IDs\n */\nexport const customCategoryConsent = ',C0001,CUSTOM01,CUSTOM02,';\n","import type { WalkerOS } from '@walkeros/core';\n\n/**\n * Expected walkerOS consent outputs.\n *\n * These represent the consent state after parsing OptanonActiveGroups\n * and mapping through the default categoryMap.\n *\n * Default map:\n * - C0001 -> functional\n * - C0002 -> analytics\n * - C0003 -> functional\n * - C0004 -> marketing\n * - C0005 -> marketing\n *\n * All mapped walkerOS groups get explicit true/false values.\n * Active groups -> true, absent groups -> false.\n */\n\n/**\n * Full consent mapped to walkerOS groups\n */\nexport const fullConsentMapped: WalkerOS.Consent = {\n functional: true,\n analytics: true,\n marketing: true,\n};\n\n/**\n * Partial consent - necessary + functional mapped\n * C0001 -> functional (true), C0003 -> functional (true)\n * analytics and marketing absent -> false\n */\nexport const partialConsentMapped: WalkerOS.Consent = {\n functional: true,\n analytics: false,\n marketing: false,\n};\n\n/**\n * Minimal consent - only strictly necessary\n * C0001 -> functional (true)\n * analytics and marketing absent -> false\n */\nexport const minimalConsentMapped: WalkerOS.Consent = {\n functional: true,\n analytics: false,\n marketing: false,\n};\n\n/**\n * Analytics only - necessary + performance\n * C0001 -> functional (true), C0002 -> analytics (true)\n * marketing absent -> false\n */\nexport const analyticsOnlyMapped: WalkerOS.Consent = {\n functional: true,\n analytics: true,\n marketing: false,\n};\n\n/**\n * Marketing only - necessary + targeting\n * C0001 -> functional (true), C0004 -> marketing (true)\n * analytics absent -> false\n */\nexport const marketingOnlyMapped: WalkerOS.Consent = {\n functional: true,\n analytics: false,\n marketing: true,\n};\n","import type { Source, Elb, Logger } from '@walkeros/core';\nimport type { OneTrustAPI } from '../types';\n\n/**\n * Example environment configurations for CookiePro source testing.\n */\n\nconst noop = () => {};\n\n/**\n * Create a properly typed elb/push function mock\n */\nexport const createMockElbFn = (): Elb.Fn => {\n const fn = (() =>\n Promise.resolve({\n ok: true,\n })) as Elb.Fn;\n return fn;\n};\n\n/**\n * Simple no-op logger for demo purposes\n */\nexport const noopLogger: Logger.Instance = {\n error: noop,\n warn: noop,\n info: noop,\n debug: noop,\n throw: (message: string | Error) => {\n throw typeof message === 'string' ? new Error(message) : message;\n },\n json: noop,\n scope: () => noopLogger,\n};\n\n/**\n * Create a mock OneTrust API object\n */\nexport const createMockOneTrustAPI = (\n isAlertBoxClosed = false,\n): OneTrustAPI => ({\n IsAlertBoxClosed: () => isAlertBoxClosed,\n});\n","import type { Flow } from '@walkeros/core';\n\nexport const fullConsent: Flow.StepExample = {\n trigger: { type: 'consent' },\n in: ',C0001,C0002,C0003,C0004,C0005,',\n out: [\n [\n 'elb',\n 'walker consent',\n {\n functional: true,\n analytics: true,\n marketing: true,\n },\n ],\n ],\n};\n\nexport const minimalConsent: Flow.StepExample = {\n trigger: { type: 'consent' },\n in: ',C0001,',\n out: [\n [\n 'elb',\n 'walker consent',\n {\n functional: true,\n analytics: false,\n marketing: false,\n },\n ],\n ],\n};\n\nexport const categoryMapOverride: Flow.StepExample = {\n description: 'Custom categoryMap remaps C0002 from analytics to statistics',\n trigger: { type: 'consent' },\n in: ',C0001,C0002,',\n mapping: { categoryMap: { C0002: 'statistics' } },\n out: [\n [\n 'elb',\n 'walker consent',\n {\n functional: true,\n statistics: true,\n marketing: false,\n },\n ],\n ],\n};\n\nexport const sdkLoadedDetection: Flow.StepExample = {\n description:\n 'Immediate detection when OneTrust SDK is already loaded with IsAlertBoxClosed() = true',\n trigger: { type: 'consent' },\n in: ',C0001,C0003,C0004,',\n out: [\n [\n 'elb',\n 'walker consent',\n {\n functional: true,\n analytics: false,\n marketing: true,\n },\n ],\n ],\n};\n","import type { Trigger, Collector } from '@walkeros/core';\nimport { startFlow } from '@walkeros/collector';\n\nconst createTrigger: Trigger.CreateFn<string, void> = async (\n config: Collector.InitConfig,\n) => {\n let flow: Trigger.FlowHandle | undefined;\n\n const trigger: Trigger.Fn<string, void> = () => async (content: string) => {\n // Pre-init: set OneTrust globals (source reads these during init)\n const win = window as unknown as Record<string, unknown>;\n win.OptanonActiveGroups = content;\n win.OneTrust = { IsAlertBoxClosed: () => true };\n\n // Lazy startFlow — source checks globals immediately during init\n if (!flow) {\n const result = await startFlow({ ...config, run: config.run ?? true });\n flow = { collector: result.collector, elb: result.elb };\n }\n };\n\n return {\n get flow() {\n return flow;\n },\n trigger,\n };\n};\n\n/** Sets OptanonActiveGroups and OneTrust globals before source init. */\nconst trigger = (input: unknown, env: Record<string, unknown>): void => {\n const win = env.window as Window & Record<string, unknown>;\n if (typeof input !== 'string') return;\n win.OptanonActiveGroups = input;\n win.OneTrust = { IsAlertBoxClosed: () => true };\n};\n\nexport { createTrigger, trigger };\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 * CookiePro / OneTrust 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 after the user closed the OneTrust banner (IsAlertBoxClosed). Default: true.',\n )\n .optional(),\n\n globalName: z\n .string()\n .describe(\n \"Custom name for the OneTrust global on window. Default: 'OneTrust'.\",\n )\n .optional(),\n })\n .meta({\n id: 'CookieProSettings',\n title: 'Settings',\n description: 'Settings for the CookiePro / OneTrust CMP source.',\n });\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACWO,IAAM,cAAc;AAKpB,IAAM,iBAAiB;AAKvB,IAAM,iBAAiB;AAKvB,IAAM,uBAAuB;AAK7B,IAAM,uBAAuB;AAK7B,IAAM,eAAe;AAKrB,IAAM,wBAAwB;;;ACnB9B,IAAM,oBAAsC;AAAA,EACjD,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AACb;AAOO,IAAM,uBAAyC;AAAA,EACpD,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AACb;AAOO,IAAM,uBAAyC;AAAA,EACpD,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AACb;AAOO,IAAM,sBAAwC;AAAA,EACnD,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AACb;AAOO,IAAM,sBAAwC;AAAA,EACnD,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;A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,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC,EACA,KAAK;AAAA,EACJ,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,aAAa;AACf,CAAC;;;ADzBI,IAAM,eAAW,yBAAY,cAAc;","names":["fullConsent","minimalConsent","trigger","import_dev"]}
package/dist/dev.mjs CHANGED
@@ -1 +1 @@
1
- var t=Object.defineProperty,n=(n,e)=>{for(var a in e)t(n,a,{get:e[a],enumerable:!0})},e={};n(e,{analyticsOnlyConsent:()=>i,analyticsOnlyMapped:()=>u,createMockElbFn:()=>d,createMockOneTrustAPI:()=>k,createTrigger:()=>b,customCategoryConsent:()=>c,emptyConsent:()=>l,fullConsent:()=>a,fullConsentMapped:()=>C,marketingOnlyConsent:()=>s,marketingOnlyMapped:()=>m,minimalConsent:()=>r,minimalConsentMapped:()=>g,noopLogger:()=>f,partialConsent:()=>o,partialConsentMapped:()=>p,step:()=>O,trigger:()=>x});var a=",C0001,C0002,C0003,C0004,C0005,",o=",C0001,C0003,",r=",C0001,",i=",C0001,C0002,",s=",C0001,C0004,",l="",c=",C0001,CUSTOM01,CUSTOM02,",C={functional:!0,analytics:!0,marketing:!0},p={functional:!0,analytics:!1,marketing:!1},g={functional:!0,analytics:!1,marketing:!1},u={functional:!0,analytics:!0,marketing:!1},m={functional:!0,analytics:!1,marketing:!0},y=()=>{},d=()=>()=>Promise.resolve({ok:!0}),f={error:y,warn:y,info:y,debug:y,throw:t=>{throw"string"==typeof t?new Error(t):t},json:y,scope:()=>f},k=(t=!1)=>({IsAlertBoxClosed:()=>t}),O={};n(O,{categoryMapOverride:()=>v,fullConsent:()=>w,minimalConsent:()=>M,sdkLoadedDetection:()=>A});var w={trigger:{type:"consent"},in:",C0001,C0002,C0003,C0004,C0005,",out:{functional:!0,analytics:!0,marketing:!0}},M={trigger:{type:"consent"},in:",C0001,",out:{functional:!0,analytics:!1,marketing:!1}},v={description:"Custom categoryMap remaps C0002 from analytics to statistics",trigger:{type:"consent"},in:",C0001,C0002,",mapping:{categoryMap:{C0002:"statistics"}},out:{functional:!0,statistics:!0,marketing:!1}},A={description:"Immediate detection when OneTrust SDK is already loaded with IsAlertBoxClosed() = true",trigger:{type:"consent"},in:",C0001,C0003,C0004,",out:{functional:!0,analytics:!1,marketing:!0}};import{startFlow as T}from"@walkeros/collector";var b=async t=>{let n;return{get flow(){return n},trigger:()=>async e=>{var a;const o=window;if(o.OptanonActiveGroups=e,o.OneTrust={IsAlertBoxClosed:()=>!0},!n){const e=await T({...t,run:null==(a=t.run)||a});n={collector:e.collector,elb:e.elb}}}}},x=(t,n)=>{const e=n.window;"string"==typeof t&&(e.OptanonActiveGroups=t,e.OneTrust={IsAlertBoxClosed:()=>!0})};export{e as examples};//# sourceMappingURL=dev.mjs.map
1
+ var e=Object.defineProperty,t=(t,n)=>{for(var o in n)e(t,o,{get:n[o],enumerable:!0})},n={};t(n,{analyticsOnlyConsent:()=>s,analyticsOnlyMapped:()=>u,createMockElbFn:()=>y,createMockOneTrustAPI:()=>k,createTrigger:()=>T,customCategoryConsent:()=>c,emptyConsent:()=>l,fullConsent:()=>o,fullConsentMapped:()=>C,marketingOnlyConsent:()=>i,marketingOnlyMapped:()=>m,minimalConsent:()=>a,minimalConsentMapped:()=>p,noopLogger:()=>f,partialConsent:()=>r,partialConsentMapped:()=>g,step:()=>w,trigger:()=>S});var o=",C0001,C0002,C0003,C0004,C0005,",r=",C0001,C0003,",a=",C0001,",s=",C0001,C0002,",i=",C0001,C0004,",l="",c=",C0001,CUSTOM01,CUSTOM02,",C={functional:!0,analytics:!0,marketing:!0},g={functional:!0,analytics:!1,marketing:!1},p={functional:!0,analytics:!1,marketing:!1},u={functional:!0,analytics:!0,marketing:!1},m={functional:!0,analytics:!1,marketing:!0},d=()=>{},y=()=>()=>Promise.resolve({ok:!0}),f={error:d,warn:d,info:d,debug:d,throw:e=>{throw"string"==typeof e?new Error(e):e},json:d,scope:()=>f},k=(e=!1)=>({IsAlertBoxClosed:()=>e}),w={};t(w,{categoryMapOverride:()=>M,fullConsent:()=>O,minimalConsent:()=>b,sdkLoadedDetection:()=>v});var O={trigger:{type:"consent"},in:",C0001,C0002,C0003,C0004,C0005,",out:[["elb","walker consent",{functional:!0,analytics:!0,marketing:!0}]]},b={trigger:{type:"consent"},in:",C0001,",out:[["elb","walker consent",{functional:!0,analytics:!1,marketing:!1}]]},M={description:"Custom categoryMap remaps C0002 from analytics to statistics",trigger:{type:"consent"},in:",C0001,C0002,",mapping:{categoryMap:{C0002:"statistics"}},out:[["elb","walker consent",{functional:!0,statistics:!0,marketing:!1}]]},v={description:"Immediate detection when OneTrust SDK is already loaded with IsAlertBoxClosed() = true",trigger:{type:"consent"},in:",C0001,C0003,C0004,",out:[["elb","walker consent",{functional:!0,analytics:!1,marketing:!0}]]};import{startFlow as h}from"@walkeros/collector";var T=async e=>{let t;return{get flow(){return t},trigger:()=>async n=>{var o;const r=window;if(r.OptanonActiveGroups=n,r.OneTrust={IsAlertBoxClosed:()=>!0},!t){const n=await h({...e,run:null==(o=e.run)||o});t={collector:n.collector,elb:n.elb}}}}},S=(e,t)=>{const n=t.window;"string"==typeof e&&(n.OptanonActiveGroups=e,n.OneTrust={IsAlertBoxClosed:()=>!0})},x={};t(x,{SettingsSchema:()=>P,settings:()=>B});import{zodToSchema as A}from"@walkeros/core/dev";import{z as I}from"@walkeros/core/dev";var P=I.object({categoryMap:I.record(I.string(),I.string()).describe("Map the CMP's consent categories (keys) to walkerOS consent groups (values).").optional(),explicitOnly:I.boolean().describe("Only process consent after the user closed the OneTrust banner (IsAlertBoxClosed). Default: true.").optional(),globalName:I.string().describe("Custom name for the OneTrust global on window. Default: 'OneTrust'.").optional()}).meta({id:"CookieProSettings",title:"Settings",description:"Settings for the CookiePro / OneTrust CMP source."}),B=A(P);export{n as examples,x as schemas};//# sourceMappingURL=dev.mjs.map
package/dist/dev.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/examples/index.ts","../src/examples/inputs.ts","../src/examples/outputs.ts","../src/examples/env.ts","../src/examples/step.ts","../src/examples/trigger.ts"],"sourcesContent":["export * from './inputs';\nexport * from './outputs';\nexport * from './env';\nexport * as step from './step';\nexport { createTrigger, trigger } from './trigger';\n","/**\n * Example CookiePro OptanonActiveGroups strings.\n *\n * These represent real consent states from CookiePro/OneTrust CMP.\n * Format: comma-separated active category IDs with leading/trailing commas.\n * Only active groups are listed. Absence means denied.\n */\n\n/**\n * Full consent - user accepted all categories\n */\nexport const fullConsent = ',C0001,C0002,C0003,C0004,C0005,';\n\n/**\n * Partial consent - necessary + functional only\n */\nexport const partialConsent = ',C0001,C0003,';\n\n/**\n * Minimal consent - only strictly necessary (always active)\n */\nexport const minimalConsent = ',C0001,';\n\n/**\n * Analytics only - necessary + performance\n */\nexport const analyticsOnlyConsent = ',C0001,C0002,';\n\n/**\n * Marketing only - necessary + targeting\n */\nexport const marketingOnlyConsent = ',C0001,C0004,';\n\n/**\n * Empty string - no consent yet or cleared\n */\nexport const emptyConsent = '';\n\n/**\n * Custom category IDs - some installations use custom IDs\n */\nexport const customCategoryConsent = ',C0001,CUSTOM01,CUSTOM02,';\n","import type { WalkerOS } from '@walkeros/core';\n\n/**\n * Expected walkerOS consent outputs.\n *\n * These represent the consent state after parsing OptanonActiveGroups\n * and mapping through the default categoryMap.\n *\n * Default map:\n * - C0001 -> functional\n * - C0002 -> analytics\n * - C0003 -> functional\n * - C0004 -> marketing\n * - C0005 -> marketing\n *\n * All mapped walkerOS groups get explicit true/false values.\n * Active groups -> true, absent groups -> false.\n */\n\n/**\n * Full consent mapped to walkerOS groups\n */\nexport const fullConsentMapped: WalkerOS.Consent = {\n functional: true,\n analytics: true,\n marketing: true,\n};\n\n/**\n * Partial consent - necessary + functional mapped\n * C0001 -> functional (true), C0003 -> functional (true)\n * analytics and marketing absent -> false\n */\nexport const partialConsentMapped: WalkerOS.Consent = {\n functional: true,\n analytics: false,\n marketing: false,\n};\n\n/**\n * Minimal consent - only strictly necessary\n * C0001 -> functional (true)\n * analytics and marketing absent -> false\n */\nexport const minimalConsentMapped: WalkerOS.Consent = {\n functional: true,\n analytics: false,\n marketing: false,\n};\n\n/**\n * Analytics only - necessary + performance\n * C0001 -> functional (true), C0002 -> analytics (true)\n * marketing absent -> false\n */\nexport const analyticsOnlyMapped: WalkerOS.Consent = {\n functional: true,\n analytics: true,\n marketing: false,\n};\n\n/**\n * Marketing only - necessary + targeting\n * C0001 -> functional (true), C0004 -> marketing (true)\n * analytics absent -> false\n */\nexport const marketingOnlyMapped: WalkerOS.Consent = {\n functional: true,\n analytics: false,\n marketing: true,\n};\n","import type { Source, Elb, Logger } from '@walkeros/core';\nimport type { OneTrustAPI } from '../types';\n\n/**\n * Example environment configurations for CookiePro source testing.\n */\n\nconst noop = () => {};\n\n/**\n * Create a properly typed elb/push function mock\n */\nexport const createMockElbFn = (): Elb.Fn => {\n const fn = (() =>\n Promise.resolve({\n ok: true,\n })) as Elb.Fn;\n return fn;\n};\n\n/**\n * Simple no-op logger for demo purposes\n */\nexport const noopLogger: Logger.Instance = {\n error: noop,\n warn: noop,\n info: noop,\n debug: noop,\n throw: (message: string | Error) => {\n throw typeof message === 'string' ? new Error(message) : message;\n },\n json: noop,\n scope: () => noopLogger,\n};\n\n/**\n * Create a mock OneTrust API object\n */\nexport const createMockOneTrustAPI = (\n isAlertBoxClosed = false,\n): OneTrustAPI => ({\n IsAlertBoxClosed: () => isAlertBoxClosed,\n});\n","import type { Flow } from '@walkeros/core';\n\nexport const fullConsent: Flow.StepExample = {\n trigger: { type: 'consent' },\n in: ',C0001,C0002,C0003,C0004,C0005,',\n out: {\n functional: true,\n analytics: true,\n marketing: true,\n },\n};\n\nexport const minimalConsent: Flow.StepExample = {\n trigger: { type: 'consent' },\n in: ',C0001,',\n out: {\n functional: true,\n analytics: false,\n marketing: false,\n },\n};\n\nexport const categoryMapOverride: Flow.StepExample = {\n description: 'Custom categoryMap remaps C0002 from analytics to statistics',\n trigger: { type: 'consent' },\n in: ',C0001,C0002,',\n mapping: { categoryMap: { C0002: 'statistics' } },\n out: {\n functional: true,\n statistics: true,\n marketing: false,\n },\n};\n\nexport const sdkLoadedDetection: Flow.StepExample = {\n description:\n 'Immediate detection when OneTrust SDK is already loaded with IsAlertBoxClosed() = true',\n trigger: { type: 'consent' },\n in: ',C0001,C0003,C0004,',\n out: {\n functional: true,\n analytics: false,\n marketing: true,\n },\n};\n","import type { Trigger, Collector } from '@walkeros/core';\nimport { startFlow } from '@walkeros/collector';\n\nconst createTrigger: Trigger.CreateFn<string, void> = async (\n config: Collector.InitConfig,\n) => {\n let flow: Trigger.FlowHandle | undefined;\n\n const trigger: Trigger.Fn<string, void> = () => async (content: string) => {\n // Pre-init: set OneTrust globals (source reads these during init)\n const win = window as unknown as Record<string, unknown>;\n win.OptanonActiveGroups = content;\n win.OneTrust = { IsAlertBoxClosed: () => true };\n\n // Lazy startFlow — source checks globals immediately during init\n if (!flow) {\n const result = await startFlow({ ...config, run: config.run ?? true });\n flow = { collector: result.collector, elb: result.elb };\n }\n };\n\n return {\n get flow() {\n return flow;\n },\n trigger,\n };\n};\n\n/** Sets OptanonActiveGroups and OneTrust globals before source init. */\nconst trigger = (input: unknown, env: Record<string, unknown>): void => {\n const win = env.window as Window & Record<string, unknown>;\n if (typeof input !== 'string') return;\n win.OptanonActiveGroups = input;\n win.OneTrust = { IsAlertBoxClosed: () => true };\n};\n\nexport { createTrigger, trigger };\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACWO,IAAM,cAAc;AAKpB,IAAM,iBAAiB;AAKvB,IAAM,iBAAiB;AAKvB,IAAM,uBAAuB;AAK7B,IAAM,uBAAuB;AAK7B,IAAM,eAAe;AAKrB,IAAM,wBAAwB;;;ACnB9B,IAAM,oBAAsC;AAAA,EACjD,YAAY;AAAA,EACZ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AAAA,EACb,SAAS,EAAE,MAAM,UAAU;AAAA,EAC3B,IAAI;AAAA,EACJ,SAAS,EAAE,aAAa,EAAE,OAAO,aAAa,EAAE;AAAA,EAChD,KAAK;AAAA,IACH,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,WAAW;AAAA,EACb;AACF;AAEO,IAAM,qBAAuC;AAAA,EAClD,aACE;AAAA,EACF,SAAS,EAAE,MAAM,UAAU;AAAA,EAC3B,IAAI;AAAA,EACJ,KAAK;AAAA,IACH,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AACF;;;AC3CA,SAAS,iBAAiB;AAE1B,IAAM,gBAAgD,OACpD,WACG;AACH,MAAI;AAEJ,QAAMC,WAAoC,MAAM,OAAO,YAAoB;AAR7E;AAUI,UAAM,MAAM;AACZ,QAAI,sBAAsB;AAC1B,QAAI,WAAW,EAAE,kBAAkB,MAAM,KAAK;AAG9C,QAAI,CAAC,MAAM;AACT,YAAM,SAAS,MAAM,UAAU,EAAE,GAAG,QAAQ,MAAK,YAAO,QAAP,YAAc,KAAK,CAAC;AACrE,aAAO,EAAE,WAAW,OAAO,WAAW,KAAK,OAAO,IAAI;AAAA,IACxD;AAAA,EACF;AAEA,SAAO;AAAA,IACL,IAAI,OAAO;AACT,aAAO;AAAA,IACT;AAAA,IACA,SAAAA;AAAA,EACF;AACF;AAGA,IAAM,UAAU,CAAC,OAAgB,QAAuC;AACtE,QAAM,MAAM,IAAI;AAChB,MAAI,OAAO,UAAU,SAAU;AAC/B,MAAI,sBAAsB;AAC1B,MAAI,WAAW,EAAE,kBAAkB,MAAM,KAAK;AAChD;","names":["fullConsent","minimalConsent","trigger"]}
1
+ {"version":3,"sources":["../src/examples/index.ts","../src/examples/inputs.ts","../src/examples/outputs.ts","../src/examples/env.ts","../src/examples/step.ts","../src/examples/trigger.ts","../src/schemas/index.ts","../src/schemas/settings.ts"],"sourcesContent":["export * from './inputs';\nexport * from './outputs';\nexport * from './env';\nexport * as step from './step';\nexport { createTrigger, trigger } from './trigger';\n","/**\n * Example CookiePro OptanonActiveGroups strings.\n *\n * These represent real consent states from CookiePro/OneTrust CMP.\n * Format: comma-separated active category IDs with leading/trailing commas.\n * Only active groups are listed. Absence means denied.\n */\n\n/**\n * Full consent - user accepted all categories\n */\nexport const fullConsent = ',C0001,C0002,C0003,C0004,C0005,';\n\n/**\n * Partial consent - necessary + functional only\n */\nexport const partialConsent = ',C0001,C0003,';\n\n/**\n * Minimal consent - only strictly necessary (always active)\n */\nexport const minimalConsent = ',C0001,';\n\n/**\n * Analytics only - necessary + performance\n */\nexport const analyticsOnlyConsent = ',C0001,C0002,';\n\n/**\n * Marketing only - necessary + targeting\n */\nexport const marketingOnlyConsent = ',C0001,C0004,';\n\n/**\n * Empty string - no consent yet or cleared\n */\nexport const emptyConsent = '';\n\n/**\n * Custom category IDs - some installations use custom IDs\n */\nexport const customCategoryConsent = ',C0001,CUSTOM01,CUSTOM02,';\n","import type { WalkerOS } from '@walkeros/core';\n\n/**\n * Expected walkerOS consent outputs.\n *\n * These represent the consent state after parsing OptanonActiveGroups\n * and mapping through the default categoryMap.\n *\n * Default map:\n * - C0001 -> functional\n * - C0002 -> analytics\n * - C0003 -> functional\n * - C0004 -> marketing\n * - C0005 -> marketing\n *\n * All mapped walkerOS groups get explicit true/false values.\n * Active groups -> true, absent groups -> false.\n */\n\n/**\n * Full consent mapped to walkerOS groups\n */\nexport const fullConsentMapped: WalkerOS.Consent = {\n functional: true,\n analytics: true,\n marketing: true,\n};\n\n/**\n * Partial consent - necessary + functional mapped\n * C0001 -> functional (true), C0003 -> functional (true)\n * analytics and marketing absent -> false\n */\nexport const partialConsentMapped: WalkerOS.Consent = {\n functional: true,\n analytics: false,\n marketing: false,\n};\n\n/**\n * Minimal consent - only strictly necessary\n * C0001 -> functional (true)\n * analytics and marketing absent -> false\n */\nexport const minimalConsentMapped: WalkerOS.Consent = {\n functional: true,\n analytics: false,\n marketing: false,\n};\n\n/**\n * Analytics only - necessary + performance\n * C0001 -> functional (true), C0002 -> analytics (true)\n * marketing absent -> false\n */\nexport const analyticsOnlyMapped: WalkerOS.Consent = {\n functional: true,\n analytics: true,\n marketing: false,\n};\n\n/**\n * Marketing only - necessary + targeting\n * C0001 -> functional (true), C0004 -> marketing (true)\n * analytics absent -> false\n */\nexport const marketingOnlyMapped: WalkerOS.Consent = {\n functional: true,\n analytics: false,\n marketing: true,\n};\n","import type { Source, Elb, Logger } from '@walkeros/core';\nimport type { OneTrustAPI } from '../types';\n\n/**\n * Example environment configurations for CookiePro source testing.\n */\n\nconst noop = () => {};\n\n/**\n * Create a properly typed elb/push function mock\n */\nexport const createMockElbFn = (): Elb.Fn => {\n const fn = (() =>\n Promise.resolve({\n ok: true,\n })) as Elb.Fn;\n return fn;\n};\n\n/**\n * Simple no-op logger for demo purposes\n */\nexport const noopLogger: Logger.Instance = {\n error: noop,\n warn: noop,\n info: noop,\n debug: noop,\n throw: (message: string | Error) => {\n throw typeof message === 'string' ? new Error(message) : message;\n },\n json: noop,\n scope: () => noopLogger,\n};\n\n/**\n * Create a mock OneTrust API object\n */\nexport const createMockOneTrustAPI = (\n isAlertBoxClosed = false,\n): OneTrustAPI => ({\n IsAlertBoxClosed: () => isAlertBoxClosed,\n});\n","import type { Flow } from '@walkeros/core';\n\nexport const fullConsent: Flow.StepExample = {\n trigger: { type: 'consent' },\n in: ',C0001,C0002,C0003,C0004,C0005,',\n out: [\n [\n 'elb',\n 'walker consent',\n {\n functional: true,\n analytics: true,\n marketing: true,\n },\n ],\n ],\n};\n\nexport const minimalConsent: Flow.StepExample = {\n trigger: { type: 'consent' },\n in: ',C0001,',\n out: [\n [\n 'elb',\n 'walker consent',\n {\n functional: true,\n analytics: false,\n marketing: false,\n },\n ],\n ],\n};\n\nexport const categoryMapOverride: Flow.StepExample = {\n description: 'Custom categoryMap remaps C0002 from analytics to statistics',\n trigger: { type: 'consent' },\n in: ',C0001,C0002,',\n mapping: { categoryMap: { C0002: 'statistics' } },\n out: [\n [\n 'elb',\n 'walker consent',\n {\n functional: true,\n statistics: true,\n marketing: false,\n },\n ],\n ],\n};\n\nexport const sdkLoadedDetection: Flow.StepExample = {\n description:\n 'Immediate detection when OneTrust SDK is already loaded with IsAlertBoxClosed() = true',\n trigger: { type: 'consent' },\n in: ',C0001,C0003,C0004,',\n out: [\n [\n 'elb',\n 'walker consent',\n {\n functional: true,\n analytics: false,\n marketing: true,\n },\n ],\n ],\n};\n","import type { Trigger, Collector } from '@walkeros/core';\nimport { startFlow } from '@walkeros/collector';\n\nconst createTrigger: Trigger.CreateFn<string, void> = async (\n config: Collector.InitConfig,\n) => {\n let flow: Trigger.FlowHandle | undefined;\n\n const trigger: Trigger.Fn<string, void> = () => async (content: string) => {\n // Pre-init: set OneTrust globals (source reads these during init)\n const win = window as unknown as Record<string, unknown>;\n win.OptanonActiveGroups = content;\n win.OneTrust = { IsAlertBoxClosed: () => true };\n\n // Lazy startFlow — source checks globals immediately during init\n if (!flow) {\n const result = await startFlow({ ...config, run: config.run ?? true });\n flow = { collector: result.collector, elb: result.elb };\n }\n };\n\n return {\n get flow() {\n return flow;\n },\n trigger,\n };\n};\n\n/** Sets OptanonActiveGroups and OneTrust globals before source init. */\nconst trigger = (input: unknown, env: Record<string, unknown>): void => {\n const win = env.window as Window & Record<string, unknown>;\n if (typeof input !== 'string') return;\n win.OptanonActiveGroups = input;\n win.OneTrust = { IsAlertBoxClosed: () => true };\n};\n\nexport { createTrigger, trigger };\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 * CookiePro / OneTrust 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 after the user closed the OneTrust banner (IsAlertBoxClosed). Default: true.',\n )\n .optional(),\n\n globalName: z\n .string()\n .describe(\n \"Custom name for the OneTrust global on window. Default: 'OneTrust'.\",\n )\n .optional(),\n })\n .meta({\n id: 'CookieProSettings',\n title: 'Settings',\n description: 'Settings for the CookiePro / OneTrust CMP source.',\n });\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACWO,IAAM,cAAc;AAKpB,IAAM,iBAAiB;AAKvB,IAAM,iBAAiB;AAKvB,IAAM,uBAAuB;AAK7B,IAAM,uBAAuB;AAK7B,IAAM,eAAe;AAKrB,IAAM,wBAAwB;;;ACnB9B,IAAM,oBAAsC;AAAA,EACjD,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AACb;AAOO,IAAM,uBAAyC;AAAA,EACpD,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AACb;AAOO,IAAM,uBAAyC;AAAA,EACpD,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AACb;AAOO,IAAM,sBAAwC;AAAA,EACnD,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AACb;AAOO,IAAM,sBAAwC;AAAA,EACnD,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AACb;;;AC/DA,IAAM,OAAO,MAAM;AAAC;AAKb,IAAM,kBAAkB,MAAc;AAC3C,QAAM,MAAM,MACV,QAAQ,QAAQ;AAAA,IACd,IAAI;AAAA,EACN,CAAC;AACH,SAAO;AACT;AAKO,IAAM,aAA8B;AAAA,EACzC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO,CAA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A,MACb;AAAA,IACF;AAAA,EACF;AACF;;;ACnEA,SAAS,iBAAiB;AAE1B,IAAM,gBAAgD,OACpD,WACG;AACH,MAAI;AAEJ,QAAMC,WAAoC,MAAM,OAAO,YAAoB;AAR7E;AAUI,UAAM,MAAM;AACZ,QAAI,sBAAsB;AAC1B,QAAI,WAAW,EAAE,kBAAkB,MAAM,KAAK;AAG9C,QAAI,CAAC,MAAM;AACT,YAAM,SAAS,MAAM,UAAU,EAAE,GAAG,QAAQ,MAAK,YAAO,QAAP,YAAc,KAAK,CAAC;AACrE,aAAO,EAAE,WAAW,OAAO,WAAW,KAAK,OAAO,IAAI;AAAA,IACxD;AAAA,EACF;AAEA,SAAO;AAAA,IACL,IAAI,OAAO;AACT,aAAO;AAAA,IACT;AAAA,IACA,SAAAA;AAAA,EACF;AACF;AAGA,IAAM,UAAU,CAAC,OAAgB,QAAuC;AACtE,QAAM,MAAM,IAAI;AAChB,MAAI,OAAO,UAAU,SAAU;AAC/B,MAAI,sBAAsB;AAC1B,MAAI,WAAW,EAAE,kBAAkB,MAAM,KAAK;AAChD;;;ACnCA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAKX,IAAM,iBAAiB,EAC3B,OAAO;AAAA,EACN,aAAa,EACV,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,EAC7B;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EAEZ,cAAc,EACX,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EAEZ,YAAY,EACT,OAAO,EACP;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC,EACA,KAAK;AAAA,EACJ,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,aAAa;AACf,CAAC;;;ADzBI,IAAM,WAAW,YAAY,cAAc;","names":["fullConsent","minimalConsent","trigger"]}
@@ -112,41 +112,65 @@ __export(step_exports, {
112
112
  var fullConsent2 = {
113
113
  trigger: { type: "consent" },
114
114
  in: ",C0001,C0002,C0003,C0004,C0005,",
115
- out: {
116
- functional: true,
117
- analytics: true,
118
- marketing: true
119
- }
115
+ out: [
116
+ [
117
+ "elb",
118
+ "walker consent",
119
+ {
120
+ functional: true,
121
+ analytics: true,
122
+ marketing: true
123
+ }
124
+ ]
125
+ ]
120
126
  };
121
127
  var minimalConsent2 = {
122
128
  trigger: { type: "consent" },
123
129
  in: ",C0001,",
124
- out: {
125
- functional: true,
126
- analytics: false,
127
- marketing: false
128
- }
130
+ out: [
131
+ [
132
+ "elb",
133
+ "walker consent",
134
+ {
135
+ functional: true,
136
+ analytics: false,
137
+ marketing: false
138
+ }
139
+ ]
140
+ ]
129
141
  };
130
142
  var categoryMapOverride = {
131
143
  description: "Custom categoryMap remaps C0002 from analytics to statistics",
132
144
  trigger: { type: "consent" },
133
145
  in: ",C0001,C0002,",
134
146
  mapping: { categoryMap: { C0002: "statistics" } },
135
- out: {
136
- functional: true,
137
- statistics: true,
138
- marketing: false
139
- }
147
+ out: [
148
+ [
149
+ "elb",
150
+ "walker consent",
151
+ {
152
+ functional: true,
153
+ statistics: true,
154
+ marketing: false
155
+ }
156
+ ]
157
+ ]
140
158
  };
141
159
  var sdkLoadedDetection = {
142
160
  description: "Immediate detection when OneTrust SDK is already loaded with IsAlertBoxClosed() = true",
143
161
  trigger: { type: "consent" },
144
162
  in: ",C0001,C0003,C0004,",
145
- out: {
146
- functional: true,
147
- analytics: false,
148
- marketing: true
149
- }
163
+ out: [
164
+ [
165
+ "elb",
166
+ "walker consent",
167
+ {
168
+ functional: true,
169
+ analytics: false,
170
+ marketing: true
171
+ }
172
+ ]
173
+ ]
150
174
  };
151
175
 
152
176
  // src/examples/trigger.ts
@@ -75,41 +75,65 @@ __export(step_exports, {
75
75
  var fullConsent2 = {
76
76
  trigger: { type: "consent" },
77
77
  in: ",C0001,C0002,C0003,C0004,C0005,",
78
- out: {
79
- functional: true,
80
- analytics: true,
81
- marketing: true
82
- }
78
+ out: [
79
+ [
80
+ "elb",
81
+ "walker consent",
82
+ {
83
+ functional: true,
84
+ analytics: true,
85
+ marketing: true
86
+ }
87
+ ]
88
+ ]
83
89
  };
84
90
  var minimalConsent2 = {
85
91
  trigger: { type: "consent" },
86
92
  in: ",C0001,",
87
- out: {
88
- functional: true,
89
- analytics: false,
90
- marketing: false
91
- }
93
+ out: [
94
+ [
95
+ "elb",
96
+ "walker consent",
97
+ {
98
+ functional: true,
99
+ analytics: false,
100
+ marketing: false
101
+ }
102
+ ]
103
+ ]
92
104
  };
93
105
  var categoryMapOverride = {
94
106
  description: "Custom categoryMap remaps C0002 from analytics to statistics",
95
107
  trigger: { type: "consent" },
96
108
  in: ",C0001,C0002,",
97
109
  mapping: { categoryMap: { C0002: "statistics" } },
98
- out: {
99
- functional: true,
100
- statistics: true,
101
- marketing: false
102
- }
110
+ out: [
111
+ [
112
+ "elb",
113
+ "walker consent",
114
+ {
115
+ functional: true,
116
+ statistics: true,
117
+ marketing: false
118
+ }
119
+ ]
120
+ ]
103
121
  };
104
122
  var sdkLoadedDetection = {
105
123
  description: "Immediate detection when OneTrust SDK is already loaded with IsAlertBoxClosed() = true",
106
124
  trigger: { type: "consent" },
107
125
  in: ",C0001,C0003,C0004,",
108
- out: {
109
- functional: true,
110
- analytics: false,
111
- marketing: true
112
- }
126
+ out: [
127
+ [
128
+ "elb",
129
+ "walker consent",
130
+ {
131
+ functional: true,
132
+ analytics: false,
133
+ marketing: true
134
+ }
135
+ ]
136
+ ]
113
137
  };
114
138
 
115
139
  // src/examples/trigger.ts