@walkeros/web-source-cmp-cookiepro 4.0.0-next-1773967844643 → 4.0.0-next-1777463920154
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 +47 -18
- package/dist/dev.d.ts +47 -18
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/examples/index.d.mts +8 -0
- package/dist/examples/index.d.ts +8 -0
- package/dist/examples/index.js +50 -20
- package/dist/examples/index.mjs +50 -20
- package/dist/index.browser.js +1 -1
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.es5.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/walkerOS.json +86 -27
- package/package.json +7 -5
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.
|
|
@@ -81,6 +83,14 @@ declare const analyticsOnlyMapped: WalkerOS.Consent;
|
|
|
81
83
|
*/
|
|
82
84
|
declare const marketingOnlyMapped: WalkerOS.Consent;
|
|
83
85
|
|
|
86
|
+
declare module '@walkeros/core' {
|
|
87
|
+
interface SourceMap {
|
|
88
|
+
cookiepro: {
|
|
89
|
+
type: 'cookiepro';
|
|
90
|
+
platform?: 'web';
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
84
94
|
/**
|
|
85
95
|
* OneTrust global API interface.
|
|
86
96
|
*
|
|
@@ -143,24 +153,43 @@ declare const createTrigger: Trigger.CreateFn<string, void>;
|
|
|
143
153
|
/** Sets OptanonActiveGroups and OneTrust globals before source init. */
|
|
144
154
|
declare const trigger: (input: unknown, env: Record<string, unknown>) => void;
|
|
145
155
|
|
|
146
|
-
declare const
|
|
147
|
-
declare const
|
|
148
|
-
declare const
|
|
149
|
-
declare const
|
|
150
|
-
declare const
|
|
151
|
-
declare const
|
|
152
|
-
declare const
|
|
153
|
-
declare const
|
|
154
|
-
declare const
|
|
155
|
-
declare const
|
|
156
|
-
declare const
|
|
157
|
-
declare const
|
|
158
|
-
declare const
|
|
159
|
-
declare const
|
|
160
|
-
declare const
|
|
161
|
-
declare const
|
|
156
|
+
declare const index$1_analyticsOnlyConsent: typeof analyticsOnlyConsent;
|
|
157
|
+
declare const index$1_analyticsOnlyMapped: typeof analyticsOnlyMapped;
|
|
158
|
+
declare const index$1_createMockElbFn: typeof createMockElbFn;
|
|
159
|
+
declare const index$1_createMockOneTrustAPI: typeof createMockOneTrustAPI;
|
|
160
|
+
declare const index$1_createTrigger: typeof createTrigger;
|
|
161
|
+
declare const index$1_customCategoryConsent: typeof customCategoryConsent;
|
|
162
|
+
declare const index$1_emptyConsent: typeof emptyConsent;
|
|
163
|
+
declare const index$1_fullConsentMapped: typeof fullConsentMapped;
|
|
164
|
+
declare const index$1_marketingOnlyConsent: typeof marketingOnlyConsent;
|
|
165
|
+
declare const index$1_marketingOnlyMapped: typeof marketingOnlyMapped;
|
|
166
|
+
declare const index$1_minimalConsentMapped: typeof minimalConsentMapped;
|
|
167
|
+
declare const index$1_noopLogger: typeof noopLogger;
|
|
168
|
+
declare const index$1_partialConsent: typeof partialConsent;
|
|
169
|
+
declare const index$1_partialConsentMapped: typeof partialConsentMapped;
|
|
170
|
+
declare const index$1_step: typeof step;
|
|
171
|
+
declare const index$1_trigger: typeof trigger;
|
|
172
|
+
declare namespace index$1 {
|
|
173
|
+
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 };
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* CookiePro / OneTrust source settings schema
|
|
178
|
+
*/
|
|
179
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
180
|
+
categoryMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
181
|
+
explicitOnly: z.ZodOptional<z.ZodBoolean>;
|
|
182
|
+
globalName: z.ZodOptional<z.ZodString>;
|
|
183
|
+
}, z.core.$strip>;
|
|
184
|
+
type Settings = z.infer<typeof SettingsSchema>;
|
|
185
|
+
|
|
186
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
187
|
+
|
|
188
|
+
type index_Settings = Settings;
|
|
189
|
+
declare const index_SettingsSchema: typeof SettingsSchema;
|
|
190
|
+
declare const index_settings: typeof settings;
|
|
162
191
|
declare namespace index {
|
|
163
|
-
export {
|
|
192
|
+
export { type index_Settings as Settings, index_SettingsSchema as SettingsSchema, index_settings as settings };
|
|
164
193
|
}
|
|
165
194
|
|
|
166
|
-
export { index as examples };
|
|
195
|
+
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.
|
|
@@ -81,6 +83,14 @@ declare const analyticsOnlyMapped: WalkerOS.Consent;
|
|
|
81
83
|
*/
|
|
82
84
|
declare const marketingOnlyMapped: WalkerOS.Consent;
|
|
83
85
|
|
|
86
|
+
declare module '@walkeros/core' {
|
|
87
|
+
interface SourceMap {
|
|
88
|
+
cookiepro: {
|
|
89
|
+
type: 'cookiepro';
|
|
90
|
+
platform?: 'web';
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
84
94
|
/**
|
|
85
95
|
* OneTrust global API interface.
|
|
86
96
|
*
|
|
@@ -143,24 +153,43 @@ declare const createTrigger: Trigger.CreateFn<string, void>;
|
|
|
143
153
|
/** Sets OptanonActiveGroups and OneTrust globals before source init. */
|
|
144
154
|
declare const trigger: (input: unknown, env: Record<string, unknown>) => void;
|
|
145
155
|
|
|
146
|
-
declare const
|
|
147
|
-
declare const
|
|
148
|
-
declare const
|
|
149
|
-
declare const
|
|
150
|
-
declare const
|
|
151
|
-
declare const
|
|
152
|
-
declare const
|
|
153
|
-
declare const
|
|
154
|
-
declare const
|
|
155
|
-
declare const
|
|
156
|
-
declare const
|
|
157
|
-
declare const
|
|
158
|
-
declare const
|
|
159
|
-
declare const
|
|
160
|
-
declare const
|
|
161
|
-
declare const
|
|
156
|
+
declare const index$1_analyticsOnlyConsent: typeof analyticsOnlyConsent;
|
|
157
|
+
declare const index$1_analyticsOnlyMapped: typeof analyticsOnlyMapped;
|
|
158
|
+
declare const index$1_createMockElbFn: typeof createMockElbFn;
|
|
159
|
+
declare const index$1_createMockOneTrustAPI: typeof createMockOneTrustAPI;
|
|
160
|
+
declare const index$1_createTrigger: typeof createTrigger;
|
|
161
|
+
declare const index$1_customCategoryConsent: typeof customCategoryConsent;
|
|
162
|
+
declare const index$1_emptyConsent: typeof emptyConsent;
|
|
163
|
+
declare const index$1_fullConsentMapped: typeof fullConsentMapped;
|
|
164
|
+
declare const index$1_marketingOnlyConsent: typeof marketingOnlyConsent;
|
|
165
|
+
declare const index$1_marketingOnlyMapped: typeof marketingOnlyMapped;
|
|
166
|
+
declare const index$1_minimalConsentMapped: typeof minimalConsentMapped;
|
|
167
|
+
declare const index$1_noopLogger: typeof noopLogger;
|
|
168
|
+
declare const index$1_partialConsent: typeof partialConsent;
|
|
169
|
+
declare const index$1_partialConsentMapped: typeof partialConsentMapped;
|
|
170
|
+
declare const index$1_step: typeof step;
|
|
171
|
+
declare const index$1_trigger: typeof trigger;
|
|
172
|
+
declare namespace index$1 {
|
|
173
|
+
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 };
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* CookiePro / OneTrust source settings schema
|
|
178
|
+
*/
|
|
179
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
180
|
+
categoryMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
181
|
+
explicitOnly: z.ZodOptional<z.ZodBoolean>;
|
|
182
|
+
globalName: z.ZodOptional<z.ZodString>;
|
|
183
|
+
}, z.core.$strip>;
|
|
184
|
+
type Settings = z.infer<typeof SettingsSchema>;
|
|
185
|
+
|
|
186
|
+
declare const settings: _walkeros_core_dev.JSONSchema;
|
|
187
|
+
|
|
188
|
+
type index_Settings = Settings;
|
|
189
|
+
declare const index_SettingsSchema: typeof SettingsSchema;
|
|
190
|
+
declare const index_settings: typeof settings;
|
|
162
191
|
declare namespace index {
|
|
163
|
-
export {
|
|
192
|
+
export { type index_Settings as Settings, index_SettingsSchema as SettingsSchema, index_settings as settings };
|
|
164
193
|
}
|
|
165
194
|
|
|
166
|
-
export { index as examples };
|
|
195
|
+
export { index$1 as examples, index as schemas };
|
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t
|
|
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:()=>g,analyticsOnlyMapped:()=>k,createMockElbFn:()=>b,createMockOneTrustAPI:()=>h,createTrigger:()=>j,customCategoryConsent:()=>d,emptyConsent:()=>C,fullConsent:()=>l,fullConsentMapped:()=>m,marketingOnlyConsent:()=>u,marketingOnlyMapped:()=>w,minimalConsent:()=>p,minimalConsentMapped:()=>f,noopLogger:()=>M,partialConsent:()=>c,partialConsentMapped:()=>y,step:()=>v,trigger:()=>z});var l=",C0001,C0002,C0003,C0004,C0005,",c=",C0001,C0003,",p=",C0001,",g=",C0001,C0002,",u=",C0001,C0004,",C="",d=",C0001,CUSTOM01,CUSTOM02,",m={functional:!0,analytics:!0,marketing:!0},y={functional:!0,analytics:!1,marketing:!1},f={functional:!0,analytics:!1,marketing:!1},k={functional:!0,analytics:!0,marketing:!1},w={functional:!0,analytics:!1,marketing:!0},O=()=>{},b=()=>()=>Promise.resolve({ok:!0}),M={error:O,warn:O,info:O,debug:O,throw:e=>{throw"string"==typeof e?new Error(e):e},json:O,scope:()=>M},h=(e=!1)=>({IsAlertBoxClosed:()=>e}),v={};a(v,{categoryMapOverride:()=>S,fullConsent:()=>P,minimalConsent:()=>T,sdkLoadedDetection:()=>A});var P={title:"Full consent",description:"A CookiePro OptanonConsent cookie listing all groups is translated into a walker consent command with all true.",trigger:{type:"consent"},in:",C0001,C0002,C0003,C0004,C0005,",out:[["elb","walker consent",{functional:!0,analytics:!0,marketing:!0}]]},T={title:"Minimal consent",description:"Only the necessary CookiePro group is granted so analytics and marketing map to false in the walker consent command.",trigger:{type:"consent"},in:",C0001,",out:[["elb","walker consent",{functional:!0,analytics:!1,marketing:!1}]]},S={title:"Category map override",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}]]},A={title:"SDK loaded detection",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}]]},x=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,x.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:()=>F});var D=require("@walkeros/core/dev"),B=require("@walkeros/core/dev"),q=B.z.object({categoryMap:B.z.record(B.z.string(),B.z.string()).describe("Map the CMP's consent categories (keys) to walkerOS consent groups (values).").optional(),explicitOnly:B.z.boolean().describe("Only process consent after the user closed the OneTrust banner (IsAlertBoxClosed). Default: true.").optional(),globalName:B.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."}),F=(0,D.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":";;;;;;;;;;;;;;;;;;;;A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B,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 title: 'Full consent',\n description:\n 'A CookiePro OptanonConsent cookie listing all groups is translated into a walker consent command with all true.',\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 title: 'Minimal consent',\n description:\n 'Only the necessary CookiePro group is granted so analytics and marketing map to false in the walker consent command.',\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 title: 'Category map override',\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 title: 'SDK loaded detection',\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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A,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,IAAAC,cAA4B;;;ACA5B,iBAAkB;AAKX,IAAM,iBAAiB,aAC3B,OAAO;AAAA,EACN,aAAa,aACV,OAAO,aAAE,OAAO,GAAG,aAAE,OAAO,CAAC,EAC7B;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EAEZ,cAAc,aACX,QAAQ,EACR;AAAA,IACC;AAAA,EACF,EACC,SAAS;AAAA,EAEZ,YAAY,aACT,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
|
|
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:()=>m,createMockElbFn:()=>y,createMockOneTrustAPI:()=>f,createTrigger:()=>T,customCategoryConsent:()=>c,emptyConsent:()=>l,fullConsent:()=>o,fullConsentMapped:()=>g,marketingOnlyConsent:()=>i,marketingOnlyMapped:()=>u,minimalConsent:()=>a,minimalConsentMapped:()=>C,noopLogger:()=>k,partialConsent:()=>r,partialConsentMapped:()=>p,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,",g={functional:!0,analytics:!0,marketing:!0},p={functional:!0,analytics:!1,marketing:!1},C={functional:!0,analytics:!1,marketing:!1},m={functional:!0,analytics:!0,marketing:!1},u={functional:!0,analytics:!1,marketing:!0},d=()=>{},y=()=>()=>Promise.resolve({ok:!0}),k={error:d,warn:d,info:d,debug:d,throw:e=>{throw"string"==typeof e?new Error(e):e},json:d,scope:()=>k},f=(e=!1)=>({IsAlertBoxClosed:()=>e}),w={};t(w,{categoryMapOverride:()=>M,fullConsent:()=>O,minimalConsent:()=>b,sdkLoadedDetection:()=>v});var O={title:"Full consent",description:"A CookiePro OptanonConsent cookie listing all groups is translated into a walker consent command with all true.",trigger:{type:"consent"},in:",C0001,C0002,C0003,C0004,C0005,",out:[["elb","walker consent",{functional:!0,analytics:!0,marketing:!0}]]},b={title:"Minimal consent",description:"Only the necessary CookiePro group is granted so analytics and marketing map to false in the walker consent command.",trigger:{type:"consent"},in:",C0001,",out:[["elb","walker consent",{functional:!0,analytics:!1,marketing:!1}]]},M={title:"Category map override",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={title:"SDK loaded detection",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})},A={};t(A,{SettingsSchema:()=>I,settings:()=>B});import{zodToSchema as P}from"@walkeros/core/dev";import{z as x}from"@walkeros/core/dev";var I=x.object({categoryMap:x.record(x.string(),x.string()).describe("Map the CMP's consent categories (keys) to walkerOS consent groups (values).").optional(),explicitOnly:x.boolean().describe("Only process consent after the user closed the OneTrust banner (IsAlertBoxClosed). Default: true.").optional(),globalName:x.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=P(I);export{n as examples,A 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;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A,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 title: 'Full consent',\n description:\n 'A CookiePro OptanonConsent cookie listing all groups is translated into a walker consent command with all true.',\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 title: 'Minimal consent',\n description:\n 'Only the necessary CookiePro group is granted so analytics and marketing map to false in the walker consent command.',\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 title: 'Category map override',\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 title: 'SDK loaded detection',\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,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AgB,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"]}
|
|
@@ -81,6 +81,14 @@ declare const analyticsOnlyMapped: WalkerOS.Consent;
|
|
|
81
81
|
*/
|
|
82
82
|
declare const marketingOnlyMapped: WalkerOS.Consent;
|
|
83
83
|
|
|
84
|
+
declare module '@walkeros/core' {
|
|
85
|
+
interface SourceMap {
|
|
86
|
+
cookiepro: {
|
|
87
|
+
type: 'cookiepro';
|
|
88
|
+
platform?: 'web';
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
84
92
|
/**
|
|
85
93
|
* OneTrust global API interface.
|
|
86
94
|
*
|
package/dist/examples/index.d.ts
CHANGED
|
@@ -81,6 +81,14 @@ declare const analyticsOnlyMapped: WalkerOS.Consent;
|
|
|
81
81
|
*/
|
|
82
82
|
declare const marketingOnlyMapped: WalkerOS.Consent;
|
|
83
83
|
|
|
84
|
+
declare module '@walkeros/core' {
|
|
85
|
+
interface SourceMap {
|
|
86
|
+
cookiepro: {
|
|
87
|
+
type: 'cookiepro';
|
|
88
|
+
platform?: 'web';
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
84
92
|
/**
|
|
85
93
|
* OneTrust global API interface.
|
|
86
94
|
*
|
package/dist/examples/index.js
CHANGED
|
@@ -110,43 +110,73 @@ __export(step_exports, {
|
|
|
110
110
|
sdkLoadedDetection: () => sdkLoadedDetection
|
|
111
111
|
});
|
|
112
112
|
var fullConsent2 = {
|
|
113
|
+
title: "Full consent",
|
|
114
|
+
description: "A CookiePro OptanonConsent cookie listing all groups is translated into a walker consent command with all true.",
|
|
113
115
|
trigger: { type: "consent" },
|
|
114
116
|
in: ",C0001,C0002,C0003,C0004,C0005,",
|
|
115
|
-
out:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
out: [
|
|
118
|
+
[
|
|
119
|
+
"elb",
|
|
120
|
+
"walker consent",
|
|
121
|
+
{
|
|
122
|
+
functional: true,
|
|
123
|
+
analytics: true,
|
|
124
|
+
marketing: true
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
]
|
|
120
128
|
};
|
|
121
129
|
var minimalConsent2 = {
|
|
130
|
+
title: "Minimal consent",
|
|
131
|
+
description: "Only the necessary CookiePro group is granted so analytics and marketing map to false in the walker consent command.",
|
|
122
132
|
trigger: { type: "consent" },
|
|
123
133
|
in: ",C0001,",
|
|
124
|
-
out:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
134
|
+
out: [
|
|
135
|
+
[
|
|
136
|
+
"elb",
|
|
137
|
+
"walker consent",
|
|
138
|
+
{
|
|
139
|
+
functional: true,
|
|
140
|
+
analytics: false,
|
|
141
|
+
marketing: false
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
]
|
|
129
145
|
};
|
|
130
146
|
var categoryMapOverride = {
|
|
147
|
+
title: "Category map override",
|
|
131
148
|
description: "Custom categoryMap remaps C0002 from analytics to statistics",
|
|
132
149
|
trigger: { type: "consent" },
|
|
133
150
|
in: ",C0001,C0002,",
|
|
134
151
|
mapping: { categoryMap: { C0002: "statistics" } },
|
|
135
|
-
out:
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
152
|
+
out: [
|
|
153
|
+
[
|
|
154
|
+
"elb",
|
|
155
|
+
"walker consent",
|
|
156
|
+
{
|
|
157
|
+
functional: true,
|
|
158
|
+
statistics: true,
|
|
159
|
+
marketing: false
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
]
|
|
140
163
|
};
|
|
141
164
|
var sdkLoadedDetection = {
|
|
165
|
+
title: "SDK loaded detection",
|
|
142
166
|
description: "Immediate detection when OneTrust SDK is already loaded with IsAlertBoxClosed() = true",
|
|
143
167
|
trigger: { type: "consent" },
|
|
144
168
|
in: ",C0001,C0003,C0004,",
|
|
145
|
-
out:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
169
|
+
out: [
|
|
170
|
+
[
|
|
171
|
+
"elb",
|
|
172
|
+
"walker consent",
|
|
173
|
+
{
|
|
174
|
+
functional: true,
|
|
175
|
+
analytics: false,
|
|
176
|
+
marketing: true
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
]
|
|
150
180
|
};
|
|
151
181
|
|
|
152
182
|
// src/examples/trigger.ts
|
package/dist/examples/index.mjs
CHANGED
|
@@ -73,43 +73,73 @@ __export(step_exports, {
|
|
|
73
73
|
sdkLoadedDetection: () => sdkLoadedDetection
|
|
74
74
|
});
|
|
75
75
|
var fullConsent2 = {
|
|
76
|
+
title: "Full consent",
|
|
77
|
+
description: "A CookiePro OptanonConsent cookie listing all groups is translated into a walker consent command with all true.",
|
|
76
78
|
trigger: { type: "consent" },
|
|
77
79
|
in: ",C0001,C0002,C0003,C0004,C0005,",
|
|
78
|
-
out:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
out: [
|
|
81
|
+
[
|
|
82
|
+
"elb",
|
|
83
|
+
"walker consent",
|
|
84
|
+
{
|
|
85
|
+
functional: true,
|
|
86
|
+
analytics: true,
|
|
87
|
+
marketing: true
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
]
|
|
83
91
|
};
|
|
84
92
|
var minimalConsent2 = {
|
|
93
|
+
title: "Minimal consent",
|
|
94
|
+
description: "Only the necessary CookiePro group is granted so analytics and marketing map to false in the walker consent command.",
|
|
85
95
|
trigger: { type: "consent" },
|
|
86
96
|
in: ",C0001,",
|
|
87
|
-
out:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
97
|
+
out: [
|
|
98
|
+
[
|
|
99
|
+
"elb",
|
|
100
|
+
"walker consent",
|
|
101
|
+
{
|
|
102
|
+
functional: true,
|
|
103
|
+
analytics: false,
|
|
104
|
+
marketing: false
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
]
|
|
92
108
|
};
|
|
93
109
|
var categoryMapOverride = {
|
|
110
|
+
title: "Category map override",
|
|
94
111
|
description: "Custom categoryMap remaps C0002 from analytics to statistics",
|
|
95
112
|
trigger: { type: "consent" },
|
|
96
113
|
in: ",C0001,C0002,",
|
|
97
114
|
mapping: { categoryMap: { C0002: "statistics" } },
|
|
98
|
-
out:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
115
|
+
out: [
|
|
116
|
+
[
|
|
117
|
+
"elb",
|
|
118
|
+
"walker consent",
|
|
119
|
+
{
|
|
120
|
+
functional: true,
|
|
121
|
+
statistics: true,
|
|
122
|
+
marketing: false
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
]
|
|
103
126
|
};
|
|
104
127
|
var sdkLoadedDetection = {
|
|
128
|
+
title: "SDK loaded detection",
|
|
105
129
|
description: "Immediate detection when OneTrust SDK is already loaded with IsAlertBoxClosed() = true",
|
|
106
130
|
trigger: { type: "consent" },
|
|
107
131
|
in: ",C0001,C0003,C0004,",
|
|
108
|
-
out:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
132
|
+
out: [
|
|
133
|
+
[
|
|
134
|
+
"elb",
|
|
135
|
+
"walker consent",
|
|
136
|
+
{
|
|
137
|
+
functional: true,
|
|
138
|
+
analytics: false,
|
|
139
|
+
marketing: true
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
]
|
|
113
143
|
};
|
|
114
144
|
|
|
115
145
|
// src/examples/trigger.ts
|