@walkeros/transformer-validator 2.0.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dev.d.mts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { JSONSchemaType } from 'ajv';
2
+ import { Flow } from '@walkeros/core';
2
3
 
3
4
  /**
4
5
  * Partial JSON Schema type - we auto-add type: 'object'.
@@ -12,6 +13,20 @@ type JsonSchema = Partial<JSONSchemaType<unknown>>;
12
13
  */
13
14
  declare const formatSchema: JsonSchema;
14
15
 
16
+ declare const validEvent: Flow.StepExample;
17
+ declare const invalidFormat: Flow.StepExample;
18
+
19
+ declare const step_invalidFormat: typeof invalidFormat;
20
+ declare const step_validEvent: typeof validEvent;
21
+ declare namespace step {
22
+ export { step_invalidFormat as invalidFormat, step_validEvent as validEvent };
23
+ }
24
+
25
+ declare const index_step: typeof step;
26
+ declare namespace index {
27
+ export { index_step as step };
28
+ }
29
+
15
30
  /**
16
31
  * Development exports for transformer-validator
17
32
  * Used by website documentation and examples
@@ -26,4 +41,4 @@ declare const schemas: {
26
41
  settings: JsonSchema;
27
42
  };
28
43
 
29
- export { formatSchema, schemas, settingsSchema };
44
+ export { index as examples, formatSchema, schemas, settingsSchema };
package/dist/dev.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { JSONSchemaType } from 'ajv';
2
+ import { Flow } from '@walkeros/core';
2
3
 
3
4
  /**
4
5
  * Partial JSON Schema type - we auto-add type: 'object'.
@@ -12,6 +13,20 @@ type JsonSchema = Partial<JSONSchemaType<unknown>>;
12
13
  */
13
14
  declare const formatSchema: JsonSchema;
14
15
 
