@walkeros/web-source-datalayer 2.0.1 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dev.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as _walkeros_core_dev from '@walkeros/core/dev';
2
2
  import { z } from '@walkeros/core/dev';
3
+ import { Source, Flow } from '@walkeros/core';
3
4
 
4
5
  /**
5
6
  * JavaScript variable name
@@ -24,13 +25,53 @@ type Settings = z.infer<typeof SettingsSchema>;
24
25
 
25
26
  declare const settings: _walkeros_core_dev.JSONSchema;
26
27
 
27
- declare const index_EventPrefix: typeof EventPrefix;
28
- declare const index_JavaScriptVarName: typeof JavaScriptVarName;
29
- type index_Settings = Settings;
30
- declare const index_SettingsSchema: typeof SettingsSchema;
31
- declare const index_settings: typeof settings;
28
+ declare const index$1_EventPrefix: typeof EventPrefix;
29
+ declare const index$1_JavaScriptVarName: typeof JavaScriptVarName;
30
+ type index$1_Settings = Settings;
31
+ declare const index$1_SettingsSchema: typeof SettingsSchema;
32
+ declare const index$1_settings: typeof settings;
33
+ declare namespace index$1 {
34
+ export { index$1_EventPrefix as EventPrefix, index$1_JavaScriptVarName as JavaScriptVarName, type index$1_Settings as Settings, index$1_SettingsSchema as SettingsSchema, index$1_settings as settings };
35
+ }
36
+
37
+ /**
38
+ * Environment interface for dataLayer source
39
+ */
40
+ interface DataLayerEnv extends Source.BaseEnv {
41
+ window?: typeof window;
42
+ }
43
+ /**
44
+ * Standard mock environment for testing dataLayer source
45
+ *
46
+ * Use this for testing dataLayer.push interception and event transformation
47
+ * without requiring a real browser environment.
48
+ */
49
+ declare const push: DataLayerEnv;
50
+
51
+ declare const env_push: typeof push;
52
+ declare namespace env {
53
+ export { env_push as push };
54
+ }
55
+
56
+ declare const gtagPurchase: Flow.StepExample;
57
+ declare const consentUpdate: Flow.StepExample;
58
+ declare const directEvent: Flow.StepExample;
59
+
60
+ declare const step_consentUpdate: typeof consentUpdate;
61
+ declare const step_directEvent: typeof directEvent;
62
+ declare const step_gtagPurchase: typeof gtagPurchase;
63
+ declare namespace step {
64
+ export { step_consentUpdate as consentUpdate, step_directEvent as directEvent, step_gtagPurchase as gtagPurchase };
65
+ }
66
+
67
+ /** Prepopulates window.dataLayer before source init. */
68
+ declare const setup: Source.SetupFn;
69
+
70
+ declare const index_env: typeof env;
71
+ declare const index_setup: typeof setup;
72
+ declare const index_step: typeof step;
32
73
  declare namespace index {
33
- export { index_EventPrefix as EventPrefix, index_JavaScriptVarName as JavaScriptVarName, type index_Settings as Settings, index_SettingsSchema as SettingsSchema, index_settings as settings };
74
+ export { index_env as env, index_setup as setup, index_step as step };
34
75
  }
35
76
 
36
- export { index as schemas };
77
+ export { index as examples, index$1 as schemas };
package/dist/dev.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as _walkeros_core_dev from '@walkeros/core/dev';
2
2
  import { z } from '@walkeros/core/dev';
3
+ import { Source, Flow } from '@walkeros/core';
3
4
 
