@walkeros/transformer-validate 4.7.2 → 4.8.0-next-1791496487198
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 +16 -0
- package/dist/dev.d.mts +13 -1
- package/dist/dev.d.ts +13 -1
- 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/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/walkerOS.json +65 -3
- package/package.json +4 -3
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setByPath as e}from"@walkeros/core";import*as t from"@cfworker/json-schema";var r=Object.freeze({$schema:"http://json-schema.org/draft-07/schema#",description:"Partial event structure with all fields optional",allOf:[{$ref:"#/definitions/WalkerOSPartialEvent"}],definitions:{WalkerOSProperty:{title:"WalkerOS.Property",description:"PropertyType or an array of PropertyType. Recursive structure for nested objects and arrays.",anyOf:[{$ref:"#/definitions/WalkerOSPropertyType"},{type:"array",items:{$ref:"#/definitions/WalkerOSPropertyType"}}]},WalkerOSPropertyType:{title:"WalkerOS.PropertyType",description:"Base property value types (boolean, string, number, or nested Property record).",anyOf:[{type:"boolean"},{type:"string"},{type:"number"},{type:"object",propertyNames:{type:"string"},additionalProperties:{$ref:"#/definitions/WalkerOSProperty"}}]},WalkerOSProperties:{type:"object",propertyNames:{type:"string"},additionalProperties:{allOf:[{$ref:"#/definitions/WalkerOSProperty"}]},title:"WalkerOS.Properties",description:"Flexible property collection with optional values."},WalkerOSOrderedProperties:{type:"object",propertyNames:{type:"string"},additionalProperties:{type:"array",items:[{$ref:"#/definitions/WalkerOSProperty"},{type:"number"}]},title:"WalkerOS.OrderedProperties",description:"Ordered properties with [value, order] tuples for priority control."},WalkerOSUser:{allOf:[{description:"Flexible property collection with optional values",allOf:[{$ref:"#/definitions/WalkerOSProperties"}]},{type:"object",properties:{id:{description:"User identifier",type:"string"},device:{description:"Device identifier",type:"string"},session:{description:"Session identifier",type:"string"},hash:{description:"Hashed identifier",type:"string"},address:{description:"User address",type:"string"},email:{description:"User email address",type:"string",format:"email",pattern:"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},phone:{description:"User phone number",type:"string"},userAgent:{description:"Browser user agent string",type:"string"},browser:{description:"Browser name",type:"string"},browserVersion:{description:"Browser version",type:"string"},deviceType:{description:"Device type (mobile, desktop, tablet)",type:"string"},os:{description:"Operating system",type:"string"},osVersion:{description:"Operating system version",type:"string"},screenSize:{description:"Screen dimensions",type:"string"},language:{description:"User language",type:"string"},country:{description:"User country",type:"string"},region:{description:"User region/state",type:"string"},city:{description:"User city",type:"string"},zip:{description:"User postal code",type:"string"},timezone:{description:"User timezone",type:"string"},ip:{description:"User IP address",type:"string"},internal:{description:"Internal user flag (employee, test user)",type:"boolean"}},additionalProperties:!1}],title:"WalkerOS.User",description:"User identification and attributes."},__schema0:{description:"Nested entity structure with recursive nesting support",$ref:"#/definitions/WalkerOSEntity"},WalkerOSEntity:{title:"WalkerOS.Entity",description:"Nested entity structure with recursive nesting support.",type:"object",properties:{entity:{type:"string",description:"Entity name"},data:{type:"object",propertyNames:{type:"string"},additionalProperties:{allOf:[{$ref:"#/definitions/WalkerOSProperty"}]},title:"WalkerOS.Properties",description:"Entity-specific properties",allOf:[{$ref:"#/definitions/WalkerOSProperties"}]},nested:{description:"Nested child entities",type:"array",items:{$ref:"#/definitions/__schema0"}},context:{description:"Entity context data",allOf:[{$ref:"#/definitions/WalkerOSOrderedProperties"}]}},required:["entity","data"],additionalProperties:!1},WalkerOSEntities:{type:"array",items:{$ref:"#/definitions/__schema0"},title:"WalkerOS.Entities",description:"Array of nested entities."},WalkerOSConsent:{type:"object",propertyNames:{type:"string"},additionalProperties:{type:"boolean"},title:"WalkerOS.Consent",description:"Consent state mapping. Keys are consent groups (e.g. marketing, functional), values are booleans for granted/denied."},WalkerOSSource:{allOf:[{description:"Flexible property collection with optional values",allOf:[{$ref:"#/definitions/WalkerOSProperties"}]},{type:"object",properties:{type:{type:"string",description:"Source kind (browser, dataLayer, gtag, ...)"},platform:{description:"Runtime platform (web, server, app, ios, android, terminal, ...)",type:"string"},version:{description:"Deployment version of the source emitter",type:"string"},schema:{description:'Event model spec version (collector defaults to "4")',type:"string"},count:{description:"Emission sequence per run",type:"integer",minimum:0,maximum:9007199254740991},trace:{description:"Trace id shared by every event of a run (W3C trace-id shape)",type:"string"},release:{description:"Per-flow config release map, keyed by flow name; accumulates across walkerOS crossings",type:"object",propertyNames:{type:"string"},additionalProperties:{type:"string"}},url:{type:"string"},referrer:{type:"string"},tool:{type:"string"},command:{type:"string"}},required:["type"],additionalProperties:!1}],title:"WalkerOS.Source",description:"Event source information (origin of the event)."},WalkerOSPartialEvent:{type:"object",properties:{name:{type:"string",description:'Event name in "entity action" format (e.g., "page view", "product add")'},data:{type:"object",propertyNames:{type:"string"},additionalProperties:{allOf:[{$ref:"#/definitions/WalkerOSProperty"}]},title:"WalkerOS.Properties",description:"Event-specific properties",allOf:[{$ref:"#/definitions/WalkerOSProperties"}]},context:{type:"object",propertyNames:{type:"string"},additionalProperties:{type:"array",items:[{$ref:"#/definitions/WalkerOSProperty"},{type:"number"}]},title:"WalkerOS.OrderedProperties",description:"Ordered context properties with priorities",allOf:[{$ref:"#/definitions/WalkerOSOrderedProperties"}]},globals:{type:"object",propertyNames:{type:"string"},additionalProperties:{allOf:[{$ref:"#/definitions/WalkerOSProperty"}]},title:"WalkerOS.Properties",description:"Global properties shared across events",allOf:[{$ref:"#/definitions/WalkerOSProperties"}]},custom:{type:"object",propertyNames:{type:"string"},additionalProperties:{allOf:[{$ref:"#/definitions/WalkerOSProperty"}]},title:"WalkerOS.Properties",description:"Custom implementation-specific properties",allOf:[{$ref:"#/definitions/WalkerOSProperties"}]},user:{allOf:[{description:"Flexible property collection with optional values",allOf:[{$ref:"#/definitions/WalkerOSProperties"}]},{type:"object",properties:{id:{description:"User identifier",type:"string"},device:{description:"Device identifier",type:"string"},session:{description:"Session identifier",type:"string"},hash:{description:"Hashed identifier",type:"string"},address:{description:"User address",type:"string"},email:{description:"User email address",type:"string",format:"email",pattern:"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},phone:{description:"User phone number",type:"string"},userAgent:{description:"Browser user agent string",type:"string"},browser:{description:"Browser name",type:"string"},browserVersion:{description:"Browser version",type:"string"},deviceType:{description:"Device type (mobile, desktop, tablet)",type:"string"},os:{description:"Operating system",type:"string"},osVersion:{description:"Operating system version",type:"string"},screenSize:{description:"Screen dimensions",type:"string"},language:{description:"User language",type:"string"},country:{description:"User country",type:"string"},region:{description:"User region/state",type:"string"},city:{description:"User city",type:"string"},zip:{description:"User postal code",type:"string"},timezone:{description:"User timezone",type:"string"},ip:{description:"User IP address",type:"string"},internal:{description:"Internal user flag (employee, test user)",type:"boolean"}},additionalProperties:!1}],title:"WalkerOS.User",description:"User identification and attributes"},nested:{type:"array",items:{$ref:"#/definitions/__schema0"},title:"WalkerOS.Entities",description:"Related nested entities",allOf:[{$ref:"#/definitions/WalkerOSEntities"}]},consent:{type:"object",propertyNames:{type:"string"},additionalProperties:{type:"boolean"},title:"WalkerOS.Consent",description:"Consent states at event time",allOf:[{$ref:"#/definitions/WalkerOSConsent"}]},id:{type:"string",minLength:1,description:"W3C span_id, 16 lowercase hex characters"},trigger:{type:"string",description:"Event trigger identifier"},entity:{type:"string",description:"Parsed entity from event name"},action:{type:"string",description:"Parsed action from event name"},timestamp:{type:"integer",exclusiveMinimum:0,maximum:9007199254740991,description:"Unix timestamp in milliseconds since epoch"},timing:{type:"number",description:"Event processing timing information"},source:{allOf:[{description:"Flexible property collection with optional values",allOf:[{$ref:"#/definitions/WalkerOSProperties"}]},{type:"object",properties:{type:{type:"string",description:"Source kind (browser, dataLayer, gtag, ...)"},platform:{description:"Runtime platform (web, server, app, ios, android, terminal, ...)",type:"string"},version:{description:"Deployment version of the source emitter",type:"string"},schema:{description:'Event model spec version (collector defaults to "4")',type:"string"},count:{description:"Emission sequence per run",type:"integer",minimum:0,maximum:9007199254740991},trace:{description:"Trace id shared by every event of a run (W3C trace-id shape)",type:"string"},release:{description:"Per-flow config release map, keyed by flow name; accumulates across walkerOS crossings",type:"object",propertyNames:{type:"string"},additionalProperties:{type:"string"}},url:{type:"string"},referrer:{type:"string"},tool:{type:"string"},command:{type:"string"}},required:["type"],additionalProperties:!1}],title:"WalkerOS.Source",description:"Event source information"}},additionalProperties:!1,title:"WalkerOS.PartialEvent",description:"Partial event structure with all fields optional."}}}),i=new Map;function n(e){if("object"!=typeof e||null===e)return!1;return"events"in e&&"object"==typeof e.events&&null!==e.events||"schema"in e}function s(e,t,r){return e[t]?.[r]??e[t]?.["*"]??e["*"]?.[r]??e["*"]?.["*"]}function o(e){if(Array.isArray(e)){let t=!1;const r=e.map(e=>{const r=void 0===e?null:o(e);return r!==e&&(t=!0),r});return t?r:e}if("object"!=typeof e||null===e)return e;let t=!1;const r={};for(const[i,n]of Object.entries(e)){if(void 0===n){t=!0;continue}const e=o(n);e!==n&&(t=!0),r[i]=e}return t?r:e}function p(e,p,a){const l=function(e,t){const i=[];t.format&&i.push(r);for(const r of t.contracts??[])if(n(r)){const t="string"==typeof e.entity?e.entity:"",n="string"==typeof e.action?e.action:"",o=s(r.events??{},t,n);o&&i.push(o),r.schema&&i.push(r.schema)}else i.push(r);return i}(e,a),d=o(e),c=[];let y;return l.forEach((e,r)=>{try{const r=function(e){const r=JSON.stringify(e),n=i.get(r);if(n)return n;const s=JSON.parse(r),o=new t.Validator(s,"2020-12");return i.set(r,o),o}(e).validate(d);if(r.valid)return;for(const e of r.errors)c.push({path:e.instanceLocation,message:e.error,level:"error"})}catch(e){const t=e instanceof Error?e.message:String(e);y??=t,c.push({path:`schema[${r}]`,message:`Validation engine failed: ${t}`,level:"error"})}}),void 0===y?{isValid:0===c.length,errors:c}:{isValid:!1,errors:c,engineError:y}}var a=t=>{const{config:r}=t,i=r.settings??{},n=i.mode??"pass",s=i.output?.isValid??"source.valid",o=i.output?.errors??"validation";return{type:"validate",config:r,async push(t,r){const{ingest:a}=r,{isValid:l,errors:d,engineError:c}=p(t,0,{contracts:i.contract,format:i.format});c&&r.logger.error("validation engine failed",{event:t.name,error:c}),o&&e(a,o,d,{mutable:!0});let y=t;return s&&(y=e(y,s,l)),!("strict"===n&&!l)&&{event:y}}}};export{a as default,a as transformerValidate,p as validateEventAgainstContract};//# sourceMappingURL=index.mjs.map
|
|
1
|
+
import{setByPath as e}from"@walkeros/core";import*as t from"@cfworker/json-schema";var r=Object.freeze({$schema:"http://json-schema.org/draft-07/schema#",description:"Partial event structure with all fields optional",allOf:[{$ref:"#/definitions/WalkerOSPartialEvent"}],definitions:{WalkerOSProperty:{title:"WalkerOS.Property",description:"PropertyType or an array of PropertyType. Recursive structure for nested objects and arrays.",anyOf:[{$ref:"#/definitions/WalkerOSPropertyType"},{type:"array",items:{$ref:"#/definitions/WalkerOSPropertyType"}}]},WalkerOSPropertyType:{title:"WalkerOS.PropertyType",description:"Base property value types (boolean, string, number, or nested Property record).",anyOf:[{type:"boolean"},{type:"string"},{type:"number"},{type:"object",propertyNames:{type:"string"},additionalProperties:{$ref:"#/definitions/WalkerOSProperty"}}]},WalkerOSProperties:{type:"object",propertyNames:{type:"string"},additionalProperties:{allOf:[{$ref:"#/definitions/WalkerOSProperty"}]},title:"WalkerOS.Properties",description:"Flexible property collection with optional values."},WalkerOSOrderedProperties:{type:"object",propertyNames:{type:"string"},additionalProperties:{type:"array",items:[{$ref:"#/definitions/WalkerOSProperty"},{type:"number"}]},title:"WalkerOS.OrderedProperties",description:"Ordered properties with [value, order] tuples for priority control."},WalkerOSUser:{type:"object",properties:{id:{description:"User identifier",type:"string"},device:{description:"Device identifier",type:"string"},session:{description:"Session identifier",type:"string"},hash:{description:"Hashed identifier",type:"string"},address:{description:"User address",type:"string"},email:{description:"User email address",type:"string",format:"email",pattern:"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},phone:{description:"User phone number",type:"string"},userAgent:{description:"Browser user agent string",type:"string"},browser:{description:"Browser name",type:"string"},browserVersion:{description:"Browser version",type:"string"},deviceType:{description:"Device type (mobile, desktop, tablet)",type:"string"},os:{description:"Operating system",type:"string"},osVersion:{description:"Operating system version",type:"string"},screenSize:{description:"Screen dimensions",type:"string"},language:{description:"User language",type:"string"},country:{description:"User country",type:"string"},region:{description:"User region/state",type:"string"},city:{description:"User city",type:"string"},zip:{description:"User postal code",type:"string"},timezone:{description:"User timezone",type:"string"},ip:{description:"User IP address",type:"string"},internal:{description:"Internal user flag (employee, test user)",type:"boolean"},optout:{description:"User opted out of tracking",type:"boolean"}},additionalProperties:{allOf:[{$ref:"#/definitions/WalkerOSProperty"}]},title:"WalkerOS.User",description:"User identification and attributes."},__schema0:{description:"Nested entity structure with recursive nesting support",$ref:"#/definitions/WalkerOSEntity"},WalkerOSEntity:{title:"WalkerOS.Entity",description:"Nested entity structure with recursive nesting support.",type:"object",properties:{entity:{type:"string",description:"Entity name"},data:{type:"object",propertyNames:{type:"string"},additionalProperties:{allOf:[{$ref:"#/definitions/WalkerOSProperty"}]},title:"WalkerOS.Properties",description:"Entity-specific properties",allOf:[{$ref:"#/definitions/WalkerOSProperties"}]},nested:{description:"Nested child entities",type:"array",items:{$ref:"#/definitions/__schema0"}},context:{description:"Entity context data",allOf:[{$ref:"#/definitions/WalkerOSOrderedProperties"}]}},required:["entity","data"],additionalProperties:!1},WalkerOSEntities:{type:"array",items:{$ref:"#/definitions/__schema0"},title:"WalkerOS.Entities",description:"Array of nested entities."},WalkerOSConsent:{type:"object",propertyNames:{type:"string"},additionalProperties:{type:"boolean"},title:"WalkerOS.Consent",description:"Consent state mapping. Keys are consent groups (e.g. marketing, functional), values are booleans for granted/denied."},WalkerOSSource:{type:"object",properties:{type:{type:"string",description:"Source kind (browser, dataLayer, gtag, ...)"},platform:{description:"Runtime platform (web, server, app, ios, android, terminal, ...)",type:"string"},version:{description:"Deployment version of the source emitter",type:"string"},schema:{description:'Event model spec version (collector defaults to "4")',type:"string"},count:{description:"Emission sequence per run",type:"integer",minimum:0,maximum:9007199254740991},trace:{description:"Trace id shared by every event of a run (W3C trace-id shape)",type:"string"},release:{description:"Per-flow config release map, keyed by flow name; accumulates across walkerOS crossings",type:"object",propertyNames:{type:"string"},additionalProperties:{type:"string"}},url:{type:"string"},referrer:{type:"string"},tool:{type:"string"},command:{type:"string"}},required:["type"],additionalProperties:{allOf:[{$ref:"#/definitions/WalkerOSProperty"}]},title:"WalkerOS.Source",description:"Event source information (origin of the event)."},WalkerOSPartialEvent:{type:"object",properties:{name:{type:"string",description:'Event name in "entity action" format (e.g., "page view", "product add")'},data:{type:"object",propertyNames:{type:"string"},additionalProperties:{allOf:[{$ref:"#/definitions/WalkerOSProperty"}]},title:"WalkerOS.Properties",description:"Event-specific properties",allOf:[{$ref:"#/definitions/WalkerOSProperties"}]},context:{type:"object",propertyNames:{type:"string"},additionalProperties:{type:"array",items:[{$ref:"#/definitions/WalkerOSProperty"},{type:"number"}]},title:"WalkerOS.OrderedProperties",description:"Ordered context properties with priorities",allOf:[{$ref:"#/definitions/WalkerOSOrderedProperties"}]},globals:{type:"object",propertyNames:{type:"string"},additionalProperties:{allOf:[{$ref:"#/definitions/WalkerOSProperty"}]},title:"WalkerOS.Properties",description:"Global properties shared across events",allOf:[{$ref:"#/definitions/WalkerOSProperties"}]},custom:{type:"object",propertyNames:{type:"string"},additionalProperties:{allOf:[{$ref:"#/definitions/WalkerOSProperty"}]},title:"WalkerOS.Properties",description:"Custom implementation-specific properties",allOf:[{$ref:"#/definitions/WalkerOSProperties"}]},user:{type:"object",properties:{id:{description:"User identifier",type:"string"},device:{description:"Device identifier",type:"string"},session:{description:"Session identifier",type:"string"},hash:{description:"Hashed identifier",type:"string"},address:{description:"User address",type:"string"},email:{description:"User email address",type:"string",format:"email",pattern:"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},phone:{description:"User phone number",type:"string"},userAgent:{description:"Browser user agent string",type:"string"},browser:{description:"Browser name",type:"string"},browserVersion:{description:"Browser version",type:"string"},deviceType:{description:"Device type (mobile, desktop, tablet)",type:"string"},os:{description:"Operating system",type:"string"},osVersion:{description:"Operating system version",type:"string"},screenSize:{description:"Screen dimensions",type:"string"},language:{description:"User language",type:"string"},country:{description:"User country",type:"string"},region:{description:"User region/state",type:"string"},city:{description:"User city",type:"string"},zip:{description:"User postal code",type:"string"},timezone:{description:"User timezone",type:"string"},ip:{description:"User IP address",type:"string"},internal:{description:"Internal user flag (employee, test user)",type:"boolean"},optout:{description:"User opted out of tracking",type:"boolean"}},additionalProperties:{allOf:[{$ref:"#/definitions/WalkerOSProperty"}]},title:"WalkerOS.User",description:"User identification and attributes",allOf:[{$ref:"#/definitions/WalkerOSUser"}]},nested:{type:"array",items:{$ref:"#/definitions/__schema0"},title:"WalkerOS.Entities",description:"Related nested entities",allOf:[{$ref:"#/definitions/WalkerOSEntities"}]},consent:{type:"object",propertyNames:{type:"string"},additionalProperties:{type:"boolean"},title:"WalkerOS.Consent",description:"Consent states at event time",allOf:[{$ref:"#/definitions/WalkerOSConsent"}]},id:{type:"string",minLength:1,description:"W3C span_id, 16 lowercase hex characters"},trigger:{type:"string",description:"Event trigger identifier"},entity:{type:"string",description:"Parsed entity from event name"},action:{type:"string",description:"Parsed action from event name"},timestamp:{type:"integer",exclusiveMinimum:0,maximum:9007199254740991,description:"Unix timestamp in milliseconds since epoch"},timing:{type:"number",description:"Event processing timing information"},source:{type:"object",properties:{type:{type:"string",description:"Source kind (browser, dataLayer, gtag, ...)"},platform:{description:"Runtime platform (web, server, app, ios, android, terminal, ...)",type:"string"},version:{description:"Deployment version of the source emitter",type:"string"},schema:{description:'Event model spec version (collector defaults to "4")',type:"string"},count:{description:"Emission sequence per run",type:"integer",minimum:0,maximum:9007199254740991},trace:{description:"Trace id shared by every event of a run (W3C trace-id shape)",type:"string"},release:{description:"Per-flow config release map, keyed by flow name; accumulates across walkerOS crossings",type:"object",propertyNames:{type:"string"},additionalProperties:{type:"string"}},url:{type:"string"},referrer:{type:"string"},tool:{type:"string"},command:{type:"string"}},required:["type"],additionalProperties:{allOf:[{$ref:"#/definitions/WalkerOSProperty"}]},title:"WalkerOS.Source",description:"Event source information",allOf:[{$ref:"#/definitions/WalkerOSSource"}]}},additionalProperties:!1,title:"WalkerOS.PartialEvent",description:"Partial event structure with all fields optional."}}}),i=new Map;function n(e){if("object"!=typeof e||null===e)return!1;return"events"in e&&"object"==typeof e.events&&null!==e.events||"schema"in e}function s(e,t,r){return e[t]?.[r]??e[t]?.["*"]??e["*"]?.[r]??e["*"]?.["*"]}function o(e){if(Array.isArray(e)){let t=!1;const r=e.map(e=>{const r=void 0===e?null:o(e);return r!==e&&(t=!0),r});return t?r:e}if("object"!=typeof e||null===e)return e;let t=!1;const r={};for(const[i,n]of Object.entries(e)){if(void 0===n){t=!0;continue}const e=o(n);e!==n&&(t=!0),r[i]=e}return t?r:e}function p(e,p,a){const d=function(e,t){const i=[];t.format&&i.push(r);for(const r of t.contracts??[])if(n(r)){const t="string"==typeof e.entity?e.entity:"",n="string"==typeof e.action?e.action:"",o=s(r.events??{},t,n);o&&i.push(o),r.schema&&i.push(r.schema)}else i.push(r);return i}(e,a),c=o(e),l=[];let y;return d.forEach((e,r)=>{try{const r=function(e){const r=JSON.stringify(e),n=i.get(r);if(n)return n;const s=JSON.parse(r),o=new t.Validator(s,"2020-12");return i.set(r,o),o}(e).validate(c);if(r.valid)return;for(const e of r.errors)l.push({path:e.instanceLocation,message:e.error,level:"error"})}catch(e){const t=e instanceof Error?e.message:String(e);y??=t,l.push({path:`schema[${r}]`,message:`Validation engine failed: ${t}`,level:"error"})}}),void 0===y?{isValid:0===l.length,errors:l}:{isValid:!1,errors:l,engineError:y}}var a=t=>{const{config:r}=t,i=r.settings??{},n=i.mode??"pass",s=i.output?.isValid??"source.valid",o=i.output?.errors??"validation";return{type:"validate",config:r,async push(t,r){const{ingest:a}=r,{isValid:d,errors:c,engineError:l}=p(t,0,{contracts:i.contract,format:i.format});l&&r.logger.error("validation engine failed",{event:t.name,error:l}),o&&e(a,o,c,{mutable:!0});let y=t;return s&&(y=e(y,s,d)),!("strict"===n&&!d)&&{event:y}}}};export{a as default,a as transformerValidate,p as validateEventAgainstContract};//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/transformer.ts","../src/validate.ts","../src/event-format.schema.ts"],"sourcesContent":["import type { Transformer } from '@walkeros/core';\nimport { setByPath } from '@walkeros/core';\nimport { validateEventAgainstContract } from './validate';\nimport type { ValidateSettings } from './types';\n\nexport const transformerValidate: Transformer.Init<\n Transformer.Types<ValidateSettings>\n> = (context) => {\n const { config } = context;\n const settings: ValidateSettings = config.settings ?? {};\n\n const mode = settings.mode ?? 'pass';\n const isValidPath = settings.output?.isValid ?? 'source.valid';\n const errorsPath = settings.output?.errors ?? 'validation';\n\n return {\n // Init's input config type is Partial<Settings>; the instance config type\n // is Settings. Same cast pattern the bot/fingerprint transformers use.\n type: 'validate',\n config: config as Transformer.Config<Transformer.Types<ValidateSettings>>,\n\n async push(event, ctx) {\n const { ingest } = ctx;\n\n const { isValid, errors, engineError } = validateEventAgainstContract(\n event,\n ingest,\n { contracts: settings.contract, format: settings.format },\n );\n if (engineError)\n ctx.logger.error('validation engine failed', {\n event: event.name,\n error: engineError,\n });\n\n // Issues go to the INGEST (observer-visible diagnostics), written in\n // place so they survive even when a strict drop stops the chain.\n if (errorsPath) setByPath(ingest, errorsPath, errors, { mutable: true });\n\n // Verdict goes to the EVENT (travels to destinations as analytics data).\n // setByPath is immutable, so reassign.\n let nextEvent = event;\n if (isValidPath) nextEvent = setByPath(nextEvent, isValidPath, isValid);\n\n // strict + invalid: chain-stop drop. Errors are already on the ingest,\n // so the drop is still diagnosable.\n if (mode === 'strict' && !isValid) return false;\n\n return { event: nextEvent };\n },\n };\n};\n","import type { Flow, Ingest, ValidateEvents, WalkerOS } from '@walkeros/core';\nimport * as cfworker from '@cfworker/json-schema';\nimport type { ContractSource, ValidateResult, ValidationIssue } from './types';\nimport { eventFormatSchema } from './event-format.schema';\n\n/**\n * Module-level Validator cache keyed by the compact JSON of the schema.\n *\n * A plain Map (not WeakMap): schemas are re-cloned per flow load, so identical\n * structures arrive as distinct object references. Keying on serialized content\n * lets repeated pushes within and across loads share one compiled interpreter.\n */\nconst validatorCache = new Map<string, cfworker.Validator>();\n\nexport function getValidator(\n schema: Record<string, unknown>,\n): cfworker.Validator {\n const key = JSON.stringify(schema);\n const cached = validatorCache.get(key);\n if (cached) return cached;\n // cfworker dereferences $ref by annotating each subschema in place\n // (e.g. __absolute_uri__). Parse a fresh mutable copy from the cache key so a\n // frozen input (the generated eventFormatSchema) stays untouched.\n const mutable = JSON.parse(key) as Record<string, unknown>;\n // Pin draft 2020-12 (the contract authoring draft).\n const validator = new cfworker.Validator(mutable, '2020-12');\n validatorCache.set(key, validator);\n return validator;\n}\n\nfunction isContractRule(source: ContractSource): source is Flow.ContractRule {\n if (typeof source !== 'object' || source === null) return false;\n const hasEvents =\n 'events' in source &&\n typeof source.events === 'object' &&\n source.events !== null;\n return hasEvents || 'schema' in source;\n}\n\n/**\n * Selects the entity-action schema with the documented wildcard fallback:\n * entity.action → entity.* → *.action → *.*.\n */\nfunction selectEventSchema(\n events: ValidateEvents,\n entity: string,\n action: string,\n): Record<string, unknown> | undefined {\n return (\n events[entity]?.[action] ??\n events[entity]?.['*'] ??\n events['*']?.[action] ??\n events['*']?.['*']\n );\n}\n\n/** Collects every JSON Schema that applies to this event. */\nfunction collectSchemas(\n event: WalkerOS.DeepPartialEvent,\n opts: { contracts?: ContractSource[]; format?: boolean },\n): Record<string, unknown>[] {\n const schemas: Record<string, unknown>[] = [];\n\n if (opts.format) schemas.push(eventFormatSchema);\n\n for (const source of opts.contracts ?? []) {\n if (isContractRule(source)) {\n const entity = typeof event.entity === 'string' ? event.entity : '';\n const action = typeof event.action === 'string' ? event.action : '';\n const selected = selectEventSchema(source.events ?? {}, entity, action);\n if (selected) schemas.push(selected);\n if (source.schema) schemas.push(source.schema);\n } else {\n // Inline whole-event JSON Schema.\n schemas.push(source);\n }\n }\n\n return schemas;\n}\n\n/**\n * JSON Schema validates JSON, and an `undefined` member is not JSON: the\n * engine throws on it. Drop own keys holding `undefined` and turn `undefined`\n * array items into `null`, as JSON serialisation does, so positions stay.\n * Returns the input itself when nothing changed.\n */\nfunction toJsonInstance(value: unknown): unknown {\n if (Array.isArray(value)) {\n let changed = false;\n const next = value.map((item) => {\n const json = item === undefined ? null : toJsonInstance(item);\n if (json !== item) changed = true;\n return json;\n });\n return changed ? next : value;\n }\n if (typeof value !== 'object' || value === null) return value;\n let changed = false;\n const next: Record<string, unknown> = {};\n for (const [key, item] of Object.entries(value)) {\n if (item === undefined) {\n changed = true;\n continue;\n }\n const json = toJsonInstance(item);\n if (json !== item) changed = true;\n next[key] = json;\n }\n return changed ? next : value;\n}\n\n/**\n * The validation verdict authority. Runs the event through every applicable\n * JSON Schema (AND semantics) and aggregates all @cfworker errors.\n *\n * No matching constraint (empty schema set) means no opinion: isValid is true.\n * Never throws: a schema the engine cannot compile or apply becomes an issue,\n * and its message is also returned as `engineError`.\n */\nexport function validateEventAgainstContract(\n event: WalkerOS.DeepPartialEvent,\n _ingest: Ingest | undefined,\n opts: { contracts?: ContractSource[]; format?: boolean },\n): ValidateResult {\n const schemas = collectSchemas(event, opts);\n const instance = toJsonInstance(event);\n\n const errors: ValidationIssue[] = [];\n let engineError: string | undefined;\n schemas.forEach((schema, index) => {\n try {\n const result = getValidator(schema).validate(instance);\n if (result.valid) return;\n for (const unit of result.errors) {\n errors.push({\n path: unit.instanceLocation,\n message: unit.error,\n level: 'error',\n });\n }\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n engineError ??= message;\n errors.push({\n path: `schema[${index}]`,\n message: `Validation engine failed: ${message}`,\n level: 'error',\n });\n }\n });\n\n return engineError === undefined\n ? { isValid: errors.length === 0, errors }\n : { isValid: false, errors, engineError };\n}\n","// GENERATED by scripts/generate-format-schema.mjs: DO NOT EDIT.\n// Source: @walkeros/core partialEventJsonSchema (canonical zod EventSchema).\n// `format: true` validates that the value is a valid WalkerOS.PartialEvent:\n// the canonical event structure with all fields optional, so it checks shape\n// and field types, not presence. Required-field enforcement is the contract\n// arm's job (events/schema with required).\n// Regenerate: npm run generate:format-schema\n\nexport const eventFormatSchema = Object.freeze({\n $schema: 'http://json-schema.org/draft-07/schema#',\n description: 'Partial event structure with all fields optional',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSPartialEvent',\n },\n ],\n definitions: {\n WalkerOSProperty: {\n title: 'WalkerOS.Property',\n description:\n 'PropertyType or an array of PropertyType. Recursive structure for nested objects and arrays.',\n anyOf: [\n {\n $ref: '#/definitions/WalkerOSPropertyType',\n },\n {\n type: 'array',\n items: {\n $ref: '#/definitions/WalkerOSPropertyType',\n },\n },\n ],\n },\n WalkerOSPropertyType: {\n title: 'WalkerOS.PropertyType',\n description:\n 'Base property value types (boolean, string, number, or nested Property record).',\n anyOf: [\n {\n type: 'boolean',\n },\n {\n type: 'string',\n },\n {\n type: 'number',\n },\n {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n $ref: '#/definitions/WalkerOSProperty',\n },\n },\n ],\n },\n WalkerOSProperties: {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperty',\n },\n ],\n },\n title: 'WalkerOS.Properties',\n description: 'Flexible property collection with optional values.',\n },\n WalkerOSOrderedProperties: {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n type: 'array',\n items: [\n {\n $ref: '#/definitions/WalkerOSProperty',\n },\n {\n type: 'number',\n },\n ],\n },\n title: 'WalkerOS.OrderedProperties',\n description:\n 'Ordered properties with [value, order] tuples for priority control.',\n },\n WalkerOSUser: {\n allOf: [\n {\n description: 'Flexible property collection with optional values',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperties',\n },\n ],\n },\n {\n type: 'object',\n properties: {\n id: {\n description: 'User identifier',\n type: 'string',\n },\n device: {\n description: 'Device identifier',\n type: 'string',\n },\n session: {\n description: 'Session identifier',\n type: 'string',\n },\n hash: {\n description: 'Hashed identifier',\n type: 'string',\n },\n address: {\n description: 'User address',\n type: 'string',\n },\n email: {\n description: 'User email address',\n type: 'string',\n format: 'email',\n pattern:\n \"^(?!\\\\.)(?!.*\\\\.\\\\.)([A-Za-z0-9_'+\\\\-\\\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\\\-]*\\\\.)+[A-Za-z]{2,}$\",\n },\n phone: {\n description: 'User phone number',\n type: 'string',\n },\n userAgent: {\n description: 'Browser user agent string',\n type: 'string',\n },\n browser: {\n description: 'Browser name',\n type: 'string',\n },\n browserVersion: {\n description: 'Browser version',\n type: 'string',\n },\n deviceType: {\n description: 'Device type (mobile, desktop, tablet)',\n type: 'string',\n },\n os: {\n description: 'Operating system',\n type: 'string',\n },\n osVersion: {\n description: 'Operating system version',\n type: 'string',\n },\n screenSize: {\n description: 'Screen dimensions',\n type: 'string',\n },\n language: {\n description: 'User language',\n type: 'string',\n },\n country: {\n description: 'User country',\n type: 'string',\n },\n region: {\n description: 'User region/state',\n type: 'string',\n },\n city: {\n description: 'User city',\n type: 'string',\n },\n zip: {\n description: 'User postal code',\n type: 'string',\n },\n timezone: {\n description: 'User timezone',\n type: 'string',\n },\n ip: {\n description: 'User IP address',\n type: 'string',\n },\n internal: {\n description: 'Internal user flag (employee, test user)',\n type: 'boolean',\n },\n },\n additionalProperties: false,\n },\n ],\n title: 'WalkerOS.User',\n description: 'User identification and attributes.',\n },\n __schema0: {\n description: 'Nested entity structure with recursive nesting support',\n $ref: '#/definitions/WalkerOSEntity',\n },\n WalkerOSEntity: {\n title: 'WalkerOS.Entity',\n description: 'Nested entity structure with recursive nesting support.',\n type: 'object',\n properties: {\n entity: {\n type: 'string',\n description: 'Entity name',\n },\n data: {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperty',\n },\n ],\n },\n title: 'WalkerOS.Properties',\n description: 'Entity-specific properties',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperties',\n },\n ],\n },\n nested: {\n description: 'Nested child entities',\n type: 'array',\n items: {\n $ref: '#/definitions/__schema0',\n },\n },\n context: {\n description: 'Entity context data',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSOrderedProperties',\n },\n ],\n },\n },\n required: ['entity', 'data'],\n additionalProperties: false,\n },\n WalkerOSEntities: {\n type: 'array',\n items: {\n $ref: '#/definitions/__schema0',\n },\n title: 'WalkerOS.Entities',\n description: 'Array of nested entities.',\n },\n WalkerOSConsent: {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n type: 'boolean',\n },\n title: 'WalkerOS.Consent',\n description:\n 'Consent state mapping. Keys are consent groups (e.g. marketing, functional), values are booleans for granted/denied.',\n },\n WalkerOSSource: {\n allOf: [\n {\n description: 'Flexible property collection with optional values',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperties',\n },\n ],\n },\n {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n description: 'Source kind (browser, dataLayer, gtag, ...)',\n },\n platform: {\n description:\n 'Runtime platform (web, server, app, ios, android, terminal, ...)',\n type: 'string',\n },\n version: {\n description: 'Deployment version of the source emitter',\n type: 'string',\n },\n schema: {\n description:\n 'Event model spec version (collector defaults to \"4\")',\n type: 'string',\n },\n count: {\n description: 'Emission sequence per run',\n type: 'integer',\n minimum: 0,\n maximum: 9007199254740991,\n },\n trace: {\n description:\n 'Trace id shared by every event of a run (W3C trace-id shape)',\n type: 'string',\n },\n release: {\n description:\n 'Per-flow config release map, keyed by flow name; accumulates across walkerOS crossings',\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n type: 'string',\n },\n },\n url: {\n type: 'string',\n },\n referrer: {\n type: 'string',\n },\n tool: {\n type: 'string',\n },\n command: {\n type: 'string',\n },\n },\n required: ['type'],\n additionalProperties: false,\n },\n ],\n title: 'WalkerOS.Source',\n description: 'Event source information (origin of the event).',\n },\n WalkerOSPartialEvent: {\n type: 'object',\n properties: {\n name: {\n type: 'string',\n description:\n 'Event name in \"entity action\" format (e.g., \"page view\", \"product add\")',\n },\n data: {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperty',\n },\n ],\n },\n title: 'WalkerOS.Properties',\n description: 'Event-specific properties',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperties',\n },\n ],\n },\n context: {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n type: 'array',\n items: [\n {\n $ref: '#/definitions/WalkerOSProperty',\n },\n {\n type: 'number',\n },\n ],\n },\n title: 'WalkerOS.OrderedProperties',\n description: 'Ordered context properties with priorities',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSOrderedProperties',\n },\n ],\n },\n globals: {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperty',\n },\n ],\n },\n title: 'WalkerOS.Properties',\n description: 'Global properties shared across events',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperties',\n },\n ],\n },\n custom: {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperty',\n },\n ],\n },\n title: 'WalkerOS.Properties',\n description: 'Custom implementation-specific properties',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperties',\n },\n ],\n },\n user: {\n allOf: [\n {\n description: 'Flexible property collection with optional values',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperties',\n },\n ],\n },\n {\n type: 'object',\n properties: {\n id: {\n description: 'User identifier',\n type: 'string',\n },\n device: {\n description: 'Device identifier',\n type: 'string',\n },\n session: {\n description: 'Session identifier',\n type: 'string',\n },\n hash: {\n description: 'Hashed identifier',\n type: 'string',\n },\n address: {\n description: 'User address',\n type: 'string',\n },\n email: {\n description: 'User email address',\n type: 'string',\n format: 'email',\n pattern:\n \"^(?!\\\\.)(?!.*\\\\.\\\\.)([A-Za-z0-9_'+\\\\-\\\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\\\-]*\\\\.)+[A-Za-z]{2,}$\",\n },\n phone: {\n description: 'User phone number',\n type: 'string',\n },\n userAgent: {\n description: 'Browser user agent string',\n type: 'string',\n },\n browser: {\n description: 'Browser name',\n type: 'string',\n },\n browserVersion: {\n description: 'Browser version',\n type: 'string',\n },\n deviceType: {\n description: 'Device type (mobile, desktop, tablet)',\n type: 'string',\n },\n os: {\n description: 'Operating system',\n type: 'string',\n },\n osVersion: {\n description: 'Operating system version',\n type: 'string',\n },\n screenSize: {\n description: 'Screen dimensions',\n type: 'string',\n },\n language: {\n description: 'User language',\n type: 'string',\n },\n country: {\n description: 'User country',\n type: 'string',\n },\n region: {\n description: 'User region/state',\n type: 'string',\n },\n city: {\n description: 'User city',\n type: 'string',\n },\n zip: {\n description: 'User postal code',\n type: 'string',\n },\n timezone: {\n description: 'User timezone',\n type: 'string',\n },\n ip: {\n description: 'User IP address',\n type: 'string',\n },\n internal: {\n description: 'Internal user flag (employee, test user)',\n type: 'boolean',\n },\n },\n additionalProperties: false,\n },\n ],\n title: 'WalkerOS.User',\n description: 'User identification and attributes',\n },\n nested: {\n type: 'array',\n items: {\n $ref: '#/definitions/__schema0',\n },\n title: 'WalkerOS.Entities',\n description: 'Related nested entities',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSEntities',\n },\n ],\n },\n consent: {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n type: 'boolean',\n },\n title: 'WalkerOS.Consent',\n description: 'Consent states at event time',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSConsent',\n },\n ],\n },\n id: {\n type: 'string',\n minLength: 1,\n description: 'W3C span_id, 16 lowercase hex characters',\n },\n trigger: {\n type: 'string',\n description: 'Event trigger identifier',\n },\n entity: {\n type: 'string',\n description: 'Parsed entity from event name',\n },\n action: {\n type: 'string',\n description: 'Parsed action from event name',\n },\n timestamp: {\n type: 'integer',\n exclusiveMinimum: 0,\n maximum: 9007199254740991,\n description: 'Unix timestamp in milliseconds since epoch',\n },\n timing: {\n type: 'number',\n description: 'Event processing timing information',\n },\n source: {\n allOf: [\n {\n description: 'Flexible property collection with optional values',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperties',\n },\n ],\n },\n {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n description: 'Source kind (browser, dataLayer, gtag, ...)',\n },\n platform: {\n description:\n 'Runtime platform (web, server, app, ios, android, terminal, ...)',\n type: 'string',\n },\n version: {\n description: 'Deployment version of the source emitter',\n type: 'string',\n },\n schema: {\n description:\n 'Event model spec version (collector defaults to \"4\")',\n type: 'string',\n },\n count: {\n description: 'Emission sequence per run',\n type: 'integer',\n minimum: 0,\n maximum: 9007199254740991,\n },\n trace: {\n description:\n 'Trace id shared by every event of a run (W3C trace-id shape)',\n type: 'string',\n },\n release: {\n description:\n 'Per-flow config release map, keyed by flow name; accumulates across walkerOS crossings',\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n type: 'string',\n },\n },\n url: {\n type: 'string',\n },\n referrer: {\n type: 'string',\n },\n tool: {\n type: 'string',\n },\n command: {\n type: 'string',\n },\n },\n required: ['type'],\n additionalProperties: false,\n },\n ],\n title: 'WalkerOS.Source',\n description: 'Event source information',\n },\n },\n additionalProperties: false,\n title: 'WalkerOS.PartialEvent',\n description: 'Partial event structure with all fields optional.',\n },\n },\n} as const);\n"],"mappings":";AACA,SAAS,iBAAiB;;;ACA1B,YAAY,cAAc;;;ACOnB,IAAM,oBAAoB,OAAO,OAAO;AAAA,EAC7C,SAAS;AAAA,EACT,aAAa;AAAA,EACb,OAAO;AAAA,IACL;AAAA,MACE,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,aAAa;AAAA,IACX,kBAAkB;AAAA,MAChB,OAAO;AAAA,MACP,aACE;AAAA,MACF,OAAO;AAAA,QACL;AAAA,UACE,MAAM;AAAA,QACR;AAAA,QACA;AAAA,UACE,MAAM;AAAA,UACN,OAAO;AAAA,YACL,MAAM;AAAA,UACR;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB,OAAO;AAAA,MACP,aACE;AAAA,MACF,OAAO;AAAA,QACL;AAAA,UACE,MAAM;AAAA,QACR;AAAA,QACA;AAAA,UACE,MAAM;AAAA,QACR;AAAA,QACA;AAAA,UACE,MAAM;AAAA,QACR;AAAA,QACA;AAAA,UACE,MAAM;AAAA,UACN,eAAe;AAAA,YACb,MAAM;AAAA,UACR;AAAA,UACA,sBAAsB;AAAA,YACpB,MAAM;AAAA,UACR;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA,oBAAoB;AAAA,MAClB,MAAM;AAAA,MACN,eAAe;AAAA,QACb,MAAM;AAAA,MACR;AAAA,MACA,sBAAsB;AAAA,QACpB,OAAO;AAAA,UACL;AAAA,YACE,MAAM;AAAA,UACR;AAAA,QACF;AAAA,MACF;AAAA,MACA,OAAO;AAAA,MACP,aAAa;AAAA,IACf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O;AAAA,QACT,CAAC;AAIH,UAAI,WAAY,WAAU,QAAQ,YAAY,QAAQ,EAAE,SAAS,KAAK,CAAC;AAIvE,UAAI,YAAY;AAChB,UAAI,YAAa,aAAY,UAAU,WAAW,aAAa,OAAO;AAItE,UAAI,SAAS,YAAY,CAAC,QAAS,QAAO;AAE1C,aAAO,EAAE,OAAO,UAAU;AAAA,IAC5B;AAAA,EACF;AACF;","names":["changed","next"]}
|
|
1
|
+
{"version":3,"sources":["../src/transformer.ts","../src/validate.ts","../src/event-format.schema.ts"],"sourcesContent":["import type { Transformer } from '@walkeros/core';\nimport { setByPath } from '@walkeros/core';\nimport { validateEventAgainstContract } from './validate';\nimport type { ValidateSettings } from './types';\n\nexport const transformerValidate: Transformer.Init<\n Transformer.Types<ValidateSettings>\n> = (context) => {\n const { config } = context;\n const settings: ValidateSettings = config.settings ?? {};\n\n const mode = settings.mode ?? 'pass';\n const isValidPath = settings.output?.isValid ?? 'source.valid';\n const errorsPath = settings.output?.errors ?? 'validation';\n\n return {\n // Init's input config type is Partial<Settings>; the instance config type\n // is Settings. Same cast pattern the bot/fingerprint transformers use.\n type: 'validate',\n config: config as Transformer.Config<Transformer.Types<ValidateSettings>>,\n\n async push(event, ctx) {\n const { ingest } = ctx;\n\n const { isValid, errors, engineError } = validateEventAgainstContract(\n event,\n ingest,\n { contracts: settings.contract, format: settings.format },\n );\n if (engineError)\n ctx.logger.error('validation engine failed', {\n event: event.name,\n error: engineError,\n });\n\n // Issues go to the INGEST (observer-visible diagnostics), written in\n // place so they survive even when a strict drop stops the chain.\n if (errorsPath) setByPath(ingest, errorsPath, errors, { mutable: true });\n\n // Verdict goes to the EVENT (travels to destinations as analytics data).\n // setByPath is immutable, so reassign.\n let nextEvent = event;\n if (isValidPath) nextEvent = setByPath(nextEvent, isValidPath, isValid);\n\n // strict + invalid: chain-stop drop. Errors are already on the ingest,\n // so the drop is still diagnosable.\n if (mode === 'strict' && !isValid) return false;\n\n return { event: nextEvent };\n },\n };\n};\n","import type { Flow, Ingest, ValidateEvents, WalkerOS } from '@walkeros/core';\nimport * as cfworker from '@cfworker/json-schema';\nimport type { ContractSource, ValidateResult, ValidationIssue } from './types';\nimport { eventFormatSchema } from './event-format.schema';\n\n/**\n * Module-level Validator cache keyed by the compact JSON of the schema.\n *\n * A plain Map (not WeakMap): schemas are re-cloned per flow load, so identical\n * structures arrive as distinct object references. Keying on serialized content\n * lets repeated pushes within and across loads share one compiled interpreter.\n */\nconst validatorCache = new Map<string, cfworker.Validator>();\n\nexport function getValidator(\n schema: Record<string, unknown>,\n): cfworker.Validator {\n const key = JSON.stringify(schema);\n const cached = validatorCache.get(key);\n if (cached) return cached;\n // cfworker dereferences $ref by annotating each subschema in place\n // (e.g. __absolute_uri__). Parse a fresh mutable copy from the cache key so a\n // frozen input (the generated eventFormatSchema) stays untouched.\n const mutable = JSON.parse(key) as Record<string, unknown>;\n // Pin draft 2020-12 (the contract authoring draft).\n const validator = new cfworker.Validator(mutable, '2020-12');\n validatorCache.set(key, validator);\n return validator;\n}\n\nfunction isContractRule(source: ContractSource): source is Flow.ContractRule {\n if (typeof source !== 'object' || source === null) return false;\n const hasEvents =\n 'events' in source &&\n typeof source.events === 'object' &&\n source.events !== null;\n return hasEvents || 'schema' in source;\n}\n\n/**\n * Selects the entity-action schema with the documented wildcard fallback:\n * entity.action → entity.* → *.action → *.*.\n */\nfunction selectEventSchema(\n events: ValidateEvents,\n entity: string,\n action: string,\n): Record<string, unknown> | undefined {\n return (\n events[entity]?.[action] ??\n events[entity]?.['*'] ??\n events['*']?.[action] ??\n events['*']?.['*']\n );\n}\n\n/** Collects every JSON Schema that applies to this event. */\nfunction collectSchemas(\n event: WalkerOS.DeepPartialEvent,\n opts: { contracts?: ContractSource[]; format?: boolean },\n): Record<string, unknown>[] {\n const schemas: Record<string, unknown>[] = [];\n\n if (opts.format) schemas.push(eventFormatSchema);\n\n for (const source of opts.contracts ?? []) {\n if (isContractRule(source)) {\n const entity = typeof event.entity === 'string' ? event.entity : '';\n const action = typeof event.action === 'string' ? event.action : '';\n const selected = selectEventSchema(source.events ?? {}, entity, action);\n if (selected) schemas.push(selected);\n if (source.schema) schemas.push(source.schema);\n } else {\n // Inline whole-event JSON Schema.\n schemas.push(source);\n }\n }\n\n return schemas;\n}\n\n/**\n * JSON Schema validates JSON, and an `undefined` member is not JSON: the\n * engine throws on it. Drop own keys holding `undefined` and turn `undefined`\n * array items into `null`, as JSON serialisation does, so positions stay.\n * Returns the input itself when nothing changed.\n */\nfunction toJsonInstance(value: unknown): unknown {\n if (Array.isArray(value)) {\n let changed = false;\n const next = value.map((item) => {\n const json = item === undefined ? null : toJsonInstance(item);\n if (json !== item) changed = true;\n return json;\n });\n return changed ? next : value;\n }\n if (typeof value !== 'object' || value === null) return value;\n let changed = false;\n const next: Record<string, unknown> = {};\n for (const [key, item] of Object.entries(value)) {\n if (item === undefined) {\n changed = true;\n continue;\n }\n const json = toJsonInstance(item);\n if (json !== item) changed = true;\n next[key] = json;\n }\n return changed ? next : value;\n}\n\n/**\n * The validation verdict authority. Runs the event through every applicable\n * JSON Schema (AND semantics) and aggregates all @cfworker errors.\n *\n * No matching constraint (empty schema set) means no opinion: isValid is true.\n * Never throws: a schema the engine cannot compile or apply becomes an issue,\n * and its message is also returned as `engineError`.\n */\nexport function validateEventAgainstContract(\n event: WalkerOS.DeepPartialEvent,\n _ingest: Ingest | undefined,\n opts: { contracts?: ContractSource[]; format?: boolean },\n): ValidateResult {\n const schemas = collectSchemas(event, opts);\n const instance = toJsonInstance(event);\n\n const errors: ValidationIssue[] = [];\n let engineError: string | undefined;\n schemas.forEach((schema, index) => {\n try {\n const result = getValidator(schema).validate(instance);\n if (result.valid) return;\n for (const unit of result.errors) {\n errors.push({\n path: unit.instanceLocation,\n message: unit.error,\n level: 'error',\n });\n }\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n engineError ??= message;\n errors.push({\n path: `schema[${index}]`,\n message: `Validation engine failed: ${message}`,\n level: 'error',\n });\n }\n });\n\n return engineError === undefined\n ? { isValid: errors.length === 0, errors }\n : { isValid: false, errors, engineError };\n}\n","// GENERATED by scripts/generate-format-schema.mjs: DO NOT EDIT.\n// Source: @walkeros/core partialEventJsonSchema (canonical zod EventSchema).\n// `format: true` validates that the value is a valid WalkerOS.PartialEvent:\n// the canonical event structure with all fields optional, so it checks shape\n// and field types, not presence. Required-field enforcement is the contract\n// arm's job (events/schema with required).\n// Regenerate: npm run generate:format-schema\n\nexport const eventFormatSchema = Object.freeze({\n $schema: 'http://json-schema.org/draft-07/schema#',\n description: 'Partial event structure with all fields optional',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSPartialEvent',\n },\n ],\n definitions: {\n WalkerOSProperty: {\n title: 'WalkerOS.Property',\n description:\n 'PropertyType or an array of PropertyType. Recursive structure for nested objects and arrays.',\n anyOf: [\n {\n $ref: '#/definitions/WalkerOSPropertyType',\n },\n {\n type: 'array',\n items: {\n $ref: '#/definitions/WalkerOSPropertyType',\n },\n },\n ],\n },\n WalkerOSPropertyType: {\n title: 'WalkerOS.PropertyType',\n description:\n 'Base property value types (boolean, string, number, or nested Property record).',\n anyOf: [\n {\n type: 'boolean',\n },\n {\n type: 'string',\n },\n {\n type: 'number',\n },\n {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n $ref: '#/definitions/WalkerOSProperty',\n },\n },\n ],\n },\n WalkerOSProperties: {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperty',\n },\n ],\n },\n title: 'WalkerOS.Properties',\n description: 'Flexible property collection with optional values.',\n },\n WalkerOSOrderedProperties: {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n type: 'array',\n items: [\n {\n $ref: '#/definitions/WalkerOSProperty',\n },\n {\n type: 'number',\n },\n ],\n },\n title: 'WalkerOS.OrderedProperties',\n description:\n 'Ordered properties with [value, order] tuples for priority control.',\n },\n WalkerOSUser: {\n type: 'object',\n properties: {\n id: {\n description: 'User identifier',\n type: 'string',\n },\n device: {\n description: 'Device identifier',\n type: 'string',\n },\n session: {\n description: 'Session identifier',\n type: 'string',\n },\n hash: {\n description: 'Hashed identifier',\n type: 'string',\n },\n address: {\n description: 'User address',\n type: 'string',\n },\n email: {\n description: 'User email address',\n type: 'string',\n format: 'email',\n pattern:\n \"^(?!\\\\.)(?!.*\\\\.\\\\.)([A-Za-z0-9_'+\\\\-\\\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\\\-]*\\\\.)+[A-Za-z]{2,}$\",\n },\n phone: {\n description: 'User phone number',\n type: 'string',\n },\n userAgent: {\n description: 'Browser user agent string',\n type: 'string',\n },\n browser: {\n description: 'Browser name',\n type: 'string',\n },\n browserVersion: {\n description: 'Browser version',\n type: 'string',\n },\n deviceType: {\n description: 'Device type (mobile, desktop, tablet)',\n type: 'string',\n },\n os: {\n description: 'Operating system',\n type: 'string',\n },\n osVersion: {\n description: 'Operating system version',\n type: 'string',\n },\n screenSize: {\n description: 'Screen dimensions',\n type: 'string',\n },\n language: {\n description: 'User language',\n type: 'string',\n },\n country: {\n description: 'User country',\n type: 'string',\n },\n region: {\n description: 'User region/state',\n type: 'string',\n },\n city: {\n description: 'User city',\n type: 'string',\n },\n zip: {\n description: 'User postal code',\n type: 'string',\n },\n timezone: {\n description: 'User timezone',\n type: 'string',\n },\n ip: {\n description: 'User IP address',\n type: 'string',\n },\n internal: {\n description: 'Internal user flag (employee, test user)',\n type: 'boolean',\n },\n optout: {\n description: 'User opted out of tracking',\n type: 'boolean',\n },\n },\n additionalProperties: {\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperty',\n },\n ],\n },\n title: 'WalkerOS.User',\n description: 'User identification and attributes.',\n },\n __schema0: {\n description: 'Nested entity structure with recursive nesting support',\n $ref: '#/definitions/WalkerOSEntity',\n },\n WalkerOSEntity: {\n title: 'WalkerOS.Entity',\n description: 'Nested entity structure with recursive nesting support.',\n type: 'object',\n properties: {\n entity: {\n type: 'string',\n description: 'Entity name',\n },\n data: {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperty',\n },\n ],\n },\n title: 'WalkerOS.Properties',\n description: 'Entity-specific properties',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperties',\n },\n ],\n },\n nested: {\n description: 'Nested child entities',\n type: 'array',\n items: {\n $ref: '#/definitions/__schema0',\n },\n },\n context: {\n description: 'Entity context data',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSOrderedProperties',\n },\n ],\n },\n },\n required: ['entity', 'data'],\n additionalProperties: false,\n },\n WalkerOSEntities: {\n type: 'array',\n items: {\n $ref: '#/definitions/__schema0',\n },\n title: 'WalkerOS.Entities',\n description: 'Array of nested entities.',\n },\n WalkerOSConsent: {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n type: 'boolean',\n },\n title: 'WalkerOS.Consent',\n description:\n 'Consent state mapping. Keys are consent groups (e.g. marketing, functional), values are booleans for granted/denied.',\n },\n WalkerOSSource: {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n description: 'Source kind (browser, dataLayer, gtag, ...)',\n },\n platform: {\n description:\n 'Runtime platform (web, server, app, ios, android, terminal, ...)',\n type: 'string',\n },\n version: {\n description: 'Deployment version of the source emitter',\n type: 'string',\n },\n schema: {\n description: 'Event model spec version (collector defaults to \"4\")',\n type: 'string',\n },\n count: {\n description: 'Emission sequence per run',\n type: 'integer',\n minimum: 0,\n maximum: 9007199254740991,\n },\n trace: {\n description:\n 'Trace id shared by every event of a run (W3C trace-id shape)',\n type: 'string',\n },\n release: {\n description:\n 'Per-flow config release map, keyed by flow name; accumulates across walkerOS crossings',\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n type: 'string',\n },\n },\n url: {\n type: 'string',\n },\n referrer: {\n type: 'string',\n },\n tool: {\n type: 'string',\n },\n command: {\n type: 'string',\n },\n },\n required: ['type'],\n additionalProperties: {\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperty',\n },\n ],\n },\n title: 'WalkerOS.Source',\n description: 'Event source information (origin of the event).',\n },\n WalkerOSPartialEvent: {\n type: 'object',\n properties: {\n name: {\n type: 'string',\n description:\n 'Event name in \"entity action\" format (e.g., \"page view\", \"product add\")',\n },\n data: {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperty',\n },\n ],\n },\n title: 'WalkerOS.Properties',\n description: 'Event-specific properties',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperties',\n },\n ],\n },\n context: {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n type: 'array',\n items: [\n {\n $ref: '#/definitions/WalkerOSProperty',\n },\n {\n type: 'number',\n },\n ],\n },\n title: 'WalkerOS.OrderedProperties',\n description: 'Ordered context properties with priorities',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSOrderedProperties',\n },\n ],\n },\n globals: {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperty',\n },\n ],\n },\n title: 'WalkerOS.Properties',\n description: 'Global properties shared across events',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperties',\n },\n ],\n },\n custom: {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperty',\n },\n ],\n },\n title: 'WalkerOS.Properties',\n description: 'Custom implementation-specific properties',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperties',\n },\n ],\n },\n user: {\n type: 'object',\n properties: {\n id: {\n description: 'User identifier',\n type: 'string',\n },\n device: {\n description: 'Device identifier',\n type: 'string',\n },\n session: {\n description: 'Session identifier',\n type: 'string',\n },\n hash: {\n description: 'Hashed identifier',\n type: 'string',\n },\n address: {\n description: 'User address',\n type: 'string',\n },\n email: {\n description: 'User email address',\n type: 'string',\n format: 'email',\n pattern:\n \"^(?!\\\\.)(?!.*\\\\.\\\\.)([A-Za-z0-9_'+\\\\-\\\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\\\-]*\\\\.)+[A-Za-z]{2,}$\",\n },\n phone: {\n description: 'User phone number',\n type: 'string',\n },\n userAgent: {\n description: 'Browser user agent string',\n type: 'string',\n },\n browser: {\n description: 'Browser name',\n type: 'string',\n },\n browserVersion: {\n description: 'Browser version',\n type: 'string',\n },\n deviceType: {\n description: 'Device type (mobile, desktop, tablet)',\n type: 'string',\n },\n os: {\n description: 'Operating system',\n type: 'string',\n },\n osVersion: {\n description: 'Operating system version',\n type: 'string',\n },\n screenSize: {\n description: 'Screen dimensions',\n type: 'string',\n },\n language: {\n description: 'User language',\n type: 'string',\n },\n country: {\n description: 'User country',\n type: 'string',\n },\n region: {\n description: 'User region/state',\n type: 'string',\n },\n city: {\n description: 'User city',\n type: 'string',\n },\n zip: {\n description: 'User postal code',\n type: 'string',\n },\n timezone: {\n description: 'User timezone',\n type: 'string',\n },\n ip: {\n description: 'User IP address',\n type: 'string',\n },\n internal: {\n description: 'Internal user flag (employee, test user)',\n type: 'boolean',\n },\n optout: {\n description: 'User opted out of tracking',\n type: 'boolean',\n },\n },\n additionalProperties: {\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperty',\n },\n ],\n },\n title: 'WalkerOS.User',\n description: 'User identification and attributes',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSUser',\n },\n ],\n },\n nested: {\n type: 'array',\n items: {\n $ref: '#/definitions/__schema0',\n },\n title: 'WalkerOS.Entities',\n description: 'Related nested entities',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSEntities',\n },\n ],\n },\n consent: {\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n type: 'boolean',\n },\n title: 'WalkerOS.Consent',\n description: 'Consent states at event time',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSConsent',\n },\n ],\n },\n id: {\n type: 'string',\n minLength: 1,\n description: 'W3C span_id, 16 lowercase hex characters',\n },\n trigger: {\n type: 'string',\n description: 'Event trigger identifier',\n },\n entity: {\n type: 'string',\n description: 'Parsed entity from event name',\n },\n action: {\n type: 'string',\n description: 'Parsed action from event name',\n },\n timestamp: {\n type: 'integer',\n exclusiveMinimum: 0,\n maximum: 9007199254740991,\n description: 'Unix timestamp in milliseconds since epoch',\n },\n timing: {\n type: 'number',\n description: 'Event processing timing information',\n },\n source: {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n description: 'Source kind (browser, dataLayer, gtag, ...)',\n },\n platform: {\n description:\n 'Runtime platform (web, server, app, ios, android, terminal, ...)',\n type: 'string',\n },\n version: {\n description: 'Deployment version of the source emitter',\n type: 'string',\n },\n schema: {\n description:\n 'Event model spec version (collector defaults to \"4\")',\n type: 'string',\n },\n count: {\n description: 'Emission sequence per run',\n type: 'integer',\n minimum: 0,\n maximum: 9007199254740991,\n },\n trace: {\n description:\n 'Trace id shared by every event of a run (W3C trace-id shape)',\n type: 'string',\n },\n release: {\n description:\n 'Per-flow config release map, keyed by flow name; accumulates across walkerOS crossings',\n type: 'object',\n propertyNames: {\n type: 'string',\n },\n additionalProperties: {\n type: 'string',\n },\n },\n url: {\n type: 'string',\n },\n referrer: {\n type: 'string',\n },\n tool: {\n type: 'string',\n },\n command: {\n type: 'string',\n },\n },\n required: ['type'],\n additionalProperties: {\n allOf: [\n {\n $ref: '#/definitions/WalkerOSProperty',\n },\n ],\n },\n title: 'WalkerOS.Source',\n description: 'Event source information',\n allOf: [\n {\n $ref: '#/definitions/WalkerOSSource',\n },\n ],\n },\n },\n additionalProperties: false,\n title: 'WalkerOS.PartialEvent',\n description: 'Partial event structure with all fields optional.',\n },\n },\n} as const);\n"],"mappings":";AACA,SAAS,iBAAiB;;;ACA1B,YAAY,cAAc;;;ACOnB,IAAM,oBAAoB,OAAO,OAAO;AAAA,EA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A,EACF,CAAC;AAED,SAAO,gBAAgB,SACnB,EAAE,SAAS,OAAO,WAAW,GAAG,OAAO,IACvC,EAAE,SAAS,OAAO,QAAQ,YAAY;AAC5C;;;ADtJO,IAAM,sBAET,CAAC,YAAY;AACf,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,WAA6B,OAAO,YAAY,CAAC;AAEvD,QAAM,OAAO,SAAS,QAAQ;AAC9B,QAAM,cAAc,SAAS,QAAQ,WAAW;AAChD,QAAM,aAAa,SAAS,QAAQ,UAAU;AAE9C,SAAO;AAAA;AAAA;AAAA,IAGL,MAAM;AAAA,IACN;AAAA,IAEA,MAAM,KAAK,OAAO,KAAK;AACrB,YAAM,EAAE,OAAO,IAAI;AAEnB,YAAM,EAAE,SAAS,QAAQ,YAAY,IAAI;AAAA,QACvC;AAAA,QACA;AAAA,QACA,EAAE,WAAW,SAAS,UAAU,QAAQ,SAAS,OAAO;AAAA,MAC1D;AACA,UAAI;AACF,YAAI,OAAO,MAAM,4BAA4B;AAAA,UAC3C,OAAO,MAAM;AAAA,UACb,OAAO;AAAA,QACT,CAAC;AAIH,UAAI,WAAY,WAAU,QAAQ,YAAY,QAAQ,EAAE,SAAS,KAAK,CAAC;AAIvE,UAAI,YAAY;AAChB,UAAI,YAAa,aAAY,UAAU,WAAW,aAAa,OAAO;AAItE,UAAI,SAAS,YAAY,CAAC,QAAS,QAAO;AAE1C,aAAO,EAAE,OAAO,UAAU;AAAA,IAC5B;AAAA,EACF;AACF;","names":["changed","next"]}
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/transformer-validate",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.8.0-next-1791496487198",
|
|
5
5
|
"type": "transformer",
|
|
6
6
|
"platform": [
|
|
7
7
|
"server",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"format": {
|
|
31
|
-
"description": "When true, also validate the canonical WalkerOS.Event structural shape (correct field types
|
|
31
|
+
"description": "When true, also validate the canonical WalkerOS.Event structural shape (correct field types; no unknown top-level fields and no unknown keys on a nested entity; `user`, `source`, `data`, `globals`, `custom`, `context` and `consent` accept extra keys of their value type). All fields are optional, so this checks structure and types, not presence.",
|
|
32
32
|
"type": "boolean"
|
|
33
33
|
},
|
|
34
34
|
"mode": {
|
|
@@ -62,6 +62,68 @@
|
|
|
62
62
|
},
|
|
63
63
|
"examples": {
|
|
64
64
|
"step": {
|
|
65
|
+
"formatCustomUserKeys": {
|
|
66
|
+
"title": "Format check accepts custom user keys",
|
|
67
|
+
"description": "With format:true, extra keys on user (segment, ltv) are part of the event model and pass. The verdict source.valid:true is written to the event.",
|
|
68
|
+
"in": {
|
|
69
|
+
"name": "page view",
|
|
70
|
+
"entity": "page",
|
|
71
|
+
"action": "view",
|
|
72
|
+
"data": {
|
|
73
|
+
"title": "Home"
|
|
74
|
+
},
|
|
75
|
+
"user": {
|
|
76
|
+
"id": "u1",
|
|
77
|
+
"segment": "vip",
|
|
78
|
+
"ltv": 5
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"out": [
|
|
82
|
+
[
|
|
83
|
+
"return",
|
|
84
|
+
{
|
|
85
|
+
"event": {
|
|
86
|
+
"name": "page view",
|
|
87
|
+
"entity": "page",
|
|
88
|
+
"action": "view",
|
|
89
|
+
"data": {
|
|
90
|
+
"title": "Home"
|
|
91
|
+
},
|
|
92
|
+
"user": {
|
|
93
|
+
"id": "u1",
|
|
94
|
+
"segment": "vip",
|
|
95
|
+
"ltv": 5
|
|
96
|
+
},
|
|
97
|
+
"source": {
|
|
98
|
+
"valid": true
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
"formatWrongUserType": {
|
|
106
|
+
"public": false,
|
|
107
|
+
"title": "Format check rejects a wrong-typed user field (strict, dropped)",
|
|
108
|
+
"description": "user.id must be a string. In strict mode the chain stops.",
|
|
109
|
+
"in": {
|
|
110
|
+
"name": "page view",
|
|
111
|
+
"entity": "page",
|
|
112
|
+
"action": "view",
|
|
113
|
+
"data": {
|
|
114
|
+
"title": "Home"
|
|
115
|
+
},
|
|
116
|
+
"user": {
|
|
117
|
+
"id": 5
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"out": [
|
|
121
|
+
[
|
|
122
|
+
"return",
|
|
123
|
+
false
|
|
124
|
+
]
|
|
125
|
+
]
|
|
126
|
+
},
|
|
65
127
|
"gtmFilterDropped": {
|
|
66
128
|
"public": false,
|
|
67
129
|
"title": "Filter gtm.* via a contract pattern (dropped)",
|
|
@@ -205,7 +267,7 @@
|
|
|
205
267
|
]
|
|
206
268
|
},
|
|
207
269
|
"format-vs-contract": {
|
|
208
|
-
"text": "format:true is a built-in structural check, not an authored schema. It validates the canonical WalkerOS.Event shape (correct field types
|
|
270
|
+
"text": "format:true is a built-in structural check, not an authored schema. It validates the canonical WalkerOS.Event shape (correct field types; no unknown top-level fields and no unknown keys on a nested entity; `user`, `source`, `data`, `globals`, `custom`, `context` and `consent` accept extra keys of their value type). All fields are optional, so it checks structure and types, not presence: a wrong-typed field or malformed structure fails, a missing field does not. It is independent of contract: turn it on to catch malformed events even when you have no contract, or alongside a contract to AND both checks. A contract is the place for your domain rules; format is the place for \"is this even a well-formed event\".",
|
|
209
271
|
"code": [
|
|
210
272
|
{
|
|
211
273
|
"lang": "json",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/transformer-validate",
|
|
3
3
|
"description": "JSON Schema contract validation transformer for walkerOS",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.8.0-next-1791496487198",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -33,11 +33,12 @@
|
|
|
33
33
|
"test": "jest"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@walkeros/core": "4.
|
|
36
|
+
"@walkeros/core": "4.8.0-next-1791496487198",
|
|
37
37
|
"@cfworker/json-schema": "^4.1.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@walkeros/
|
|
40
|
+
"@walkeros/collector": "4.8.0-next-1791496487198",
|
|
41
|
+
"@walkeros/core": "4.8.0-next-1791496487198"
|
|
41
42
|
},
|
|
42
43
|
"repository": {
|
|
43
44
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|