@cratis/screenplay-language 4.213.3 → 4.213.4

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.
@@ -1,2 +1,2 @@
1
- import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{AuthoringProductionResolver as t}from"../Syntax/AuthoringProductionResolver.js";import{diagnosticText as n}from"../Diagnostics/DiagnosticArgument.js";import{EventSourceCatalog as r}from"../Syntax/EventSourceCatalog.js";import{expandEffectiveSpecificationExamples as i,specificationExamples as a}from"./SpecificationCommandExamples.js";import{compatibleValue as o,uniqueByName as s}from"./ResponseValidator.js";import{commandDestinationType as c}from"./CommandDestinationTypes.js";import{LineReader as l}from"./LineReader.js";import{ParserContext as u}from"./ParserContext.js";import{streamIdFailureMessage as d}from"../Syntax/StreamIdFormatter.js";import{validateStreamIdParts as f}from"./CompositeStreamIdValidator.js";import{formatSpecificationStreamId as p}from"./SpecificationRouteComparison.js";import{formatStreamIdLiteral as m}from"./EventSourceValidator.js";function validateSpecificationStreams(n,r){let i=new t(n).slices.flatMap(({slice:e})=>e.specifications.flatMap(e=>e.cases??[]));if(i.length===0)return validateRoutes(n,r);let a=new u(new l([]));validateRoutes(n,a);let o=/* @__PURE__ */ new Set,s=/* @__PURE__ */ new Set;for(let t of a.diagnostics){let n=JSON.stringify([t.code,t.location.path,t.location.line,t.location.column,t.message]);if(s.has(n))continue;s.add(n);let a=t.code===e.InvalidSpecificationStreamRoute?i.find(e=>e.values.some(e=>e.source.location.line===t.location.line&&e.source.location.column===t.location.column&&e.source.location.path===t.location.path)):void 0;if(a===void 0)r.error(t.code,t.message,t.location,t.arguments);else{let e=JSON.stringify(t.location);o.has(e)||r.error(t.code,`Case '${a.name}': ${t.message}`,t.location,t.arguments),o.add(e)}}}function validateRoutes(l,u){let h=a(l).resolvedExamples,g=i(l);l=g.application;let _=new t(l),v=/* @__PURE__ */ new Set,y=h.flatMap(t=>{if(t.kind!==`event`)return(t.kind===`command`||t.kind===`readmodel`)&&(t.example.stream!=null||t.example.noStream!=null)&&u.error(e.InvalidSpecificationExampleBody,`only event examples carry routes; a command's route comes from its declaration, and read models have none`,(t.example.stream??t.example.noStream).location,n(`example`,t.example.name)),[];let r={kind:`SpecificationEventSyntax`,eventType:t.name,values:t.example.values,for:t.example.for,stream:t.example.stream,noStream:t.example.noStream,location:t.example.location};return v.add(r),[{scope:t.scope,specification:{when:null,given:[],whenAppended:null,thenEvents:[r],whenRedelivered:null}}]}),b=new r(l),x=s(l.concepts),S=s(l.types),C=new Map([...S].map(([e,t])=>[e,s(t.properties)])),compatible=(e,t)=>o(e,t,x,C),w=/* @__PURE__ */ new Set([`String`,`Uuid`,`Int`,`Decimal`,`Bool`,`Date`,`DateTime`,...x.keys(),...S.keys()]),nominallyCompatible=(e,t)=>w.has(e.name)&&w.has(t.name)?e.name===t.name&&e.isCollection===t.isCollection&&(!e.isOptional||t.isOptional):null,formatStreamId=(e,t)=>p(e,t,l),eventOf=(e,t)=>{let n=_.resolve(e,t).declaration;return n?.node.kind===`EventSyntax`?n.node:null},T=[];for(let{slice:e}of _.slices){for(let t of e.commands)for(let n of t.produces){if(!_.isEventProduction(n,e))continue;let r=eventOf(n.event,e);if(r===null)continue;let i=c(t,n,l,{resolver:_,slice:e});T.push({event:r,command:t,type:i,route:n.stream??t.stream})}for(let t of e.reactions.flatMap(e=>e.triggers).flatMap(e=>e.produces)){let n=eventOf(t.event,e);n!==null&&T.push({event:n,command:null,type:null})}for(let t of e.captures)for(let n of[...t.appends,...t.children.flatMap(e=>e.appends),...t.nested.flatMap(e=>e.appends)]){let t=eventOf(n.event,e);t!==null&&T.push({event:t,command:null,type:null})}}let E=[...y.flatMap(e=>_.slices.filter(t=>t.scope.join(`.`)===e.scope.join(`.`)).map(({slice:t,scope:n})=>({slice:t,scope:n,specification:e.specification}))),..._.slices.flatMap(({slice:e,scope:t})=>e.specifications.map(n=>({slice:e,scope:t,specification:n})))];for(let{slice:t,scope:n,specification:r}of E){let i=_.slices.flatMap(e=>e.slice.commands.map(t=>({command:t,scope:e.scope}))),a=r.when?.commandType.split(`.`)??[],o=a.slice(0,-1),s=i.filter(e=>e.command.name===a.at(-1)&&o.every((t,n)=>e.scope[e.scope.length-o.length+n]===t)),c=o.length>0&&s.length===1?s[0].command:null;for(let e=n.length;o.length===0&&e>=0&&c===null;e--){let t=s.filter(t=>n.slice(0,e).every((e,n)=>t.scope[n]===e));if(t.length>0){c=t.length===1?t[0].command:null;break}}let p=[...r.given.map(e=>({node:e,required:!0,expected:!1})),...r.whenAppended===null?[]:[{node:r.whenAppended,required:!0,expected:!1}],...r.thenEvents.map(e=>({node:e,required:!1,expected:!v.has(e)})),...r.whenRedelivered==null?[]:[{node:{...r.whenRedelivered,kind:`SpecificationEventSyntax`},required:!1,expected:!1}]];for(let{node:n,required:r,expected:i}of p){let a=g.specifications.flatMap(e=>e.steps).find(e=>e.effective===n),o=a?.route?.origin!==`example`,s=o||n.for!==a?.example?.for,contextualError=(e,t,n)=>{u.error(e,a?.example==null?t:`${t} Example '${a.example.name}' is used here.`,a?.example==null?n:a.authored.location)};if(n.stream==null&&n.noStream==null)continue;r&&n.noStream!=null&&contextualError(e.InvalidSpecificationStream,`Expected 'stream Source.Stream', or 'no stream' on a then event.`,n.noStream.location);let p=null,h=eventOf(n.eventType,t),_=T.filter(e=>e.event===h);if(n.stream!=null){let t=n.stream,i=b.resolve(t.eventSource,t.stream);if(i.kind!==`unique`){let n={ambiguous:`Ambiguous`,notFound:`NotFound`,wrongKind:`WrongKind`}[i.kind];o&&u.error(e.InvalidSpecificationStreamRoute,`Stream '${t.eventSource}.${t.stream}' is ${n}; routing requires one physical source and stream.`,t.location);continue}let c=i.sources[0],h=i.streams[0],validateLiteral=(t,n)=>{let r=t.source,i=m(r,n,l);i?.failure==null?(r.kind!==`LiteralExpressionSyntax`||r.value===null||n!==null&&!compatible(r,n))&&u.error(e.InvalidSpecificationStreamRoute,`A specification stream id needs a nonempty concrete scalar literal compatible with the stream's declared type.`,r.location):u.error(e.InvalidSpecificationStreamRoute,d(i.failure),r.location)};if(o&&(h.streamIdParts.length>0?f(h,t.streamIdParts,t.streamId!==null,t.location,e.InvalidSpecificationStreamRoute,u,validateLiteral):t.streamIdParts.length>0?u.error(e.InvalidSpecificationStreamRoute,`A streamId part block requires a composite stream.`,t.location):(h.streamId===null!=(t.streamId===null)&&u.error(e.InvalidSpecificationStreamRoute,h.streamId===null?`An unkeyed stream cannot take a streamId mapping.`:`This keyed stream requires a streamId mapping.`,t.location),t.streamId!==null&&validateLiteral(t.streamId,h.streamId))),p=c.identifier,p===null){let n=_.map(e=>e.type),r=new Set(n.filter(e=>e!==null).map(e=>`${e.name}:${e.isOptional}:${e.isCollection}`));n.length===0||n.some(e=>e===null)||r.size!==1?o&&u.error(e.InvalidSpecificationStreamEventSource,`Declare an identifier on source '${c.name}'; the event's producers do not supply one unambiguous destination type.`,t.location):p=n[0]}let g=!1;if(a?.example?.stream!=null&&n.for!==null&&n.for===a.example.for){let e=b.resolve(a.example.stream.eventSource,a.example.stream.stream);if(e.kind===`unique`){let t=_.map(e=>e.type),r=new Set(t.filter(e=>e!==null).map(e=>`${e.name}:${e.isOptional}:${e.isCollection}`)),i=e.sources[0].identifier??(t.length>0&&!t.some(e=>e===null)&&r.size===1?t[0]:null);i!==null&&(g=n.for.kind!==`LiteralExpressionSyntax`||n.for.value===null||i.isCollection||i.isOptional||!compatible(n.for,i))}}r&&n.for===null?contextualError(e.InvalidSpecificationStreamEventSource,`A routed given or when append event requires 'for <literal>'.`,t.location):s&&!g&&n.for!==null&&(n.for.kind!==`LiteralExpressionSyntax`||n.for.value===null||p!==null&&(p.isCollection||p.isOptional||!compatible(n.for,p)))&&contextualError(e.InvalidSpecificationStreamEventSource,`A routed event's for value must be a concrete literal compatible with the source's identifier type.`,n.for.location)}if(!i||c===null||_.length===0||_.some(e=>e.command!==c))continue;let v=_.every(e=>{let t=e.route?.propertyCandidate===null?e.route:null,r=n.noStream==null?t==null||t.eventSource!==n.stream.eventSource||t.stream!==n.stream.stream:t!=null;if(!r&&n.stream!=null&&t!=null){let e=b.resolve(n.stream.eventSource,n.stream.stream),i=e.kind===`unique`?e.streams[0]:null;if(i!==null&&i.streamIdParts.length>0){if(t.streamId===null&&n.stream.streamId===null&&t.streamIdParts.length>0&&n.stream.streamIdParts.length>0)for(let e of i.streamIdParts){let i=t.streamIdParts.filter(t=>t.property===e.name),a=n.stream.streamIdParts.filter(t=>t.property===e.name);if(i.length!==1||a.length!==1)continue;let o=formatStreamId(i[0].source,e.type),s=formatStreamId(a[0].source,e.type);o!==null&&s!==null&&o!==s&&(r=!0)}}else if(i?.streamId!=null&&t.streamIdParts.length===0&&n.stream.streamIdParts.length===0){let e=formatStreamId(t.streamId?.source,i.streamId),a=formatStreamId(n.stream.streamId?.source,i.streamId);e!==null&&a!==null&&e!==a&&(r=!0)}}return r});n.for?.kind===`LiteralExpressionSyntax`&&_.every(e=>e.type!==null&&(p===null?!compatible(n.for,e.type):nominallyCompatible(e.type,p)===!1))&&(v=!0),v&&contextualError(e.SpecificationStreamContradictsCommand,`The expected event route contradicts its only producer, the command under test.`,(n.stream??n.noStream).location)}}}export{validateSpecificationStreams};
1
+ import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{AuthoringProductionResolver as t}from"../Syntax/AuthoringProductionResolver.js";import{diagnosticText as n}from"../Diagnostics/DiagnosticArgument.js";import{EventSourceCatalog as r}from"../Syntax/EventSourceCatalog.js";import{expandEffectiveSpecificationExamples as i,specificationExamples as a}from"./SpecificationCommandExamples.js";import{compatibleValue as o,uniqueByName as s}from"./ResponseValidator.js";import{commandDestinationType as c}from"./CommandDestinationTypes.js";import{LineReader as l}from"./LineReader.js";import{ParserContext as u}from"./ParserContext.js";import{streamIdFailureMessage as d}from"../Syntax/StreamIdFormatter.js";import{validateStreamIdParts as f}from"./CompositeStreamIdValidator.js";import{formatSpecificationStreamId as p}from"./SpecificationRouteComparison.js";import{formatStreamIdLiteral as m}from"./EventSourceValidator.js";function validateSpecificationStreams(n,r){let i=new t(n).slices.flatMap(({slice:e})=>e.specifications.flatMap(e=>e.cases??[]));if(i.length===0)return validateRoutes(n,r);let a=new u(new l([]));validateRoutes(n,a);let o=/* @__PURE__ */ new Set,s=/* @__PURE__ */ new Set;for(let t of a.diagnostics){let n=JSON.stringify([t.code,t.location.path,t.location.line,t.location.column,t.message]);if(s.has(n))continue;s.add(n);let a=t.code===e.InvalidSpecificationStreamRoute?i.find(e=>e.values.some(e=>e.source.location.line===t.location.line&&e.source.location.column===t.location.column&&e.source.location.path===t.location.path)):void 0;if(a===void 0)r.error(t.code,t.message,t.location,t.arguments);else{let e=JSON.stringify(t.location);o.has(e)||r.error(t.code,`Case '${a.name}': ${t.message}`,t.location,t.arguments),o.add(e)}}}function validateRoutes(l,u){let h=a(l).resolvedExamples,g=i(l);l=g.application;let _=new t(l),v=/* @__PURE__ */ new Set,y=h.flatMap(t=>{if(t.kind!==`event`)return(t.kind===`command`||t.kind===`readmodel`)&&(t.example.stream!=null||t.example.noStream!=null)&&u.error(e.InvalidSpecificationExampleBody,`only event examples carry routes; a command's route comes from its declaration, and read models have none`,(t.example.stream??t.example.noStream).location,n(`example`,t.example.name)),[];let r={kind:`SpecificationEventSyntax`,eventType:t.name,values:t.example.values,for:t.example.for,stream:t.example.stream,noStream:t.example.noStream,location:t.example.location};return v.add(r),[{scope:t.scope,specification:{when:null,given:[],whenAppended:null,thenEvents:[r],whenRedelivered:null}}]}),b=new r(l),x=s(l.concepts),S=s(l.types),C=new Map([...S].map(([e,t])=>[e,s(t.properties)])),compatible=(e,t)=>o(e,t,x,C),w=/* @__PURE__ */ new Set([`String`,`Uuid`,`Int`,`Decimal`,`Bool`,`Date`,`DateTime`,...x.keys(),...S.keys()]),nominallyCompatible=(e,t)=>w.has(e.name)&&w.has(t.name)?e.name===t.name&&e.isCollection===t.isCollection&&(!e.isOptional||t.isOptional):null,formatStreamId=(e,t)=>p(e,t,l),eventOf=(e,t)=>{let n=_.resolve(e,t).declaration;return n?.node.kind===`EventSyntax`?n.node:null},T=[];for(let{slice:e}of _.slices){for(let t of e.commands)for(let n of t.produces){if(!_.isEventProduction(n,e))continue;let r=eventOf(n.event,e);if(r===null)continue;let i=c(t,n,l,{resolver:_,slice:e});T.push({event:r,command:t,type:i,route:n.stream??t.stream})}for(let t of e.reactions.flatMap(e=>e.triggers).flatMap(e=>[...e.produces,...e.invokes.flatMap(e=>e.onRefused??[]).flatMap(e=>e.produces)])){let n=eventOf(t.event,e);n!==null&&T.push({event:n,command:null,type:null})}for(let t of e.captures)for(let n of[...t.appends,...t.children.flatMap(e=>e.appends),...t.nested.flatMap(e=>e.appends)]){let t=eventOf(n.event,e);t!==null&&T.push({event:t,command:null,type:null})}}let E=[...y.flatMap(e=>_.slices.filter(t=>t.scope.join(`.`)===e.scope.join(`.`)).map(({slice:t,scope:n})=>({slice:t,scope:n,specification:e.specification}))),..._.slices.flatMap(({slice:e,scope:t})=>e.specifications.map(n=>({slice:e,scope:t,specification:n})))];for(let{slice:t,scope:n,specification:r}of E){let i=_.slices.flatMap(e=>e.slice.commands.map(t=>({command:t,scope:e.scope}))),a=r.when?.commandType.split(`.`)??[],o=a.slice(0,-1),s=i.filter(e=>e.command.name===a.at(-1)&&o.every((t,n)=>e.scope[e.scope.length-o.length+n]===t)),c=o.length>0&&s.length===1?s[0].command:null;for(let e=n.length;o.length===0&&e>=0&&c===null;e--){let t=s.filter(t=>n.slice(0,e).every((e,n)=>t.scope[n]===e));if(t.length>0){c=t.length===1?t[0].command:null;break}}let p=[...r.given.map(e=>({node:e,required:!0,expected:!1})),...r.whenAppended===null?[]:[{node:r.whenAppended,required:!0,expected:!1}],...r.thenEvents.map(e=>({node:e,required:!1,expected:!v.has(e)})),...r.whenRedelivered==null?[]:[{node:{...r.whenRedelivered,kind:`SpecificationEventSyntax`},required:!1,expected:!1}]];for(let{node:n,required:r,expected:i}of p){let a=g.specifications.flatMap(e=>e.steps).find(e=>e.effective===n),o=a?.route?.origin!==`example`,s=o||n.for!==a?.example?.for,contextualError=(e,t,n)=>{u.error(e,a?.example==null?t:`${t} Example '${a.example.name}' is used here.`,a?.example==null?n:a.authored.location)};if(n.stream==null&&n.noStream==null)continue;r&&n.noStream!=null&&contextualError(e.InvalidSpecificationStream,`Expected 'stream Source.Stream', or 'no stream' on a then event.`,n.noStream.location);let p=null,h=eventOf(n.eventType,t),_=T.filter(e=>e.event===h);if(n.stream!=null){let t=n.stream,i=b.resolve(t.eventSource,t.stream);if(i.kind!==`unique`){let n={ambiguous:`Ambiguous`,notFound:`NotFound`,wrongKind:`WrongKind`}[i.kind];o&&u.error(e.InvalidSpecificationStreamRoute,`Stream '${t.eventSource}.${t.stream}' is ${n}; routing requires one physical source and stream.`,t.location);continue}let c=i.sources[0],h=i.streams[0],validateLiteral=(t,n)=>{let r=t.source,i=m(r,n,l);i?.failure==null?(r.kind!==`LiteralExpressionSyntax`||r.value===null||n!==null&&!compatible(r,n))&&u.error(e.InvalidSpecificationStreamRoute,`A specification stream id needs a nonempty concrete scalar literal compatible with the stream's declared type.`,r.location):u.error(e.InvalidSpecificationStreamRoute,d(i.failure),r.location)};if(o&&(h.streamIdParts.length>0?f(h,t.streamIdParts,t.streamId!==null,t.location,e.InvalidSpecificationStreamRoute,u,validateLiteral):t.streamIdParts.length>0?u.error(e.InvalidSpecificationStreamRoute,`A streamId part block requires a composite stream.`,t.location):(h.streamId===null!=(t.streamId===null)&&u.error(e.InvalidSpecificationStreamRoute,h.streamId===null?`An unkeyed stream cannot take a streamId mapping.`:`This keyed stream requires a streamId mapping.`,t.location),t.streamId!==null&&validateLiteral(t.streamId,h.streamId))),p=c.identifier,p===null){let n=_.map(e=>e.type),r=new Set(n.filter(e=>e!==null).map(e=>`${e.name}:${e.isOptional}:${e.isCollection}`));n.length===0||n.some(e=>e===null)||r.size!==1?o&&u.error(e.InvalidSpecificationStreamEventSource,`Declare an identifier on source '${c.name}'; the event's producers do not supply one unambiguous destination type.`,t.location):p=n[0]}let g=!1;if(a?.example?.stream!=null&&n.for!==null&&n.for===a.example.for){let e=b.resolve(a.example.stream.eventSource,a.example.stream.stream);if(e.kind===`unique`){let t=_.map(e=>e.type),r=new Set(t.filter(e=>e!==null).map(e=>`${e.name}:${e.isOptional}:${e.isCollection}`)),i=e.sources[0].identifier??(t.length>0&&!t.some(e=>e===null)&&r.size===1?t[0]:null);i!==null&&(g=n.for.kind!==`LiteralExpressionSyntax`||n.for.value===null||i.isCollection||i.isOptional||!compatible(n.for,i))}}r&&n.for===null?contextualError(e.InvalidSpecificationStreamEventSource,`A routed given or when append event requires 'for <literal>'.`,t.location):s&&!g&&n.for!==null&&(n.for.kind!==`LiteralExpressionSyntax`||n.for.value===null||p!==null&&(p.isCollection||p.isOptional||!compatible(n.for,p)))&&contextualError(e.InvalidSpecificationStreamEventSource,`A routed event's for value must be a concrete literal compatible with the source's identifier type.`,n.for.location)}if(!i||c===null||_.length===0||_.some(e=>e.command!==c))continue;let v=_.every(e=>{let t=e.route?.propertyCandidate===null?e.route:null,r=n.noStream==null?t==null||t.eventSource!==n.stream.eventSource||t.stream!==n.stream.stream:t!=null;if(!r&&n.stream!=null&&t!=null){let e=b.resolve(n.stream.eventSource,n.stream.stream),i=e.kind===`unique`?e.streams[0]:null;if(i!==null&&i.streamIdParts.length>0){if(t.streamId===null&&n.stream.streamId===null&&t.streamIdParts.length>0&&n.stream.streamIdParts.length>0)for(let e of i.streamIdParts){let i=t.streamIdParts.filter(t=>t.property===e.name),a=n.stream.streamIdParts.filter(t=>t.property===e.name);if(i.length!==1||a.length!==1)continue;let o=formatStreamId(i[0].source,e.type),s=formatStreamId(a[0].source,e.type);o!==null&&s!==null&&o!==s&&(r=!0)}}else if(i?.streamId!=null&&t.streamIdParts.length===0&&n.stream.streamIdParts.length===0){let e=formatStreamId(t.streamId?.source,i.streamId),a=formatStreamId(n.stream.streamId?.source,i.streamId);e!==null&&a!==null&&e!==a&&(r=!0)}}return r});n.for?.kind===`LiteralExpressionSyntax`&&_.every(e=>e.type!==null&&(p===null?!compatible(n.for,e.type):nominallyCompatible(e.type,p)===!1))&&(v=!0),v&&contextualError(e.SpecificationStreamContradictsCommand,`The expected event route contradicts its only producer, the command under test.`,(n.stream??n.noStream).location)}}}export{validateSpecificationStreams};
2
2
  //# sourceMappingURL=SpecificationStreamValidator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpecificationStreamValidator.js","names":["rows","AuthoringProductionResolver","application","slice","specification","context","sink","ParserContext","LineReader","reported","distinct","diagnostic","key","row","DiagnosticCodes","value","examples","specificationExamples","expansion","expandEffectiveSpecificationExamples","resolver","declarationSteps","exampleSpecifications","entry","diagnosticText","node","catalog","EventSourceCatalog","concepts","uniqueByName","composites","properties","name","type","compatibleValue","known","source","target","formatSpecificationStreamId","expression","declared","reference","producers","command","produced","event","commandDestinationType","reaction","trigger","capture","appended","child","nested","validationSpecifications","owner","commands","parts","qualifiers","candidates","index","segment","depth","scope","visible","occurrences","step","pair","validateRoute","validateFor","code","message","location","required","identifier","eventProducers","producer","route","resolution","state","stream","mapping","formatted","formatStreamIdLiteral","streamIdFailureMessage","validateStreamIdParts","types","inheritedIdentityIsInvalid","prior","priorIdentifier","expected","contradicts","commandRoute","differs","part","actual","actualId","expectedId"],"sources":["../../../../../../Compiler/Parsing/SpecificationStreamValidator.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { diagnosticText } from '../Diagnostics/DiagnosticArgument';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { AuthoringProductionResolver } from '../Syntax/AuthoringProductionResolver';\nimport { CommandSyntax } from '../Syntax/Commands';\nimport { EventSyntax, TypeRefSyntax } from '../Syntax/Declarations';\nimport { EventSourceCatalog } from '../Syntax/EventSourceCatalog';\nimport { CommandStreamSyntax, EventSourceResolutionKind } from '../Syntax/EventSources';\nimport { formatSpecificationStreamId } from './SpecificationRouteComparison';\nimport { streamIdFailureMessage } from '../Syntax/StreamIdFormatter';\nimport { ExpressionSyntax } from '../Syntax/Expressions';\nimport { commandDestinationType } from './CommandDestinationTypes';\nimport { formatStreamIdLiteral } from './EventSourceValidator';\nimport { ApplicationSyntax } from '../Syntax/Structure';\nimport { PropertyMappingSyntax } from '../Syntax/Expressions';\nimport { validateStreamIdParts } from './CompositeStreamIdValidator';\nimport { ParserContext } from './ParserContext';\nimport { LineReader } from './LineReader';\nimport { compatibleValue, uniqueByName } from './ResponseValidator';\nimport { expandEffectiveSpecificationExamples, specificationExamples } from './SpecificationCommandExamples';\nimport { SpecificationEventSyntax } from '../Syntax/Specifications';\n\ninterface Producer { event: EventSyntax; command: CommandSyntax | null; type: TypeRefSyntax | null; route?: CommandStreamSyntax | null }\n\nexport function validateSpecificationStreams(application: ApplicationSyntax, context: ParserContext): void {\n const rows = new AuthoringProductionResolver(application).slices.flatMap(({ slice }) => slice.specifications.flatMap(specification => specification.cases ?? []));\n if (rows.length === 0) return validateRoutes(application, context);\n const sink = new ParserContext(new LineReader([]));\n validateRoutes(application, sink);\n const reported = new Set<string>();\n const distinct = new Set<string>();\n for (const diagnostic of sink.diagnostics) {\n const key = JSON.stringify([diagnostic.code, diagnostic.location.path, diagnostic.location.line, diagnostic.location.column, diagnostic.message]);\n if (distinct.has(key)) continue;\n distinct.add(key);\n const row = diagnostic.code === DiagnosticCodes.InvalidSpecificationStreamRoute ? rows.find(row => row.values.some(value => value.source.location.line === diagnostic.location.line && value.source.location.column === diagnostic.location.column && value.source.location.path === diagnostic.location.path)) : undefined;\n if (row === undefined) context.error(diagnostic.code, diagnostic.message, diagnostic.location, diagnostic.arguments);\n else {\n const key = JSON.stringify(diagnostic.location);\n if (!reported.has(key)) context.error(diagnostic.code, `Case '${row.name}': ${diagnostic.message}`, diagnostic.location, diagnostic.arguments);\n reported.add(key);\n }\n }\n}\n\nfunction validateRoutes(application: ApplicationSyntax, context: ParserContext): void {\n const examples = specificationExamples(application).resolvedExamples;\n const expansion = expandEffectiveSpecificationExamples(application);\n application = expansion.application;\n const resolver = new AuthoringProductionResolver(application);\n const declarationSteps = new Set<SpecificationEventSyntax>();\n const exampleSpecifications = examples.flatMap(entry => {\n if (entry.kind !== 'event') {\n if ((entry.kind === 'command' || entry.kind === 'readmodel') && (entry.example.stream != null || entry.example.noStream != null))\n context.error(DiagnosticCodes.InvalidSpecificationExampleBody, \"only event examples carry routes; a command's route comes from its declaration, and read models have none\", (entry.example.stream ?? entry.example.noStream)!.location, diagnosticText('example', entry.example.name));\n return [];\n }\n const node: SpecificationEventSyntax = { kind: 'SpecificationEventSyntax', eventType: entry.name, values: entry.example.values, for: entry.example.for, stream: entry.example.stream, noStream: entry.example.noStream, location: entry.example.location };\n declarationSteps.add(node);\n return [{ scope: entry.scope, specification: { when: null, given: [], whenAppended: null, thenEvents: [node], whenRedelivered: null } }];\n });\n const catalog = new EventSourceCatalog(application);\n const concepts = uniqueByName(application.concepts);\n const composites = uniqueByName(application.types);\n const properties = new Map([...composites].map(([name, type]) => [name, uniqueByName(type.properties)]));\n const compatible = (value: Parameters<typeof compatibleValue>[0], type: TypeRefSyntax): boolean => compatibleValue(value, type, concepts, properties);\n const known = new Set(['String', 'Uuid', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime', ...concepts.keys(), ...composites.keys()]);\n const nominallyCompatible = (source: TypeRefSyntax, target: TypeRefSyntax): boolean | null => known.has(source.name) && known.has(target.name)\n ? source.name === target.name && source.isCollection === target.isCollection && (!source.isOptional || target.isOptional) : null;\n const formatStreamId = (expression: ExpressionSyntax | null | undefined, type: TypeRefSyntax): string | null => formatSpecificationStreamId(expression, type, application);\n const eventOf = (reference: string, slice: typeof resolver.slices[number]['slice']): EventSyntax | null => {\n const declared = resolver.resolve(reference, slice).declaration;\n return declared?.node.kind === 'EventSyntax' ? declared.node : null;\n };\n const producers: Producer[] = [];\n for (const { slice } of resolver.slices) {\n for (const command of slice.commands) for (const produced of command.produces) {\n if (!resolver.isEventProduction(produced, slice)) continue;\n const event = eventOf(produced.event, slice);\n if (event === null) continue;\n const type = commandDestinationType(command, produced, application, { resolver, slice });\n producers.push({ event, command, type, route: produced.stream ?? command.stream });\n }\n for (const produced of slice.reactions.flatMap(reaction => reaction.triggers).flatMap(trigger => trigger.produces)) {\n const event = eventOf(produced.event, slice);\n if (event !== null) producers.push({ event, command: null, type: null });\n }\n for (const capture of slice.captures) for (const appended of [...capture.appends, ...capture.children.flatMap(child => child.appends), ...capture.nested.flatMap(nested => nested.appends)]) {\n const event = eventOf(appended.event, slice);\n if (event !== null) producers.push({ event, command: null, type: null });\n }\n }\n const validationSpecifications = [\n ...exampleSpecifications.flatMap(entry => resolver.slices.filter(owner => owner.scope.join('.') === entry.scope.join('.')).map(({ slice, scope }) => ({ slice, scope, specification: entry.specification }))),\n ...resolver.slices.flatMap(({ slice, scope }) => slice.specifications.map(specification => ({ slice, scope, specification })))\n ];\n for (const { slice, scope, specification } of validationSpecifications) {\n const commands = resolver.slices.flatMap(entry => entry.slice.commands.map(command => ({ command, scope: entry.scope })));\n const parts = specification.when?.commandType.split('.') ?? [];\n const qualifiers = parts.slice(0, -1);\n const candidates = commands.filter(entry => entry.command.name === parts.at(-1) && qualifiers.every((segment, index) => entry.scope[entry.scope.length - qualifiers.length + index] === segment));\n let command: CommandSyntax | null = qualifiers.length > 0 && candidates.length === 1 ? candidates[0].command : null;\n for (let depth = scope.length; qualifiers.length === 0 && depth >= 0 && command === null; depth--) {\n const visible = candidates.filter(entry => scope.slice(0, depth).every((segment, index) => entry.scope[index] === segment));\n if (visible.length > 0) { command = visible.length === 1 ? visible[0].command : null; break; }\n }\n const occurrences = [...specification.given.map(node => ({ node, required: true, expected: false })),\n ...(specification.whenAppended === null ? [] : [{ node: specification.whenAppended, required: true, expected: false }]),\n ...specification.thenEvents.map(node => ({ node, required: false, expected: !declarationSteps.has(node) })),\n ...(specification.whenRedelivered == null ? [] : [{ node: { ...specification.whenRedelivered, kind: 'SpecificationEventSyntax' as const }, required: false, expected: false }])];\n for (const { node, required, expected } of occurrences) {\n const step = expansion.specifications.flatMap(pair => pair.steps).find(step => step.effective === node);\n const validateRoute = step?.route?.origin !== 'example';\n const validateFor = validateRoute || node.for !== step?.example?.for;\n const contextualError = (code: string, message: string, location: typeof node.location): void => {\n context.error(code, step?.example == null ? message : `${message} Example '${step.example.name}' is used here.`, step?.example == null ? location : step.authored.location);\n };\n if (node.stream == null && node.noStream == null) continue;\n if (required && node.noStream != null)\n contextualError(DiagnosticCodes.InvalidSpecificationStream, \"Expected 'stream Source.Stream', or 'no stream' on a then event.\", node.noStream.location);\n let identifier: TypeRefSyntax | null = null;\n const event = eventOf(node.eventType, slice);\n const eventProducers = producers.filter(producer => producer.event === event);\n if (node.stream != null) {\n const route = node.stream;\n const resolution = catalog.resolve(route.eventSource, route.stream);\n if (resolution.kind !== EventSourceResolutionKind.Unique) {\n const state = { ambiguous: 'Ambiguous', notFound: 'NotFound', wrongKind: 'WrongKind' }[resolution.kind];\n if (validateRoute) context.error(DiagnosticCodes.InvalidSpecificationStreamRoute, `Stream '${route.eventSource}.${route.stream}' is ${state}; routing requires one physical source and stream.`, route.location);\n continue;\n }\n const source = resolution.sources[0];\n const stream = resolution.streams[0];\n const validateLiteral = (mapping: PropertyMappingSyntax, target: TypeRefSyntax | null): void => {\n const value = mapping.source;\n const formatted = formatStreamIdLiteral(value, target, application);\n if (formatted?.failure != null) context.error(DiagnosticCodes.InvalidSpecificationStreamRoute, streamIdFailureMessage(formatted.failure), value.location);\n else if (value.kind !== 'LiteralExpressionSyntax' || value.value === null || target !== null && !compatible(value, target))\n context.error(DiagnosticCodes.InvalidSpecificationStreamRoute, \"A specification stream id needs a nonempty concrete scalar literal compatible with the stream's declared type.\", value.location);\n };\n if (!validateRoute) { /* The authored example's route is checked once at its declaration. */ }\n else if (stream.streamIdParts.length > 0)\n validateStreamIdParts(stream, route.streamIdParts, route.streamId !== null, route.location, DiagnosticCodes.InvalidSpecificationStreamRoute, context, validateLiteral);\n else if (route.streamIdParts.length > 0)\n context.error(DiagnosticCodes.InvalidSpecificationStreamRoute, 'A streamId part block requires a composite stream.', route.location);\n else {\n if ((stream.streamId === null) !== (route.streamId === null))\n context.error(DiagnosticCodes.InvalidSpecificationStreamRoute, stream.streamId === null ? 'An unkeyed stream cannot take a streamId mapping.' : 'This keyed stream requires a streamId mapping.', route.location);\n if (route.streamId !== null) validateLiteral(route.streamId, stream.streamId);\n }\n identifier = source.identifier;\n if (identifier === null) {\n const types = eventProducers.map(producer => producer.type);\n const distinct = new Set(types.filter(type => type !== null).map(type => `${type.name}:${type.isOptional}:${type.isCollection}`));\n if (types.length === 0 || types.some(type => type === null) || distinct.size !== 1) {\n if (validateRoute) context.error(DiagnosticCodes.InvalidSpecificationStreamEventSource, `Declare an identifier on source '${source.name}'; the event's producers do not supply one unambiguous destination type.`, route.location);\n } else identifier = types[0];\n }\n let inheritedIdentityIsInvalid = false;\n if (step?.example?.stream != null && node.for !== null && node.for === step.example.for) {\n const prior = catalog.resolve(step.example.stream.eventSource, step.example.stream.stream);\n if (prior.kind === EventSourceResolutionKind.Unique) {\n const types = eventProducers.map(producer => producer.type);\n const distinct = new Set(types.filter(type => type !== null).map(type => `${type.name}:${type.isOptional}:${type.isCollection}`));\n const priorIdentifier = prior.sources[0].identifier ?? (types.length > 0 && !types.some(type => type === null) && distinct.size === 1 ? types[0] : null);\n if (priorIdentifier !== null)\n inheritedIdentityIsInvalid = node.for.kind !== 'LiteralExpressionSyntax' || node.for.value === null || priorIdentifier.isCollection || priorIdentifier.isOptional || !compatible(node.for, priorIdentifier);\n }\n }\n if (required && node.for === null)\n contextualError(DiagnosticCodes.InvalidSpecificationStreamEventSource, \"A routed given or when append event requires 'for <literal>'.\", route.location);\n else if (validateFor && !inheritedIdentityIsInvalid && node.for !== null && (node.for.kind !== 'LiteralExpressionSyntax' || node.for.value === null || identifier !== null && (identifier.isCollection || identifier.isOptional || !compatible(node.for, identifier))))\n contextualError(DiagnosticCodes.InvalidSpecificationStreamEventSource, \"A routed event's for value must be a concrete literal compatible with the source's identifier type.\", node.for.location);\n }\n if (!expected || command === null || eventProducers.length === 0 || eventProducers.some(producer => producer.command !== command)) continue;\n let contradicts = eventProducers.every(producer => {\n const commandRoute = producer.route?.propertyCandidate === null ? producer.route : null;\n let differs = node.noStream != null ? commandRoute != null : commandRoute == null || commandRoute.eventSource !== node.stream!.eventSource || commandRoute.stream !== node.stream!.stream;\n if (!differs && node.stream != null && commandRoute != null) {\n const resolution = catalog.resolve(node.stream.eventSource, node.stream.stream);\n const stream = resolution.kind === EventSourceResolutionKind.Unique ? resolution.streams[0] : null;\n if (stream !== null && stream.streamIdParts.length > 0) {\n if (commandRoute.streamId === null && node.stream.streamId === null && commandRoute.streamIdParts.length > 0 && node.stream.streamIdParts.length > 0) {\n for (const part of stream.streamIdParts) {\n const actual = commandRoute.streamIdParts.filter(mapping => mapping.property === part.name);\n const expected = node.stream.streamIdParts.filter(mapping => mapping.property === part.name);\n if (actual.length !== 1 || expected.length !== 1) continue;\n const actualId = formatStreamId(actual[0].source, part.type);\n const expectedId = formatStreamId(expected[0].source, part.type);\n if (actualId !== null && expectedId !== null && actualId !== expectedId) differs = true;\n }\n }\n } else if (stream?.streamId != null && commandRoute.streamIdParts.length === 0 && node.stream.streamIdParts.length === 0) {\n const actualId = formatStreamId(commandRoute.streamId?.source, stream.streamId);\n const expectedId = formatStreamId(node.stream.streamId?.source, stream.streamId);\n if (actualId !== null && expectedId !== null && actualId !== expectedId) differs = true;\n }\n }\n return differs;\n });\n if (node.for?.kind === 'LiteralExpressionSyntax' && eventProducers.every(producer => producer.type !== null &&\n (identifier !== null ? nominallyCompatible(producer.type, identifier) === false : !compatible(node.for!, producer.type)))) contradicts = true;\n if (contradicts) contextualError(DiagnosticCodes.SpecificationStreamContradictsCommand, 'The expected event route contradicts its only producer, the command under test.', (node.stream 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EAAK,IAAI,EACpFJ,EAAWhE,EAAK,OAAO,cAAc,OAAO,GAAWuD,EAAQ,WAAaa,EAAK,IAAI,EAC3F,GAAIC,EAAO,SAAW,GAAKL,EAAS,SAAW,EAAG,SAClD,IAAMM,EAAW,eAAeD,EAAO,EAAE,CAAC,OAAQD,EAAK,IAAI,EACrDG,EAAa,eAAeP,EAAS,EAAE,CAAC,OAAQI,EAAK,IAAI,EAC3DE,IAAa,MAAQC,IAAe,MAAQD,IAAaC,IAAY,EAAU,GACvF,OAED,GAAIjB,GAAQ,UAAY,MAAQY,EAAa,cAAc,SAAW,GAAKlE,EAAK,OAAO,cAAc,SAAW,EAAG,CACtH,IAAMsE,EAAW,eAAeJ,EAAa,UAAU,OAAQZ,EAAO,QAAQ,EACxEiB,EAAa,eAAevE,EAAK,OAAO,UAAU,OAAQsD,EAAO,QAAQ,EAC3EgB,IAAa,MAAQC,IAAe,MAAQD,IAAaC,IAAY,EAAU,GACvF,CACJ,CACA,OAAOJ,CACX,CAAC,EACGnE,EAAK,KAAK,OAAS,2BAA6BiD,EAAe,MAAM,GAAYC,EAAS,OAAS,OAClGF,IAAe,KAAkE,CAAC,WAAWhD,EAAK,IAAMkD,EAAS,IAAI,EAA/F,oBAAoBA,EAAS,KAAMF,CAAU,IAAM,GAA8C,IAAG,EAAc,IACzIiB,GAAa,gBAAgB5E,EAAgB,sCAAuC,mFAAoFW,EAAK,QAAUA,EAAK,SAAA,CAAW,QAAQ,CACvN,CACJ,CACJ"}