4
5
  /**
5
6
  * JavaScript variable name
@@ -24,13 +25,53 @@ type Settings = z.infer<typeof SettingsSchema>;
24
25
 
25
26
  declare const settings: _walkeros_core_dev.JSONSchema;
26
27
 
27
- declare const index_EventPrefix: typeof EventPrefix;
28
- declare const index_JavaScriptVarName: typeof JavaScriptVarName;
29
- type index_Settings = Settings;
30
- declare const index_SettingsSchema: typeof SettingsSchema;
31
- declare const index_settings: typeof settings;
28
+ declare const index$1_EventPrefix: typeof EventPrefix;
29
+ declare const index$1_JavaScriptVarName: typeof JavaScriptVarName;
30
+ type index$1_Settings = Settings;
31
+ declare const index$1_SettingsSchema: typeof SettingsSchema;
32
+ declare const index$1_settings: typeof settings;
33
+ declare namespace index$1 {
34
+ export { index$1_EventPrefix as EventPrefix, index$1_JavaScriptVarName as JavaScriptVarName, type index$1_Settings as Settings, index$1_SettingsSchema as SettingsSchema, index$1_settings as settings };
35
+ }
36
+
37
+ /**
38
+ * Environment interface for dataLayer source
39
+ */
40
+ interface DataLayerEnv extends Source.BaseEnv {
41
+ window?: typeof window;
42
+ }
43
+ /**
44
+ * Standard mock environment for testing dataLayer source
45
+ *
46
+ * Use this for testing dataLayer.push interception and event transformation
47
+ * without requiring a real browser environment.
48
+ */
49
+ declare const push: DataLayerEnv;
50
+
51
+ declare const env_push: typeof push;
52
+ declare namespace env {
53
+ export { env_push as push };
54
+ }
55
+
56
+ declare const gtagPurchase: Flow.StepExample;
57
+ declare const consentUpdate: Flow.StepExample;
58
+ declare const directEvent: Flow.StepExample;
59
+
60
+ declare const step_consentUpdate: typeof consentUpdate;
61
+ declare const step_directEvent: typeof directEvent;
62
+ declare const step_gtagPurchase: typeof gtagPurchase;
63
+ declare namespace step {
64
+ export { step_consentUpdate as consentUpdate, step_directEvent as directEvent, step_gtagPurchase as gtagPurchase };
65
+ }
66
+
67
+ /** Prepopulates window.dataLayer before source init. */
68
+ declare const setup: Source.SetupFn;
69
+
70
+ declare const index_env: typeof env;
71
+ declare const index_setup: typeof setup;
72
+ declare const index_step: typeof step;
32
73
  declare namespace index {
33
- export { index_EventPrefix as EventPrefix, index_JavaScriptVarName as JavaScriptVarName, type index_Settings as Settings, index_SettingsSchema as SettingsSchema, index_settings as settings };
74
+ export { index_env as env, index_setup as setup, index_step as step };
34
75
  }
35
76
 
