@walkeros/web-source-cmp-cookiepro 4.7.0-next-1790245733116 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -15
- 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.js +8 -5
- package/dist/examples/index.mjs +8 -5
- package/dist/walkerOS.json +5 -4
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
# @walkeros/web-source-cmp-cookiepro
|
|
2
2
|
|
|
3
|
-
## 4.7.0
|
|
3
|
+
## 4.7.0
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- Updated dependencies [
|
|
7
|
+
- Updated dependencies [786a860]
|
|
8
|
+
- Updated dependencies [74821ed]
|
|
8
9
|
- Updated dependencies [06b498a]
|
|
9
|
-
- Updated dependencies [
|
|
10
|
-
- Updated dependencies [
|
|
11
|
-
- Updated dependencies [
|
|
10
|
+
- Updated dependencies [7e5e3de]
|
|
11
|
+
- Updated dependencies [b9668bf]
|
|
12
|
+
- Updated dependencies [74821ed]
|
|
13
|
+
- Updated dependencies [64b06de]
|
|
14
|
+
- Updated dependencies [4b4937f]
|
|
15
|
+
- Updated dependencies [74821ed]
|
|
16
|
+
- Updated dependencies [74821ed]
|
|
17
|
+
- Updated dependencies [74821ed]
|
|
12
18
|
- Updated dependencies [06b498a]
|
|
13
|
-
- Updated dependencies [
|
|
14
|
-
- Updated dependencies [
|
|
15
|
-
- Updated dependencies [
|
|
16
|
-
- Updated dependencies [
|
|
17
|
-
- Updated dependencies [
|
|
18
|
-
- Updated dependencies [
|
|
19
|
-
- Updated dependencies [
|
|
20
|
-
- Updated dependencies [
|
|
21
|
-
|
|
22
|
-
- @walkeros/collector@4.7.0
|
|
19
|
+
- Updated dependencies [74821ed]
|
|
20
|
+
- Updated dependencies [74821ed]
|
|
21
|
+
- Updated dependencies [74821ed]
|
|
22
|
+
- Updated dependencies [74821ed]
|
|
23
|
+
- Updated dependencies [74821ed]
|
|
24
|
+
- Updated dependencies [e860006]
|
|
25
|
+
- Updated dependencies [74821ed]
|
|
26
|
+
- Updated dependencies [74821ed]
|
|
27
|
+
- Updated dependencies [4f89234]
|
|
28
|
+
- @walkeros/collector@4.7.0
|
|
29
|
+
- @walkeros/core@4.7.0
|
|
23
30
|
|
|
24
31
|
## 4.6.1
|
|
25
32
|
|
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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:()=>
|
|
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:()=>w,createMockElbFn:()=>b,createMockOneTrustAPI:()=>M,createTrigger:()=>z,customCategoryConsent:()=>d,emptyConsent:()=>C,fullConsent:()=>l,fullConsentMapped:()=>m,marketingOnlyConsent:()=>u,marketingOnlyMapped:()=>k,minimalConsent:()=>p,minimalConsentMapped:()=>f,noopLogger:()=>v,partialConsent:()=>c,partialConsentMapped:()=>y,step:()=>h,trigger:()=>D});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},w={functional:!0,analytics:!0,marketing:!1},k={functional:!0,analytics:!1,marketing:!0},O=()=>{},b=()=>()=>Promise.resolve({ok:!0}),v={error:O,warn:O,info:O,debug:O,throw:e=>{throw"string"==typeof e?new Error(e):e},json:O,scope:()=>v},M=(e=!1)=>({IsAlertBoxClosed:()=>e}),h={};a(h,{categoryMapOverride:()=>S,fullConsent:()=>T,minimalConsent:()=>P,sdkLoadedDetection:()=>A});var T={title:"Full consent",description:"An OptanonActiveGroups string listing all groups is translated into a walker consent command with all groups true.",trigger:{type:"consent"},in:",C0001,C0002,C0003,C0004,C0005,",out:[["elb","walker consent",{functional:!0,analytics:!0,marketing:!0}]]},P={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:{settings:{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}]]},j=require("@walkeros/collector"),x={IsAlertBoxClosed:()=>!0},z=async e=>{let t;return{get flow(){return t},trigger:()=>async n=>{var o;if(window.OptanonActiveGroups=n,window.OneTrust=x,!t){const n=await(0,j.startFlow)({...e,run:null==(o=e.run)||o});t={collector:n.collector,elb:n.elb}}}}},D=(e,t)=>{const n=t.window;var o;"string"==typeof e&&("object"==typeof(o=n)&&null!==o&&"addEventListener"in o)&&(n.OptanonActiveGroups=e,n.OneTrust=x)};var I={};a(I,{SettingsSchema:()=>E,settings:()=>F});var B=require("@walkeros/core/dev"),q=require("@walkeros/core/dev"),E=q.z.object({categoryMap:q.z.record(q.z.string(),q.z.string()).describe("Map the CMP's consent categories (keys) to walkerOS consent groups (values).").optional(),explicitOnly:q.z.boolean().describe("Only process consent after the user closed the OneTrust banner (IsAlertBoxClosed). Default: true.").optional(),globalName:q.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,B.zodToSchema)(E);//# 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","../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 'An OptanonActiveGroups string listing all groups is translated into a walker consent command with all groups 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: { settings: { 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;;;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,CAAC,YAA4B;AAClC,UAAM,OAAO,YAAY,WAAW,IAAI,MAAM,OAAO,IAA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
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 'An OptanonActiveGroups string listing all groups is translated into a walker consent command with all groups 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: { settings: { 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';\nimport type { OneTrustAPI } from '../types';\n\nconst oneTrust: OneTrustAPI = { IsAlertBoxClosed: () => true };\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 window.OptanonActiveGroups = content;\n window.OneTrust = oneTrust;\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;\n if (typeof input !== 'string' || !isWindow(win)) return;\n win.OptanonActiveGroups = input;\n win.OneTrust = oneTrust;\n};\n\nfunction isWindow(value: unknown): value is Window {\n return (\n typeof value === 'object' && value !== null && 'addEventListener' in value\n );\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;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AAuC;AACtE,QAAM,MAAM,IAAI;AAChB,MAAI,OAAO,UAAU,YAAY,CAAC,SAAS,GAAG,EAAG;AACjD,MAAI,sBAAsB;AAC1B,MAAI,WAAW;AACjB;AAEA,SAAS,SAAS,OAAiC;AACjD,SACE,OAAO,UAAU,YAAY,UAAU,QAAQ,sBAAsB;AAEzE;;;AC3CA;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 e=Object.defineProperty,t=(t,n)=>{for(var o in n)e(t,o,{get:n[o],enumerable:!0})},n={};t(n,{analyticsOnlyConsent:()=>
|
|
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:()=>i,analyticsOnlyMapped:()=>u,createMockElbFn:()=>y,createMockOneTrustAPI:()=>k,createTrigger:()=>S,customCategoryConsent:()=>c,emptyConsent:()=>l,fullConsent:()=>o,fullConsentMapped:()=>g,marketingOnlyConsent:()=>s,marketingOnlyMapped:()=>d,minimalConsent:()=>a,minimalConsentMapped:()=>C,noopLogger:()=>f,partialConsent:()=>r,partialConsentMapped:()=>p,step:()=>w,trigger:()=>A});var o=",C0001,C0002,C0003,C0004,C0005,",r=",C0001,C0003,",a=",C0001,",i=",C0001,C0002,",s=",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},u={functional:!0,analytics:!0,marketing:!1},d={functional:!0,analytics:!1,marketing:!0},m=()=>{},y=()=>()=>Promise.resolve({ok:!0}),f={error:m,warn:m,info:m,debug:m,throw:e=>{throw"string"==typeof e?new Error(e):e},json:m,scope:()=>f},k=(e=!1)=>({IsAlertBoxClosed:()=>e}),w={};t(w,{categoryMapOverride:()=>v,fullConsent:()=>O,minimalConsent:()=>b,sdkLoadedDetection:()=>M});var O={title:"Full consent",description:"An OptanonActiveGroups string listing all groups is translated into a walker consent command with all groups 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}]]},v={title:"Category map override",description:"Custom categoryMap remaps C0002 from analytics to statistics",trigger:{type:"consent"},in:",C0001,C0002,",mapping:{settings:{categoryMap:{C0002:"statistics"}}},out:[["elb","walker consent",{functional:!0,statistics:!0,marketing:!1}]]},M={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={IsAlertBoxClosed:()=>!0},S=async e=>{let t;return{get flow(){return t},trigger:()=>async n=>{var o;if(window.OptanonActiveGroups=n,window.OneTrust=T,!t){const n=await h({...e,run:null==(o=e.run)||o});t={collector:n.collector,elb:n.elb}}}}},A=(e,t)=>{const n=t.window;var o;"string"==typeof e&&("object"==typeof(o=n)&&null!==o&&"addEventListener"in o)&&(n.OptanonActiveGroups=e,n.OneTrust=T)};var P={};t(P,{SettingsSchema:()=>D,settings:()=>j});import{zodToSchema as x}from"@walkeros/core/dev";import{z as I}from"@walkeros/core/dev";var D=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."}),j=x(D);export{n as examples,P 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","../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 'An OptanonActiveGroups string listing all groups is translated into a walker consent command with all groups 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: { settings: { 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;AA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C,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"]}
|
|
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 'An OptanonActiveGroups string listing all groups is translated into a walker consent command with all groups 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: { settings: { 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';\nimport type { OneTrustAPI } from '../types';\n\nconst oneTrust: OneTrustAPI = { IsAlertBoxClosed: () => true };\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 window.OptanonActiveGroups = content;\n window.OneTrust = oneTrust;\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;\n if (typeof input !== 'string' || !isWindow(win)) return;\n win.OptanonActiveGroups = input;\n win.OneTrust = oneTrust;\n};\n\nfunction isWindow(value: unknown): value is Window {\n return (\n typeof value === 'object' && value !== null && 'addEventListener' in value\n );\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;AAA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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"]}
|
package/dist/examples/index.js
CHANGED
|
@@ -181,13 +181,13 @@ var sdkLoadedDetection = {
|
|
|
181
181
|
|
|
182
182
|
// src/examples/trigger.ts
|
|
183
183
|
var import_collector = require("@walkeros/collector");
|
|
184
|
+
var oneTrust = { IsAlertBoxClosed: () => true };
|
|
184
185
|
var createTrigger = async (config) => {
|
|
185
186
|
let flow;
|
|
186
187
|
const trigger2 = () => async (content) => {
|
|
187
188
|
var _a;
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
win.OneTrust = { IsAlertBoxClosed: () => true };
|
|
189
|
+
window.OptanonActiveGroups = content;
|
|
190
|
+
window.OneTrust = oneTrust;
|
|
191
191
|
if (!flow) {
|
|
192
192
|
const result = await (0, import_collector.startFlow)({ ...config, run: (_a = config.run) != null ? _a : true });
|
|
193
193
|
flow = { collector: result.collector, elb: result.elb };
|
|
@@ -202,10 +202,13 @@ var createTrigger = async (config) => {
|
|
|
202
202
|
};
|
|
203
203
|
var trigger = (input, env) => {
|
|
204
204
|
const win = env.window;
|
|
205
|
-
if (typeof input !== "string") return;
|
|
205
|
+
if (typeof input !== "string" || !isWindow(win)) return;
|
|
206
206
|
win.OptanonActiveGroups = input;
|
|
207
|
-
win.OneTrust =
|
|
207
|
+
win.OneTrust = oneTrust;
|
|
208
208
|
};
|
|
209
|
+
function isWindow(value) {
|
|
210
|
+
return typeof value === "object" && value !== null && "addEventListener" in value;
|
|
211
|
+
}
|
|
209
212
|
// Annotate the CommonJS export names for ESM import in node:
|
|
210
213
|
0 && (module.exports = {
|
|
211
214
|
analyticsOnlyConsent,
|
package/dist/examples/index.mjs
CHANGED
|
@@ -144,13 +144,13 @@ var sdkLoadedDetection = {
|
|
|
144
144
|
|
|
145
145
|
// src/examples/trigger.ts
|
|
146
146
|
import { startFlow } from "@walkeros/collector";
|
|
147
|
+
var oneTrust = { IsAlertBoxClosed: () => true };
|
|
147
148
|
var createTrigger = async (config) => {
|
|
148
149
|
let flow;
|
|
149
150
|
const trigger2 = () => async (content) => {
|
|
150
151
|
var _a;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
win.OneTrust = { IsAlertBoxClosed: () => true };
|
|
152
|
+
window.OptanonActiveGroups = content;
|
|
153
|
+
window.OneTrust = oneTrust;
|
|
154
154
|
if (!flow) {
|
|
155
155
|
const result = await startFlow({ ...config, run: (_a = config.run) != null ? _a : true });
|
|
156
156
|
flow = { collector: result.collector, elb: result.elb };
|
|
@@ -165,10 +165,13 @@ var createTrigger = async (config) => {
|
|
|
165
165
|
};
|
|
166
166
|
var trigger = (input, env) => {
|
|
167
167
|
const win = env.window;
|
|
168
|
-
if (typeof input !== "string") return;
|
|
168
|
+
if (typeof input !== "string" || !isWindow(win)) return;
|
|
169
169
|
win.OptanonActiveGroups = input;
|
|
170
|
-
win.OneTrust =
|
|
170
|
+
win.OneTrust = oneTrust;
|
|
171
171
|
};
|
|
172
|
+
function isWindow(value) {
|
|
173
|
+
return typeof value === "object" && value !== null && "addEventListener" in value;
|
|
174
|
+
}
|
|
172
175
|
export {
|
|
173
176
|
analyticsOnlyConsent,
|
|
174
177
|
analyticsOnlyMapped,
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/web-source-cmp-cookiepro",
|
|
4
|
-
"version": "4.7.0
|
|
4
|
+
"version": "4.7.0",
|
|
5
5
|
"type": "source",
|
|
6
6
|
"platform": [
|
|
7
7
|
"web"
|
|
8
8
|
],
|
|
9
9
|
"renderer": "codebox",
|
|
10
|
+
"exports": {},
|
|
10
11
|
"docs": "https://www.walkeros.io/docs/sources/web/cmps/cookiepro",
|
|
11
12
|
"source": "https://github.com/elbwalker/walkerOS/tree/main/packages/web/sources/cmps/cookiepro/src"
|
|
12
13
|
},
|
|
@@ -53,7 +54,7 @@
|
|
|
53
54
|
"$code": "(e=!1)=>({IsAlertBoxClosed:()=>e})"
|
|
54
55
|
},
|
|
55
56
|
"createTrigger": {
|
|
56
|
-
"$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async n=>{var o;
|
|
57
|
+
"$code": "async e=>{let t;return{get flow(){return t},trigger:()=>async n=>{var o;if(window.OptanonActiveGroups=n,window.OneTrust=T,!t){const n=await h({...e,run:null==(o=e.run)||o});t={collector:n.collector,elb:n.elb}}}}}"
|
|
57
58
|
},
|
|
58
59
|
"customCategoryConsent": ",C0001,CUSTOM01,CUSTOM02,",
|
|
59
60
|
"emptyConsent": "",
|
|
@@ -95,7 +96,7 @@
|
|
|
95
96
|
"$code": "()=>{}"
|
|
96
97
|
},
|
|
97
98
|
"scope": {
|
|
98
|
-
"$code": "()=>
|
|
99
|
+
"$code": "()=>f"
|
|
99
100
|
}
|
|
100
101
|
},
|
|
101
102
|
"partialConsent": ",C0001,C0003,",
|
|
@@ -190,7 +191,7 @@
|
|
|
190
191
|
}
|
|
191
192
|
},
|
|
192
193
|
"trigger": {
|
|
193
|
-
"$code": "(e,t)=>{const n=t.window;\"string\"==typeof e&&(n.OptanonActiveGroups=e,n.OneTrust=
|
|
194
|
+
"$code": "(e,t)=>{const n=t.window;var o;\"string\"==typeof e&&(\"object\"==typeof(o=n)&&null!==o&&\"addEventListener\"in o)&&(n.OptanonActiveGroups=e,n.OneTrust=T)}"
|
|
194
195
|
}
|
|
195
196
|
}
|
|
196
197
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/web-source-cmp-cookiepro",
|
|
3
3
|
"description": "CookiePro/OneTrust consent management source for walkerOS",
|
|
4
|
-
"version": "4.7.0
|
|
4
|
+
"version": "4.7.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"walkerOS": {
|
|
7
7
|
"type": "source",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"update": "npx npm-check-updates -u && npm update"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@walkeros/core": "4.7.0
|
|
50
|
-
"@walkeros/collector": "4.7.0
|
|
49
|
+
"@walkeros/core": "4.7.0",
|
|
50
|
+
"@walkeros/collector": "4.7.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {},
|
|
53
53
|
"repository": {
|