16
+ declare const validEvent: Flow.StepExample;
17
+ declare const invalidFormat: Flow.StepExample;
18
+
19
+ declare const step_invalidFormat: typeof invalidFormat;
20
+ declare const step_validEvent: typeof validEvent;
21
+ declare namespace step {
22
+ export { step_invalidFormat as invalidFormat, step_validEvent as validEvent };
23
+ }
24
+
25
+ declare const index_step: typeof step;
26
+ declare namespace index {
27
+ export { index_step as step };
28
+ }
29
+
15
30
  /**
16
31
  * Development exports for transformer-validator
17
32
  * Used by website documentation and examples
@@ -26,4 +41,4 @@ declare const schemas: {
26
41
  settings: JsonSchema;
27
42
  };
28
43
 
29
- export { formatSchema, schemas, settingsSchema };
44
+ export { index as examples, formatSchema, schemas, settingsSchema };
package/dist/dev.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,n={};((e,r)=>{for(var o in r)t(e,o,{get:r[o],enumerable:!0})})(n,{formatSchema:()=>p,schemas:()=>c,settingsSchema:()=>s}),module.exports=(e=n,((e,n,p,s)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let c of o(n))i.call(e,c)||c===p||t(e,c,{get:()=>n[c],enumerable:!(s=r(n,c))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var p={type:"object",required:["name","entity","action","data","context","globals","custom","user","nested","consent","id","trigger","timestamp","timing","group","count","version","source"],properties:{name:{type:"string",pattern:"^\\S+ \\S+$"},entity:{type:"string"},action:{type:"string"},data:{type:"object"},context:{type:"object"},globals:{type:"object"},custom:{type:"object"},user:{type:"object"},nested:{type:"array"},consent:{type:"object"},id:{type:"string"},trigger:{type:"string"},timestamp:{type:"number"},timing:{type:"number"},group:{type:"string"},count:{type:"number"},version:{type:"object",required:["source","tagging"],properties:{source:{type:"string"},tagging:{type:"number"}}},source:{type:"object",required:["type","id","previous_id"],properties:{type:{type:"string"},id:{type:"string"},previous_id:{type:"string"}}}}},s={type:"object",properties:{format:{type:"boolean",description:"Validate full WalkerOS.Event structure. Pre-compiled at init.",default:!0},contract:{type:"object",description:"Event-specific validation rules. Entity/action keyed, supports wildcards."}}},c={format:p,settings:s};//# sourceMappingURL=dev.js.map
1
+ "use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,p=(e,r)=>{for(var i in r)t(e,i,{get:r[i],enumerable:!0})},n={};p(n,{examples:()=>s,formatSchema:()=>a,schemas:()=>g,settingsSchema:()=>m}),module.exports=(e=n,((e,p,n,a)=>{if(p&&"object"==typeof p||"function"==typeof p)for(let s of i(p))o.call(e,s)||s===n||t(e,s,{get:()=>p[s],enumerable:!(a=r(p,s))||a.enumerable});return e})(t({},"__esModule",{value:!0}),e));var a={type:"object",required:["name","entity","action","data","context","globals","custom","user","nested","consent","id","trigger","timestamp","timing","group","count","version","source"],properties:{name:{type:"string",pattern:"^\\S+ \\S+$"},entity:{type:"string"},action:{type:"string"},data:{type:"object"},context:{type:"object"},globals:{type:"object"},custom:{type:"object"},user:{type:"object"},nested:{type:"array"},consent:{type:"object"},id:{type:"string"},trigger:{type:"string"},timestamp:{type:"number"},timing:{type:"number"},group:{type:"string"},count:{type:"number"},version:{type:"object",required:["source","tagging"],properties:{source:{type:"string"},tagging:{type:"number"}}},source:{type:"object",required:["type","id","previous_id"],properties:{type:{type:"string"},id:{type:"string"},previous_id:{type:"string"}}}}},s={};p(s,{step:()=>c});var c={};p(c,{invalidFormat:()=>d,validEvent:()=>y});var u=require("@walkeros/core"),y={in:(0,u.getEvent)("product view",{timestamp:1700000700,data:{id:"SKU-100",name:"Trail Runner Pro",price:129.99},source:{type:"web",id:"https://example.com",previous_id:""}}),out:(0,u.getEvent)("product view",{timestamp:1700000700,data:{id:"SKU-100",name:"Trail Runner Pro",price:129.99},source:{type:"web",id:"https://example.com",previous_id:""}})},d={in:{name:"invalid",data:{}},out:!1},m={type:"object",properties:{format:{type:"boolean",description:"Validate full WalkerOS.Event structure. Pre-compiled at init.",default:!0},contract:{type:"object",description:"Event-specific validation rules. Entity/action keyed, supports wildcards."}}},g={format:a,settings:m};//# sourceMappingURL=dev.js.map
package/dist/dev.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/dev.ts","../src/format-schema.ts"],"sourcesContent":["/**\n * Development exports for transformer-validator\n * Used by website documentation and examples\n */\nimport { formatSchema } from './format-schema';\nimport type { JsonSchema } from './types';\n\nexport { formatSchema };\n\n/**\n * JSON Schema describing ValidatorSettings for documentation.\n */\nexport const settingsSchema: JsonSchema = {\n type: 'object',\n properties: {\n format: {\n type: 'boolean',\n description:\n 'Validate full WalkerOS.Event structure. Pre-compiled at init.',\n default: true,\n },\n contract: {\n type: 'object',\n description:\n 'Event-specific validation rules. Entity/action keyed, supports wildcards.',\n },\n },\n};\n\n// Re-export for convenience\nexport const schemas: { format: JsonSchema; settings: JsonSchema } = {\n format: formatSchema,\n settings: settingsSchema,\n};\n","import type { JsonSchema } from './types';\n\n/**\n * Pre-compiled JSON Schema for WalkerOS.Event structure validation.\n * Validates that all required fields exist with correct types.\n */\nexport const formatSchema: JsonSchema = {\n type: 'object',\n required: [\n 'name',\n 'entity',\n 'action',\n 'data',\n 'context',\n 'globals',\n 'custom',\n 'user',\n 'nested',\n 'consent',\n 'id',\n 'trigger',\n 'timestamp',\n 'timing',\n 'group',\n 'count',\n 'version',\n 'source',\n ],\n properties: {\n name: { type: 'string', pattern: '^\\\\S+ \\\\S+$' }, // \"entity action\"\n entity: { type: 'string' },\n action: { type: 'string' },\n data: { type: 'object' },\n context: { type: 'object' },\n globals: { type: 'object' },\n custom: { type: 'object' },\n user: { type: 'object' },\n nested: { type: 'array' },\n consent: { type: 'object' },\n id: { type: 'string' },\n trigger: { type: 'string' },\n timestamp: { type: 'number' },\n timing: { type: 'number' },\n group: { type: 'string' },\n count: { type: 'number' },\n version: {\n type: 'object',\n required: ['source', 'tagging'],\n properties: {\n source: { type: 'string' },\n tagging: { type: 'number' },\n },\n },\n source: {\n type: 'object',\n required: ['type', 'id', 'previous_id'],\n properties: {\n type: { type: 'string' },\n id: { type: 'string' },\n previous_id: { type: 'string' },\n },\n },\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMO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AAAA,QACrB,aAAa,EAAE,MAAM,SAAS;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AACF;;;ADnDO,IAAM,iBAA6B;AAAA,EACxC,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,aACE;AAAA,MACF,SAAS;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,MACN,aACE;AAAA,IACJ;AAAA,EACF;AACF;AAGO,IAAM,UAAwD;AAAA,EACnE,QAAQ;AAAA,EACR,UAAU;AACZ;","names":[]}
1
+ {"version":3,"sources":["../src/dev.ts","../src/format-schema.ts","../src/examples/index.ts","../src/examples/step.ts"],"sourcesContent":["/**\n * Development exports for transformer-validator\n * Used by website documentation and examples\n */\nimport { formatSchema } from './format-schema';\nimport type { JsonSchema } from './types';\n\nexport { formatSchema };\n\n/**\n * JSON Schema describing ValidatorSettings for documentation.\n */\nexport const settingsSchema: JsonSchema = {\n type: 'object',\n properties: {\n format: {\n type: 'boolean',\n description:\n 'Validate full WalkerOS.Event structure. Pre-compiled at init.',\n default: true,\n },\n contract: {\n type: 'object',\n description:\n 'Event-specific validation rules. Entity/action keyed, supports wildcards.',\n },\n },\n};\n\n// Re-export for convenience\nexport const schemas: { format: JsonSchema; settings: JsonSchema } = {\n format: formatSchema,\n settings: settingsSchema,\n};\n\nexport * as examples from './examples';\n","import type { JsonSchema } from './types';\n\n/**\n * Pre-compiled JSON Schema for WalkerOS.Event structure validation.\n * Validates that all required fields exist with correct types.\n */\nexport const formatSchema: JsonSchema = {\n type: 'object',\n required: [\n 'name',\n 'entity',\n 'action',\n 'data',\n 'context',\n 'globals',\n 'custom',\n 'user',\n 'nested',\n 'consent',\n 'id',\n 'trigger',\n 'timestamp',\n 'timing',\n 'group',\n 'count',\n 'version',\n 'source',\n ],\n properties: {\n name: { type: 'string', pattern: '^\\\\S+ \\\\S+$' }, // \"entity action\"\n entity: { type: 'string' },\n action: { type: 'string' },\n data: { type: 'object' },\n context: { type: 'object' },\n globals: { type: 'object' },\n custom: { type: 'object' },\n user: { type: 'object' },\n nested: { type: 'array' },\n consent: { type: 'object' },\n id: { type: 'string' },\n trigger: { type: 'string' },\n timestamp: { type: 'number' },\n timing: { type: 'number' },\n group: { type: 'string' },\n count: { type: 'number' },\n version: {\n type: 'object',\n required: ['source', 'tagging'],\n properties: {\n source: { type: 'string' },\n tagging: { type: 'number' },\n },\n },\n source: {\n type: 'object',\n required: ['type', 'id', 'previous_id'],\n properties: {\n type: { type: 'string' },\n id: { type: 'string' },\n previous_id: { type: 'string' },\n },\n },\n },\n};\n","export * as step from './step';\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\nexport const validEvent: Flow.StepExample = {\n in: getEvent('product view', {\n timestamp: 1700000700,\n data: { id: 'SKU-100', name: 'Trail Runner Pro', price: 129.99 },\n source: { type: 'web', id: 'https://example.com', previous_id: '' },\n }),\n out: getEvent('product view', {\n timestamp: 1700000700,\n data: { id: 'SKU-100', name: 'Trail Runner Pro', price: 129.99 },\n source: { type: 'web', id: 'https://example.com', previous_id: '' },\n }),\n};\n\nexport const invalidFormat: Flow.StepExample = {\n in: {\n name: 'invalid',\n data: {},\n },\n out: false,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMO,IAAM,eAA2B;AAAA,EACtC,MAAM;AAAA,EACN,UAAU;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,MAAM,EAAE,MAAM,UAAU,SAAS,cAAc;AAAA;AAAA,IAC/C,QAAQ,EAAE,MAAM,SAAS;AAAA,IACz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ACD,SAAK,sBAAS,gBAAgB;AAAA,IAC5B,WAAW;AAAA,IACX,MAAM,EAAE,IAAI,WAAW,MAAM,oBAAoB,OAAO,OAAO;AAAA,IAC/D,QAAQ,EAAE,MAAM,OAAO,IAAI,uBAAuB,aAAa,GAAG;AAAA,EACpE,CAAC;AACH;AAEO,IAAM,gBAAkC;AAAA,EAC7C,IAAI;AAAA,IACF,MAAM;AAAA,IACN,MAAM,CAAC;AAAA,EACT;AAAA,EACA,KAAK;AACP;;;AHVO,IAAM,iBAA6B;AAAA,EACxC,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,aACE;AAAA,MACF,SAAS;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,MACN,aACE;AAAA,IACJ;AAAA,EACF;AACF;AAGO,IAAM,UAAwD;AAAA,EACnE,QAAQ;AAAA,EACR,UAAU;AACZ;","names":[]}
package/dist/dev.mjs CHANGED
@@ -1 +1 @@
1
- var t={type:"object",required:["name","entity","action","data","context","globals","custom","user","nested","consent","id","trigger","timestamp","timing","group","count","version","source"],properties:{name:{type:"string",pattern:"^\\S+ \\S+$"},entity:{type:"string"},action:{type:"string"},data:{type:"object"},context:{type:"object"},globals:{type:"object"},custom:{type:"object"},user:{type:"object"},nested:{type:"array"},consent:{type:"object"},id:{type:"string"},trigger:{type:"string"},timestamp:{type:"number"},timing:{type:"number"},group:{type:"string"},count:{type:"number"},version:{type:"object",required:["source","tagging"],properties:{source:{type:"string"},tagging:{type:"number"}}},source:{type:"object",required:["type","id","previous_id"],properties:{type:{type:"string"},id:{type:"string"},previous_id:{type:"string"}}}}},e={type:"object",properties:{format:{type:"boolean",description:"Validate full WalkerOS.Event structure. Pre-compiled at init.",default:!0},contract:{type:"object",description:"Event-specific validation rules. Entity/action keyed, supports wildcards."}}},r={format:t,settings:e};export{t as formatSchema,r as schemas,e as settingsSchema};//# sourceMappingURL=dev.mjs.map
1
+ var e=Object.defineProperty,t=(t,r)=>{for(var i in r)e(t,i,{get:r[i],enumerable:!0})},r={type:"object",required:["name","entity","action","data","context","globals","custom","user","nested","consent","id","trigger","timestamp","timing","group","count","version","source"],properties:{name:{type:"string",pattern:"^\\S+ \\S+$"},entity:{type:"string"},action:{type:"string"},data:{type:"object"},context:{type:"object"},globals:{type:"object"},custom:{type:"object"},user:{type:"object"},nested:{type:"array"},consent:{type:"object"},id:{type:"string"},trigger:{type:"string"},timestamp:{type:"number"},timing:{type:"number"},group:{type:"string"},count:{type:"number"},version:{type:"object",required:["source","tagging"],properties:{source:{type:"string"},tagging:{type:"number"}}},source:{type:"object",required:["type","id","previous_id"],properties:{type:{type:"string"},id:{type:"string"},previous_id:{type:"string"}}}}},i={};t(i,{step:()=>p});var p={};t(p,{invalidFormat:()=>a,validEvent:()=>n});import{getEvent as o}from"@walkeros/core";var n={in:o("product view",{timestamp:1700000700,data:{id:"SKU-100",name:"Trail Runner Pro",price:129.99},source:{type:"web",id:"https://example.com",previous_id:""}}),out:o("product view",{timestamp:1700000700,data:{id:"SKU-100",name:"Trail Runner Pro",price:129.99},source:{type:"web",id:"https://example.com",previous_id:""}})},a={in:{name:"invalid",data:{}},out:!1},s={type:"object",properties:{format:{type:"boolean",description:"Validate full WalkerOS.Event structure. Pre-compiled at init.",default:!0},contract:{type:"object",description:"Event-specific validation rules. Entity/action keyed, supports wildcards."}}},c={format:r,settings:s};export{i as examples,r as formatSchema,c as schemas,s as settingsSchema};//# sourceMappingURL=dev.mjs.map
package/dist/dev.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/format-schema.ts","../src/dev.ts"],"sourcesContent":["import type { JsonSchema } from './types';\n\n/**\n * Pre-compiled JSON Schema for WalkerOS.Event structure validation.\n * Validates that all required fields exist with correct types.\n */\nexport const formatSchema: JsonSchema = {\n type: 'object',\n required: [\n 'name',\n 'entity',\n 'action',\n 'data',\n 'context',\n 'globals',\n 'custom',\n 'user',\n 'nested',\n 'consent',\n 'id',\n 'trigger',\n 'timestamp',\n 'timing',\n 'group',\n 'count',\n 'version',\n 'source',\n ],\n properties: {\n name: { type: 'string', pattern: '^\\\\S+ \\\\S+$' }, // \"entity action\"\n entity: { type: 'string' },\n action: { type: 'string' },\n data: { type: 'object' },\n context: { type: 'object' },\n globals: { type: 'object' },\n custom: { type: 'object' },\n user: { type: 'object' },\n nested: { type: 'array' },\n consent: { type: 'object' },\n id: { type: 'string' },\n trigger: { type: 'string' },\n timestamp: { type: 'number' },\n timing: { type: 'number' },\n group: { type: 'string' },\n count: { type: 'number' },\n version: {\n type: 'object',\n required: ['source', 'tagging'],\n properties: {\n source: { type: 'string' },\n tagging: { type: 'number' },\n },\n },\n source: {\n type: 'object',\n required: ['type', 'id', 'previous_id'],\n properties: {\n type: { type: 'string' },\n id: { type: 'string' },\n previous_id: { type: 'string' },\n },\n },\n },\n};\n","/**\n * Development exports for transformer-validator\n * Used by website documentation and examples\n */\nimport { formatSchema } from './format-schema';\nimport type { JsonSchema } from './types';\n\nexport { formatSchema };\n\n/**\n * JSON Schema describing ValidatorSettings for documentation.\n */\nexport const settingsSchema: JsonSchema = {\n type: 'object',\n properties: {\n format: {\n type: 'boolean',\n description:\n 'Validate full WalkerOS.Event structure. Pre-compiled at init.',\n default: true,\n },\n contract: {\n type: 'object',\n description:\n 'Event-specific validation rules. Entity/action keyed, supports wildcards.',\n },\n },\n};\n\n// Re-export for convenience\nexport const schemas: { format: JsonSchema; settings: JsonSchema } = {\n format: formatSchema,\n settings: settingsSchema,\n};\n"],"mappings":";AAMO,IAAM,eAA2B;AAAA,EACtC,MAAM;AAAA,EACN,UAAU;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,YA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ACJ;AAAA,EACF;AACF;AAGO,IAAM,UAAwD;AAAA,EACnE,QAAQ;AAAA,EACR,UAAU;AACZ;","names":[]}
1
+ {"version":3,"sources":["../src/format-schema.ts","../src/examples/index.ts","../src/examples/step.ts","../src/dev.ts"],"sourcesContent":["import type { JsonSchema } from './types';\n\n/**\n * Pre-compiled JSON Schema for WalkerOS.Event structure validation.\n * Validates that all required fields exist with correct types.\n */\nexport const formatSchema: JsonSchema = {\n type: 'object',\n required: [\n 'name',\n 'entity',\n 'action',\n 'data',\n 'context',\n 'globals',\n 'custom',\n 'user',\n 'nested',\n 'consent',\n 'id',\n 'trigger',\n 'timestamp',\n 'timing',\n 'group',\n 'count',\n 'version',\n 'source',\n ],\n properties: {\n name: { type: 'string', pattern: '^\\\\S+ \\\\S+$' }, // \"entity action\"\n entity: { type: 'string' },\n action: { type: 'string' },\n data: { type: 'object' },\n context: { type: 'object' },\n globals: { type: 'object' },\n custom: { type: 'object' },\n user: { type: 'object' },\n nested: { type: 'array' },\n consent: { type: 'object' },\n id: { type: 'string' },\n trigger: { type: 'string' },\n timestamp: { type: 'number' },\n timing: { type: 'number' },\n group: { type: 'string' },\n count: { type: 'number' },\n version: {\n type: 'object',\n required: ['source', 'tagging'],\n properties: {\n source: { type: 'string' },\n tagging: { type: 'number' },\n },\n },\n source: {\n type: 'object',\n required: ['type', 'id', 'previous_id'],\n properties: {\n type: { type: 'string' },\n id: { type: 'string' },\n previous_id: { type: 'string' },\n },\n },\n },\n};\n","export * as step from './step';\n","import type { Flow } from '@walkeros/core';\nimport { getEvent } from '@walkeros/core';\n\nexport const validEvent: Flow.StepExample = {\n in: getEvent('product view', {\n timestamp: 1700000700,\n data: { id: 'SKU-100', name: 'Trail Runner Pro', price: 129.99 },\n source: { type: 'web', id: 'https://example.com', previous_id: '' },\n }),\n out: getEvent('product view', {\n timestamp: 1700000700,\n data: { id: 'SKU-100', name: 'Trail Runner Pro', price: 129.99 },\n source: { type: 'web', id: 'https://example.com', previous_id: '' },\n }),\n};\n\nexport const invalidFormat: Flow.StepExample = {\n in: {\n name: 'invalid',\n data: {},\n },\n out: false,\n};\n","/**\n * Development exports for transformer-validator\n * Used by website documentation and examples\n */\nimport { formatSchema } from './format-schema';\nimport type { JsonSchema } from './types';\n\nexport { formatSchema };\n\n/**\n * JSON Schema describing ValidatorSettings for documentation.\n */\nexport const settingsSchema: JsonSchema = {\n type: 'object',\n properties: {\n format: {\n type: 'boolean',\n description:\n 'Validate full WalkerOS.Event structure. Pre-compiled at init.',\n default: true,\n },\n contract: {\n type: 'object',\n description:\n 'Event-specific validation rules. Entity/action keyed, supports wildcards.',\n },\n },\n};\n\n// Re-export for convenience\nexport const schemas: { format: JsonSchema; settings: JsonSchema } = {\n format: formatSchema,\n settings: settingsSchema,\n};\n\nexport * as examples from './examples';\n"],"mappings":";;;;;;;AAMO,IAAM,eAA2B;AAAA,EACtC,MAAM;AAAA,EACN,UAAU;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,MAAM,EAAE,MAAM,UAAU,SAAS,cAAc;AAAA;AAAA,IAC/C,QAAQ,EAAE,MAAM,SAAS;AAAA,IACzB,QAAQ,EAAE,MAAM,SAAS;AAAA,IACzB,MAAM,EAAE,MAAM,SAAS;AAAA,IACvB,SAAS,EAAE,MAAM,SAAS;AAAA,IAC1B,SAAS,EAAE,MAAM,SAAS;AAAA,IAC1B,QAAQ,EAAE,MAAM,SAAS;AAAA,IACzB,MAAM,EAAE,MAAM,SAAS;AAAA,IACvB,QAAQ,EAAE,MAAM,QAAQ;AAAA,IACxB,SAAS,EAAE,MAAM,SAAS;AAAA,IAC1B,IAAI,EAAE,MAAM,SAAS;AAAA,IACrB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AA,EACxC,MAAM;AAAA,EACN,YAAY;AAAA,IACV,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,aACE;AAAA,MACF,SAAS;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACR,MAAM;AAAA,MACN,aACE;AAAA,IACJ;AAAA,EACF;AACF;AAGO,IAAM,UAAwD;AAAA,EACnE,QAAQ;AAAA,EACR,UAAU;AACZ;","names":[]}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$meta": {
3
3
  "package": "@walkeros/transformer-validator",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "type": "transformer"
6
6
  },
7
7
  "schemas": {
@@ -128,5 +128,109 @@
128
128
  }
129
129
  }
130
130
  },