36
- export { index as schemas };
77
+ export { index as examples, index$1 as schemas };
package/dist/dev.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e,r=Object.defineProperty,a=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,o=(e,a)=>{for(var t in a)r(e,t,{get:a[t],enumerable:!0})},n={};o(n,{schemas:()=>s}),module.exports=(e=n,((e,o,n,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let c of t(o))i.call(e,c)||c===n||r(e,c,{get:()=>o[c],enumerable:!(s=a(o,c))||s.enumerable});return e})(r({},"__esModule",{value:!0}),e));var s={};o(s,{EventPrefix:()=>b,JavaScriptVarName:()=>d,SettingsSchema:()=>p,settings:()=>u});var c=require("@walkeros/core/dev"),l=require("@walkeros/core/dev"),f=require("@walkeros/core/dev"),d=f.z.string().min(1).regex(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,"Must be a valid JavaScript identifier").describe("JavaScript variable name"),b=f.z.string().min(1).describe("Prefix for filtering dataLayer events"),p=l.z.object({name:d.default("dataLayer").describe("DataLayer variable name (default: dataLayer)").optional(),prefix:b.default("dataLayer").describe("Event prefix for filtering which events to process").optional(),filter:l.z.any().describe("Custom filter function: (event: unknown) => boolean | Promise<boolean>").optional()}),u=(0,c.zodToSchema)(p);//# sourceMappingURL=dev.js.map
1
+ "use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,o=(e,a)=>{for(var r in a)t(e,r,{get:a[r],enumerable:!0})},i={};o(i,{examples:()=>v,schemas:()=>s}),module.exports=(e=i,((e,o,i,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let d of r(o))n.call(e,d)||d===i||t(e,d,{get:()=>o[d],enumerable:!(s=a(o,d))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s={};o(s,{EventPrefix:()=>y,JavaScriptVarName:()=>l,SettingsSchema:()=>p,settings:()=>m});var d=require("@walkeros/core/dev"),c=require("@walkeros/core/dev"),u=require("@walkeros/core/dev"),l=u.z.string().min(1).regex(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,"Must be a valid JavaScript identifier").describe("JavaScript variable name"),y=u.z.string().min(1).describe("Prefix for filtering dataLayer events"),p=c.z.object({name:l.default("dataLayer").describe("DataLayer variable name (default: dataLayer)").optional(),prefix:y.default("dataLayer").describe("Event prefix for filtering which events to process").optional(),filter:c.z.any().describe("Custom filter function: (event: unknown) => boolean | Promise<boolean>").optional()}),m=(0,d.zodToSchema)(p),v={};o(v,{env:()=>g,setup:()=>j,step:()=>L});var g={};o(g,{push:()=>h});var f=()=>{},b=()=>()=>Promise.resolve({ok:!0}),_={error:f,warn:f,info:f,debug:f,throw:e=>{throw"string"==typeof e?new Error(e):e},json:f,scope:()=>_},h={get push(){return b()},get command(){return b()},get elb(){return b()},get window(){return{dataLayer:[],addEventListener:f,removeEventListener:f}},logger:_},L={};o(L,{consentUpdate:()=>S,directEvent:()=>P,gtagPurchase:()=>w});var w={in:["event","purchase",{transaction_id:"T-12345",value:25.42,currency:"EUR",items:[{item_id:"SKU-1",item_name:"T-Shirt",quantity:1}]}],out:{name:"dataLayer purchase",data:{transaction_id:"T-12345",value:25.42,currency:"EUR",items:[{item_id:"SKU-1",item_name:"T-Shirt",quantity:1}]},entity:"dataLayer",action:"purchase"}},S={in:["consent","update",{ad_storage:"granted",analytics_storage:"granted"}],out:{name:"dataLayer consent update",data:{ad_storage:"granted",analytics_storage:"granted"},entity:"dataLayer",action:"consent update"}},P={in:{event:"custom_event",category:"engagement",label:"video_play"},out:{name:"dataLayer custom_event",data:{category:"engagement",label:"video_play"},entity:"dataLayer",action:"custom_event"}},j=(e,t)=>{const a=t.window;if(a.dataLayer||(a.dataLayer=[]),Array.isArray(e))for(const t of e)a.dataLayer.push(t);else e&&"object"==typeof e&&a.dataLayer.push(e)};//# sourceMappingURL=dev.js.map
package/dist/dev.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/primitives.ts"],"sourcesContent":["export * as schemas from './schemas';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\n\n// Export primitives\nexport * from './primitives';\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';\nimport { JavaScriptVarName, EventPrefix } from './primitives';\n\n/**\n * DataLayer source settings schema\n */\nexport const SettingsSchema = z.object({\n name: JavaScriptVarName.default('dataLayer')\n .describe('DataLayer variable name (default: dataLayer)')\n .optional(),\n\n prefix: EventPrefix.default('dataLayer')\n .describe('Event prefix for filtering which events to process')\n .optional(),\n\n filter: z\n .any()\n .describe(\n 'Custom filter function: (event: unknown) => boolean | Promise<boolean>',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * JavaScript variable name\n * Used for dataLayer variable naming\n */\nexport const JavaScriptVarName = z\n .string()\n .min(1)\n .regex(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/, 'Must be a valid JavaScript identifier')\n .describe('JavaScript variable name');\n\n/**\n * Event prefix\n * Used for filtering dataLayer events\n */\nexport const EventPrefix = z\n .string()\n .min(1)\n .describe('Prefix for filtering dataLayer events');\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,IAAAC,cAAkB;;;ACAlB,iBAAkB;AAMX,IAAM,oBAAoB,aAC9B,OAAO,EACP,IAAI,CAAC,EACL,MAAM,8BAA8B,uCAAuC,EAC3E,SAAS,0BAA0B;AAM/B,IAAM,cAAc,aACxB,OAAO,EACP,IAAI,CAAC,EACL,SAAS,uCAAuC;;;ADb5C,IAAM,iBAAiB,cAAE,OAAO;AAAA,EACrC,MAAM,kBAAkB,QAAQ,WAAW,EACxC,SAAS,8CAA8C,EACvD,SAAS;AAAA,EAEZ,QAAQ,YAAY,QAAQ,WAAW,EACpC,SAAS,oDAAoD,EAC7D,SAAS;AAAA,EAEZ,QAAQ,cACL,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;ADXM,IAAM,eAAW,yBAAY,cAAc;","names":["import_dev","import_dev"]}
1
+ {"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/primitives.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts","../src/examples/setup.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\n\n// Export primitives\nexport * from './primitives';\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';\nimport { JavaScriptVarName, EventPrefix } from './primitives';\n\n/**\n * DataLayer source settings schema\n */\nexport const SettingsSchema = z.object({\n name: JavaScriptVarName.default('dataLayer')\n .describe('DataLayer variable name (default: dataLayer)')\n .optional(),\n\n prefix: EventPrefix.default('dataLayer')\n .describe('Event prefix for filtering which events to process')\n .optional(),\n\n filter: z\n .any()\n .describe(\n 'Custom filter function: (event: unknown) => boolean | Promise<boolean>',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * JavaScript variable name\n * Used for dataLayer variable naming\n */\nexport const JavaScriptVarName = z\n .string()\n .min(1)\n .regex(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/, 'Must be a valid JavaScript identifier')\n .describe('JavaScript variable name');\n\n/**\n * Event prefix\n * Used for filtering dataLayer events\n */\nexport const EventPrefix = z\n .string()\n .min(1)\n .describe('Prefix for filtering dataLayer events');\n","export * as env from './env';\nexport * as step from './step';\nexport { setup } from './setup';\n","import type { Source, Elb, Logger } from '@walkeros/core';\n\n/**\n * Example environment configurations for dataLayer source\n *\n * These environments provide standardized mock structures for testing\n * dataLayer interception without requiring a real window object.\n */\n\n// Simple no-op function for mocking\nconst noop = () => {};\n\n// Create a properly typed elb/push/command function that returns a promise with PushResult\nconst createMockElbFn = (): Elb.Fn => {\n const fn = (() =>\n Promise.resolve({\n ok: true,\n })) as Elb.Fn;\n return fn;\n};\n\n// Simple no-op logger for demo purposes\nconst 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 * Environment interface for dataLayer source\n */\ninterface DataLayerEnv extends Source.BaseEnv {\n window?: typeof window;\n}\n\n/**\n * Mock window object with dataLayer array\n */\nconst createMockWindow = () => ({\n dataLayer: [] as unknown[],\n addEventListener: noop,\n removeEventListener: noop,\n});\n\n/**\n * Standard mock environment for testing dataLayer source\n *\n * Use this for testing dataLayer.push interception and event transformation\n * without requiring a real browser environment.\n */\nexport const push: DataLayerEnv = {\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() as unknown as typeof window;\n },\n logger: noopLogger,\n};\n","import type { Flow } from '@walkeros/core';\n\nexport const gtagPurchase: Flow.StepExample = {\n in: [\n 'event',\n 'purchase',\n {\n transaction_id: 'T-12345',\n value: 25.42,\n currency: 'EUR',\n items: [{ item_id: 'SKU-1', item_name: 'T-Shirt', quantity: 1 }],\n },\n ],\n out: {\n name: 'dataLayer purchase',\n data: {\n transaction_id: 'T-12345',\n value: 25.42,\n currency: 'EUR',\n items: [{ item_id: 'SKU-1', item_name: 'T-Shirt', quantity: 1 }],\n },\n entity: 'dataLayer',\n action: 'purchase',\n },\n};\n\nexport const consentUpdate: Flow.StepExample = {\n in: [\n 'consent',\n 'update',\n {\n ad_storage: 'granted',\n analytics_storage: 'granted',\n },\n ],\n out: {\n name: 'dataLayer consent update',\n data: {\n ad_storage: 'granted',\n analytics_storage: 'granted',\n },\n entity: 'dataLayer',\n action: 'consent update',\n },\n};\n\nexport const directEvent: Flow.StepExample = {\n in: {\n event: 'custom_event',\n category: 'engagement',\n label: 'video_play',\n },\n out: {\n name: 'dataLayer custom_event',\n data: {\n category: 'engagement',\n label: 'video_play',\n },\n entity: 'dataLayer',\n action: 'custom_event',\n },\n};\n","import type { Source } from '@walkeros/core';\n\n/** Prepopulates window.dataLayer before source init. */\nexport const setup: Source.SetupFn = (input, env) => {\n const win = env.window as Window & { dataLayer?: unknown[] };\n if (!win.dataLayer) win.dataLayer = [];\n\n if (Array.isArray(input)) {\n for (const item of input) win.dataLayer.push(item);\n } else if (input && typeof input === 'object') {\n win.dataLayer.push(input);\n }\n};\n"],"mappings":"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","names":["import_dev","import_dev"]}
package/dist/dev.mjs CHANGED
@@ -1 +1 @@
1
- var e=Object.defineProperty,a={};((a,r)=>{for(var t in r)e(a,t,{get:r[t],enumerable:!0})})(a,{EventPrefix:()=>n,JavaScriptVarName:()=>o,SettingsSchema:()=>s,settings:()=>f});import{zodToSchema as r}from"@walkeros/core/dev";import{z as t}from"@walkeros/core/dev";import{z as i}from"@walkeros/core/dev";var o=i.string().min(1).regex(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,"Must be a valid JavaScript identifier").describe("JavaScript variable name"),n=i.string().min(1).describe("Prefix for filtering dataLayer events"),s=t.object({name:o.default("dataLayer").describe("DataLayer variable name (default: dataLayer)").optional(),prefix:n.default("dataLayer").describe("Event prefix for filtering which events to process").optional(),filter:t.any().describe("Custom filter function: (event: unknown) => boolean | Promise<boolean>").optional()}),f=r(s);export{a as schemas};//# sourceMappingURL=dev.mjs.map
1
+ var e=Object.defineProperty,a=(a,t)=>{for(var r in t)e(a,r,{get:t[r],enumerable:!0})},t={};a(t,{EventPrefix:()=>s,JavaScriptVarName:()=>o,SettingsSchema:()=>d,settings:()=>c});import{zodToSchema as r}from"@walkeros/core/dev";import{z as n}from"@walkeros/core/dev";import{z as i}from"@walkeros/core/dev";var o=i.string().min(1).regex(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,"Must be a valid JavaScript identifier").describe("JavaScript variable name"),s=i.string().min(1).describe("Prefix for filtering dataLayer events"),d=n.object({name:o.default("dataLayer").describe("DataLayer variable name (default: dataLayer)").optional(),prefix:s.default("dataLayer").describe("Event prefix for filtering which events to process").optional(),filter:n.any().describe("Custom filter function: (event: unknown) => boolean | Promise<boolean>").optional()}),c=r(d),m={};a(m,{env:()=>u,setup:()=>_,step:()=>g});var u={};a(u,{push:()=>p});var v=()=>{},y=()=>()=>Promise.resolve({ok:!0}),l={error:v,warn:v,info:v,debug:v,throw:e=>{throw"string"==typeof e?new Error(e):e},json:v,scope:()=>l},p={get push(){return y()},get command(){return y()},get elb(){return y()},get window(){return{dataLayer:[],addEventListener:v,removeEventListener:v}},logger:l},g={};a(g,{consentUpdate:()=>b,directEvent:()=>L,gtagPurchase:()=>f});var f={in:["event","purchase",{transaction_id:"T-12345",value:25.42,currency:"EUR",items:[{item_id:"SKU-1",item_name:"T-Shirt",quantity:1}]}],out:{name:"dataLayer purchase",data:{transaction_id:"T-12345",value:25.42,currency:"EUR",items:[{item_id:"SKU-1",item_name:"T-Shirt",quantity:1}]},entity:"dataLayer",action:"purchase"}},b={in:["consent","update",{ad_storage:"granted",analytics_storage:"granted"}],out:{name:"dataLayer consent update",data:{ad_storage:"granted",analytics_storage:"granted"},entity:"dataLayer",action:"consent update"}},L={in:{event:"custom_event",category:"engagement",label:"video_play"},out:{name:"dataLayer custom_event",data:{category:"engagement",label:"video_play"},entity:"dataLayer",action:"custom_event"}},_=(e,a)=>{const t=a.window;if(t.dataLayer||(t.dataLayer=[]),Array.isArray(e))for(const a of e)t.dataLayer.push(a);else e&&"object"==typeof e&&t.dataLayer.push(e)};export{m as examples,t as schemas};//# sourceMappingURL=dev.mjs.map
package/dist/dev.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/primitives.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\n\n// Export primitives\nexport * from './primitives';\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';\nimport { JavaScriptVarName, EventPrefix } from './primitives';\n\n/**\n * DataLayer source settings schema\n */\nexport const SettingsSchema = z.object({\n name: JavaScriptVarName.default('dataLayer')\n .describe('DataLayer variable name (default: dataLayer)')\n .optional(),\n\n prefix: EventPrefix.default('dataLayer')\n .describe('Event prefix for filtering which events to process')\n .optional(),\n\n filter: z\n .any()\n .describe(\n 'Custom filter function: (event: unknown) => boolean | Promise<boolean>',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * JavaScript variable name\n * Used for dataLayer variable naming\n */\nexport const JavaScriptVarName = z\n .string()\n .min(1)\n .regex(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/, 'Must be a valid JavaScript identifier')\n .describe('JavaScript variable name');\n\n/**\n * Event prefix\n * Used for filtering dataLayer events\n */\nexport const EventPrefix = z\n .string()\n .min(1)\n .describe('Prefix for filtering dataLayer events');\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,KAAAA,UAAS;;;ACAlB,SAAS,SAAS;AAMX,IAAM,oBAAoB,EAC9B,OAAO,EACP,IAAI,CAAC,EACL,MAAM,8BAA8B,uCAAuC,EAC3E,SAAS,0BAA0B;AAM/B,IAAM,cAAc,EACxB,OAAO,EACP,IAAI,CAAC,EACL,SAAS,uCAAuC;;;ADb5C,IAAM,iBAAiBC,GAAE,OAAO;AAAA,EACrC,MAAM,kBAAkB,QAAQ,WAAW,EACxC,SAAS,8CAA8C,EACvD,SAAS;AAAA,EAEZ,QAAQ,YAAY,QAAQ,WAAW,EACpC,SAAS,oDAAoD,EAC7D,SAAS;AAAA,EAEZ,QAAQA,GACL,IAAI,EACJ;AAAA,IACC;AAAA,EACF,EACC,SAAS;AACd,CAAC;;;ADXM,IAAM,WAAW,YAAY,cAAc;","names":["z","z"]}
1
+ {"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/primitives.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts","../src/examples/setup.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\n\n// Export primitives\nexport * from './primitives';\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';\nimport { JavaScriptVarName, EventPrefix } from './primitives';\n\n/**\n * DataLayer source settings schema\n */\nexport const SettingsSchema = z.object({\n name: JavaScriptVarName.default('dataLayer')\n .describe('DataLayer variable name (default: dataLayer)')\n .optional(),\n\n prefix: EventPrefix.default('dataLayer')\n .describe('Event prefix for filtering which events to process')\n .optional(),\n\n filter: z\n .any()\n .describe(\n 'Custom filter function: (event: unknown) => boolean | Promise<boolean>',\n )\n .optional(),\n});\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\n/**\n * JavaScript variable name\n * Used for dataLayer variable naming\n */\nexport const JavaScriptVarName = z\n .string()\n .min(1)\n .regex(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/, 'Must be a valid JavaScript identifier')\n .describe('JavaScript variable name');\n\n/**\n * Event prefix\n * Used for filtering dataLayer events\n */\nexport const EventPrefix = z\n .string()\n .min(1)\n .describe('Prefix for filtering dataLayer events');\n","export * as env from './env';\nexport * as step from './step';\nexport { setup } from './setup';\n","import type { Source, Elb, Logger } from '@walkeros/core';\n\n/**\n * Example environment configurations for dataLayer source\n *\n * These environments provide standardized mock structures for testing\n * dataLayer interception without requiring a real window object.\n */\n\n// Simple no-op function for mocking\nconst noop = () => {};\n\n// Create a properly typed elb/push/command function that returns a promise with PushResult\nconst createMockElbFn = (): Elb.Fn => {\n const fn = (() =>\n Promise.resolve({\n ok: true,\n })) as Elb.Fn;\n return fn;\n};\n\n// Simple no-op logger for demo purposes\nconst 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 * Environment interface for dataLayer source\n */\ninterface DataLayerEnv extends Source.BaseEnv {\n window?: typeof window;\n}\n\n/**\n * Mock window object with dataLayer array\n */\nconst createMockWindow = () => ({\n dataLayer: [] as unknown[],\n addEventListener: noop,\n removeEventListener: noop,\n});\n\n/**\n * Standard mock environment for testing dataLayer source\n *\n * Use this for testing dataLayer.push interception and event transformation\n * without requiring a real browser environment.\n */\nexport const push: DataLayerEnv = {\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() as unknown as typeof window;\n },\n logger: noopLogger,\n};\n","import type { Flow } from '@walkeros/core';\n\nexport const gtagPurchase: Flow.StepExample = {\n in: [\n 'event',\n 'purchase',\n {\n transaction_id: 'T-12345',\n value: 25.42,\n currency: 'EUR',\n items: [{ item_id: 'SKU-1', item_name: 'T-Shirt', quantity: 1 }],\n },\n ],\n out: {\n name: 'dataLayer purchase',\n data: {\n transaction_id: 'T-12345',\n value: 25.42,\n currency: 'EUR',\n items: [{ item_id: 'SKU-1', item_name: 'T-Shirt', quantity: 1 }],\n },\n entity: 'dataLayer',\n action: 'purchase',\n },\n};\n\nexport const consentUpdate: Flow.StepExample = {\n in: [\n 'consent',\n 'update',\n {\n ad_storage: 'granted',\n analytics_storage: 'granted',\n },\n ],\n out: {\n name: 'dataLayer consent update',\n data: {\n ad_storage: 'granted',\n analytics_storage: 'granted',\n },\n entity: 'dataLayer',\n action: 'consent update',\n },\n};\n\nexport const directEvent: Flow.StepExample = {\n in: {\n event: 'custom_event',\n category: 'engagement',\n label: 'video_play',\n },\n out: {\n name: 'dataLayer custom_event',\n data: {\n category: 'engagement',\n label: 'video_play',\n },\n entity: 'dataLayer',\n action: 'custom_event',\n },\n};\n","import type { Source } from '@walkeros/core';\n\n/** Prepopulates window.dataLayer before source init. */\nexport const setup: Source.SetupFn = (input, env) => {\n const win = env.window as Window & { dataLayer?: unknown[] };\n if (!win.dataLayer) win.dataLayer = [];\n\n if (Array.isArray(input)) {\n for (const item of input) win.dataLayer.push(item);\n } else if (input && typeof input === 'object') {\n win.dataLayer.push(input);\n }\n};\n"],"mappings":"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","names":["z","z"]}
@@ -1,4 +1,4 @@
1
- import { Source, Mapping } from '@walkeros/core';
1
+ import { Source, Flow } from '@walkeros/core';
2
2
 