1
+ {"version":3,"file":"SpecificationStreamValidator.js","names":["rows","AuthoringProductionResolver","application","slice","specification","context","sink","ParserContext","LineReader","reported","distinct","diagnostic","key","row","DiagnosticCodes","value","examples","specificationExamples","expansion","expandEffectiveSpecificationExamples","resolver","declarationSteps","exampleSpecifications","entry","diagnosticText","node","catalog","EventSourceCatalog","concepts","uniqueByName","composites","properties","name","type","compatibleValue","known","source","target","formatSpecificationStreamId","expression","declared","reference","producers","command","produced","event","commandDestinationType","reaction","trigger","invocation","branch","capture","appended","child","nested","validationSpecifications","owner","commands","parts","qualifiers","candidates","index","segment","depth","scope","visible","occurrences","step","pair","validateRoute","validateFor","code","message","location","required","identifier","eventProducers","producer","route","resolution","state","stream","mapping","formatted","formatStreamIdLiteral","streamIdFailureMessage","validateStreamIdParts","types","inheritedIdentityIsInvalid","prior","priorIdentifier","expected","contradicts","commandRoute","differs","part","actual","actualId","expectedId"],"sources":["../../../../../../Compiler/Parsing/SpecificationStreamValidator.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { diagnosticText } from '../Diagnostics/DiagnosticArgument';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { AuthoringProductionResolver } from '../Syntax/AuthoringProductionResolver';\nimport { CommandSyntax } from '../Syntax/Commands';\nimport { EventSyntax, TypeRefSyntax } from '../Syntax/Declarations';\nimport { EventSourceCatalog } from '../Syntax/EventSourceCatalog';\nimport { CommandStreamSyntax, EventSourceResolutionKind } from '../Syntax/EventSources';\nimport { formatSpecificationStreamId } from './SpecificationRouteComparison';\nimport { streamIdFailureMessage } from '../Syntax/StreamIdFormatter';\nimport { ExpressionSyntax } from '../Syntax/Expressions';\nimport { commandDestinationType } from './CommandDestinationTypes';\nimport { formatStreamIdLiteral } from './EventSourceValidator';\nimport { ApplicationSyntax } from '../Syntax/Structure';\nimport { PropertyMappingSyntax } from '../Syntax/Expressions';\nimport { validateStreamIdParts } from './CompositeStreamIdValidator';\nimport { ParserContext } from './ParserContext';\nimport { LineReader } from './LineReader';\nimport { compatibleValue, uniqueByName } from './ResponseValidator';\nimport { expandEffectiveSpecificationExamples, specificationExamples } from './SpecificationCommandExamples';\nimport { SpecificationEventSyntax } from '../Syntax/Specifications';\n\ninterface Producer { event: EventSyntax; command: CommandSyntax | null; type: TypeRefSyntax | null; route?: CommandStreamSyntax | null }\n\nexport function validateSpecificationStreams(application: ApplicationSyntax, context: ParserContext): void {\n const rows = new AuthoringProductionResolver(application).slices.flatMap(({ slice }) => slice.specifications.flatMap(specification => specification.cases ?? []));\n if (rows.length === 0) return validateRoutes(application, context);\n const sink = new ParserContext(new LineReader([]));\n validateRoutes(application, sink);\n const reported = new Set<string>();\n const distinct = new Set<string>();\n for (const diagnostic of sink.diagnostics) {\n const key = JSON.stringify([diagnostic.code, diagnostic.location.path, diagnostic.location.line, diagnostic.location.column, diagnostic.message]);\n if (distinct.has(key)) continue;\n distinct.add(key);\n const row = diagnostic.code === DiagnosticCodes.InvalidSpecificationStreamRoute ? rows.find(row => row.values.some(value => value.source.location.line === diagnostic.location.line && value.source.location.column === diagnostic.location.column && value.source.location.path === diagnostic.location.path)) : undefined;\n if (row === undefined) context.error(diagnostic.code, diagnostic.message, diagnostic.location, diagnostic.arguments);\n else {\n const key = JSON.stringify(diagnostic.location);\n if (!reported.has(key)) context.error(diagnostic.code, `Case '${row.name}': ${diagnostic.message}`, diagnostic.location, diagnostic.arguments);\n reported.add(key);\n }\n }\n}\n\nfunction validateRoutes(application: ApplicationSyntax, context: ParserContext): void {\n const examples = specificationExamples(application).resolvedExamples;\n const expansion = expandEffectiveSpecificationExamples(application);\n application = expansion.application;\n const resolver = new AuthoringProductionResolver(application);\n const declarationSteps = new Set<SpecificationEventSyntax>();\n const exampleSpecifications = examples.flatMap(entry => {\n if (entry.kind !== 'event') {\n if ((entry.kind === 'command' || entry.kind === 'readmodel') && (entry.example.stream != null || entry.example.noStream != null))\n context.error(DiagnosticCodes.InvalidSpecificationExampleBody, \"only event examples carry routes; a command's route comes from its declaration, and read models have none\", (entry.example.stream ?? entry.example.noStream)!.location, diagnosticText('example', entry.example.name));\n return [];\n }\n const node: SpecificationEventSyntax = { kind: 'SpecificationEventSyntax', eventType: entry.name, values: entry.example.values, for: entry.example.for, stream: entry.example.stream, noStream: entry.example.noStream, location: entry.example.location };\n declarationSteps.add(node);\n return [{ scope: entry.scope, specification: { when: null, given: [], whenAppended: null, thenEvents: [node], whenRedelivered: null } }];\n });\n const catalog = new EventSourceCatalog(application);\n const concepts = uniqueByName(application.concepts);\n const composites = uniqueByName(application.types);\n const properties = new Map([...composites].map(([name, type]) => [name, uniqueByName(type.properties)]));\n const compatible = (value: Parameters<typeof compatibleValue>[0], type: TypeRefSyntax): boolean => compatibleValue(value, type, concepts, properties);\n const known = new Set(['String', 'Uuid', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime', ...concepts.keys(), ...composites.keys()]);\n const nominallyCompatible = (source: TypeRefSyntax, target: TypeRefSyntax): boolean | null => known.has(source.name) && known.has(target.name)\n ? source.name === target.name && source.isCollection === target.isCollection && (!source.isOptional || target.isOptional) : null;\n const formatStreamId = (expression: ExpressionSyntax | null | undefined, type: TypeRefSyntax): string | null => formatSpecificationStreamId(expression, type, application);\n const eventOf = (reference: string, slice: typeof resolver.slices[number]['slice']): EventSyntax | null => {\n const declared = resolver.resolve(reference, slice).declaration;\n return declared?.node.kind === 'EventSyntax' ? declared.node : null;\n };\n const producers: Producer[] = [];\n for (const { slice } of resolver.slices) {\n for (const command of slice.commands) for (const produced of command.produces) {\n if (!resolver.isEventProduction(produced, slice)) continue;\n const event = eventOf(produced.event, slice);\n if (event === null) continue;\n const type = commandDestinationType(command, produced, application, { resolver, slice });\n producers.push({ event, command, type, route: produced.stream ?? command.stream });\n }\n for (const produced of slice.reactions.flatMap(reaction => reaction.triggers).flatMap(trigger => [...trigger.produces, ...trigger.invokes.flatMap(invocation => invocation.onRefused ?? []).flatMap(branch => branch.produces)])) {\n const event = eventOf(produced.event, slice);\n if (event !== null) producers.push({ event, command: null, type: null });\n }\n for (const capture of slice.captures) for (const appended of [...capture.appends, ...capture.children.flatMap(child => child.appends), ...capture.nested.flatMap(nested => nested.appends)]) {\n const event = eventOf(appended.event, slice);\n if (event !== null) producers.push({ event, command: null, type: null });\n }\n }\n const validationSpecifications = [\n ...exampleSpecifications.flatMap(entry => resolver.slices.filter(owner => owner.scope.join('.') === entry.scope.join('.')).map(({ slice, scope }) => ({ slice, scope, specification: entry.specification }))),\n ...resolver.slices.flatMap(({ slice, scope }) => slice.specifications.map(specification => ({ slice, scope, specification })))\n ];\n for (const { slice, scope, specification } of validationSpecifications) {\n const commands = resolver.slices.flatMap(entry => entry.slice.commands.map(command => ({ command, scope: entry.scope })));\n const parts = specification.when?.commandType.split('.') ?? [];\n const qualifiers = parts.slice(0, -1);\n const candidates = commands.filter(entry => entry.command.name === parts.at(-1) && qualifiers.every((segment, index) => entry.scope[entry.scope.length - qualifiers.length + index] === segment));\n let command: CommandSyntax | null = qualifiers.length > 0 && candidates.length === 1 ? candidates[0].command : null;\n for (let depth = scope.length; qualifiers.length === 0 && depth >= 0 && command === null; depth--) {\n const visible = candidates.filter(entry => scope.slice(0, depth).every((segment, index) => entry.scope[index] === segment));\n if (visible.length > 0) { command = visible.length === 1 ? visible[0].command : null; break; }\n }\n const occurrences = [...specification.given.map(node => ({ node, required: true, expected: false })),\n ...(specification.whenAppended === null ? [] : [{ node: specification.whenAppended, required: true, expected: false }]),\n ...specification.thenEvents.map(node => ({ node, required: false, expected: !declarationSteps.has(node) })),\n ...(specification.whenRedelivered == null ? [] : [{ node: { ...specification.whenRedelivered, kind: 'SpecificationEventSyntax' as const }, required: false, expected: false }])];\n for (const { node, required, expected } of occurrences) {\n const step = expansion.specifications.flatMap(pair => pair.steps).find(step => step.effective === node);\n const validateRoute = step?.route?.origin !== 'example';\n const validateFor = validateRoute || node.for !== step?.example?.for;\n const contextualError = (code: string, message: string, location: typeof node.location): void => {\n context.error(code, step?.example == null ? message : `${message} Example '${step.example.name}' is used here.`, step?.example == null ? location : step.authored.location);\n };\n if (node.stream == null && node.noStream == null) continue;\n if (required && node.noStream != null)\n contextualError(DiagnosticCodes.InvalidSpecificationStream, \"Expected 'stream Source.Stream', or 'no stream' on a then event.\", node.noStream.location);\n let identifier: TypeRefSyntax | null = null;\n const event = eventOf(node.eventType, slice);\n const eventProducers = producers.filter(producer => producer.event === event);\n if (node.stream != null) {\n const route = node.stream;\n const resolution = catalog.resolve(route.eventSource, route.stream);\n if (resolution.kind !== EventSourceResolutionKind.Unique) {\n const state = { ambiguous: 'Ambiguous', notFound: 'NotFound', wrongKind: 'WrongKind' }[resolution.kind];\n if (validateRoute) context.error(DiagnosticCodes.InvalidSpecificationStreamRoute, `Stream '${route.eventSource}.${route.stream}' is ${state}; routing requires one physical source and stream.`, route.location);\n continue;\n }\n const source = resolution.sources[0];\n const stream = resolution.streams[0];\n const validateLiteral = (mapping: PropertyMappingSyntax, target: TypeRefSyntax | null): void => {\n const value = mapping.source;\n const formatted = formatStreamIdLiteral(value, target, application);\n if (formatted?.failure != null) context.error(DiagnosticCodes.InvalidSpecificationStreamRoute, streamIdFailureMessage(formatted.failure), value.location);\n else if (value.kind !== 'LiteralExpressionSyntax' || value.value === null || target !== null && !compatible(value, target))\n context.error(DiagnosticCodes.InvalidSpecificationStreamRoute, \"A specification stream id needs a nonempty concrete scalar literal compatible with the stream's declared type.\", value.location);\n };\n if (!validateRoute) { /* The authored example's route is checked once at its declaration. */ }\n else if (stream.streamIdParts.length > 0)\n validateStreamIdParts(stream, route.streamIdParts, route.streamId !== null, route.location, DiagnosticCodes.InvalidSpecificationStreamRoute, context, validateLiteral);\n else if (route.streamIdParts.length > 0)\n context.error(DiagnosticCodes.InvalidSpecificationStreamRoute, 'A streamId part block requires a composite stream.', route.location);\n else {\n if ((stream.streamId === null) !== (route.streamId === null))\n context.error(DiagnosticCodes.InvalidSpecificationStreamRoute, stream.streamId === null ? 'An unkeyed stream cannot take a streamId mapping.' : 'This keyed stream requires a streamId mapping.', route.location);\n if (route.streamId !== null) validateLiteral(route.streamId, stream.streamId);\n }\n identifier = source.identifier;\n if (identifier === null) {\n const types = eventProducers.map(producer => producer.type);\n const distinct = new Set(types.filter(type => type !== null).map(type => `${type.name}:${type.isOptional}:${type.isCollection}`));\n if (types.length === 0 || types.some(type => type === null) || distinct.size !== 1) {\n if (validateRoute) context.error(DiagnosticCodes.InvalidSpecificationStreamEventSource, `Declare an identifier on source '${source.name}'; the event's producers do not supply one unambiguous destination type.`, route.location);\n } else identifier = types[0];\n }\n let inheritedIdentityIsInvalid = false;\n if (step?.example?.stream != null && node.for !== null && node.for === step.example.for) {\n const prior = catalog.resolve(step.example.stream.eventSource, step.example.stream.stream);\n if (prior.kind === EventSourceResolutionKind.Unique) {\n const types = eventProducers.map(producer => producer.type);\n const distinct = new Set(types.filter(type => type !== null).map(type => `${type.name}:${type.isOptional}:${type.isCollection}`));\n const priorIdentifier = prior.sources[0].identifier ?? (types.length > 0 && !types.some(type => type === null) && distinct.size === 1 ? types[0] : null);\n if (priorIdentifier !== null)\n inheritedIdentityIsInvalid = node.for.kind !== 'LiteralExpressionSyntax' || node.for.value === null || priorIdentifier.isCollection || priorIdentifier.isOptional || !compatible(node.for, priorIdentifier);\n }\n }\n if (required && node.for === null)\n contextualError(DiagnosticCodes.InvalidSpecificationStreamEventSource, \"A routed given or when append event requires 'for <literal>'.\", route.location);\n else if (validateFor && !inheritedIdentityIsInvalid && node.for !== null && (node.for.kind !== 'LiteralExpressionSyntax' || node.for.value === null || identifier !== null && (identifier.isCollection || identifier.isOptional || !compatible(node.for, identifier))))\n contextualError(DiagnosticCodes.InvalidSpecificationStreamEventSource, \"A routed event's for value must be a concrete literal compatible with the source's identifier type.\", node.for.location);\n }\n if (!expected || command === null || eventProducers.length === 0 || eventProducers.some(producer => producer.command !== command)) continue;\n let contradicts = eventProducers.every(producer => {\n const commandRoute = producer.route?.propertyCandidate === null ? producer.route : null;\n let differs = node.noStream != null ? commandRoute != null : commandRoute == null || commandRoute.eventSource !== node.stream!.eventSource || commandRoute.stream !== node.stream!.stream;\n if (!differs && node.stream != null && commandRoute != null) {\n const resolution = catalog.resolve(node.stream.eventSource, node.stream.stream);\n const stream = resolution.kind === EventSourceResolutionKind.Unique ? resolution.streams[0] : null;\n if (stream !== null && stream.streamIdParts.length > 0) {\n if (commandRoute.streamId === null && node.stream.streamId === null && commandRoute.streamIdParts.length > 0 && node.stream.streamIdParts.length > 0) {\n for (const part of stream.streamIdParts) {\n const actual = commandRoute.streamIdParts.filter(mapping => mapping.property === part.name);\n const expected = node.stream.streamIdParts.filter(mapping => mapping.property === part.name);\n if (actual.length !== 1 || expected.length !== 1) continue;\n const actualId = formatStreamId(actual[0].source, part.type);\n const expectedId = formatStreamId(expected[0].source, part.type);\n if (actualId !== null && expectedId !== null && actualId !== expectedId) differs = true;\n }\n }\n } else if (stream?.streamId != null && commandRoute.streamIdParts.length === 0 && node.stream.streamIdParts.length === 0) {\n const actualId = formatStreamId(commandRoute.streamId?.source, stream.streamId);\n const expectedId = formatStreamId(node.stream.streamId?.source, stream.streamId);\n if (actualId !== null && expectedId !== null && actualId !== expectedId) differs = true;\n }\n }\n return differs;\n });\n if (node.for?.kind === 'LiteralExpressionSyntax' && eventProducers.every(producer => producer.type !== null &&\n (identifier !== null ? nominallyCompatible(producer.type, identifier) === false : !compatible(node.for!, producer.type)))) contradicts = true;\n if (contradicts) contextualError(DiagnosticCodes.SpecificationStreamContradictsCommand, 'The expected event route contradicts its only producer, the command under test.', (node.stream ?? node.noStream)!.location);\n }\n }\n}\n"],"mappings":"k+BA0BA,SAAgB,6BAA6B,EAAgC,EAA8B,CACvG,IAAMA,EAAO,IAAIC,EAA4BC,CAAW,CAAC,CAAC,OAAO,SAAS,CAAE,WAAYC,EAAM,eAAe,QAAQ,GAAiBC,EAAc,OAAS,CAAC,CAAC,CAAC,EAChK,GAAIJ,EAAK,SAAW,EAAG,OAAO,eAAeE,EAAaG,CAAO,EACjE,IAAMC,EAAO,IAAIC,EAAc,IAAIC,EAAW,CAAC,CAAC,CAAC,EACjD,eAAeN,EAAaI,CAAI,EAChC,IAAMG,kBAAW,IAAI,IACfC,kBAAW,IAAI,IACrB,IAAK,IAAMC,KAAcL,EAAK,YAAa,CACvC,IAAMM,EAAM,KAAK,UAAU,CAACD,EAAW,KAAMA,EAAW,SAAS,KAAMA,EAAW,SAAS,KAAMA,EAAW,SA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IAAMwE,EAAW,eAAeJ,EAAa,UAAU,OAAQZ,EAAO,QAAQ,EACxEiB,EAAa,eAAezE,EAAK,OAAO,UAAU,OAAQwD,EAAO,QAAQ,EAC3EgB,IAAa,MAAQC,IAAe,MAAQD,IAAaC,IAAY,EAAU,GACvF,CACJ,CACA,OAAOJ,CACX,CAAC,EACGrE,EAAK,KAAK,OAAS,2BAA6BmD,EAAe,MAAM,GAAYC,EAAS,OAAS,OAClGF,IAAe,KAAkE,CAAC,WAAWlD,EAAK,IAAMoD,EAAS,IAAI,EAA/F,oBAAoBA,EAAS,KAAMF,CAAU,IAAM,GAA8C,IAAG,EAAc,IACzIiB,GAAa,gBAAgB9E,EAAgB,sCAAuC,mFAAoFW,EAAK,QAAUA,EAAK,SAAA,CAAW,QAAQ,CACvN,CACJ,CACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/screenplay-language",
3
- "version": "4.213.3",
3
+ "version": "4.213.4",
4
4
  "description": "Monaco language service for the Cratis Screenplay DSL — syntax highlighting, IntelliSense, hover and diagnostics for .play files",
5
5
  "keywords": [
6
6
  "cratis",