131
- "examples": {}
131
+ "examples": {
132
+ "step": {
133
+ "invalidFormat": {
134
+ "in": {
135
+ "name": "invalid",
136
+ "data": {}
137
+ },
138
+ "out": false
139
+ },
140
+ "validEvent": {
141
+ "in": {
142
+ "name": "product view",
143
+ "data": {
144
+ "id": "SKU-100",
145
+ "name": "Trail Runner Pro",
146
+ "price": 129.99
147
+ },
148
+ "context": {
149
+ "shopping": [
150
+ "detail",
151
+ 0
152
+ ]
153
+ },
154
+ "globals": {
155
+ "pagegroup": "shop"
156
+ },
157
+ "custom": {
158
+ "completely": "random"
159
+ },
160
+ "user": {
161
+ "id": "us3r",
162
+ "device": "c00k13",
163
+ "session": "s3ss10n"
164
+ },
165
+ "nested": [],
166
+ "consent": {
167
+ "functional": true
168
+ },
169
+ "id": "1700000700-gr0up-1",
170
+ "trigger": "load",
171
+ "entity": "product",
172
+ "action": "view",
173
+ "timestamp": 1700000700,
174
+ "timing": 3.14,
175
+ "group": "gr0up",
176
+ "count": 1,
177
+ "version": {
178
+ "source": "2.0.1",
179
+ "tagging": 1
180
+ },
181
+ "source": {
182
+ "type": "web",
183
+ "id": "https://example.com",
184
+ "previous_id": ""
185
+ }
186
+ },
187
+ "out": {
188
+ "name": "product view",
189
+ "data": {
190
+ "id": "SKU-100",
191
+ "name": "Trail Runner Pro",
192
+ "price": 129.99
193
+ },
194
+ "context": {
195
+ "shopping": [
196
+ "detail",
197
+ 0
198
+ ]
199
+ },
200
+ "globals": {
201
+ "pagegroup": "shop"
202
+ },
203
+ "custom": {
204
+ "completely": "random"
205
+ },
206
+ "user": {
207
+ "id": "us3r",
208
+ "device": "c00k13",
209
+ "session": "s3ss10n"
210
+ },
211
+ "nested": [],
212
+ "consent": {
213
+ "functional": true
214
+ },
215
+ "id": "1700000700-gr0up-1",
216
+ "trigger": "load",
217
+ "entity": "product",
218
+ "action": "view",
219
+ "timestamp": 1700000700,
220
+ "timing": 3.14,
221
+ "group": "gr0up",
222
+ "count": 1,
223
+ "version": {
224
+ "source": "2.0.1",
225
+ "tagging": 1
226
+ },
227
+ "source": {
228
+ "type": "web",
229
+ "id": "https://example.com",
230
+ "previous_id": ""
231
+ }
232
+ }
233
+ }
234
+ }
235
+ }
132
236
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@walkeros/transformer-validator",
3
3
  "description": "Event validation transformer for walkerOS using AJV and JSON Schema",
4
- "version": "2.0.1",
4
+ "version": "2.1.0",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -32,10 +32,10 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "ajv": "^8.17.1",
35
- "@walkeros/core": "^2.0.0"
35
+ "@walkeros/core": "^2.1.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@walkeros/core": "^2.0.0"
38
+ "@walkeros/core": "^2.1.0"
39
39
  },
40
40
  "repository": {
41
41
  "url": "git+https://github.com/elbwalker/walkerOS.git",