3
3
  /**
4
4
  * Environment interface for dataLayer source
@@ -19,83 +19,18 @@ declare namespace env {
19
19
  export { env_push as push };
20
20
  }
21
21
 
22
- /**
23
- * Sample gtag events that would be pushed to dataLayer
24
- * These represent real-world gtag calls that the dataLayer source should transform to WalkerOS events
25
- */
26
- /**
27
- * Consent Mode Events - Primary use case
28
- */
29
- declare function consentUpdate$1(): unknown[];
30
- declare function consentDefault(): unknown[];
31
- /**
32
- * E-commerce Events
33
- */
34
- declare function purchase$1(): unknown[];
35
- declare function add_to_cart$1(): unknown[];
36
- declare function view_item$1(): unknown[];
37
- /**
38
- * Config Events
39
- */
40
- declare function config$1(): unknown[];
41
- /**
42
- * Set Events
43
- */
44
- declare function setCustom(): unknown[];
45
- /**
46
- * Direct dataLayer object pushes (not gtag)
47
- */
48
- declare function directDataLayerEvent(): Record<string, unknown>;
22
+ declare const gtagPurchase: Flow.StepExample;
23
+ declare const consentUpdate: Flow.StepExample;
24
+ declare const directEvent: Flow.StepExample;
49
25
 
