@walkeros/web-source-cmp-cookiefirst 4.9.0 → 4.10.0-next-1794522704623
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 +10 -0
- 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 +1 -0
- package/dist/examples/index.mjs +1 -0
- package/dist/walkerOS.json +7 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @walkeros/web-source-cmp-cookiefirst
|
|
2
2
|
|
|
3
|
+
## 4.10.0-next-1794522704623
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [61030f8]
|
|
8
|
+
- Updated dependencies [61030f8]
|
|
9
|
+
- Updated dependencies [61030f8]
|
|
10
|
+
- @walkeros/core@4.10.0-next-1794522704623
|
|
11
|
+
- @walkeros/collector@4.10.0-next-1794522704623
|
|
12
|
+
|
|
3
13
|
## 4.9.0
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})},i={};o(i,{examples:()=>s,schemas:()=>q}),module.exports=(e=i,((e,o,i,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let c of r(o))a.call(e,c)||c===i||t(e,c,{get:()=>o[c],enumerable:!(s=n(o,c))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s={};o(s,{analyticsOnlyConsent:()=>u,analyticsOnlyMapped:()=>k,createMockCookieFirstAPI:()=>h,createMockElbFn:()=>C,createMockWindow:()=>M,createTrigger:()=>A,fullConsent:()=>c,fullConsentMapped:()=>d,marketingOnlyConsent:()=>y,marketingOnlyMapped:()=>v,minimalConsent:()=>g,minimalConsentMapped:()=>f,mockEnv:()=>F,noConsent:()=>p,noopLogger:()=>b,partialConsent:()=>l,partialConsentMapped:()=>m,step:()=>O,trigger:()=>L});var c={necessary:!0,functional:!0,performance:!0,advertising:!0},l={necessary:!0,functional:!0,performance:!1,advertising:!1},g={necessary:!0,functional:!1,performance:!1,advertising:!1},p=null,u={necessary:!0,functional:!1,performance:!0,advertising:!1},y={necessary:!0,functional:!1,performance:!1,advertising:!0},d={necessary:!0,functional:!0,analytics:!0,marketing:!0},m={necessary:!0,functional:!0,analytics:!1,marketing:!1},f={necessary:!0,functional:!1,analytics:!1,marketing:!1},k={necessary:!0,functional:!1,analytics:!0,marketing:!1},v={necessary:!0,functional:!1,analytics:!1,marketing:!0},w=()=>{},C=()=>()=>Promise.resolve({ok:!0}),b={error:w,warn:w,info:w,debug:w,throw:e=>{throw"string"==typeof e?new Error(e):e},json:w,scope:()=>b},h=(e=null)=>({consent:e}),M=(e=null)=>({CookieFirst:h(e),addEventListener:w,removeEventListener:w}),F={get push(){return C()},get command(){return C()},get elb(){return C()},get window(){return M()},logger:b},O={};o(O,{categoryMapOverride:()=>E,cfInitDetection:()=>S,fullConsent:()=>j,partialConsent:()=>P});var j={title:"Full consent",description:"CookieFirst reports all categories granted and the source forwards a walker consent command with all groups true.",trigger:{type:"consent"},in:{necessary:!0,functional:!0,performance:!0,advertising:!0},out:[["elb","walker consent",{necessary:!0,functional:!0,analytics:!0,marketing:!0}]]},P={title:"Partial consent",description:"A partial CookieFirst grant maps analytics and marketing to false in the emitted walker consent command.",trigger:{type:"consent"},in:{necessary:!0,functional:!0,performance:!1,advertising:!1},out:[["elb","walker consent",{necessary:!0,functional:!0,analytics:!1,marketing:!1}]]},E={title:"Category map override",description:"Custom categoryMap remaps performance to statistics instead of analytics",trigger:{type:"consent"},in:{necessary:!0,functional:!1,performance:!0,advertising:!1},mapping:{settings:{categoryMap:{performance:"statistics"}}},out:[["elb","walker consent",{necessary:!0,functional:!1,statistics:!0,marketing:!1}]]},S={title:"Stored choice at start",description:"CookieFirst already holds the visitor's choice when the source starts, so the read at init emits it.",trigger:{type:"consent"},in:{necessary:!0,functional:!1,performance:!1,advertising:!0},out:[["elb","walker consent",{necessary:!0,functional:!1,analytics:!1,marketing:!0}]]},z=require("@walkeros/collector"),A=async e=>{let t;return{get flow(){return t},trigger:()=>async n=>{var r;if(window.CookieFirst={consent:n},!t){const n=await(0,z.startFlow)({...e,run:null==(r=e.run)||r});return void(t={collector:n.collector,elb:n.elb})}window.dispatchEvent(new CustomEvent("cf_consent",{detail:n}))}}},L=(e,t)=>{const n=t.window;var r;"object"==typeof(r=e)&&null!==r&&!Array.isArray(r)&&Object.values(r).every(e=>void 0===e||"boolean"==typeof e)&&function(e){return"object"==typeof e&&null!==e&&"addEventListener"in e}(n)&&(n.CookieFirst={consent:e})};var q={};o(q,{SettingsSchema:()=>x,settings:()=>I});var D=require("@walkeros/core/dev"),_=require("@walkeros/core/dev"),x=_.z.object({categoryMap:_.z.record(_.z.string(),_.z.string()).describe("Map the CMP's consent categories (keys) to walkerOS consent groups (values).").optional(),globalName:_.z.string().describe("Custom name for the CookieFirst global on window. Default: 'CookieFirst'.").optional()}).meta({id:"CookieFirstSettings",title:"Settings",description:"Settings for the CookieFirst CMP source."}),I=(0,D.zodToSchema)(x);//# sourceMappingURL=dev.js.map
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})},i={};o(i,{examples:()=>s,schemas:()=>q}),module.exports=(e=i,((e,o,i,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let c of r(o))a.call(e,c)||c===i||t(e,c,{get:()=>o[c],enumerable:!(s=n(o,c))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s={};o(s,{analyticsOnlyConsent:()=>u,analyticsOnlyMapped:()=>k,createMockCookieFirstAPI:()=>h,createMockElbFn:()=>C,createMockWindow:()=>M,createTrigger:()=>A,fullConsent:()=>c,fullConsentMapped:()=>d,marketingOnlyConsent:()=>y,marketingOnlyMapped:()=>v,minimalConsent:()=>g,minimalConsentMapped:()=>f,mockEnv:()=>F,noConsent:()=>p,noopLogger:()=>b,partialConsent:()=>l,partialConsentMapped:()=>m,step:()=>O,trigger:()=>L});var c={necessary:!0,functional:!0,performance:!0,advertising:!0},l={necessary:!0,functional:!0,performance:!1,advertising:!1},g={necessary:!0,functional:!1,performance:!1,advertising:!1},p=null,u={necessary:!0,functional:!1,performance:!0,advertising:!1},y={necessary:!0,functional:!1,performance:!1,advertising:!0},d={necessary:!0,functional:!0,analytics:!0,marketing:!0},m={necessary:!0,functional:!0,analytics:!1,marketing:!1},f={necessary:!0,functional:!1,analytics:!1,marketing:!1},k={necessary:!0,functional:!1,analytics:!0,marketing:!1},v={necessary:!0,functional:!1,analytics:!1,marketing:!0},w=()=>{},C=()=>()=>Promise.resolve({ok:!0}),b={error:w,warn:w,info:w,debug:w,throw:e=>{throw"string"==typeof e?new Error(e):e},json:w,mask:e=>e,scope:()=>b},h=(e=null)=>({consent:e}),M=(e=null)=>({CookieFirst:h(e),addEventListener:w,removeEventListener:w}),F={get push(){return C()},get command(){return C()},get elb(){return C()},get window(){return M()},logger:b},O={};o(O,{categoryMapOverride:()=>E,cfInitDetection:()=>S,fullConsent:()=>j,partialConsent:()=>P});var j={title:"Full consent",description:"CookieFirst reports all categories granted and the source forwards a walker consent command with all groups true.",trigger:{type:"consent"},in:{necessary:!0,functional:!0,performance:!0,advertising:!0},out:[["elb","walker consent",{necessary:!0,functional:!0,analytics:!0,marketing:!0}]]},P={title:"Partial consent",description:"A partial CookieFirst grant maps analytics and marketing to false in the emitted walker consent command.",trigger:{type:"consent"},in:{necessary:!0,functional:!0,performance:!1,advertising:!1},out:[["elb","walker consent",{necessary:!0,functional:!0,analytics:!1,marketing:!1}]]},E={title:"Category map override",description:"Custom categoryMap remaps performance to statistics instead of analytics",trigger:{type:"consent"},in:{necessary:!0,functional:!1,performance:!0,advertising:!1},mapping:{settings:{categoryMap:{performance:"statistics"}}},out:[["elb","walker consent",{necessary:!0,functional:!1,statistics:!0,marketing:!1}]]},S={title:"Stored choice at start",description:"CookieFirst already holds the visitor's choice when the source starts, so the read at init emits it.",trigger:{type:"consent"},in:{necessary:!0,functional:!1,performance:!1,advertising:!0},out:[["elb","walker consent",{necessary:!0,functional:!1,analytics:!1,marketing:!0}]]},z=require("@walkeros/collector"),A=async e=>{let t;return{get flow(){return t},trigger:()=>async n=>{var r;if(window.CookieFirst={consent:n},!t){const n=await(0,z.startFlow)({...e,run:null==(r=e.run)||r});return void(t={collector:n.collector,elb:n.elb})}window.dispatchEvent(new CustomEvent("cf_consent",{detail:n}))}}},L=(e,t)=>{const n=t.window;var r;"object"==typeof(r=e)&&null!==r&&!Array.isArray(r)&&Object.values(r).every(e=>void 0===e||"boolean"==typeof e)&&function(e){return"object"==typeof e&&null!==e&&"addEventListener"in e}(n)&&(n.CookieFirst={consent:e})};var q={};o(q,{SettingsSchema:()=>x,settings:()=>I});var D=require("@walkeros/core/dev"),_=require("@walkeros/core/dev"),x=_.z.object({categoryMap:_.z.record(_.z.string(),_.z.string()).describe("Map the CMP's consent categories (keys) to walkerOS consent groups (values).").optional(),globalName:_.z.string().describe("Custom name for the CookieFirst global on window. Default: 'CookieFirst'.").optional()}).meta({id:"CookieFirstSettings",title:"Settings",description:"Settings for the CookieFirst CMP source."}),I=(0,D.zodToSchema)(x);//# 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","/**\n * CookieFirst source examples for testing and documentation.\n */\n\nexport * from './inputs';\nexport * from './outputs';\nexport * from './env';\nexport * as step from './step';\nexport { createTrigger, trigger } from './trigger';\n","import type { CookieFirstConsent } from '../types';\n\n/**\n * Example CookieFirst consent inputs.\n *\n * These represent real consent states from CookieFirst CMP.\n */\n\n/**\n * Full consent - user accepted all categories\n */\nexport const fullConsent: CookieFirstConsent = {\n necessary: true,\n functional: true,\n performance: true,\n advertising: true,\n};\n\n/**\n * Partial consent - user accepted only necessary and functional\n */\nexport const partialConsent: CookieFirstConsent = {\n necessary: true,\n functional: true,\n performance: false,\n advertising: false,\n};\n\n/**\n * Minimal consent - user accepted only necessary (required)\n */\nexport const minimalConsent: CookieFirstConsent = {\n necessary: true,\n functional: false,\n performance: false,\n advertising: false,\n};\n\n/**\n * No consent - user hasn't made a choice yet\n * CookieFirst returns null when no explicit choice has been made\n */\nexport const noConsent: CookieFirstConsent | null = null;\n\n/**\n * Analytics only - user accepted performance tracking\n */\nexport const analyticsOnlyConsent: CookieFirstConsent = {\n necessary: true,\n functional: false,\n performance: true,\n advertising: false,\n};\n\n/**\n * Marketing only - user accepted advertising\n */\nexport const marketingOnlyConsent: CookieFirstConsent = {\n necessary: true,\n functional: false,\n performance: false,\n advertising: true,\n};\n","import type { WalkerOS } from '@walkeros/core';\n\n/**\n * Expected walkerOS consent outputs.\n *\n * These represent the consent state after mapping CookieFirst categories\n * to walkerOS consent groups using the default category map.\n */\n\n/**\n * Full consent mapped to walkerOS groups\n * (functional → functional, performance → analytics, advertising → marketing;\n * necessary has no entry and keeps its own name)\n */\nexport const fullConsentMapped: WalkerOS.Consent = {\n necessary: true,\n functional: true,\n analytics: true,\n marketing: true,\n};\n\n/**\n * Partial consent mapped to walkerOS groups\n */\nexport const partialConsentMapped: WalkerOS.Consent = {\n necessary: true,\n functional: true,\n analytics: false,\n marketing: false,\n};\n\n/**\n * Minimal consent mapped to walkerOS groups\n */\nexport const minimalConsentMapped: WalkerOS.Consent = {\n necessary: true,\n functional: false,\n analytics: false,\n marketing: false,\n};\n\n/**\n * Analytics only consent mapped to walkerOS groups\n */\nexport const analyticsOnlyMapped: WalkerOS.Consent = {\n necessary: true,\n functional: false,\n analytics: true,\n marketing: false,\n};\n\n/**\n * Marketing only consent mapped to walkerOS groups\n */\nexport const marketingOnlyMapped: WalkerOS.Consent = {\n necessary: true,\n functional: false,\n analytics: false,\n marketing: true,\n};\n","import type { Source, Elb, Logger } from '@walkeros/core';\nimport type { CookieFirstAPI, CookieFirstConsent } from '../types';\n\n/**\n * Example environment configurations for CookieFirst source testing.\n *\n * These provide mock structures for testing consent handling\n * without requiring a real browser environment.\n */\n\n// Simple no-op function for mocking\nconst noop = () => {};\n\n/**\n * Create a properly typed elb/push function mock that returns a promise with PushResult\n */\nexport const createMockElbFn = (): Elb.Fn => {\n const fn: Elb.Fn = () => Promise.resolve({ ok: true });\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 * Minimal window surface the CookieFirst source touches: the CookieFirst\n * global plus event registration.\n */\ntype MockCookieFirstWindow = Partial<Window> & { CookieFirst: CookieFirstAPI };\n\n/**\n * Environment interface for CookieFirst source. Its window is the mock's own\n * narrowed shape, so the mock satisfies it directly.\n */\ninterface CookieFirstEnv extends Source.BaseEnv {\n window?: MockCookieFirstWindow;\n}\n\n/**\n * Create a mock CookieFirst API object\n */\nexport const createMockCookieFirstAPI = (\n consent: CookieFirstConsent | null = null,\n): CookieFirstAPI => ({\n consent,\n});\n\n/**\n * Create a mock window object with CookieFirst\n */\nexport const createMockWindow = (\n consent: CookieFirstConsent | null = null,\n): MockCookieFirstWindow => ({\n CookieFirst: createMockCookieFirstAPI(consent),\n addEventListener: noop,\n removeEventListener: noop,\n});\n\n/**\n * Standard mock environment for testing CookieFirst source\n *\n * Use this for testing consent handling without requiring\n * a real browser environment.\n */\nexport const mockEnv: CookieFirstEnv = {\n get push() {\n return createMockElbFn();\n },\n get command() {\n return createMockElbFn();\n },\n get elb() {\n return createMockElbFn();\n },\n get window() {\n return createMockWindow();\n },\n logger: noopLogger,\n};\n","import type { Flow } from '@walkeros/core';\n\nexport const fullConsent: Flow.StepExample = {\n title: 'Full consent',\n description:\n 'CookieFirst reports all categories granted and the source forwards a walker consent command with all groups true.',\n trigger: { type: 'consent' },\n in: {\n necessary: true,\n functional: true,\n performance: true,\n advertising: true,\n },\n out: [\n [\n 'elb',\n 'walker consent',\n {\n necessary: true,\n functional: true,\n analytics: true,\n marketing: true,\n },\n ],\n ],\n};\n\nexport const partialConsent: Flow.StepExample = {\n title: 'Partial consent',\n description:\n 'A partial CookieFirst grant maps analytics and marketing to false in the emitted walker consent command.',\n trigger: { type: 'consent' },\n in: {\n necessary: true,\n functional: true,\n performance: false,\n advertising: false,\n },\n out: [\n [\n 'elb',\n 'walker consent',\n {\n necessary: true,\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:\n 'Custom categoryMap remaps performance to statistics instead of analytics',\n trigger: { type: 'consent' },\n in: {\n necessary: true,\n functional: false,\n performance: true,\n advertising: false,\n },\n mapping: {\n settings: {\n categoryMap: {\n performance: 'statistics',\n },\n },\n },\n out: [\n [\n 'elb',\n 'walker consent',\n {\n necessary: true,\n functional: false,\n statistics: true,\n marketing: false,\n },\n ],\n ],\n};\n\nexport const cfInitDetection: Flow.StepExample = {\n title: 'Stored choice at start',\n description:\n \"CookieFirst already holds the visitor's choice when the source starts, so the read at init emits it.\",\n trigger: { type: 'consent' },\n in: {\n necessary: true,\n functional: false,\n performance: false,\n advertising: true,\n },\n out: [\n [\n 'elb',\n 'walker consent',\n {\n necessary: true,\n functional: false,\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 { CookieFirstConsent } from '../types';\n\nconst createTrigger: Trigger.CreateFn<CookieFirstConsent, void> = async (\n config: Collector.InitConfig,\n) => {\n let flow: Trigger.FlowHandle | undefined;\n\n const trigger: Trigger.Fn<CookieFirstConsent, void> =\n () => async (content: CookieFirstConsent) => {\n // The banner keeps window.CookieFirst current.\n window.CookieFirst = { consent: content };\n\n // First call, the page load: the source reads the global at init and\n // emits once. No cf_init follows: in a browser it fires when the global\n // appears, so a page where the global is already set has seen it before\n // the source started. One page load emits one consent.\n if (!flow) {\n const result = await startFlow({ ...config, run: config.run ?? true });\n flow = { collector: result.collector, elb: result.elb };\n return;\n }\n\n // Later calls are a decision on the loaded page: CookieFirst announces\n // it with cf_consent, carrying the new consent.\n window.dispatchEvent(\n new CustomEvent<CookieFirstConsent>('cf_consent', { detail: content }),\n );\n };\n\n return {\n get flow() {\n return flow;\n },\n trigger,\n };\n};\n\n/** Sets window.CookieFirst.consent before source init (legacy). */\nconst trigger = (input: unknown, env: Record<string, unknown>): void => {\n const win = env.window;\n if (!isConsent(input) || !isWindow(win)) return;\n win.CookieFirst = { consent: input };\n};\n\nfunction isWindow(value: unknown): value is Window {\n return (\n typeof value === 'object' && value !== null && 'addEventListener' in value\n );\n}\n\nfunction isConsent(value: unknown): value is CookieFirstConsent {\n return (\n typeof value === 'object' &&\n value !== null &&\n !Array.isArray(value) &&\n Object.values(value).every(\n (state) => state === undefined || typeof state === 'boolean',\n )\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 * CookieFirst 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 globalName: z\n .string()\n .describe(\n \"Custom name for the CookieFirst global on window. Default: 'CookieFirst'.\",\n )\n .optional(),\n })\n .meta({\n id: 'CookieFirstSettings',\n title: 'Settings',\n description: 'Settings for the CookieFirst 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;AAAA;;;ACWO,IAAM,cAAkC;AAAA,EAC7C,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,aAAa;AACf;AAKO,IAAM,iBAAqC;AAAA,EAChD,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,aAAa;AACf;AAKO,IAAM,iBAAqC;AAAA,EAChD,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,aAAa;AACf;AAMO,IAAM,YAAuC;AAK7C,IAAM,uBAA2C;AAAA,EACtD,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,aAAa;AACf;AAKO,IAAM,uBAA2C;AAAA,EACtD,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,aAAa;AACf;;;AChDO,IAAM,oBAAsC;AAAA,EACjD,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AACb;AAKO,IAAM,uBAAyC;AAAA,EACpD,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AACb;AAKO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B;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,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;;;ADlBI,IAAM,eAAW,yBAAY,cAAc;","names":["fullConsent","partialConsent","trigger","import_dev"]}
|
|
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","/**\n * CookieFirst source examples for testing and documentation.\n */\n\nexport * from './inputs';\nexport * from './outputs';\nexport * from './env';\nexport * as step from './step';\nexport { createTrigger, trigger } from './trigger';\n","import type { CookieFirstConsent } from '../types';\n\n/**\n * Example CookieFirst consent inputs.\n *\n * These represent real consent states from CookieFirst CMP.\n */\n\n/**\n * Full consent - user accepted all categories\n */\nexport const fullConsent: CookieFirstConsent = {\n necessary: true,\n functional: true,\n performance: true,\n advertising: true,\n};\n\n/**\n * Partial consent - user accepted only necessary and functional\n */\nexport const partialConsent: CookieFirstConsent = {\n necessary: true,\n functional: true,\n performance: false,\n advertising: false,\n};\n\n/**\n * Minimal consent - user accepted only necessary (required)\n */\nexport const minimalConsent: CookieFirstConsent = {\n necessary: true,\n functional: false,\n performance: false,\n advertising: false,\n};\n\n/**\n * No consent - user hasn't made a choice yet\n * CookieFirst returns null when no explicit choice has been made\n */\nexport const noConsent: CookieFirstConsent | null = null;\n\n/**\n * Analytics only - user accepted performance tracking\n */\nexport const analyticsOnlyConsent: CookieFirstConsent = {\n necessary: true,\n functional: false,\n performance: true,\n advertising: false,\n};\n\n/**\n * Marketing only - user accepted advertising\n */\nexport const marketingOnlyConsent: CookieFirstConsent = {\n necessary: true,\n functional: false,\n performance: false,\n advertising: true,\n};\n","import type { WalkerOS } from '@walkeros/core';\n\n/**\n * Expected walkerOS consent outputs.\n *\n * These represent the consent state after mapping CookieFirst categories\n * to walkerOS consent groups using the default category map.\n */\n\n/**\n * Full consent mapped to walkerOS groups\n * (functional → functional, performance → analytics, advertising → marketing;\n * necessary has no entry and keeps its own name)\n */\nexport const fullConsentMapped: WalkerOS.Consent = {\n necessary: true,\n functional: true,\n analytics: true,\n marketing: true,\n};\n\n/**\n * Partial consent mapped to walkerOS groups\n */\nexport const partialConsentMapped: WalkerOS.Consent = {\n necessary: true,\n functional: true,\n analytics: false,\n marketing: false,\n};\n\n/**\n * Minimal consent mapped to walkerOS groups\n */\nexport const minimalConsentMapped: WalkerOS.Consent = {\n necessary: true,\n functional: false,\n analytics: false,\n marketing: false,\n};\n\n/**\n * Analytics only consent mapped to walkerOS groups\n */\nexport const analyticsOnlyMapped: WalkerOS.Consent = {\n necessary: true,\n functional: false,\n analytics: true,\n marketing: false,\n};\n\n/**\n * Marketing only consent mapped to walkerOS groups\n */\nexport const marketingOnlyMapped: WalkerOS.Consent = {\n necessary: true,\n functional: false,\n analytics: false,\n marketing: true,\n};\n","import type { Source, Elb, Logger } from '@walkeros/core';\nimport type { CookieFirstAPI, CookieFirstConsent } from '../types';\n\n/**\n * Example environment configurations for CookieFirst source testing.\n *\n * These provide mock structures for testing consent handling\n * without requiring a real browser environment.\n */\n\n// Simple no-op function for mocking\nconst noop = () => {};\n\n/**\n * Create a properly typed elb/push function mock that returns a promise with PushResult\n */\nexport const createMockElbFn = (): Elb.Fn => {\n const fn: Elb.Fn = () => Promise.resolve({ ok: true });\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 mask: (text: string) => text,\n scope: () => noopLogger,\n};\n\n/**\n * Minimal window surface the CookieFirst source touches: the CookieFirst\n * global plus event registration.\n */\ntype MockCookieFirstWindow = Partial<Window> & { CookieFirst: CookieFirstAPI };\n\n/**\n * Environment interface for CookieFirst source. Its window is the mock's own\n * narrowed shape, so the mock satisfies it directly.\n */\ninterface CookieFirstEnv extends Source.BaseEnv {\n window?: MockCookieFirstWindow;\n}\n\n/**\n * Create a mock CookieFirst API object\n */\nexport const createMockCookieFirstAPI = (\n consent: CookieFirstConsent | null = null,\n): CookieFirstAPI => ({\n consent,\n});\n\n/**\n * Create a mock window object with CookieFirst\n */\nexport const createMockWindow = (\n consent: CookieFirstConsent | null = null,\n): MockCookieFirstWindow => ({\n CookieFirst: createMockCookieFirstAPI(consent),\n addEventListener: noop,\n removeEventListener: noop,\n});\n\n/**\n * Standard mock environment for testing CookieFirst source\n *\n * Use this for testing consent handling without requiring\n * a real browser environment.\n */\nexport const mockEnv: CookieFirstEnv = {\n get push() {\n return createMockElbFn();\n },\n get command() {\n return createMockElbFn();\n },\n get elb() {\n return createMockElbFn();\n },\n get window() {\n return createMockWindow();\n },\n logger: noopLogger,\n};\n","import type { Flow } from '@walkeros/core';\n\nexport const fullConsent: Flow.StepExample = {\n title: 'Full consent',\n description:\n 'CookieFirst reports all categories granted and the source forwards a walker consent command with all groups true.',\n trigger: { type: 'consent' },\n in: {\n necessary: true,\n functional: true,\n performance: true,\n advertising: true,\n },\n out: [\n [\n 'elb',\n 'walker consent',\n {\n necessary: true,\n functional: true,\n analytics: true,\n marketing: true,\n },\n ],\n ],\n};\n\nexport const partialConsent: Flow.StepExample = {\n title: 'Partial consent',\n description:\n 'A partial CookieFirst grant maps analytics and marketing to false in the emitted walker consent command.',\n trigger: { type: 'consent' },\n in: {\n necessary: true,\n functional: true,\n performance: false,\n advertising: false,\n },\n out: [\n [\n 'elb',\n 'walker consent',\n {\n necessary: true,\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:\n 'Custom categoryMap remaps performance to statistics instead of analytics',\n trigger: { type: 'consent' },\n in: {\n necessary: true,\n functional: false,\n performance: true,\n advertising: false,\n },\n mapping: {\n settings: {\n categoryMap: {\n performance: 'statistics',\n },\n },\n },\n out: [\n [\n 'elb',\n 'walker consent',\n {\n necessary: true,\n functional: false,\n statistics: true,\n marketing: false,\n },\n ],\n ],\n};\n\nexport const cfInitDetection: Flow.StepExample = {\n title: 'Stored choice at start',\n description:\n \"CookieFirst already holds the visitor's choice when the source starts, so the read at init emits it.\",\n trigger: { type: 'consent' },\n in: {\n necessary: true,\n functional: false,\n performance: false,\n advertising: true,\n },\n out: [\n [\n 'elb',\n 'walker consent',\n {\n necessary: true,\n functional: false,\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 { CookieFirstConsent } from '../types';\n\nconst createTrigger: Trigger.CreateFn<CookieFirstConsent, void> = async (\n config: Collector.InitConfig,\n) => {\n let flow: Trigger.FlowHandle | undefined;\n\n const trigger: Trigger.Fn<CookieFirstConsent, void> =\n () => async (content: CookieFirstConsent) => {\n // The banner keeps window.CookieFirst current.\n window.CookieFirst = { consent: content };\n\n // First call, the page load: the source reads the global at init and\n // emits once. No cf_init follows: in a browser it fires when the global\n // appears, so a page where the global is already set has seen it before\n // the source started. One page load emits one consent.\n if (!flow) {\n const result = await startFlow({ ...config, run: config.run ?? true });\n flow = { collector: result.collector, elb: result.elb };\n return;\n }\n\n // Later calls are a decision on the loaded page: CookieFirst announces\n // it with cf_consent, carrying the new consent.\n window.dispatchEvent(\n new CustomEvent<CookieFirstConsent>('cf_consent', { detail: content }),\n );\n };\n\n return {\n get flow() {\n return flow;\n },\n trigger,\n };\n};\n\n/** Sets window.CookieFirst.consent before source init (legacy). */\nconst trigger = (input: unknown, env: Record<string, unknown>): void => {\n const win = env.window;\n if (!isConsent(input) || !isWindow(win)) return;\n win.CookieFirst = { consent: input };\n};\n\nfunction isWindow(value: unknown): value is Window {\n return (\n typeof value === 'object' && value !== null && 'addEventListener' in value\n );\n}\n\nfunction isConsent(value: unknown): value is CookieFirstConsent {\n return (\n typeof value === 'object' &&\n value !== null &&\n !Array.isArray(value) &&\n Object.values(value).every(\n (state) => state === undefined || typeof state === 'boolean',\n )\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 * CookieFirst 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 globalName: z\n .string()\n .describe(\n \"Custom name for the CookieFirst global on window. Default: 'CookieFirst'.\",\n )\n .optional(),\n })\n .meta({\n id: 'CookieFirstSettings',\n title: 'Settings',\n description: 'Settings for the CookieFirst 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;AAAA;;;ACWO,IAAM,cAAkC;AAAA,EAC7C,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,aAAa;AACf;AAKO,IAAM,iBAAqC;AAAA,EAChD,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAA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,aAAO;AAAA,IACT;AAAA,IACA,SAAAA;AAAA,EACF;AACF;AAGA,IAAM,UAAU,CAAC,OAAgB,QAAuC;AACtE,QAAM,MAAM,IAAI;AAChB,MAAI,CAAC,UAAU,KAAK,KAAK,CAAC,SAAS,GAAG,EAAG;AACzC,MAAI,cAAc,EAAE,SAAS,MAAM;AACrC;AAEA,SAAS,SAAS,OAAiC;AACjD,SACE,OAAO,UAAU,YAAY,UAAU,QAAQ,sBAAsB;AAEzE;AAEA,SAAS,UAAU,OAA6C;AAC9D,SACE,OAAO,UAAU,YACjB,UAAU,QACV,CAAC,MAAM,QAAQ,KAAK,KACpB,OAAO,OAAO,KAAK,EAAE;AAAA,IACnB,CAAC,UAAU,UAAU,UAAa,OAAO,UAAU;AAAA,EACrD;AAEJ;;;AC7DA;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,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;;;ADlBI,IAAM,eAAW,yBAAY,cAAc;","names":["fullConsent","partialConsent","trigger","import_dev"]}
|
package/dist/dev.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})},n={};t(n,{analyticsOnlyConsent:()=>s,analyticsOnlyMapped:()=>m,createMockCookieFirstAPI:()=>k,createMockElbFn:()=>y,createMockWindow:()=>v,createTrigger:()=>O,fullConsent:()=>r,fullConsentMapped:()=>l,marketingOnlyConsent:()=>c,marketingOnlyMapped:()=>u,minimalConsent:()=>o,minimalConsentMapped:()=>p,mockEnv:()=>w,noConsent:()=>i,noopLogger:()=>f,partialConsent:()=>a,partialConsentMapped:()=>g,step:()=>C,trigger:()=>S});var r={necessary:!0,functional:!0,performance:!0,advertising:!0},a={necessary:!0,functional:!0,performance:!1,advertising:!1},o={necessary:!0,functional:!1,performance:!1,advertising:!1},i=null,s={necessary:!0,functional:!1,performance:!0,advertising:!1},c={necessary:!0,functional:!1,performance:!1,advertising:!0},l={necessary:!0,functional:!0,analytics:!0,marketing:!0},g={necessary:!0,functional:!0,analytics:!1,marketing:!1},p={necessary:!0,functional:!1,analytics:!1,marketing:!1},m={necessary:!0,functional:!1,analytics:!0,marketing:!1},u={necessary:!0,functional:!1,analytics:!1,marketing:!0},d=()=>{},y=()=>()=>Promise.resolve({ok:!0}),f={error:d,warn:d,info:d,debug:d,throw:e=>{throw"string"==typeof e?new Error(e):e},json:d,scope:()=>f},k=(e=null)=>({consent:e}),v=(e=null)=>({CookieFirst:k(e),addEventListener:d,removeEventListener:d}),w={get push(){return y()},get command(){return y()},get elb(){return y()},get window(){return v()},logger:f},C={};t(C,{categoryMapOverride:()=>M,cfInitDetection:()=>F,fullConsent:()=>b,partialConsent:()=>h});var b={title:"Full consent",description:"CookieFirst reports all categories granted and the source forwards a walker consent command with all groups true.",trigger:{type:"consent"},in:{necessary:!0,functional:!0,performance:!0,advertising:!0},out:[["elb","walker consent",{necessary:!0,functional:!0,analytics:!0,marketing:!0}]]},h={title:"Partial consent",description:"A partial CookieFirst grant maps analytics and marketing to false in the emitted walker consent command.",trigger:{type:"consent"},in:{necessary:!0,functional:!0,performance:!1,advertising:!1},out:[["elb","walker consent",{necessary:!0,functional:!0,analytics:!1,marketing:!1}]]},M={title:"Category map override",description:"Custom categoryMap remaps performance to statistics instead of analytics",trigger:{type:"consent"},in:{necessary:!0,functional:!1,performance:!0,advertising:!1},mapping:{settings:{categoryMap:{performance:"statistics"}}},out:[["elb","walker consent",{necessary:!0,functional:!1,statistics:!0,marketing:!1}]]},F={title:"Stored choice at start",description:"CookieFirst already holds the visitor's choice when the source starts, so the read at init emits it.",trigger:{type:"consent"},in:{necessary:!0,functional:!1,performance:!1,advertising:!0},out:[["elb","walker consent",{necessary:!0,functional:!1,analytics:!1,marketing:!0}]]};import{startFlow as E}from"@walkeros/collector";var O=async e=>{let t;return{get flow(){return t},trigger:()=>async n=>{var r;if(window.CookieFirst={consent:n},!t){const n=await E({...e,run:null==(r=e.run)||r});return void(t={collector:n.collector,elb:n.elb})}window.dispatchEvent(new CustomEvent("cf_consent",{detail:n}))}}},S=(e,t)=>{const n=t.window;var r;"object"==typeof(r=e)&&null!==r&&!Array.isArray(r)&&Object.values(r).every(e=>void 0===e||"boolean"==typeof e)&&function(e){return"object"==typeof e&&null!==e&&"addEventListener"in e}(n)&&(n.CookieFirst={consent:e})};var j={};t(j,{SettingsSchema:()=>L,settings:()=>x});import{zodToSchema as P}from"@walkeros/core/dev";import{z as A}from"@walkeros/core/dev";var L=A.object({categoryMap:A.record(A.string(),A.string()).describe("Map the CMP's consent categories (keys) to walkerOS consent groups (values).").optional(),globalName:A.string().describe("Custom name for the CookieFirst global on window. Default: 'CookieFirst'.").optional()}).meta({id:"CookieFirstSettings",title:"Settings",description:"Settings for the CookieFirst CMP source."}),x=P(L);export{n as examples,j as schemas};//# sourceMappingURL=dev.mjs.map
|
|
1
|
+
var e=Object.defineProperty,t=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})},n={};t(n,{analyticsOnlyConsent:()=>s,analyticsOnlyMapped:()=>m,createMockCookieFirstAPI:()=>k,createMockElbFn:()=>y,createMockWindow:()=>v,createTrigger:()=>O,fullConsent:()=>r,fullConsentMapped:()=>l,marketingOnlyConsent:()=>c,marketingOnlyMapped:()=>u,minimalConsent:()=>o,minimalConsentMapped:()=>p,mockEnv:()=>w,noConsent:()=>i,noopLogger:()=>f,partialConsent:()=>a,partialConsentMapped:()=>g,step:()=>C,trigger:()=>S});var r={necessary:!0,functional:!0,performance:!0,advertising:!0},a={necessary:!0,functional:!0,performance:!1,advertising:!1},o={necessary:!0,functional:!1,performance:!1,advertising:!1},i=null,s={necessary:!0,functional:!1,performance:!0,advertising:!1},c={necessary:!0,functional:!1,performance:!1,advertising:!0},l={necessary:!0,functional:!0,analytics:!0,marketing:!0},g={necessary:!0,functional:!0,analytics:!1,marketing:!1},p={necessary:!0,functional:!1,analytics:!1,marketing:!1},m={necessary:!0,functional:!1,analytics:!0,marketing:!1},u={necessary:!0,functional:!1,analytics:!1,marketing:!0},d=()=>{},y=()=>()=>Promise.resolve({ok:!0}),f={error:d,warn:d,info:d,debug:d,throw:e=>{throw"string"==typeof e?new Error(e):e},json:d,mask:e=>e,scope:()=>f},k=(e=null)=>({consent:e}),v=(e=null)=>({CookieFirst:k(e),addEventListener:d,removeEventListener:d}),w={get push(){return y()},get command(){return y()},get elb(){return y()},get window(){return v()},logger:f},C={};t(C,{categoryMapOverride:()=>M,cfInitDetection:()=>F,fullConsent:()=>b,partialConsent:()=>h});var b={title:"Full consent",description:"CookieFirst reports all categories granted and the source forwards a walker consent command with all groups true.",trigger:{type:"consent"},in:{necessary:!0,functional:!0,performance:!0,advertising:!0},out:[["elb","walker consent",{necessary:!0,functional:!0,analytics:!0,marketing:!0}]]},h={title:"Partial consent",description:"A partial CookieFirst grant maps analytics and marketing to false in the emitted walker consent command.",trigger:{type:"consent"},in:{necessary:!0,functional:!0,performance:!1,advertising:!1},out:[["elb","walker consent",{necessary:!0,functional:!0,analytics:!1,marketing:!1}]]},M={title:"Category map override",description:"Custom categoryMap remaps performance to statistics instead of analytics",trigger:{type:"consent"},in:{necessary:!0,functional:!1,performance:!0,advertising:!1},mapping:{settings:{categoryMap:{performance:"statistics"}}},out:[["elb","walker consent",{necessary:!0,functional:!1,statistics:!0,marketing:!1}]]},F={title:"Stored choice at start",description:"CookieFirst already holds the visitor's choice when the source starts, so the read at init emits it.",trigger:{type:"consent"},in:{necessary:!0,functional:!1,performance:!1,advertising:!0},out:[["elb","walker consent",{necessary:!0,functional:!1,analytics:!1,marketing:!0}]]};import{startFlow as E}from"@walkeros/collector";var O=async e=>{let t;return{get flow(){return t},trigger:()=>async n=>{var r;if(window.CookieFirst={consent:n},!t){const n=await E({...e,run:null==(r=e.run)||r});return void(t={collector:n.collector,elb:n.elb})}window.dispatchEvent(new CustomEvent("cf_consent",{detail:n}))}}},S=(e,t)=>{const n=t.window;var r;"object"==typeof(r=e)&&null!==r&&!Array.isArray(r)&&Object.values(r).every(e=>void 0===e||"boolean"==typeof e)&&function(e){return"object"==typeof e&&null!==e&&"addEventListener"in e}(n)&&(n.CookieFirst={consent:e})};var j={};t(j,{SettingsSchema:()=>L,settings:()=>x});import{zodToSchema as P}from"@walkeros/core/dev";import{z as A}from"@walkeros/core/dev";var L=A.object({categoryMap:A.record(A.string(),A.string()).describe("Map the CMP's consent categories (keys) to walkerOS consent groups (values).").optional(),globalName:A.string().describe("Custom name for the CookieFirst global on window. Default: 'CookieFirst'.").optional()}).meta({id:"CookieFirstSettings",title:"Settings",description:"Settings for the CookieFirst CMP source."}),x=P(L);export{n as examples,j 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":["/**\n * CookieFirst source examples for testing and documentation.\n */\n\nexport * from './inputs';\nexport * from './outputs';\nexport * from './env';\nexport * as step from './step';\nexport { createTrigger, trigger } from './trigger';\n","import type { CookieFirstConsent } from '../types';\n\n/**\n * Example CookieFirst consent inputs.\n *\n * These represent real consent states from CookieFirst CMP.\n */\n\n/**\n * Full consent - user accepted all categories\n */\nexport const fullConsent: CookieFirstConsent = {\n necessary: true,\n functional: true,\n performance: true,\n advertising: true,\n};\n\n/**\n * Partial consent - user accepted only necessary and functional\n */\nexport const partialConsent: CookieFirstConsent = {\n necessary: true,\n functional: true,\n performance: false,\n advertising: false,\n};\n\n/**\n * Minimal consent - user accepted only necessary (required)\n */\nexport const minimalConsent: CookieFirstConsent = {\n necessary: true,\n functional: false,\n performance: false,\n advertising: false,\n};\n\n/**\n * No consent - user hasn't made a choice yet\n * CookieFirst returns null when no explicit choice has been made\n */\nexport const noConsent: CookieFirstConsent | null = null;\n\n/**\n * Analytics only - user accepted performance tracking\n */\nexport const analyticsOnlyConsent: CookieFirstConsent = {\n necessary: true,\n functional: false,\n performance: true,\n advertising: false,\n};\n\n/**\n * Marketing only - user accepted advertising\n */\nexport const marketingOnlyConsent: CookieFirstConsent = {\n necessary: true,\n functional: false,\n performance: false,\n advertising: true,\n};\n","import type { WalkerOS } from '@walkeros/core';\n\n/**\n * Expected walkerOS consent outputs.\n *\n * These represent the consent state after mapping CookieFirst categories\n * to walkerOS consent groups using the default category map.\n */\n\n/**\n * Full consent mapped to walkerOS groups\n * (functional → functional, performance → analytics, advertising → marketing;\n * necessary has no entry and keeps its own name)\n */\nexport const fullConsentMapped: WalkerOS.Consent = {\n necessary: true,\n functional: true,\n analytics: true,\n marketing: true,\n};\n\n/**\n * Partial consent mapped to walkerOS groups\n */\nexport const partialConsentMapped: WalkerOS.Consent = {\n necessary: true,\n functional: true,\n analytics: false,\n marketing: false,\n};\n\n/**\n * Minimal consent mapped to walkerOS groups\n */\nexport const minimalConsentMapped: WalkerOS.Consent = {\n necessary: true,\n functional: false,\n analytics: false,\n marketing: false,\n};\n\n/**\n * Analytics only consent mapped to walkerOS groups\n */\nexport const analyticsOnlyMapped: WalkerOS.Consent = {\n necessary: true,\n functional: false,\n analytics: true,\n marketing: false,\n};\n\n/**\n * Marketing only consent mapped to walkerOS groups\n */\nexport const marketingOnlyMapped: WalkerOS.Consent = {\n necessary: true,\n functional: false,\n analytics: false,\n marketing: true,\n};\n","import type { Source, Elb, Logger } from '@walkeros/core';\nimport type { CookieFirstAPI, CookieFirstConsent } from '../types';\n\n/**\n * Example environment configurations for CookieFirst source testing.\n *\n * These provide mock structures for testing consent handling\n * without requiring a real browser environment.\n */\n\n// Simple no-op function for mocking\nconst noop = () => {};\n\n/**\n * Create a properly typed elb/push function mock that returns a promise with PushResult\n */\nexport const createMockElbFn = (): Elb.Fn => {\n const fn: Elb.Fn = () => Promise.resolve({ ok: true });\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 * Minimal window surface the CookieFirst source touches: the CookieFirst\n * global plus event registration.\n */\ntype MockCookieFirstWindow = Partial<Window> & { CookieFirst: CookieFirstAPI };\n\n/**\n * Environment interface for CookieFirst source. Its window is the mock's own\n * narrowed shape, so the mock satisfies it directly.\n */\ninterface CookieFirstEnv extends Source.BaseEnv {\n window?: MockCookieFirstWindow;\n}\n\n/**\n * Create a mock CookieFirst API object\n */\nexport const createMockCookieFirstAPI = (\n consent: CookieFirstConsent | null = null,\n): CookieFirstAPI => ({\n consent,\n});\n\n/**\n * Create a mock window object with CookieFirst\n */\nexport const createMockWindow = (\n consent: CookieFirstConsent | null = null,\n): MockCookieFirstWindow => ({\n CookieFirst: createMockCookieFirstAPI(consent),\n addEventListener: noop,\n removeEventListener: noop,\n});\n\n/**\n * Standard mock environment for testing CookieFirst source\n *\n * Use this for testing consent handling without requiring\n * a real browser environment.\n */\nexport const mockEnv: CookieFirstEnv = {\n get push() {\n return createMockElbFn();\n },\n get command() {\n return createMockElbFn();\n },\n get elb() {\n return createMockElbFn();\n },\n get window() {\n return createMockWindow();\n },\n logger: noopLogger,\n};\n","import type { Flow } from '@walkeros/core';\n\nexport const fullConsent: Flow.StepExample = {\n title: 'Full consent',\n description:\n 'CookieFirst reports all categories granted and the source forwards a walker consent command with all groups true.',\n trigger: { type: 'consent' },\n in: {\n necessary: true,\n functional: true,\n performance: true,\n advertising: true,\n },\n out: [\n [\n 'elb',\n 'walker consent',\n {\n necessary: true,\n functional: true,\n analytics: true,\n marketing: true,\n },\n ],\n ],\n};\n\nexport const partialConsent: Flow.StepExample = {\n title: 'Partial consent',\n description:\n 'A partial CookieFirst grant maps analytics and marketing to false in the emitted walker consent command.',\n trigger: { type: 'consent' },\n in: {\n necessary: true,\n functional: true,\n performance: false,\n advertising: false,\n },\n out: [\n [\n 'elb',\n 'walker consent',\n {\n necessary: true,\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:\n 'Custom categoryMap remaps performance to statistics instead of analytics',\n trigger: { type: 'consent' },\n in: {\n necessary: true,\n functional: false,\n performance: true,\n advertising: false,\n },\n mapping: {\n settings: {\n categoryMap: {\n performance: 'statistics',\n },\n },\n },\n out: [\n [\n 'elb',\n 'walker consent',\n {\n necessary: true,\n functional: false,\n statistics: true,\n marketing: false,\n },\n ],\n ],\n};\n\nexport const cfInitDetection: Flow.StepExample = {\n title: 'Stored choice at start',\n description:\n \"CookieFirst already holds the visitor's choice when the source starts, so the read at init emits it.\",\n trigger: { type: 'consent' },\n in: {\n necessary: true,\n functional: false,\n performance: false,\n advertising: true,\n },\n out: [\n [\n 'elb',\n 'walker consent',\n {\n necessary: true,\n functional: false,\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 { CookieFirstConsent } from '../types';\n\nconst createTrigger: Trigger.CreateFn<CookieFirstConsent, void> = async (\n config: Collector.InitConfig,\n) => {\n let flow: Trigger.FlowHandle | undefined;\n\n const trigger: Trigger.Fn<CookieFirstConsent, void> =\n () => async (content: CookieFirstConsent) => {\n // The banner keeps window.CookieFirst current.\n window.CookieFirst = { consent: content };\n\n // First call, the page load: the source reads the global at init and\n // emits once. No cf_init follows: in a browser it fires when the global\n // appears, so a page where the global is already set has seen it before\n // the source started. One page load emits one consent.\n if (!flow) {\n const result = await startFlow({ ...config, run: config.run ?? true });\n flow = { collector: result.collector, elb: result.elb };\n return;\n }\n\n // Later calls are a decision on the loaded page: CookieFirst announces\n // it with cf_consent, carrying the new consent.\n window.dispatchEvent(\n new CustomEvent<CookieFirstConsent>('cf_consent', { detail: content }),\n );\n };\n\n return {\n get flow() {\n return flow;\n },\n trigger,\n };\n};\n\n/** Sets window.CookieFirst.consent before source init (legacy). */\nconst trigger = (input: unknown, env: Record<string, unknown>): void => {\n const win = env.window;\n if (!isConsent(input) || !isWindow(win)) return;\n win.CookieFirst = { consent: input };\n};\n\nfunction isWindow(value: unknown): value is Window {\n return (\n typeof value === 'object' && value !== null && 'addEventListener' in value\n );\n}\n\nfunction isConsent(value: unknown): value is CookieFirstConsent {\n return (\n typeof value === 'object' &&\n value !== null &&\n !Array.isArray(value) &&\n Object.values(value).every(\n (state) => state === undefined || typeof state === 'boolean',\n )\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 * CookieFirst 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 globalName: z\n .string()\n .describe(\n \"Custom name for the CookieFirst global on window. Default: 'CookieFirst'.\",\n )\n .optional(),\n })\n .meta({\n id: 'CookieFirstSettings',\n title: 'Settings',\n description: 'Settings for the CookieFirst CMP source.',\n });\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AO,QAAP,YAAc,KAAK,CAAC;AACrE,aAAO,EAAE,WAAW,OAAO,WAAW,KAAK,OAAO,IAAI;AACtD;AAAA,IACF;AAIA,WAAO;AAAA,MACL,IAAI,YAAgC,cAAc,EAAE,QAAQ,QAAQ,CAAC;AAAA,IACvE;AAAA,EACF;AAEF,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,CAAC,UAAU,KAAK,KAAK,CAAC,SAAS,GAAG,EAAG;AACzC,MAAI,cAAc,EAAE,SAAS,MAAM;AACrC;AAEA,SAAS,SAAS,OAAiC;AACjD,SACE,OAAO,UAAU,YAAY,UAAU,QAAQ,sBAAsB;AAEzE;AAEA,SAAS,UAAU,OAA6C;AAC9D,SACE,OAAO,UAAU,YACjB,UAAU,QACV,CAAC,MAAM,QAAQ,KAAK,KACpB,OAAO,OAAO,KAAK,EAAE;AAAA,IACnB,CAAC,UAAU,UAAU,UAAa,OAAO,UAAU;AAAA,EACrD;AAEJ;;;AC7DA;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,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;;;ADlBI,IAAM,WAAW,YAAY,cAAc;","names":["fullConsent","partialConsent","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":["/**\n * CookieFirst source examples for testing and documentation.\n */\n\nexport * from './inputs';\nexport * from './outputs';\nexport * from './env';\nexport * as step from './step';\nexport { createTrigger, trigger } from './trigger';\n","import type { CookieFirstConsent } from '../types';\n\n/**\n * Example CookieFirst consent inputs.\n *\n * These represent real consent states from CookieFirst CMP.\n */\n\n/**\n * Full consent - user accepted all categories\n */\nexport const fullConsent: CookieFirstConsent = {\n necessary: true,\n functional: true,\n performance: true,\n advertising: true,\n};\n\n/**\n * Partial consent - user accepted only necessary and functional\n */\nexport const partialConsent: CookieFirstConsent = {\n necessary: true,\n functional: true,\n performance: false,\n advertising: false,\n};\n\n/**\n * Minimal consent - user accepted only necessary (required)\n */\nexport const minimalConsent: CookieFirstConsent = {\n necessary: true,\n functional: false,\n performance: false,\n advertising: false,\n};\n\n/**\n * No consent - user hasn't made a choice yet\n * CookieFirst returns null when no explicit choice has been made\n */\nexport const noConsent: CookieFirstConsent | null = null;\n\n/**\n * Analytics only - user accepted performance tracking\n */\nexport const analyticsOnlyConsent: CookieFirstConsent = {\n necessary: true,\n functional: false,\n performance: true,\n advertising: false,\n};\n\n/**\n * Marketing only - user accepted advertising\n */\nexport const marketingOnlyConsent: CookieFirstConsent = {\n necessary: true,\n functional: false,\n performance: false,\n advertising: true,\n};\n","import type { WalkerOS } from '@walkeros/core';\n\n/**\n * Expected walkerOS consent outputs.\n *\n * These represent the consent state after mapping CookieFirst categories\n * to walkerOS consent groups using the default category map.\n */\n\n/**\n * Full consent mapped to walkerOS groups\n * (functional → functional, performance → analytics, advertising → marketing;\n * necessary has no entry and keeps its own name)\n */\nexport const fullConsentMapped: WalkerOS.Consent = {\n necessary: true,\n functional: true,\n analytics: true,\n marketing: true,\n};\n\n/**\n * Partial consent mapped to walkerOS groups\n */\nexport const partialConsentMapped: WalkerOS.Consent = {\n necessary: true,\n functional: true,\n analytics: false,\n marketing: false,\n};\n\n/**\n * Minimal consent mapped to walkerOS groups\n */\nexport const minimalConsentMapped: WalkerOS.Consent = {\n necessary: true,\n functional: false,\n analytics: false,\n marketing: false,\n};\n\n/**\n * Analytics only consent mapped to walkerOS groups\n */\nexport const analyticsOnlyMapped: WalkerOS.Consent = {\n necessary: true,\n functional: false,\n analytics: true,\n marketing: false,\n};\n\n/**\n * Marketing only consent mapped to walkerOS groups\n */\nexport const marketingOnlyMapped: WalkerOS.Consent = {\n necessary: true,\n functional: false,\n analytics: false,\n marketing: true,\n};\n","import type { Source, Elb, Logger } from '@walkeros/core';\nimport type { CookieFirstAPI, CookieFirstConsent } from '../types';\n\n/**\n * Example environment configurations for CookieFirst source testing.\n *\n * These provide mock structures for testing consent handling\n * without requiring a real browser environment.\n */\n\n// Simple no-op function for mocking\nconst noop = () => {};\n\n/**\n * Create a properly typed elb/push function mock that returns a promise with PushResult\n */\nexport const createMockElbFn = (): Elb.Fn => {\n const fn: Elb.Fn = () => Promise.resolve({ ok: true });\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 mask: (text: string) => text,\n scope: () => noopLogger,\n};\n\n/**\n * Minimal window surface the CookieFirst source touches: the CookieFirst\n * global plus event registration.\n */\ntype MockCookieFirstWindow = Partial<Window> & { CookieFirst: CookieFirstAPI };\n\n/**\n * Environment interface for CookieFirst source. Its window is the mock's own\n * narrowed shape, so the mock satisfies it directly.\n */\ninterface CookieFirstEnv extends Source.BaseEnv {\n window?: MockCookieFirstWindow;\n}\n\n/**\n * Create a mock CookieFirst API object\n */\nexport const createMockCookieFirstAPI = (\n consent: CookieFirstConsent | null = null,\n): CookieFirstAPI => ({\n consent,\n});\n\n/**\n * Create a mock window object with CookieFirst\n */\nexport const createMockWindow = (\n consent: CookieFirstConsent | null = null,\n): MockCookieFirstWindow => ({\n CookieFirst: createMockCookieFirstAPI(consent),\n addEventListener: noop,\n removeEventListener: noop,\n});\n\n/**\n * Standard mock environment for testing CookieFirst source\n *\n * Use this for testing consent handling without requiring\n * a real browser environment.\n */\nexport const mockEnv: CookieFirstEnv = {\n get push() {\n return createMockElbFn();\n },\n get command() {\n return createMockElbFn();\n },\n get elb() {\n return createMockElbFn();\n },\n get window() {\n return createMockWindow();\n },\n logger: noopLogger,\n};\n","import type { Flow } from '@walkeros/core';\n\nexport const fullConsent: Flow.StepExample = {\n title: 'Full consent',\n description:\n 'CookieFirst reports all categories granted and the source forwards a walker consent command with all groups true.',\n trigger: { type: 'consent' },\n in: {\n necessary: true,\n functional: true,\n performance: true,\n advertising: true,\n },\n out: [\n [\n 'elb',\n 'walker consent',\n {\n necessary: true,\n functional: true,\n analytics: true,\n marketing: true,\n },\n ],\n ],\n};\n\nexport const partialConsent: Flow.StepExample = {\n title: 'Partial consent',\n description:\n 'A partial CookieFirst grant maps analytics and marketing to false in the emitted walker consent command.',\n trigger: { type: 'consent' },\n in: {\n necessary: true,\n functional: true,\n performance: false,\n advertising: false,\n },\n out: [\n [\n 'elb',\n 'walker consent',\n {\n necessary: true,\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:\n 'Custom categoryMap remaps performance to statistics instead of analytics',\n trigger: { type: 'consent' },\n in: {\n necessary: true,\n functional: false,\n performance: true,\n advertising: false,\n },\n mapping: {\n settings: {\n categoryMap: {\n performance: 'statistics',\n },\n },\n },\n out: [\n [\n 'elb',\n 'walker consent',\n {\n necessary: true,\n functional: false,\n statistics: true,\n marketing: false,\n },\n ],\n ],\n};\n\nexport const cfInitDetection: Flow.StepExample = {\n title: 'Stored choice at start',\n description:\n \"CookieFirst already holds the visitor's choice when the source starts, so the read at init emits it.\",\n trigger: { type: 'consent' },\n in: {\n necessary: true,\n functional: false,\n performance: false,\n advertising: true,\n },\n out: [\n [\n 'elb',\n 'walker consent',\n {\n necessary: true,\n functional: false,\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 { CookieFirstConsent } from '../types';\n\nconst createTrigger: Trigger.CreateFn<CookieFirstConsent, void> = async (\n config: Collector.InitConfig,\n) => {\n let flow: Trigger.FlowHandle | undefined;\n\n const trigger: Trigger.Fn<CookieFirstConsent, void> =\n () => async (content: CookieFirstConsent) => {\n // The banner keeps window.CookieFirst current.\n window.CookieFirst = { consent: content };\n\n // First call, the page load: the source reads the global at init and\n // emits once. No cf_init follows: in a browser it fires when the global\n // appears, so a page where the global is already set has seen it before\n // the source started. One page load emits one consent.\n if (!flow) {\n const result = await startFlow({ ...config, run: config.run ?? true });\n flow = { collector: result.collector, elb: result.elb };\n return;\n }\n\n // Later calls are a decision on the loaded page: CookieFirst announces\n // it with cf_consent, carrying the new consent.\n window.dispatchEvent(\n new CustomEvent<CookieFirstConsent>('cf_consent', { detail: content }),\n );\n };\n\n return {\n get flow() {\n return flow;\n },\n trigger,\n };\n};\n\n/** Sets window.CookieFirst.consent before source init (legacy). */\nconst trigger = (input: unknown, env: Record<string, unknown>): void => {\n const win = env.window;\n if (!isConsent(input) || !isWindow(win)) return;\n win.CookieFirst = { consent: input };\n};\n\nfunction isWindow(value: unknown): value is Window {\n return (\n typeof value === 'object' && value !== null && 'addEventListener' in value\n );\n}\n\nfunction isConsent(value: unknown): value is CookieFirstConsent {\n return (\n typeof value === 'object' &&\n value !== null &&\n !Array.isArray(value) &&\n Object.values(value).every(\n (state) => state === undefined || typeof state === 'boolean',\n )\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 * CookieFirst 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 globalName: z\n .string()\n .describe(\n \"Custom name for the CookieFirst global on window. Default: 'CookieFirst'.\",\n )\n .optional(),\n })\n .meta({\n id: 'CookieFirstSettings',\n title: 'Settings',\n description: 'Settings for the CookieFirst 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;AAAA;;;ACWO,IAAM,cAAkC;AAAA,EAC7C,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,aAAa;AACf;AAKO,IAAM,iBAAqC;AAAA,EAChD,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,aAAa;AACf;AAKO,IAAM,iBAAqC;AAAA,EAChD,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,aAAa;AACf;AAMO,IAAM,YAAuC;AAK7C,IAAM,uBAA2C;AAAA,EACtD,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,aAAa;AACf;AAKO,IAAM,uBAA2C;AAAA,EACtD,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,aAAa;AACf;;;AChDO,IAAM,oBAAsC;AAAA,EACjD,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AACb;AAKO,IAAM,uBAAyC;AAAA,EACpD,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AACb;AAKO,IAAM,uBAAyC;AAAA,EACpD,WAAW;AAAA,EACX,YAA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IAAM,iBAAiB,EAC3B,OAAO;AAAA,EACN,aAAa,EACV,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,EAC7B;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;;;ADlBI,IAAM,WAAW,YAAY,cAAc;","names":["fullConsent","partialConsent","trigger"]}
|
package/dist/examples/index.js
CHANGED
package/dist/examples/index.mjs
CHANGED
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/web-source-cmp-cookiefirst",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.10.0-next-1794522704623",
|
|
5
5
|
"type": "source",
|
|
6
6
|
"platform": [
|
|
7
7
|
"web"
|
|
@@ -137,6 +137,9 @@
|
|
|
137
137
|
"json": {
|
|
138
138
|
"$code": "()=>{}"
|
|
139
139
|
},
|
|
140
|
+
"mask": {
|
|
141
|
+
"$code": "e=>e"
|
|
142
|
+
},
|
|
140
143
|
"scope": {
|
|
141
144
|
"$code": "()=>f"
|
|
142
145
|
}
|
|
@@ -162,6 +165,9 @@
|
|
|
162
165
|
"json": {
|
|
163
166
|
"$code": "()=>{}"
|
|
164
167
|
},
|
|
168
|
+
"mask": {
|
|
169
|
+
"$code": "e=>e"
|
|
170
|
+
},
|
|
165
171
|
"scope": {
|
|
166
172
|
"$code": "()=>f"
|
|
167
173
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/web-source-cmp-cookiefirst",
|
|
3
3
|
"description": "CookieFirst consent management source for walkerOS",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.10.0-next-1794522704623",
|
|
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.
|
|
50
|
-
"@walkeros/collector": "4.
|
|
49
|
+
"@walkeros/core": "4.10.0-next-1794522704623",
|
|
50
|
+
"@walkeros/collector": "4.10.0-next-1794522704623"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {},
|
|
53
53
|
"repository": {
|