50
- declare const events_consentDefault: typeof consentDefault;
51
- declare const events_directDataLayerEvent: typeof directDataLayerEvent;
52
- declare const events_setCustom: typeof setCustom;
53
- declare namespace events {
54
- export { add_to_cart$1 as add_to_cart, config$1 as config, events_consentDefault as consentDefault, consentUpdate$1 as consentUpdate, events_directDataLayerEvent as directDataLayerEvent, purchase$1 as purchase, events_setCustom as setCustom, view_item$1 as view_item };
26
+ declare const step_consentUpdate: typeof consentUpdate;
27
+ declare const step_directEvent: typeof directEvent;
28
+ declare const step_gtagPurchase: typeof gtagPurchase;
29
+ declare namespace step {
30
+ export { step_consentUpdate as consentUpdate, step_directEvent as directEvent, step_gtagPurchase as gtagPurchase };
55
31
  }
56
32
 
57
- /**
58
- * Consent Mode Mapping - Primary use case
59
- * Maps gtag consent events to walker consent commands
60
- */
61
- declare const consentUpdate: Mapping.Rule;
62
- /**
63
- * E-commerce Event Mappings
64
- * Transform GA4 ecommerce events to WalkerOS events
65
- */
66
- declare const purchase: Mapping.Rule;
67
- declare const add_to_cart: Mapping.Rule;
68
- declare const view_item: Mapping.Rule;
69
- /**
70
- * Config Event Mapping
71
- * Transform GA4 config events to WalkerOS page events
72
- */
73
- declare const configGA4: Mapping.Rule;
74
- /**
75
- * Custom Event Mapping
76
- * Handle direct dataLayer pushes
77
- */
78
- declare const customEvent: Mapping.Rule;
79
- /**
80
- * Complete mapping configuration
81
- * Following the same pattern as destination mappings
82
- */
83
- declare const config: Mapping.Rules;
84
- /**
85
- * Minimal consent-only mapping for focused use cases
86
- */
87
- declare const consentOnlyMapping: Mapping.Rules;
88
-
89
- declare const mapping_add_to_cart: typeof add_to_cart;
90
- declare const mapping_config: typeof config;
91
- declare const mapping_configGA4: typeof configGA4;
92
- declare const mapping_consentOnlyMapping: typeof consentOnlyMapping;
93
- declare const mapping_consentUpdate: typeof consentUpdate;
94
- declare const mapping_customEvent: typeof customEvent;
95
- declare const mapping_purchase: typeof purchase;
96
- declare const mapping_view_item: typeof view_item;
97
- declare namespace mapping {
98
- export { mapping_add_to_cart as add_to_cart, mapping_config as config, mapping_configGA4 as configGA4, mapping_consentOnlyMapping as consentOnlyMapping, mapping_consentUpdate as consentUpdate, mapping_customEvent as customEvent, mapping_purchase as purchase, mapping_view_item as view_item };
99
- }
33
+ /** Prepopulates window.dataLayer before source init. */
34
+ declare const setup: Source.SetupFn;
100
35
 
101
- export { events as Events, mapping as Mapping, consentOnlyMapping, consentUpdate$1 as consentUpdateEvent, config as dataLayerExamples, env };
36
+ export { env, setup, step };
@@ -1,4 +1,4 @@
1
- import { Source, Mapping } from '@walkeros/core';
1
+ import { Source, Flow } from '@walkeros/core';
2
2
 
3
3
  /**
4
4
  * Environment interface for dataLayer source
@@ -19,83 +19,18 @@ declare namespace env {
19
19
  export { env_push as push };
20
20
  }
21
21
 
22
- /**
23
- * Sample gtag events that would be pushed to dataLayer
24
- * These represent real-world gtag calls that the dataLayer source should transform to WalkerOS events
25
- */
26
- /**
27
- * Consent Mode Events - Primary use case
28
- */
29
- declare function consentUpdate$1(): unknown[];
30
- declare function consentDefault(): unknown[];
31
- /**
32
- * E-commerce Events
33
- */
34
- declare function purchase$1(): unknown[];
35
- declare function add_to_cart$1(): unknown[];
36
- declare function view_item$1(): unknown[];
37
- /**
38
- * Config Events
39
- */
40
- declare function config$1(): unknown[];
41
- /**
42
- * Set Events
43
- */
44
- declare function setCustom(): unknown[];
45
- /**
46
- * Direct dataLayer object pushes (not gtag)
47
- */
48
- declare function directDataLayerEvent(): Record<string, unknown>;
22
+ declare const gtagPurchase: Flow.StepExample;
23
+ declare const consentUpdate: Flow.StepExample;
24
+ declare const directEvent: Flow.StepExample;
49
25
 
50
- declare const events_consentDefault: typeof consentDefault;
51
- declare const events_directDataLayerEvent: typeof directDataLayerEvent;
52
- declare const events_setCustom: typeof setCustom;
53
- declare namespace events {
54
- export { add_to_cart$1 as add_to_cart, config$1 as config, events_consentDefault as consentDefault, consentUpdate$1 as consentUpdate, events_directDataLayerEvent as directDataLayerEvent, purchase$1 as purchase, events_setCustom as setCustom, view_item$1 as view_item };
26
+ declare const step_consentUpdate: typeof consentUpdate;
27
+ declare const step_directEvent: typeof directEvent;
28
+ declare const step_gtagPurchase: typeof gtagPurchase;
29
+ declare namespace step {
30
+ export { step_consentUpdate as consentUpdate, step_directEvent as directEvent, step_gtagPurchase as gtagPurchase };
55
31
  }
56
32
 
57
- /**
58
- * Consent Mode Mapping - Primary use case
59
- * Maps gtag consent events to walker consent commands
60
- */
61
- declare const consentUpdate: Mapping.Rule;
62
- /**
63
- * E-commerce Event Mappings
64
- * Transform GA4 ecommerce events to WalkerOS events
65
- */
66
- declare const purchase: Mapping.Rule;
67
- declare const add_to_cart: Mapping.Rule;
68
- declare const view_item: Mapping.Rule;
69
- /**
70
- * Config Event Mapping
71
- * Transform GA4 config events to WalkerOS page events
72
- */
73
- declare const configGA4: Mapping.Rule;
74
- /**
75
- * Custom Event Mapping
76
- * Handle direct dataLayer pushes
77
- */
78
- declare const customEvent: Mapping.Rule;
79
- /**
80
- * Complete mapping configuration
81
- * Following the same pattern as destination mappings
82
- */
83
- declare const config: Mapping.Rules;
84
- /**
85
- * Minimal consent-only mapping for focused use cases
86
- */
87
- declare const consentOnlyMapping: Mapping.Rules;
88
-
89
- declare const mapping_add_to_cart: typeof add_to_cart;
90
- declare const mapping_config: typeof config;
91
- declare const mapping_configGA4: typeof configGA4;
92
- declare const mapping_consentOnlyMapping: typeof consentOnlyMapping;
93
- declare const mapping_consentUpdate: typeof consentUpdate;
94
- declare const mapping_customEvent: typeof customEvent;
95
- declare const mapping_purchase: typeof purchase;
96
- declare const mapping_view_item: typeof view_item;
97
- declare namespace mapping {
98
- export { mapping_add_to_cart as add_to_cart, mapping_config as config, mapping_configGA4 as configGA4, mapping_consentOnlyMapping as consentOnlyMapping, mapping_consentUpdate as consentUpdate, mapping_customEvent as customEvent, mapping_purchase as purchase, mapping_view_item as view_item };
99
- }
33
+ /** Prepopulates window.dataLayer before source init. */
34
+ declare const setup: Source.SetupFn;
100
35
 
101
- export { events as Events, mapping as Mapping, consentOnlyMapping, consentUpdate$1 as consentUpdateEvent, config as dataLayerExamples, env };
36
+ export { env, setup, step };