@cratis/screenplay-language 4.259.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundles/compiler/Authoring/QuickFixes.js +6 -2
- package/dist/bundles/compiler/Authoring/QuickFixes.js.map +1 -1
- package/dist/bundles/compiler/Authoring/StructuredValueQuickFix.js +3 -0
- package/dist/bundles/compiler/Authoring/StructuredValueQuickFix.js.map +1 -0
- package/dist/bundles/compiler/Dependencies/SliceReferences.js +1 -1
- package/dist/bundles/compiler/Dependencies/SliceReferences.js.map +1 -1
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js +1 -1
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js.map +1 -1
- package/dist/bundles/compiler/Files/PlayFolderMerge.js +1 -1
- package/dist/bundles/compiler/Files/PlayFolderMerge.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CaptureParser.js +1 -1
- package/dist/bundles/compiler/Parsing/CaptureParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CompositionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/CompositionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ExpressionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ExpressionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/OperationParser.js +1 -1
- package/dist/bundles/compiler/Parsing/OperationParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ProducesParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ProducesParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ProjectionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ProjectionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ReactionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ReactionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ScreenParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ScreenParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ScreenplayParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ScreenplayParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SeedParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SeedParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationCaseParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationCaseParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationExampleParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationExampleParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationResponseParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationResponseParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/StateMachineParser.js +2 -0
- package/dist/bundles/compiler/Parsing/StateMachineParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/StructuredBlockParser.js +2 -0
- package/dist/bundles/compiler/Parsing/StructuredBlockParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/UiBindingParser.js +1 -1
- package/dist/bundles/compiler/Parsing/UiBindingParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/WorkflowParser.js +2 -0
- package/dist/bundles/compiler/Parsing/WorkflowParser.js.map +1 -0
- package/dist/bundles/compiler/Syntax/ScreenplaySyntaxWalker.js +1 -1
- package/dist/bundles/compiler/Syntax/ScreenplaySyntaxWalker.js.map +1 -1
- package/dist/bundles/compiler/Syntax/Structure.js.map +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxCollections.js +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxCollections.js.map +1 -1
- package/dist/bundles/completion-items.js +22 -16
- package/dist/bundles/completion-items.js.map +1 -1
- package/dist/bundles/completion-planner.js +2 -2
- package/dist/bundles/completion-planner.js.map +1 -1
- package/dist/bundles/example-analysis.js +1 -1
- package/dist/bundles/example-analysis.js.map +1 -1
- package/dist/bundles/keyword-docs.js +1 -1
- package/dist/bundles/keyword-docs.js.map +1 -1
- package/dist/bundles/language.js +1 -1
- package/dist/bundles/language.js.map +1 -1
- package/dist/bundles/tokens.js +1 -1
- package/dist/bundles/tokens.js.map +1 -1
- package/dist/completion-items.d.ts +3 -0
- package/dist/completion-items.d.ts.map +1 -1
- package/dist/completion-planner.d.ts.map +1 -1
- package/dist/keyword-docs.d.ts.map +1 -1
- package/dist/language.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{checkPortableMatchPattern as t}from"../Parsing/checkPortableMatchPattern.js";import{stringBodyPattern as n}from"../Text/StringLiteral.js";import{pattern as r}from"../Text/patterns.js";import{complianceWireName as i}from"../Parsing/ConceptComplianceParser.js";import{commentStart as a,splitLines as o}from"../Parsing/SourceLineSplitter.js";import{implicitConjunctionTokens as s,isAuthorizeContinuation as c}from"../Parsing/AuthorizeParser.js";import{ScreenplaySyntaxWalker as l}from"../Syntax/ScreenplaySyntaxWalker.js";import{parseForAuthoring as u}from"../ScreenplayCompiler.js";import{prepareTimelineQuickFixes as d}from"./TimelineQuickFixes.js";import{prepareActionSubjectQuickFixes as f}from"./ActionSubjectQuickFixes.js";const
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{checkPortableMatchPattern as t}from"../Parsing/checkPortableMatchPattern.js";import{stringBodyPattern as n}from"../Text/StringLiteral.js";import{pattern as r}from"../Text/patterns.js";import{complianceWireName as i}from"../Parsing/ConceptComplianceParser.js";import{commentStart as a,splitLines as o}from"../Parsing/SourceLineSplitter.js";import{implicitConjunctionTokens as s,isAuthorizeContinuation as c}from"../Parsing/AuthorizeParser.js";import{ScreenplaySyntaxWalker as l}from"../Syntax/ScreenplaySyntaxWalker.js";import{parseForAuthoring as u}from"../ScreenplayCompiler.js";import{prepareTimelineQuickFixes as d}from"./TimelineQuickFixes.js";import{prepareActionSubjectQuickFixes as f}from"./ActionSubjectQuickFixes.js";import{rewriteInlineJson as p}from"./StructuredValueQuickFix.js";const m=/* @__PURE__ */ new Set([e.InferredActionSubject,e.ChangedActionSubject,e.EventFromLaterSlice,e.DeprecatedStudioTextRulePattern,e.DuplicateComplianceMarker,e.LegacyOptionalSuffix,e.LegacyComplianceMarker,e.RedundantEventId,e.PublicTranslationRequiresDirection,e.LegacyProfileLayout,e.RedundantCompositeKeyBraces,e.ImplicitAuthorizationConjunction,e.InlineJsonValue]);function isQuickFixDiagnostic(e){return m.has(e)}function legacyOptionalTypeLength(t,n){return n.code===e.LegacyOptionalSuffix?/^[\p{L}\p{Mn}\p{Nd}\p{Pc}.]+(?:\[\])?\?/u.exec(t.slice(n.location.column-1))?.[0].length??0:0}function prepareQuickFixes(t,n={}){let r=prepareLocalQuickFixes(t,n),i,a,subjectFixes=(e,r)=>(a??=f(t,n))(e,r);return(a,o)=>{let s=typeof a==`number`?[{line:a,diagnosticCode:o}]:a??[],c=r(a,o),l=s.filter(t=>t.diagnosticCode===e.EventFromLaterSlice||t.diagnosticCode===void 0&&c.length===0),u=l.length===0?[]:[...new Set(l.map(e=>e.line))].flatMap(e=>(i??=d(t,n))(e)),f=s.filter(t=>t.diagnosticCode===void 0||t.diagnosticCode===e.InferredActionSubject||t.diagnosticCode===e.ChangedActionSubject),p=s.length===0?subjectFixes(void 0,o):f.flatMap(e=>subjectFixes(e.line,e.diagnosticCode));return[...c,...u,...p]}}function prepareLocalQuickFixes(r,i){let s=u(r,void 0,i.placement),c=/* @__PURE__ */ new Set([...Array.from({length:14},(e,t)=>`PLAY0${607+t}`),e.InlineJsonValue]),acceptable=e=>e.success||e.diagnostics.every(e=>e.severity!==`error`||c.has(e.code)),errorCodes=e=>new Set(e.diagnostics.filter(e=>e.severity===`error`).map(e=>e.code));if(!acceptable(s))return()=>[];let d=o(r),f=/* @__PURE__ */ new Map,m=/* @__PURE__ */ new Map,h=/* @__PURE__ */ new Map;new class extends l{visitValidationRule(e){h.set(e.location.line,e),super.visitValidationRule(e)}visitEvent(e){f.set(e.location.line,e)}visitSlice(e){m.set(e.location.line,e),super.visitSlice(e)}}().visitApplication(s.value);let g=/* @__PURE__ */ new Map,_=/* @__PURE__ */ new Map,v=/* @__PURE__ */ new Map,y=/* @__PURE__ */ new Map,b=/* @__PURE__ */ new Map,x;for(let e of d)x=f.get(e.number)??x,x!==void 0&&b.set(e.number,x);for(let o of s.diagnostics){g.set(o.code,(g.get(o.code)??0)+1);let c=d[o.location.line-1];if(o.code===e.DuplicateComplianceMarker){let e=duplicateComplianceMarkerEdit(c.raw,c.startOffset);e!==void 0&&v.set(c.number,{diagnosticCode:o.code,title:`Remove duplicate compliance markers`,scope:`occurrence`,edits:[e]})}let l=legacyOptionalTypeLength(c.raw,o);if(l>0)_.set(c.number,{line:c.number,fix:{diagnosticCode:o.code,title:`Use 'optional' instead of '?'`,scope:`occurrence`,edits:[{start:c.startOffset+o.location.column+l-2,length:1,text:` optional`}]}});else if(o.code===e.DeprecatedStudioTextRulePattern){let e=h.get(c.number);if(e?.rule!==`Matches`||e.value?.kind!==`LiteralExpressionSyntax`||typeof e.value.value!=`string`)continue;let r=t(e.value.value).replacement,i=RegExp(`\\bmatches\\s+"${n}"`).exec(c.raw);if(r===void 0||i===null)continue;let a={Equal:`==`,NotEqual:`!=`,Contains:`contains`,NotContains:`not contains`,StartsWith:`starts with`,EndsWith:`ends with`},s=`"`+r.value.replace(/["\\\n\r\t]/g,e=>JSON.stringify(e).slice(1,-1))+`"`;_.set(c.number,{line:c.number,fix:{diagnosticCode:o.code,title:`Use the equivalent ordinal text rule`,scope:`occurrence`,edits:[{start:c.startOffset+i.index,length:i[0].length,text:a[r.kind]+` `+s}]},change:{node:e,replacement:{...e,rule:r.kind,value:{...e.value,value:r.value}}}})}else if(o.code===e.LegacyComplianceMarker){let e=complianceMarkerEdit(c.raw,c.startOffset);e!==void 0&&_.set(c.number,{line:c.number,fix:{diagnosticCode:o.code,title:`Use bare pii and secret compliance markers`,scope:`occurrence`,edits:[e]}})}else if(o.code===e.PublicTranslationRequiresDirection){let t=m.get(c.number),n=/^\s*/.exec(c.raw)[0],a=r.includes(`\r
|
|
2
2
|
`)?`\r
|
|
3
3
|
`:`
|
|
4
|
-
`,l=[`Inbound`,`Outbound`].map(e=>({direction:e,text:`${a}${n} direction ${e===`Inbound`?`inbound`:`outbound`}`})).filter(t=>{let n=applyQuickFixEdits(r,[{start:c.startOffset+c.raw.length,length:0,text:t.text}]),a=u(n,void 0,i.placement),o=errorCodes(s);return acceptable(a)&&![...errorCodes(a)].some(t=>t===e.PublicTranslationRequiresDirection||!o.has(t))});if(l.length===1){let[{direction:e,text:n}]=l;
|
|
4
|
+
`,l=[`Inbound`,`Outbound`].map(e=>({direction:e,text:`${a}${n} direction ${e===`Inbound`?`inbound`:`outbound`}`})).filter(t=>{let n=applyQuickFixEdits(r,[{start:c.startOffset+c.raw.length,length:0,text:t.text}]),a=u(n,void 0,i.placement),o=errorCodes(s);return acceptable(a)&&![...errorCodes(a)].some(t=>t===e.PublicTranslationRequiresDirection||!o.has(t))});if(l.length===1){let[{direction:e,text:n}]=l;_.set(c.number,{line:c.number,fix:{diagnosticCode:o.code,title:`Declare 'direction ${e===`Inbound`?`inbound`:`outbound`}'`,scope:`occurrence`,edits:[{start:c.startOffset+c.raw.length,length:0,text:n}]},change:{node:t,replacement:{...t,direction:e}}})}}else if(o.code===e.LegacyProfileLayout){let e=legacyProfileLayoutFix(d,c.number-1,o.code);e!==void 0&&_.set(c.number,{line:c.number,fix:e})}else if(o.code===e.RedundantCompositeKeyBraces||o.code===e.ImplicitAuthorizationConjunction){let t=o.code===e.RedundantCompositeKeyBraces?redundantKeyBracesFix(r,d,c.number-1,o.code):implicitAuthorizationFix(r,d,c.number-1,o.code);t!==void 0&&_.set(c.number,{line:c.number,fix:t})}else if(o.code===e.InlineJsonValue){let e=indentationUnit(d,c.number-1),t=p(c.raw,e);if(t!==void 0){let e=r.includes(`\r
|
|
5
|
+
`)?`\r
|
|
6
|
+
`:`
|
|
7
|
+
`;_.set(c.number,{line:c.number,fix:{diagnosticCode:o.code,title:`Write the value as an indented block`,scope:`occurrence`,edits:[{start:c.startOffset+t.start,length:c.raw.length-t.start,text:t.text.replaceAll(`
|
|
8
|
+
`,e)}]}})}}else if(o.code===e.RedundantEventId&&a(c.raw)<0){let e=b.get(c.number);if(e?.id!==e?.name||e===void 0)continue;_.set(c.number,{line:c.number,fix:{diagnosticCode:o.code,title:`Remove the redundant event id`,scope:`occurrence`,edits:[{start:c.startOffset,length:(d[c.number]?.startOffset??r.length)-c.startOffset,text:``}]},change:{node:e,replacement:{...e,id:null}}})}}let S=[e.LegacyOptionalSuffix,e.LegacyComplianceMarker],C=verificationShape(s),w=/* @__PURE__ */ new Map,T,E=/* @__PURE__ */ new Set,D=/* @__PURE__ */ new Map,verify=(e,t)=>{let n=applyQuickFixEdits(r,e.edits);if(n===void 0)return;let a=u(n,void 0,i.placement);if(acceptable(a)&&verificationShape(a)===(t===void 0?C:verificationShape(s,[t])))return a.diagnostics.filter(t=>t.code===e.diagnosticCode).length===(g.get(e.diagnosticCode)??0)-e.edits.length?e:void 0};return(t,n)=>{let a=typeof t==`number`||t===void 0?void 0:t,o=a===void 0?typeof t==`number`&&(n===void 0||n===e.DuplicateComplianceMarker)?[t]:[]:a.filter(t=>t.diagnosticCode===e.DuplicateComplianceMarker).map(e=>e.line),c=[...new Set(o)].flatMap(e=>{let t=v.get(e);if(t===void 0)return[];y.has(e)||y.set(e,verify(t));let n=y.get(e);return n===void 0?[]:[n]}),l=S.filter(e=>a===void 0?n===void 0||n===e:a.some(t=>t.diagnosticCode===e));for(let t of l.filter(e=>!E.has(e))){let n=[..._.values()].filter(e=>e.fix.diagnosticCode===t);if(n.length>0){let r=verify({diagnosticCode:t,title:t===e.LegacyOptionalSuffix?`Use 'optional' throughout this document`:`Use bare pii and secret throughout this document`,scope:`document`,edits:n.flatMap(e=>e.fix.edits)});r!==void 0&&D.set(t,r)}E.add(t)}let f=l.flatMap(e=>D.has(e)?[D.get(e)]:[]);if(a!==void 0){if(T===void 0){T=/* @__PURE__ */ new Map;let e=d.flatMap(e=>_.has(e.number)?[_.get(e.number)]:[]),t=e.flatMap(e=>e.fix.edits),n=applyQuickFixEdits(r,t);if(t.length>0&&n!==void 0){let t=u(n,void 0,i.placement),r=e.flatMap(e=>e.change===void 0?[]:[e.change]);if(acceptable(t)&&verificationShape(t)===verificationShape(s,r)){let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map;for(let e of t.diagnostics)n.set(e.code,(n.get(e.code)??0)+1);for(let t of e)r.set(t.fix.diagnosticCode,(r.get(t.fix.diagnosticCode)??0)+t.fix.edits.length);if([...r].every(([e,t])=>(n.get(e)??0)===(g.get(e)??0)-t))for(let t of e)T.set(t.line,t.fix)}}}let e=/* @__PURE__ */ new Map;for(let t of a){let n=T.get(t.line);n?.diagnosticCode===t.diagnosticCode&&e.set(t.line,n)}return[...e.values(),...c,...f]}let p=typeof t==`number`?t:void 0,m=p===void 0?void 0:_.get(p),h;return m!==void 0&&p!==void 0&&(n===void 0||m.fix.diagnosticCode===n)&&(w.has(p)||(w.size===32&&w.delete(w.keys().next().value),w.set(p,verify(m.fix,m.change))),h=w.get(p)),[...h===void 0?[]:[h],...c,...f]}}function legacyProfileLayoutFix(e,t,n){let indentOf=e=>/^\s*/.exec(e)[0].length,r=indentOf(e[t].raw),i,a=!1;for(let n=t+1;n<e.length;n++){let t=e[n].raw;if(t.trim().length!==0){if(indentOf(t)<=r)break;i===void 0&&/^\s*layout\s+[A-Za-z_]\w*\s*$/.test(t)&&(i={index:n,indent:indentOf(t)}),/^\s*root\s+template(\s|$)/.test(t)&&(a=!0)}}if(i===void 0)return;let o=e[i.index];return a?{diagnosticCode:n,title:`Remove the ignored layout line`,scope:`occurrence`,edits:[{start:o.startOffset,length:(e[i.index+1]?.startOffset??o.startOffset+o.raw.length)-o.startOffset,text:``}]}:{diagnosticCode:n,title:`Use 'root template' instead of 'layout'`,scope:`occurrence`,edits:[{start:o.startOffset+i.indent,length:6,text:`root template`}]}}function indentationUnit(e,t){let n=e[t].indent,r=e.slice(0,t).reverse().find(e=>e.content.length>0&&e.indent<n);return` `.repeat(r===void 0?2:n-r.indent)}function redundantKeyBracesFix(e,t,n,r){let i=t[n];if(!i.content.endsWith(`{`))return;let a=i.indent+i.content.length-1,o=i.raw.slice(0,a).trimEnd().length;for(let s=n+1;s<t.length;s++){let n=t[s];if(n.content.length===0||n.indent>i.indent)continue;if(n.indent!==i.indent||n.content!==`}`||n.raw.trim()!==`}`)return;let c=t[s+1],l=e.slice(i.startOffset+i.raw.length,n.startOffset),u=i.raw.slice(a+1)+(c===void 0?l.replace(/\r?\n$/,``):l),d=i.startOffset+o;return{diagnosticCode:r,title:`Remove the redundant composite key braces`,scope:`occurrence`,edits:[{start:d,length:(c?.startOffset??e.length)-d,text:u}]}}}function implicitAuthorizationFix(e,t,n,r){let i=t[n];if(!i.content.startsWith(`authorize`))return;let a=[],o,visit=(e,t)=>{let n=s(e.content.slice(t),o);o=n.previous;for(let r of n.tokens)a.push({index:e.startOffset+e.indent+t+r.index,length:r.length})};visit(i,9);for(let e=n+1;e<t.length;e++){let n=t[e];if(n.content.length!==0){if(n.indent<=i.indent||!c(n.content))break;visit(n,0)}}if(a.length===0)return;let l=a[a.length-1],u=a.map((t,n)=>`and `+e.slice(t.index,n<a.length-1?a[n+1].index:t.index+t.length)).join(``);return{diagnosticCode:r,title:`Write 'and' between the adjacent authorize policies`,scope:`occurrence`,edits:[{start:a[0].index,length:l.index+l.length-a[0].index,text:u}]}}function duplicateComplianceMarkerEdit(e,t){let n=r(`^(\\s*concept\\s+\\w+\\s*:\\s*\\w+)((?:[^\\S\\r\\n]+@?\\w+)*)`).exec(e);if(n===null)return;let a=n[2],o=/* @__PURE__ */ new Set,s=a.replace(new RegExp(r(`[^\\S\\r\\n]+(@?\\w+)`).source,`gu`),(e,t)=>{let n=i(t);return o.has(n)?``:(o.add(n),e)});return s===a?void 0:{start:t+n[1].length,length:a.length,text:s}}function complianceMarkerEdit(e,t){let n=r(`^(\\s*concept\\s+\\w+\\s*:\\s*\\w+)((?:[^\\S\\r\\n]+@?\\w+)*)`).exec(e);if(n!==null){let e=n[2],r=e.replace(/@pii\b|@?sensitive\b/g,e=>e===`@pii`?`pii`:`secret`);return r===e?void 0:{start:t+n[1].length,length:e.length,text:r}}let i=r(`^(\\s*)(@pii|@?sensitive)\\b`).exec(e);return i===null?void 0:{start:t+i[1].length,length:i[2].length,text:i[2]===`@pii`?`pii`:`secret`}}function verificationShape(e,t=[]){let n=new Map(t.map(e=>[e.node,e.replacement]));return JSON.stringify([e.value,e.triggerData],(e,t)=>[`location`,`usesLocation`,`targetLocation`].includes(e)?void 0:n.get(t)??t)}function applyQuickFixEdits(e,t){let n=[],r=0;for(let i of t){if(i.start<r||i.start<0||i.length<0||i.start+i.length>e.length)return;n.push(e.slice(r,i.start),i.text),r=i.start+i.length}return n.push(e.slice(r)),n.join(``)}export{applyQuickFixEdits,isQuickFixDiagnostic,legacyOptionalTypeLength,prepareQuickFixes};
|
|
5
9
|
//# sourceMappingURL=QuickFixes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuickFixes.js","names":["quickFixDiagnosticCodes","DiagnosticCodes","code","diagnostic","line","local","source","options","timeline","subjects","prepareActionSubjectQuickFixes","requests","localFixes","diagnosticCode","selected","request","fixes","prepareTimelineQuickFixes","subjectRequests","actions","original","parseForAuthoring","publicEventCodes","index","parsed","lines","splitLines","eventsByLine","slicesByLine","rulesByLine","ScreenplaySyntaxWalker","rule","event","slice","counts","byLine","duplicateByLine","duplicateVerdicts","events","edit","length","replacement","checkPortableMatchPattern","match","stringBodyPattern","spellings","quoted","character","indent","ending","candidates","direction","edited","candidate","originalCodes","fix","commentStart","declaration","spellingCodes","syntax","verified","rangeVerdicts","documentChecked","documentFixes","change","duplicateLines","duplicates","number","selectedCodes","documents","edits","candidateSource","changes","remaining","removed","count","occurrenceLine","occurrenceFix","raw","headerIndent","headerIndex","layout","hasRoot","key","keyIndex","brace","prefix","next","keep","text","start","first","authorizeIndex","found","previous","result","implicitConjunctionTokens","from","token","isAuthorizeContinuation","last","header","pattern","suffix","seen","wire","complianceWireName","marker","startOffset","directive","replacements","value","parts","end"],"sources":["../../../../../../Compiler/Authoring/QuickFixes.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 { Diagnostic } from '../Diagnostics/Diagnostic';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { PlayPlacement } from '../Files/PlayPlacement';\nimport { checkPortableMatchPattern } from '../Parsing/checkPortableMatchPattern';\nimport { ValidationRuleSyntax } from '../Syntax/Commands';\nimport { stringBodyPattern } from '../Text/StringLiteral';\nimport { complianceWireName } from '../Parsing/ConceptComplianceParser';\nimport { commentStart, splitLines } from '../Parsing/SourceLineSplitter';\nimport { implicitConjunctionTokens, isAuthorizeContinuation } from '../Parsing/AuthorizeParser';\nimport { parseForAuthoring } from '../ScreenplayCompiler';\nimport { EventSyntax } from '../Syntax/Declarations';\nimport { SliceSyntax } from '../Syntax/Structure';\nimport { TranslationDirection } from '../Syntax/TranslationDirection';\nimport { ScreenplaySyntaxWalker } from '../Syntax/ScreenplaySyntaxWalker';\nimport { pattern } from '../Text/patterns';\nimport { QuickFixCandidate } from './QuickFixCandidate';\nimport { prepareTimelineQuickFixes } from './TimelineQuickFixes';\nimport { prepareActionSubjectQuickFixes } from './ActionSubjectQuickFixes';\n\nexport interface QuickFixEdit {\n /** Destination document for an application-snapshot repair; absent for a buffer-local edit. */\n readonly path?: string;\n readonly start: number;\n readonly length: number;\n readonly text: string;\n}\n\nexport interface QuickFix {\n /** Original diagnostic line, which may differ from the edited import's line. */\n readonly line?: number;\n readonly diagnosticCode: string;\n readonly title: string;\n readonly scope: 'occurrence' | 'document';\n readonly edits: readonly QuickFixEdit[];\n}\n\nexport interface QuickFixOptions {\n readonly path?: string;\n readonly documents?: ReadonlyMap<string, string>;\n readonly line?: number;\n readonly placement?: PlayPlacement;\n readonly diagnosticCode?: string;\n}\n\nconst quickFixDiagnosticCodes: ReadonlySet<unknown> = new Set([\n DiagnosticCodes.InferredActionSubject,\n DiagnosticCodes.ChangedActionSubject,\n DiagnosticCodes.EventFromLaterSlice,\n DiagnosticCodes.DeprecatedStudioTextRulePattern,\n DiagnosticCodes.DuplicateComplianceMarker,\n DiagnosticCodes.LegacyOptionalSuffix,\n DiagnosticCodes.LegacyComplianceMarker,\n DiagnosticCodes.RedundantEventId,\n DiagnosticCodes.PublicTranslationRequiresDirection,\n DiagnosticCodes.LegacyProfileLayout,\n DiagnosticCodes.RedundantCompositeKeyBraces,\n DiagnosticCodes.ImplicitAuthorizationConjunction,\n]);\n\nexport function isQuickFixDiagnostic(code: unknown): code is string {\n return quickFixDiagnosticCodes.has(code);\n}\n\n// Diagnostics point at the complete type, not at the suffix. Never derive edits from message text.\nexport function legacyOptionalTypeLength(line: string, diagnostic: Diagnostic): number {\n if (diagnostic.code !== DiagnosticCodes.LegacyOptionalSuffix) return 0;\n return /^[\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}.]+(?:\\[\\])?\\?/u.exec(line.slice(diagnostic.location.column - 1))?.[0].length ?? 0;\n}\n\nexport function findQuickFixes(source: string, options: QuickFixOptions = {}): QuickFix[] {\n return prepareQuickFixes(source, options)(options.line, options.diagnosticCode);\n}\n\n// One immutable buffer version owns the analysis and document verdict. Cursor moves reuse them;\n// single-occurrence verdicts have a bounded cache. Range requests verify the independent recipes\n// together once per version, rather than reparsing N times for N intersecting markers.\nexport function prepareQuickFixes(source: string, options: Pick<QuickFixOptions, 'placement' | 'path' | 'documents'> = {}): (line?: number | readonly { line: number; diagnosticCode: string }[], diagnosticCode?: string) => QuickFix[] {\n const local = prepareLocalQuickFixes(source, options);\n let timeline: ReturnType<typeof prepareTimelineQuickFixes> | undefined;\n let subjects: ReturnType<typeof prepareActionSubjectQuickFixes> | undefined;\n const subjectFixes = (line?: number, code?: string) => (subjects ??= prepareActionSubjectQuickFixes(source, options))(line, code);\n return (line, diagnosticCode) => {\n const requests = typeof line === 'number' ? [{ line, diagnosticCode }] : line ?? [];\n const localFixes = local(line, diagnosticCode);\n const selected = requests.filter(request => request.diagnosticCode === DiagnosticCodes.EventFromLaterSlice || (request.diagnosticCode === undefined && localFixes.length === 0));\n const fixes = selected.length === 0 ? [] : [...new Set(selected.map(request => request.line))].flatMap(line => (timeline ??= prepareTimelineQuickFixes(source, options))(line));\n const subjectRequests = requests.filter(request => request.diagnosticCode === undefined || request.diagnosticCode === DiagnosticCodes.InferredActionSubject || request.diagnosticCode === DiagnosticCodes.ChangedActionSubject);\n const actions = requests.length === 0 ? subjectFixes(undefined, diagnosticCode) : subjectRequests.flatMap(request => subjectFixes(request.line, request.diagnosticCode));\n return [...localFixes, ...fixes, ...actions];\n };\n}\n\nfunction prepareLocalQuickFixes(source: string, options: Pick<QuickFixOptions, 'placement'>): (line?: number | readonly { line: number; diagnosticCode: string }[], diagnosticCode?: string) => QuickFix[] {\n const original = parseForAuthoring(source, undefined, options.placement);\n // PLAY0614 and the public-event boundary errors that follow from a missing direction are errors the repair itself removes,\n // so a document whose only errors are public-event boundary errors stays repairable.\n const publicEventCodes: ReadonlySet<string> = new Set(Array.from({ length: 14 }, (_, index) => `PLAY0${607 + index}`));\n const acceptable = (parsed: ReturnType<typeof parseForAuthoring>): boolean => parsed.success || parsed.diagnostics.every(diagnostic => diagnostic.severity !== 'error' || publicEventCodes.has(diagnostic.code));\n const errorCodes = (parsed: ReturnType<typeof parseForAuthoring>): Set<string> => new Set(parsed.diagnostics.filter(diagnostic => diagnostic.severity === 'error').map(diagnostic => diagnostic.code));\n if (!acceptable(original)) return () => [];\n const lines = splitLines(source);\n const eventsByLine = new Map<number, EventSyntax>();\n const slicesByLine = new Map<number, SliceSyntax>();\n const rulesByLine = new Map<number, ValidationRuleSyntax>();\n // Index inline and standalone declarations once, without scanning the tree per diagnostic.\n const walker = new class extends ScreenplaySyntaxWalker {\n override visitValidationRule(rule: ValidationRuleSyntax): void { rulesByLine.set(rule.location.line, rule); super.visitValidationRule(rule); }\n override visitEvent(event: EventSyntax): void { eventsByLine.set(event.location.line, event); }\n override visitSlice(slice: SliceSyntax): void { slicesByLine.set(slice.location.line, slice); super.visitSlice(slice); }\n }();\n walker.visitApplication(original.value);\n const counts = new Map<string, number>();\n const byLine = new Map<number, QuickFixCandidate>();\n // Duplicate removal and legacy spelling can share a header. Keep their independently verified recipes separate.\n const duplicateByLine = new Map<number, QuickFix>();\n const duplicateVerdicts = new Map<number, QuickFix | undefined>();\n const events = new Map<number, EventSyntax>();\n let event: EventSyntax | undefined;\n for (const line of lines) {\n event = eventsByLine.get(line.number) ?? event;\n if (event !== undefined) events.set(line.number, event);\n }\n for (const diagnostic of original.diagnostics) {\n counts.set(diagnostic.code, (counts.get(diagnostic.code) ?? 0) + 1);\n const line = lines[diagnostic.location.line - 1];\n if (diagnostic.code === DiagnosticCodes.DuplicateComplianceMarker) {\n const edit = duplicateComplianceMarkerEdit(line.raw, line.startOffset);\n if (edit !== undefined) duplicateByLine.set(line.number, { diagnosticCode: diagnostic.code, title: 'Remove duplicate compliance markers', scope: 'occurrence', edits: [edit] });\n }\n const length = legacyOptionalTypeLength(line.raw, diagnostic);\n if (length > 0) {\n byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: \"Use 'optional' instead of '?'\", scope: 'occurrence', edits: [{ start: line.startOffset + diagnostic.location.column + length - 2, length: 1, text: ' optional' }] } });\n } else if (diagnostic.code === DiagnosticCodes.DeprecatedStudioTextRulePattern) {\n const rule = rulesByLine.get(line.number);\n if (rule?.rule !== 'Matches' || rule.value?.kind !== 'LiteralExpressionSyntax' || typeof rule.value.value !== 'string') continue;\n const replacement = checkPortableMatchPattern(rule.value.value).replacement;\n const match = new RegExp(`\\\\bmatches\\\\s+\"${stringBodyPattern}\"`).exec(line.raw);\n if (replacement === undefined || match === null) continue;\n const spellings = { Equal: '==', NotEqual: '!=', Contains: 'contains', NotContains: 'not contains', StartsWith: 'starts with', EndsWith: 'ends with' };\n const quoted = '\"' + replacement.value.replace(/[\"\\\\\\n\\r\\t]/g, character => JSON.stringify(character).slice(1, -1)) + '\"';\n byLine.set(line.number, { line: line.number,\n fix: { diagnosticCode: diagnostic.code, title: 'Use the equivalent ordinal text rule', scope: 'occurrence', edits: [{ start: line.startOffset + match.index, length: match[0].length, text: spellings[replacement.kind] + ' ' + quoted }] },\n change: { node: rule, replacement: { ...rule, rule: replacement.kind, value: { ...rule.value, value: replacement.value } } as ValidationRuleSyntax } });\n } else if (diagnostic.code === DiagnosticCodes.LegacyComplianceMarker) {\n const edit = complianceMarkerEdit(line.raw, line.startOffset);\n if (edit !== undefined) byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: 'Use bare pii and secret compliance markers', scope: 'occurrence', edits: [edit] } });\n } else if (diagnostic.code === DiagnosticCodes.PublicTranslationRequiresDirection) {\n // PLAY0614 is only reported on the declaration line of a Translate slice that has no direction.\n const slice = slicesByLine.get(line.number)!;\n // Offer a direction only when exactly one is consistent with the slice: the other would add errors.\n const indent = /^\\s*/.exec(line.raw)![0];\n const ending = source.includes('\\r\\n') ? '\\r\\n' : '\\n';\n const candidates = [TranslationDirection.Inbound, TranslationDirection.Outbound].map(direction => ({ direction, text: `${ending}${indent} direction ${direction === TranslationDirection.Inbound ? 'inbound' : 'outbound'}` }))\n .filter(candidate => {\n // The insertion point is the end of an existing line, so the edit is always in bounds.\n const edited = applyQuickFixEdits(source, [{ start: line.startOffset + line.raw.length, length: 0, text: candidate.text }])!;\n const parsed = parseForAuthoring(edited, undefined, options.placement);\n const originalCodes = errorCodes(original);\n // Valid when the missing-direction error is gone and the direction introduces no kind of error the document lacked.\n return acceptable(parsed) && ![...errorCodes(parsed)].some(code => code === DiagnosticCodes.PublicTranslationRequiresDirection || !originalCodes.has(code));\n });\n if (candidates.length === 1) {\n const [{ direction, text }] = candidates;\n byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: `Declare 'direction ${direction === TranslationDirection.Inbound ? 'inbound' : 'outbound'}'`, scope: 'occurrence', edits: [{ start: line.startOffset + line.raw.length, length: 0, text }] },\n change: { node: slice, replacement: { ...slice, direction } as SliceSyntax } });\n }\n } else if (diagnostic.code === DiagnosticCodes.LegacyProfileLayout) {\n const fix = legacyProfileLayoutFix(lines, line.number - 1, diagnostic.code);\n if (fix !== undefined) byLine.set(line.number, { line: line.number, fix });\n } else if (diagnostic.code === DiagnosticCodes.RedundantCompositeKeyBraces || diagnostic.code === DiagnosticCodes.ImplicitAuthorizationConjunction) {\n const fix = diagnostic.code === DiagnosticCodes.RedundantCompositeKeyBraces ? redundantKeyBracesFix(source, lines, line.number - 1, diagnostic.code) : implicitAuthorizationFix(source, lines, line.number - 1, diagnostic.code);\n if (fix !== undefined) byLine.set(line.number, { line: line.number, fix });\n } else if (diagnostic.code === DiagnosticCodes.RedundantEventId && commentStart(line.raw) < 0) {\n const declaration = events.get(line.number);\n if (declaration?.id !== declaration?.name || declaration === undefined) continue;\n byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: 'Remove the redundant event id', scope: 'occurrence', edits: [{ start: line.startOffset, length: (lines[line.number]?.startOffset ?? source.length) - line.startOffset, text: '' }] },\n change: { node: declaration, replacement: { ...declaration, id: null } as EventSyntax } });\n }\n }\n const spellingCodes = [DiagnosticCodes.LegacyOptionalSuffix, DiagnosticCodes.LegacyComplianceMarker];\n const syntax = verificationShape(original);\n const verified = new Map<number, QuickFix | undefined>();\n let rangeVerdicts: Map<number, QuickFix> | undefined;\n const documentChecked = new Set<string>();\n const documentFixes = new Map<string, QuickFix>();\n const verify = (fix: QuickFix, change?: QuickFixCandidate['change']): QuickFix | undefined => {\n const candidate = applyQuickFixEdits(source, fix.edits);\n if (candidate === undefined) return undefined;\n const parsed = parseForAuthoring(candidate, undefined, options.placement);\n if (!acceptable(parsed) || verificationShape(parsed) !== (change === undefined ? syntax : verificationShape(original, [change]))) return undefined;\n return parsed.diagnostics.filter(diagnostic => diagnostic.code === fix.diagnosticCode).length === (counts.get(fix.diagnosticCode) ?? 0) - fix.edits.length ? fix : undefined;\n };\n return (line, diagnosticCode) => {\n const requests = typeof line === 'number' || line === undefined ? undefined : line;\n const duplicateLines = requests === undefined\n ? typeof line === 'number' && (diagnosticCode === undefined || diagnosticCode === DiagnosticCodes.DuplicateComplianceMarker) ? [line] : []\n : requests.filter(request => request.diagnosticCode === DiagnosticCodes.DuplicateComplianceMarker).map(request => request.line);\n const duplicates = [...new Set(duplicateLines)].flatMap(number => {\n const fix = duplicateByLine.get(number);\n if (fix === undefined) return [];\n if (!duplicateVerdicts.has(number)) duplicateVerdicts.set(number, verify(fix));\n const verified = duplicateVerdicts.get(number);\n return verified === undefined ? [] : [verified];\n });\n const selectedCodes = spellingCodes.filter(code => requests === undefined ? diagnosticCode === undefined || diagnosticCode === code : requests.some(request => request.diagnosticCode === code));\n for (const code of selectedCodes.filter(code => !documentChecked.has(code))) {\n const candidates = [...byLine.values()].filter(candidate => candidate.fix.diagnosticCode === code);\n if (candidates.length > 0) {\n const fix = verify({ diagnosticCode: code, title: code === DiagnosticCodes.LegacyOptionalSuffix ? \"Use 'optional' throughout this document\" : 'Use bare pii and secret throughout this document', scope: 'document', edits: candidates.flatMap(candidate => candidate.fix.edits) });\n if (fix !== undefined) documentFixes.set(code, fix);\n }\n documentChecked.add(code);\n }\n const documents = selectedCodes.flatMap(code => documentFixes.has(code) ? [documentFixes.get(code)!] : []);\n if (requests !== undefined) {\n if (rangeVerdicts === undefined) {\n rangeVerdicts = new Map();\n // Source order gives ordered, non-overlapping edits without sorting. Recipes replace\n // distinct nodes/lines; the batch must preserve every other modeled member and remove\n // exactly the expected diagnostics before any of its occurrence edits can be offered.\n const candidates = lines.flatMap(line => byLine.has(line.number) ? [byLine.get(line.number)!] : []);\n const edits = candidates.flatMap(candidate => candidate.fix.edits);\n const candidateSource = applyQuickFixEdits(source, edits);\n if (edits.length > 0 && candidateSource !== undefined) {\n const parsed = parseForAuthoring(candidateSource, undefined, options.placement);\n const changes = candidates.flatMap(candidate => candidate.change === undefined ? [] : [candidate.change]);\n if (acceptable(parsed) && verificationShape(parsed) === verificationShape(original, changes)) {\n const remaining = new Map<string, number>();\n const removed = new Map<string, number>();\n for (const diagnostic of parsed.diagnostics) remaining.set(diagnostic.code, (remaining.get(diagnostic.code) ?? 0) + 1);\n for (const candidate of candidates) removed.set(candidate.fix.diagnosticCode, (removed.get(candidate.fix.diagnosticCode) ?? 0) + candidate.fix.edits.length);\n if ([...removed].every(([code, count]) => (remaining.get(code) ?? 0) === (counts.get(code) ?? 0) - count)) {\n for (const candidate of candidates) rangeVerdicts.set(candidate.line, candidate.fix);\n }\n }\n }\n }\n const selected = new Map<number, QuickFix>();\n for (const request of requests) {\n const fix = rangeVerdicts.get(request.line);\n if (fix?.diagnosticCode === request.diagnosticCode) selected.set(request.line, fix);\n }\n return [...selected.values(), ...duplicates, ...documents];\n }\n const occurrenceLine = typeof line === 'number' ? line : undefined;\n const selected = occurrenceLine === undefined ? undefined : byLine.get(occurrenceLine);\n let occurrenceFix: QuickFix | undefined;\n if (selected !== undefined && occurrenceLine !== undefined && (diagnosticCode === undefined || selected.fix.diagnosticCode === diagnosticCode)) {\n if (!verified.has(occurrenceLine)) {\n if (verified.size === 32) verified.delete(verified.keys().next().value!);\n verified.set(occurrenceLine, verify(selected.fix, selected.change));\n }\n occurrenceFix = verified.get(occurrenceLine);\n }\n return [...(occurrenceFix === undefined ? [] : [occurrenceFix]), ...duplicates, ...documents];\n };\n}\n\n// PLAY0791 is reported on the `ui profile` line. The canonical form is `root template <Name>`; beside a root template the legacy line is ignored, so it is removed.\nfunction legacyProfileLayoutFix(lines: readonly { readonly number: number; readonly raw: string; readonly startOffset: number }[], headerIndex: number, diagnosticCode: string): QuickFix | undefined {\n const indentOf = (raw: string): number => /^\\s*/.exec(raw)![0].length;\n const headerIndent = indentOf(lines[headerIndex].raw);\n let layout: { readonly index: number; readonly indent: number } | undefined;\n let hasRoot = false;\n for (let index = headerIndex + 1; index < lines.length; index++) {\n const raw = lines[index].raw;\n if (raw.trim().length === 0) continue;\n if (indentOf(raw) <= headerIndent) break;\n if (layout === undefined && /^\\s*layout\\s+[A-Za-z_]\\w*\\s*$/.test(raw)) layout = { index, indent: indentOf(raw) };\n if (/^\\s*root\\s+template(\\s|$)/.test(raw)) hasRoot = true;\n }\n if (layout === undefined) return undefined;\n const line = lines[layout.index];\n return hasRoot\n ? { diagnosticCode, title: 'Remove the ignored layout line', scope: 'occurrence', edits: [{ start: line.startOffset, length: (lines[layout.index + 1]?.startOffset ?? line.startOffset + line.raw.length) - line.startOffset, text: '' }] }\n : { diagnosticCode, title: \"Use 'root template' instead of 'layout'\", scope: 'occurrence', edits: [{ start: line.startOffset + layout.indent, length: 'layout'.length, text: 'root template' }] };\n}\n\ntype QuickFixLine = { readonly number: number; readonly raw: string; readonly indent: number; readonly content: string; readonly startOffset: number };\n\n// One edit from the opening brace to the end of the closing line, so the fix removes exactly one diagnostic. A closing brace that carries a comment is left alone.\nfunction redundantKeyBracesFix(source: string, lines: readonly QuickFixLine[], keyIndex: number, diagnosticCode: string): QuickFix | undefined {\n const key = lines[keyIndex];\n if (!key.content.endsWith('{')) return undefined;\n const brace = key.indent + key.content.length - 1;\n const prefix = key.raw.slice(0, brace).trimEnd().length;\n for (let index = keyIndex + 1; index < lines.length; index++) {\n const candidate = lines[index];\n if (candidate.content.length === 0 || candidate.indent > key.indent) continue;\n if (candidate.indent !== key.indent || candidate.content !== '}' || candidate.raw.trim() !== '}') return undefined;\n const next = lines[index + 1];\n const keep = source.slice(key.startOffset + key.raw.length, candidate.startOffset);\n const text = key.raw.slice(brace + 1) + (next === undefined ? keep.replace(/\\r?\\n$/, '') : keep);\n const start = key.startOffset + prefix;\n return { diagnosticCode, title: 'Remove the redundant composite key braces', scope: 'occurrence', edits: [{ start, length: (next?.startOffset ?? source.length) - start, text }] };\n }\n return undefined;\n}\n\n// One edit from the first to the last operand that needs an 'and', so the fix removes exactly one diagnostic.\nfunction implicitAuthorizationFix(source: string, lines: readonly QuickFixLine[], authorizeIndex: number, diagnosticCode: string): QuickFix | undefined {\n const first = lines[authorizeIndex];\n if (!first.content.startsWith('authorize')) return undefined;\n const found: { index: number; length: number }[] = [];\n let previous: string | undefined;\n const visit = (line: QuickFixLine, from: number): void => {\n const result = implicitConjunctionTokens(line.content.slice(from), previous);\n previous = result.previous;\n for (const token of result.tokens) found.push({ index: line.startOffset + line.indent + from + token.index, length: token.length });\n };\n visit(first, 'authorize'.length);\n for (let index = authorizeIndex + 1; index < lines.length; index++) {\n const line = lines[index];\n if (line.content.length === 0) continue;\n if (line.indent <= first.indent || !isAuthorizeContinuation(line.content)) break;\n visit(line, 0);\n }\n if (found.length === 0) return undefined;\n const last = found[found.length - 1];\n const text = found.map((token, index) => 'and ' + source.slice(token.index, index < found.length - 1 ? found[index + 1].index : token.index + token.length)).join('');\n return { diagnosticCode, title: \"Write 'and' between the adjacent authorize policies\", scope: 'occurrence', edits: [{ start: found[0].index, length: last.index + last.length - found[0].index, text }] };\n}\n\nfunction duplicateComplianceMarkerEdit(raw: string, startOffset: number): QuickFixEdit | undefined {\n const header = pattern('^(\\\\s*concept\\\\s+\\\\w+\\\\s*:\\\\s*\\\\w+)((?:[^\\\\S\\\\r\\\\n]+@?\\\\w+)*)').exec(raw);\n if (header === null) return undefined;\n const suffix = header[2];\n const seen = new Set<string>();\n const text = suffix.replace(new RegExp(pattern('[^\\\\S\\\\r\\\\n]+(@?\\\\w+)').source, 'gu'), (token, marker: string) => {\n const wire = complianceWireName(marker);\n if (seen.has(wire)) return '';\n seen.add(wire);\n return token;\n });\n return text === suffix ? undefined : { start: startOffset + header[1].length, length: suffix.length, text };\n}\n\nfunction complianceMarkerEdit(raw: string, startOffset: number): QuickFixEdit | undefined {\n // Restrict rewriting to the suffix or leading directive marker, never comments or quoted reasons.\n const header = pattern('^(\\\\s*concept\\\\s+\\\\w+\\\\s*:\\\\s*\\\\w+)((?:[^\\\\S\\\\r\\\\n]+@?\\\\w+)*)').exec(raw);\n if (header !== null) {\n const suffix = header[2];\n const text = suffix.replace(/@pii\\b|@?sensitive\\b/g, marker => marker === '@pii' ? 'pii' : 'secret');\n return text === suffix ? undefined : { start: startOffset + header[1].length, length: suffix.length, text };\n }\n const directive = pattern('^(\\\\s*)(@pii|@?sensitive)\\\\b').exec(raw);\n return directive === null ? undefined : { start: startOffset + directive[1].length, length: directive[2].length, text: directive[2] === '@pii' ? 'pii' : 'secret' };\n}\n\nfunction verificationShape(parsed: ReturnType<typeof parseForAuthoring>, changes: readonly NonNullable<QuickFixCandidate['change']>[] = []): string {\n // Compare every modeled member (including trigger data), ignoring only source locations. A recipe\n // may replace only its original node; no other id or destination is normalized away.\n const replacements = new Map(changes.map(change => [change.node, change.replacement]));\n return JSON.stringify([parsed.value, parsed.triggerData], (key, value: unknown) => ['location', 'usesLocation', 'targetLocation'].includes(key) ? undefined : replacements.get(value as NonNullable<QuickFixCandidate['change']>['node']) ?? value);\n}\n\n// One forward pass; applying N edits by repeatedly slicing the document would be quadratic.\nexport function applyQuickFixEdits(source: string, edits: readonly QuickFixEdit[]): string | undefined {\n const parts: string[] = [];\n let end = 0;\n for (const edit of edits) {\n if (edit.start < end || edit.start < 0 || edit.length < 0 || edit.start + edit.length > source.length) return undefined;\n parts.push(source.slice(end, edit.start), edit.text);\n end = edit.start + edit.length;\n }\n parts.push(source.slice(end));\n return parts.join('');\n}\n"],"mappings":"s1BA+CA,MAAMA,kBAAgD,IAAI,IAAI,CAC1DC,EAAgB,sBAChBA,EAAgB,qBAChBA,EAAgB,oBAChBA,EAAgB,gCAChBA,EAAgB,0BACh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ClE,OAAO+B,IAAc,KAAO,IAAA,GAAY,CAAE,MAAOD,EAAcC,EAAU,EAAE,CAAC,OAAQ,OAAQA,EAAU,EAAE,CAAC,OAAQ,KAAMA,EAAU,KAAO,OAAS,MAAQ,QAAS,CACtK,CAEA,SAAS,kBAAkB,EAA8C,EAA+D,CAAC,EAAW,CAGhJ,IAAMC,EAAe,IAAI,IAAItC,EAAQ,IAAI,GAAU,CAACR,EAAO,KAAMA,EAAO,WAAW,CAAC,CAAC,EACrF,OAAO,KAAK,UAAU,CAACxC,EAAO,MAAOA,EAAO,WAAW,GAAI,EAAK,IAAmB,CAAC,WAAY,eAAgB,gBAAgB,CAAC,CAAC,SAAS2D,CAAG,EAAI,IAAA,GAAY2B,EAAa,IAAIC,CAAyD,GAAKA,CAAK,CACtP,CAGA,SAAgB,mBAAmB,EAAgB,EAAoD,CACnG,IAAMC,EAAkB,CAAC,EACrBC,EAAM,EACV,IAAK,IAAM1E,KAAQ+B,EAAO,CACtB,GAAI/B,EAAK,MAAQ0E,GAAO1E,EAAK,MAAQ,GAAKA,EAAK,OAAS,GAAKA,EAAK,MAAQA,EAAK,OAASjC,EAAO,OAAQ,OACvG0G,EAAM,KAAK1G,EAAO,MAAM2G,EAAK1E,EAAK,KAAK,EAAGA,EAAK,IAAI,EACnD,EAAMA,EAAK,MAAQA,EAAK,MAC5B,CAEA,OADAyE,EAAM,KAAK1G,EAAO,MAAM2G,CAAG,CAAC,EACrBD,EAAM,KAAK,EAAE,CACxB"}
|
|
1
|
+
{"version":3,"file":"QuickFixes.js","names":["quickFixDiagnosticCodes","DiagnosticCodes","code","diagnostic","line","local","source","options","timeline","subjects","prepareActionSubjectQuickFixes","requests","localFixes","diagnosticCode","selected","request","fixes","prepareTimelineQuickFixes","subjectRequests","actions","original","parseForAuthoring","publicEventCodes","index","parsed","lines","splitLines","eventsByLine","slicesByLine","rulesByLine","ScreenplaySyntaxWalker","rule","event","slice","counts","byLine","duplicateByLine","duplicateVerdicts","events","edit","length","replacement","checkPortableMatchPattern","match","stringBodyPattern","spellings","quoted","character","indent","ending","candidates","direction","edited","candidate","originalCodes","fix","unit","rewrite","rewriteInlineJson","commentStart","declaration","spellingCodes","syntax","verified","rangeVerdicts","documentChecked","documentFixes","change","duplicateLines","duplicates","number","selectedCodes","documents","edits","candidateSource","changes","remaining","removed","count","occurrenceLine","occurrenceFix","raw","headerIndent","headerIndex","layout","hasRoot","parent","key","keyIndex","brace","prefix","next","keep","text","start","first","authorizeIndex","found","previous","result","implicitConjunctionTokens","from","token","isAuthorizeContinuation","last","header","pattern","suffix","seen","wire","complianceWireName","marker","startOffset","directive","replacements","value","parts","end"],"sources":["../../../../../../Compiler/Authoring/QuickFixes.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 { Diagnostic } from '../Diagnostics/Diagnostic';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { PlayPlacement } from '../Files/PlayPlacement';\nimport { checkPortableMatchPattern } from '../Parsing/checkPortableMatchPattern';\nimport { ValidationRuleSyntax } from '../Syntax/Commands';\nimport { stringBodyPattern } from '../Text/StringLiteral';\nimport { complianceWireName } from '../Parsing/ConceptComplianceParser';\nimport { commentStart, splitLines } from '../Parsing/SourceLineSplitter';\nimport { implicitConjunctionTokens, isAuthorizeContinuation } from '../Parsing/AuthorizeParser';\nimport { parseForAuthoring } from '../ScreenplayCompiler';\nimport { EventSyntax } from '../Syntax/Declarations';\nimport { SliceSyntax } from '../Syntax/Structure';\nimport { TranslationDirection } from '../Syntax/TranslationDirection';\nimport { ScreenplaySyntaxWalker } from '../Syntax/ScreenplaySyntaxWalker';\nimport { pattern } from '../Text/patterns';\nimport { QuickFixCandidate } from './QuickFixCandidate';\nimport { prepareTimelineQuickFixes } from './TimelineQuickFixes';\nimport { prepareActionSubjectQuickFixes } from './ActionSubjectQuickFixes';\nimport { rewriteInlineJson } from './StructuredValueQuickFix';\n\nexport interface QuickFixEdit {\n /** Destination document for an application-snapshot repair; absent for a buffer-local edit. */\n readonly path?: string;\n readonly start: number;\n readonly length: number;\n readonly text: string;\n}\n\nexport interface QuickFix {\n /** Original diagnostic line, which may differ from the edited import's line. */\n readonly line?: number;\n readonly diagnosticCode: string;\n readonly title: string;\n readonly scope: 'occurrence' | 'document';\n readonly edits: readonly QuickFixEdit[];\n}\n\nexport interface QuickFixOptions {\n readonly path?: string;\n readonly documents?: ReadonlyMap<string, string>;\n readonly line?: number;\n readonly placement?: PlayPlacement;\n readonly diagnosticCode?: string;\n}\n\nconst quickFixDiagnosticCodes: ReadonlySet<unknown> = new Set([\n DiagnosticCodes.InferredActionSubject,\n DiagnosticCodes.ChangedActionSubject,\n DiagnosticCodes.EventFromLaterSlice,\n DiagnosticCodes.DeprecatedStudioTextRulePattern,\n DiagnosticCodes.DuplicateComplianceMarker,\n DiagnosticCodes.LegacyOptionalSuffix,\n DiagnosticCodes.LegacyComplianceMarker,\n DiagnosticCodes.RedundantEventId,\n DiagnosticCodes.PublicTranslationRequiresDirection,\n DiagnosticCodes.LegacyProfileLayout,\n DiagnosticCodes.RedundantCompositeKeyBraces,\n DiagnosticCodes.ImplicitAuthorizationConjunction,\n DiagnosticCodes.InlineJsonValue,\n]);\n\nexport function isQuickFixDiagnostic(code: unknown): code is string {\n return quickFixDiagnosticCodes.has(code);\n}\n\n// Diagnostics point at the complete type, not at the suffix. Never derive edits from message text.\nexport function legacyOptionalTypeLength(line: string, diagnostic: Diagnostic): number {\n if (diagnostic.code !== DiagnosticCodes.LegacyOptionalSuffix) return 0;\n return /^[\\p{L}\\p{Mn}\\p{Nd}\\p{Pc}.]+(?:\\[\\])?\\?/u.exec(line.slice(diagnostic.location.column - 1))?.[0].length ?? 0;\n}\n\nexport function findQuickFixes(source: string, options: QuickFixOptions = {}): QuickFix[] {\n return prepareQuickFixes(source, options)(options.line, options.diagnosticCode);\n}\n\n// One immutable buffer version owns the analysis and document verdict. Cursor moves reuse them;\n// single-occurrence verdicts have a bounded cache. Range requests verify the independent recipes\n// together once per version, rather than reparsing N times for N intersecting markers.\nexport function prepareQuickFixes(source: string, options: Pick<QuickFixOptions, 'placement' | 'path' | 'documents'> = {}): (line?: number | readonly { line: number; diagnosticCode: string }[], diagnosticCode?: string) => QuickFix[] {\n const local = prepareLocalQuickFixes(source, options);\n let timeline: ReturnType<typeof prepareTimelineQuickFixes> | undefined;\n let subjects: ReturnType<typeof prepareActionSubjectQuickFixes> | undefined;\n const subjectFixes = (line?: number, code?: string) => (subjects ??= prepareActionSubjectQuickFixes(source, options))(line, code);\n return (line, diagnosticCode) => {\n const requests = typeof line === 'number' ? [{ line, diagnosticCode }] : line ?? [];\n const localFixes = local(line, diagnosticCode);\n const selected = requests.filter(request => request.diagnosticCode === DiagnosticCodes.EventFromLaterSlice || (request.diagnosticCode === undefined && localFixes.length === 0));\n const fixes = selected.length === 0 ? [] : [...new Set(selected.map(request => request.line))].flatMap(line => (timeline ??= prepareTimelineQuickFixes(source, options))(line));\n const subjectRequests = requests.filter(request => request.diagnosticCode === undefined || request.diagnosticCode === DiagnosticCodes.InferredActionSubject || request.diagnosticCode === DiagnosticCodes.ChangedActionSubject);\n const actions = requests.length === 0 ? subjectFixes(undefined, diagnosticCode) : subjectRequests.flatMap(request => subjectFixes(request.line, request.diagnosticCode));\n return [...localFixes, ...fixes, ...actions];\n };\n}\n\nfunction prepareLocalQuickFixes(source: string, options: Pick<QuickFixOptions, 'placement'>): (line?: number | readonly { line: number; diagnosticCode: string }[], diagnosticCode?: string) => QuickFix[] {\n const original = parseForAuthoring(source, undefined, options.placement);\n // PLAY0614 and the public-event boundary errors that follow from a missing direction are errors the repair itself removes,\n // so a document whose only errors are public-event boundary errors stays repairable.\n // Inline JSON (PLAY0833) is likewise an error its own repair removes.\n const publicEventCodes: ReadonlySet<string> = new Set([...Array.from({ length: 14 }, (_, index) => `PLAY0${607 + index}`), DiagnosticCodes.InlineJsonValue]);\n const acceptable = (parsed: ReturnType<typeof parseForAuthoring>): boolean => parsed.success || parsed.diagnostics.every(diagnostic => diagnostic.severity !== 'error' || publicEventCodes.has(diagnostic.code));\n const errorCodes = (parsed: ReturnType<typeof parseForAuthoring>): Set<string> => new Set(parsed.diagnostics.filter(diagnostic => diagnostic.severity === 'error').map(diagnostic => diagnostic.code));\n if (!acceptable(original)) return () => [];\n const lines = splitLines(source);\n const eventsByLine = new Map<number, EventSyntax>();\n const slicesByLine = new Map<number, SliceSyntax>();\n const rulesByLine = new Map<number, ValidationRuleSyntax>();\n // Index inline and standalone declarations once, without scanning the tree per diagnostic.\n const walker = new class extends ScreenplaySyntaxWalker {\n override visitValidationRule(rule: ValidationRuleSyntax): void { rulesByLine.set(rule.location.line, rule); super.visitValidationRule(rule); }\n override visitEvent(event: EventSyntax): void { eventsByLine.set(event.location.line, event); }\n override visitSlice(slice: SliceSyntax): void { slicesByLine.set(slice.location.line, slice); super.visitSlice(slice); }\n }();\n walker.visitApplication(original.value);\n const counts = new Map<string, number>();\n const byLine = new Map<number, QuickFixCandidate>();\n // Duplicate removal and legacy spelling can share a header. Keep their independently verified recipes separate.\n const duplicateByLine = new Map<number, QuickFix>();\n const duplicateVerdicts = new Map<number, QuickFix | undefined>();\n const events = new Map<number, EventSyntax>();\n let event: EventSyntax | undefined;\n for (const line of lines) {\n event = eventsByLine.get(line.number) ?? event;\n if (event !== undefined) events.set(line.number, event);\n }\n for (const diagnostic of original.diagnostics) {\n counts.set(diagnostic.code, (counts.get(diagnostic.code) ?? 0) + 1);\n const line = lines[diagnostic.location.line - 1];\n if (diagnostic.code === DiagnosticCodes.DuplicateComplianceMarker) {\n const edit = duplicateComplianceMarkerEdit(line.raw, line.startOffset);\n if (edit !== undefined) duplicateByLine.set(line.number, { diagnosticCode: diagnostic.code, title: 'Remove duplicate compliance markers', scope: 'occurrence', edits: [edit] });\n }\n const length = legacyOptionalTypeLength(line.raw, diagnostic);\n if (length > 0) {\n byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: \"Use 'optional' instead of '?'\", scope: 'occurrence', edits: [{ start: line.startOffset + diagnostic.location.column + length - 2, length: 1, text: ' optional' }] } });\n } else if (diagnostic.code === DiagnosticCodes.DeprecatedStudioTextRulePattern) {\n const rule = rulesByLine.get(line.number);\n if (rule?.rule !== 'Matches' || rule.value?.kind !== 'LiteralExpressionSyntax' || typeof rule.value.value !== 'string') continue;\n const replacement = checkPortableMatchPattern(rule.value.value).replacement;\n const match = new RegExp(`\\\\bmatches\\\\s+\"${stringBodyPattern}\"`).exec(line.raw);\n if (replacement === undefined || match === null) continue;\n const spellings = { Equal: '==', NotEqual: '!=', Contains: 'contains', NotContains: 'not contains', StartsWith: 'starts with', EndsWith: 'ends with' };\n const quoted = '\"' + replacement.value.replace(/[\"\\\\\\n\\r\\t]/g, character => JSON.stringify(character).slice(1, -1)) + '\"';\n byLine.set(line.number, { line: line.number,\n fix: { diagnosticCode: diagnostic.code, title: 'Use the equivalent ordinal text rule', scope: 'occurrence', edits: [{ start: line.startOffset + match.index, length: match[0].length, text: spellings[replacement.kind] + ' ' + quoted }] },\n change: { node: rule, replacement: { ...rule, rule: replacement.kind, value: { ...rule.value, value: replacement.value } } as ValidationRuleSyntax } });\n } else if (diagnostic.code === DiagnosticCodes.LegacyComplianceMarker) {\n const edit = complianceMarkerEdit(line.raw, line.startOffset);\n if (edit !== undefined) byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: 'Use bare pii and secret compliance markers', scope: 'occurrence', edits: [edit] } });\n } else if (diagnostic.code === DiagnosticCodes.PublicTranslationRequiresDirection) {\n // PLAY0614 is only reported on the declaration line of a Translate slice that has no direction.\n const slice = slicesByLine.get(line.number)!;\n // Offer a direction only when exactly one is consistent with the slice: the other would add errors.\n const indent = /^\\s*/.exec(line.raw)![0];\n const ending = source.includes('\\r\\n') ? '\\r\\n' : '\\n';\n const candidates = [TranslationDirection.Inbound, TranslationDirection.Outbound].map(direction => ({ direction, text: `${ending}${indent} direction ${direction === TranslationDirection.Inbound ? 'inbound' : 'outbound'}` }))\n .filter(candidate => {\n // The insertion point is the end of an existing line, so the edit is always in bounds.\n const edited = applyQuickFixEdits(source, [{ start: line.startOffset + line.raw.length, length: 0, text: candidate.text }])!;\n const parsed = parseForAuthoring(edited, undefined, options.placement);\n const originalCodes = errorCodes(original);\n // Valid when the missing-direction error is gone and the direction introduces no kind of error the document lacked.\n return acceptable(parsed) && ![...errorCodes(parsed)].some(code => code === DiagnosticCodes.PublicTranslationRequiresDirection || !originalCodes.has(code));\n });\n if (candidates.length === 1) {\n const [{ direction, text }] = candidates;\n byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: `Declare 'direction ${direction === TranslationDirection.Inbound ? 'inbound' : 'outbound'}'`, scope: 'occurrence', edits: [{ start: line.startOffset + line.raw.length, length: 0, text }] },\n change: { node: slice, replacement: { ...slice, direction } as SliceSyntax } });\n }\n } else if (diagnostic.code === DiagnosticCodes.LegacyProfileLayout) {\n const fix = legacyProfileLayoutFix(lines, line.number - 1, diagnostic.code);\n if (fix !== undefined) byLine.set(line.number, { line: line.number, fix });\n } else if (diagnostic.code === DiagnosticCodes.RedundantCompositeKeyBraces || diagnostic.code === DiagnosticCodes.ImplicitAuthorizationConjunction) {\n const fix = diagnostic.code === DiagnosticCodes.RedundantCompositeKeyBraces ? redundantKeyBracesFix(source, lines, line.number - 1, diagnostic.code) : implicitAuthorizationFix(source, lines, line.number - 1, diagnostic.code);\n if (fix !== undefined) byLine.set(line.number, { line: line.number, fix });\n } else if (diagnostic.code === DiagnosticCodes.InlineJsonValue) {\n const unit = indentationUnit(lines, line.number - 1);\n const rewrite = rewriteInlineJson(line.raw, unit);\n if (rewrite !== undefined) {\n const ending = source.includes('\\r\\n') ? '\\r\\n' : '\\n';\n byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: 'Write the value as an indented block', scope: 'occurrence', edits: [{ start: line.startOffset + rewrite.start, length: line.raw.length - rewrite.start, text: rewrite.text.replaceAll('\\n', ending) }] } });\n }\n } else if (diagnostic.code === DiagnosticCodes.RedundantEventId && commentStart(line.raw) < 0) {\n const declaration = events.get(line.number);\n if (declaration?.id !== declaration?.name || declaration === undefined) continue;\n byLine.set(line.number, { line: line.number, fix: { diagnosticCode: diagnostic.code, title: 'Remove the redundant event id', scope: 'occurrence', edits: [{ start: line.startOffset, length: (lines[line.number]?.startOffset ?? source.length) - line.startOffset, text: '' }] },\n change: { node: declaration, replacement: { ...declaration, id: null } as EventSyntax } });\n }\n }\n const spellingCodes = [DiagnosticCodes.LegacyOptionalSuffix, DiagnosticCodes.LegacyComplianceMarker];\n const syntax = verificationShape(original);\n const verified = new Map<number, QuickFix | undefined>();\n let rangeVerdicts: Map<number, QuickFix> | undefined;\n const documentChecked = new Set<string>();\n const documentFixes = new Map<string, QuickFix>();\n const verify = (fix: QuickFix, change?: QuickFixCandidate['change']): QuickFix | undefined => {\n const candidate = applyQuickFixEdits(source, fix.edits);\n if (candidate === undefined) return undefined;\n const parsed = parseForAuthoring(candidate, undefined, options.placement);\n if (!acceptable(parsed) || verificationShape(parsed) !== (change === undefined ? syntax : verificationShape(original, [change]))) return undefined;\n return parsed.diagnostics.filter(diagnostic => diagnostic.code === fix.diagnosticCode).length === (counts.get(fix.diagnosticCode) ?? 0) - fix.edits.length ? fix : undefined;\n };\n return (line, diagnosticCode) => {\n const requests = typeof line === 'number' || line === undefined ? undefined : line;\n const duplicateLines = requests === undefined\n ? typeof line === 'number' && (diagnosticCode === undefined || diagnosticCode === DiagnosticCodes.DuplicateComplianceMarker) ? [line] : []\n : requests.filter(request => request.diagnosticCode === DiagnosticCodes.DuplicateComplianceMarker).map(request => request.line);\n const duplicates = [...new Set(duplicateLines)].flatMap(number => {\n const fix = duplicateByLine.get(number);\n if (fix === undefined) return [];\n if (!duplicateVerdicts.has(number)) duplicateVerdicts.set(number, verify(fix));\n const verified = duplicateVerdicts.get(number);\n return verified === undefined ? [] : [verified];\n });\n const selectedCodes = spellingCodes.filter(code => requests === undefined ? diagnosticCode === undefined || diagnosticCode === code : requests.some(request => request.diagnosticCode === code));\n for (const code of selectedCodes.filter(code => !documentChecked.has(code))) {\n const candidates = [...byLine.values()].filter(candidate => candidate.fix.diagnosticCode === code);\n if (candidates.length > 0) {\n const fix = verify({ diagnosticCode: code, title: code === DiagnosticCodes.LegacyOptionalSuffix ? \"Use 'optional' throughout this document\" : 'Use bare pii and secret throughout this document', scope: 'document', edits: candidates.flatMap(candidate => candidate.fix.edits) });\n if (fix !== undefined) documentFixes.set(code, fix);\n }\n documentChecked.add(code);\n }\n const documents = selectedCodes.flatMap(code => documentFixes.has(code) ? [documentFixes.get(code)!] : []);\n if (requests !== undefined) {\n if (rangeVerdicts === undefined) {\n rangeVerdicts = new Map();\n // Source order gives ordered, non-overlapping edits without sorting. Recipes replace\n // distinct nodes/lines; the batch must preserve every other modeled member and remove\n // exactly the expected diagnostics before any of its occurrence edits can be offered.\n const candidates = lines.flatMap(line => byLine.has(line.number) ? [byLine.get(line.number)!] : []);\n const edits = candidates.flatMap(candidate => candidate.fix.edits);\n const candidateSource = applyQuickFixEdits(source, edits);\n if (edits.length > 0 && candidateSource !== undefined) {\n const parsed = parseForAuthoring(candidateSource, undefined, options.placement);\n const changes = candidates.flatMap(candidate => candidate.change === undefined ? [] : [candidate.change]);\n if (acceptable(parsed) && verificationShape(parsed) === verificationShape(original, changes)) {\n const remaining = new Map<string, number>();\n const removed = new Map<string, number>();\n for (const diagnostic of parsed.diagnostics) remaining.set(diagnostic.code, (remaining.get(diagnostic.code) ?? 0) + 1);\n for (const candidate of candidates) removed.set(candidate.fix.diagnosticCode, (removed.get(candidate.fix.diagnosticCode) ?? 0) + candidate.fix.edits.length);\n if ([...removed].every(([code, count]) => (remaining.get(code) ?? 0) === (counts.get(code) ?? 0) - count)) {\n for (const candidate of candidates) rangeVerdicts.set(candidate.line, candidate.fix);\n }\n }\n }\n }\n const selected = new Map<number, QuickFix>();\n for (const request of requests) {\n const fix = rangeVerdicts.get(request.line);\n if (fix?.diagnosticCode === request.diagnosticCode) selected.set(request.line, fix);\n }\n return [...selected.values(), ...duplicates, ...documents];\n }\n const occurrenceLine = typeof line === 'number' ? line : undefined;\n const selected = occurrenceLine === undefined ? undefined : byLine.get(occurrenceLine);\n let occurrenceFix: QuickFix | undefined;\n if (selected !== undefined && occurrenceLine !== undefined && (diagnosticCode === undefined || selected.fix.diagnosticCode === diagnosticCode)) {\n if (!verified.has(occurrenceLine)) {\n if (verified.size === 32) verified.delete(verified.keys().next().value!);\n verified.set(occurrenceLine, verify(selected.fix, selected.change));\n }\n occurrenceFix = verified.get(occurrenceLine);\n }\n return [...(occurrenceFix === undefined ? [] : [occurrenceFix]), ...duplicates, ...documents];\n };\n}\n\n// PLAY0791 is reported on the `ui profile` line. The canonical form is `root template <Name>`; beside a root template the legacy line is ignored, so it is removed.\nfunction legacyProfileLayoutFix(lines: readonly { readonly number: number; readonly raw: string; readonly startOffset: number }[], headerIndex: number, diagnosticCode: string): QuickFix | undefined {\n const indentOf = (raw: string): number => /^\\s*/.exec(raw)![0].length;\n const headerIndent = indentOf(lines[headerIndex].raw);\n let layout: { readonly index: number; readonly indent: number } | undefined;\n let hasRoot = false;\n for (let index = headerIndex + 1; index < lines.length; index++) {\n const raw = lines[index].raw;\n if (raw.trim().length === 0) continue;\n if (indentOf(raw) <= headerIndent) break;\n if (layout === undefined && /^\\s*layout\\s+[A-Za-z_]\\w*\\s*$/.test(raw)) layout = { index, indent: indentOf(raw) };\n if (/^\\s*root\\s+template(\\s|$)/.test(raw)) hasRoot = true;\n }\n if (layout === undefined) return undefined;\n const line = lines[layout.index];\n return hasRoot\n ? { diagnosticCode, title: 'Remove the ignored layout line', scope: 'occurrence', edits: [{ start: line.startOffset, length: (lines[layout.index + 1]?.startOffset ?? line.startOffset + line.raw.length) - line.startOffset, text: '' }] }\n : { diagnosticCode, title: \"Use 'root template' instead of 'layout'\", scope: 'occurrence', edits: [{ start: line.startOffset + layout.indent, length: 'layout'.length, text: 'root template' }] };\n}\n\ntype QuickFixLine = { readonly number: number; readonly raw: string; readonly indent: number; readonly content: string; readonly startOffset: number };\n\n// The step one level of the document indents by, read from the nearest shallower line above; two spaces otherwise.\nfunction indentationUnit(lines: readonly QuickFixLine[], index: number): string {\n const indent = lines[index].indent;\n const parent = lines.slice(0, index).reverse().find(line => line.content.length > 0 && line.indent < indent);\n return ' '.repeat(parent === undefined ? 2 : indent - parent.indent);\n}\n\n// One edit from the opening brace to the end of the closing line, so the fix removes exactly one diagnostic. A closing brace that carries a comment is left alone.\nfunction redundantKeyBracesFix(source: string, lines: readonly QuickFixLine[], keyIndex: number, diagnosticCode: string): QuickFix | undefined {\n const key = lines[keyIndex];\n if (!key.content.endsWith('{')) return undefined;\n const brace = key.indent + key.content.length - 1;\n const prefix = key.raw.slice(0, brace).trimEnd().length;\n for (let index = keyIndex + 1; index < lines.length; index++) {\n const candidate = lines[index];\n if (candidate.content.length === 0 || candidate.indent > key.indent) continue;\n if (candidate.indent !== key.indent || candidate.content !== '}' || candidate.raw.trim() !== '}') return undefined;\n const next = lines[index + 1];\n const keep = source.slice(key.startOffset + key.raw.length, candidate.startOffset);\n const text = key.raw.slice(brace + 1) + (next === undefined ? keep.replace(/\\r?\\n$/, '') : keep);\n const start = key.startOffset + prefix;\n return { diagnosticCode, title: 'Remove the redundant composite key braces', scope: 'occurrence', edits: [{ start, length: (next?.startOffset ?? source.length) - start, text }] };\n }\n return undefined;\n}\n\n// One edit from the first to the last operand that needs an 'and', so the fix removes exactly one diagnostic.\nfunction implicitAuthorizationFix(source: string, lines: readonly QuickFixLine[], authorizeIndex: number, diagnosticCode: string): QuickFix | undefined {\n const first = lines[authorizeIndex];\n if (!first.content.startsWith('authorize')) return undefined;\n const found: { index: number; length: number }[] = [];\n let previous: string | undefined;\n const visit = (line: QuickFixLine, from: number): void => {\n const result = implicitConjunctionTokens(line.content.slice(from), previous);\n previous = result.previous;\n for (const token of result.tokens) found.push({ index: line.startOffset + line.indent + from + token.index, length: token.length });\n };\n visit(first, 'authorize'.length);\n for (let index = authorizeIndex + 1; index < lines.length; index++) {\n const line = lines[index];\n if (line.content.length === 0) continue;\n if (line.indent <= first.indent || !isAuthorizeContinuation(line.content)) break;\n visit(line, 0);\n }\n if (found.length === 0) return undefined;\n const last = found[found.length - 1];\n const text = found.map((token, index) => 'and ' + source.slice(token.index, index < found.length - 1 ? found[index + 1].index : token.index + token.length)).join('');\n return { diagnosticCode, title: \"Write 'and' between the adjacent authorize policies\", scope: 'occurrence', edits: [{ start: found[0].index, length: last.index + last.length - found[0].index, text }] };\n}\n\nfunction duplicateComplianceMarkerEdit(raw: string, startOffset: number): QuickFixEdit | undefined {\n const header = pattern('^(\\\\s*concept\\\\s+\\\\w+\\\\s*:\\\\s*\\\\w+)((?:[^\\\\S\\\\r\\\\n]+@?\\\\w+)*)').exec(raw);\n if (header === null) return undefined;\n const suffix = header[2];\n const seen = new Set<string>();\n const text = suffix.replace(new RegExp(pattern('[^\\\\S\\\\r\\\\n]+(@?\\\\w+)').source, 'gu'), (token, marker: string) => {\n const wire = complianceWireName(marker);\n if (seen.has(wire)) return '';\n seen.add(wire);\n return token;\n });\n return text === suffix ? undefined : { start: startOffset + header[1].length, length: suffix.length, text };\n}\n\nfunction complianceMarkerEdit(raw: string, startOffset: number): QuickFixEdit | undefined {\n // Restrict rewriting to the suffix or leading directive marker, never comments or quoted reasons.\n const header = pattern('^(\\\\s*concept\\\\s+\\\\w+\\\\s*:\\\\s*\\\\w+)((?:[^\\\\S\\\\r\\\\n]+@?\\\\w+)*)').exec(raw);\n if (header !== null) {\n const suffix = header[2];\n const text = suffix.replace(/@pii\\b|@?sensitive\\b/g, marker => marker === '@pii' ? 'pii' : 'secret');\n return text === suffix ? undefined : { start: startOffset + header[1].length, length: suffix.length, text };\n }\n const directive = pattern('^(\\\\s*)(@pii|@?sensitive)\\\\b').exec(raw);\n return directive === null ? undefined : { start: startOffset + directive[1].length, length: directive[2].length, text: directive[2] === '@pii' ? 'pii' : 'secret' };\n}\n\nfunction verificationShape(parsed: ReturnType<typeof parseForAuthoring>, changes: readonly NonNullable<QuickFixCandidate['change']>[] = []): string {\n // Compare every modeled member (including trigger data), ignoring only source locations. A recipe\n // may replace only its original node; no other id or destination is normalized away.\n const replacements = new Map(changes.map(change => [change.node, change.replacement]));\n return JSON.stringify([parsed.value, parsed.triggerData], (key, value: unknown) => ['location', 'usesLocation', 'targetLocation'].includes(key) ? undefined : replacements.get(value as NonNullable<QuickFixCandidate['change']>['node']) ?? value);\n}\n\n// One forward pass; applying N edits by repeatedly slicing the document would be quadratic.\nexport function applyQuickFixEdits(source: string, edits: readonly QuickFixEdit[]): string | undefined {\n const parts: string[] = [];\n let end = 0;\n for (const edit of edits) {\n if (edit.start < end || edit.start < 0 || edit.length < 0 || edit.start + edit.length > source.length) return undefined;\n parts.push(source.slice(end, edit.start), edit.text);\n end = edit.start + edit.length;\n }\n parts.push(source.slice(end));\n return parts.join('');\n}\n"],"mappings":"u5BAgDA,MAAMA,kBAAgD,IAAI,IAAI,CAC1DC,EAAgB,sBAChBA,EAAgB,qBAChBA,EAAgB,oBAChBA,EAAgB,gCAChBA,EAAgB,0BAChBA,EAAgB,qBAChBA,EAAgB,uBAChBA,EAAgB,iBAChBA,EAAgB,mCAChBA,EAAgB,oBAChBA,EAAgB,4BAChBA,EAAgB,iCAChBA,EAAgB,eACpB,CAAC,EAED,SAAgB,qBAAqB,EAA+B,CAChE,OAAOD,EAAwB,IAAIE,CAAI,CAC3C,CAGA,SAAgB,yBAAyB,EAAc,EAAgC,CAEnF,OADIC,EAAW,OAASF,EAAgB,qBACjC,2CAA2C,KAAKG,EAAK,MAAMD,EAAW,SAAS,OAAS,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,QAAU,EAD7C,CAEzE,CASA,SAAgB,kBAAkB,EAAgB,EAAqE,CAAC,EAAiH,CACrO,IAAME,EAAQ,uBAAuBC,EAAQC,CAAO,EAChDC,EACAC,EACE,cAAgB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AAK9G,EAAO,MAAM+G,CAAG,CAAC,EACrBD,EAAM,KAAK,EAAE,CACxB"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{commentStart as e}from"../Parsing/SourceLineSplitter.js";const t=[(e,t)=>/\bthen\s+returns\s*$/.test(e)&&t===``?`${e.trimEnd()} value`:void 0,(e,t)=>/\bthen\s+no\s+readmodel\s+\S+\s+for\s*$/.test(e)&&t===``?e.trimEnd():void 0,(e,t)=>/\bfrom\s+literal\s*$/.test(e)?`${e.trimEnd()}${t===``?``:` ${t}`}`:void 0,(e,t)=>/=\s*literal\s*$/.test(e)&&t===``?e.replace(/\s*=\s*literal\s*$/,``):void 0,(e,t)=>/=\s*$/.test(e)&&t===``?e.replace(/\s*=\s*$/,``):void 0],n=/^\s*(?:given|when|then|case)\s+\S+.*\s\S+\s*=\s*$/;function rewriteInlineJson(r,i){let a=e(r),o=a<0?r:r.slice(0,a),s=a<0?``:` ${r.slice(a).trimStart()}`;for(let e of openings(o)){let a=new Reader(o,e),c=a.value();if(c===void 0||c.kind===`scalar`)continue;let l=o.slice(0,e),u=o.slice(a.position).trim();if(n.test(l))return;let d=t.map(e=>e(l,u)).find(e=>e!==void 0);if(d===void 0)continue;let f=/^\s*/.exec(r)[0],p=[];return block(d.slice(f.length),c,f,i,p),p[0]+=s,{start:f.length,text:p.join(`
|
|
2
|
+
`).slice(f.length)}}}function*openings(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t&&r===`\\`?n++:r===`"`?t=!t:!t&&(r===`{`||r===`[`)&&(yield n)}}function block(e,t,n,r,i){if(t.kind===`list`&&t.items.length===0){i.push(`${n}${e} none`);return}if(t.kind===`object`&&t.members.length===0){i.push(`${n}${e} empty`);return}i.push(`${n}${e}`);let a=n+r;if(t.kind===`list`)for(let e of t.items)e.kind===`scalar`?i.push(`${a}item ${e.text}`):block(`item`,e,a,r,i);else if(t.kind===`object`)for(let e of t.members){let t=memberName(e.name);e.value.kind===`scalar`?i.push(`${a}${t} = ${e.value.text}`):block(t,e.value,a,r,i)}}const memberName=e=>e===`item`?`@item`:/^[\p{L}_][\p{L}\p{N}_]*$/u.test(e)?e:quote(e),quote=e=>`"`+e.replace(/["\\\n\r\t]/g,e=>JSON.stringify(e).slice(1,-1))+`"`;var Reader=class{text;position;constructor(e,t){this.text=e,this.position=t}value(){this.space();let e=this.text[this.position];if(e===`{`)return this.object();if(e===`[`)return this.list();if(e===`"`){let e=this.string();return e===void 0?void 0:{kind:`scalar`,text:quote(e)}}let t=/^(?:-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null)/.exec(this.text.slice(this.position));if(t!==null)return this.position+=t[0].length,{kind:`scalar`,text:t[0]}}object(){this.position++;let e=[];if(this.space(),this.text[this.position]===`}`)return this.position++,{kind:`object`,members:e};for(;;){this.space();let t=this.string();if(this.space(),t===void 0||this.text[this.position]!==`:`)return;this.position++;let n=this.value();if(n===void 0)return;e.push({name:t,value:n}),this.space();let r=this.text[this.position++];if(r===`}`)return{kind:`object`,members:e};if(r!==`,`)return}}list(){this.position++;let e=[];if(this.space(),this.text[this.position]===`]`)return this.position++,{kind:`list`,items:e};for(;;){let t=this.value();if(t===void 0)return;e.push(t),this.space();let n=this.text[this.position++];if(n===`]`)return{kind:`list`,items:e};if(n!==`,`)return}}string(){if(this.text[this.position]!==`"`)return;let e=this.position+1;for(;e<this.text.length&&this.text[e]!==`"`;)e+=this.text[e]===`\\`?2:1;if(!(e>=this.text.length))try{let t=JSON.parse(this.text.slice(this.position,e+1));return this.position=e+1,t}catch{return}}space(){for(;this.position<this.text.length&&/\s/.test(this.text[this.position]);)this.position++}};export{rewriteInlineJson};
|
|
3
|
+
//# sourceMappingURL=StructuredValueQuickFix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StructuredValueQuickFix.js","names":["headers","before","after","inlineStepHeader","comment","commentStart","line","code","trailing","start","reader","value","header","text","indent","lines","unit","inString","index","current","child","item","member","name","character","position","token","members","next","items","end"],"sources":["../../../../../../Compiler/Authoring/StructuredValueQuickFix.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 { commentStart } from '../Parsing/SourceLineSplitter';\n\n// Rewrites one inline JSON value (PLAY0833) as the indented structured block Screenplay writes instead. The value is\n// read token by token so numbers keep their authored spelling; nothing is evaluated or normalized.\n\ntype Value =\n | { readonly kind: 'scalar'; readonly text: string }\n | { readonly kind: 'list'; readonly items: readonly Value[] }\n | { readonly kind: 'object'; readonly members: readonly { readonly name: string; readonly value: Value }[] };\n\nexport interface StructuredValueRewrite {\n /** Offset within the line where the replaced text starts. */\n readonly start: number;\n /** Replacement for the rest of the line from start; continuation lines carry their own indentation. */\n readonly text: string;\n}\n\n// The header shapes a JSON value can follow. Each returns the text that stays on the line before the block opens.\nconst headers: readonly ((before: string, after: string) => string | undefined)[] = [\n (before, after) => /\\bthen\\s+returns\\s*$/.test(before) && after === '' ? `${before.trimEnd()} value` : undefined,\n (before, after) => /\\bthen\\s+no\\s+readmodel\\s+\\S+\\s+for\\s*$/.test(before) && after === '' ? before.trimEnd() : undefined,\n (before, after) => /\\bfrom\\s+literal\\s*$/.test(before) ? `${before.trimEnd()}${after === '' ? '' : ` ${after}`}` : undefined,\n (before, after) => /=\\s*literal\\s*$/.test(before) && after === '' ? before.replace(/\\s*=\\s*literal\\s*$/, '') : undefined,\n (before, after) => /=\\s*$/.test(before) && after === '' ? before.replace(/\\s*=\\s*$/, '') : undefined,\n];\n\n// A step header that carries one inline assignment keeps scalars only; its structured value moves under the header,\n// which changes the parsed tree, so the editor leaves that rewrite to the author.\nconst inlineStepHeader = /^\\s*(?:given|when|then|case)\\s+\\S+.*\\s\\S+\\s*=\\s*$/;\n\n// The diagnostic may point at the line or at the value, so the value is found on the line: the first '{' or '[' outside a\n// string that follows one of the header shapes and runs to the end of the code.\nexport function rewriteInlineJson(line: string, unit: string): StructuredValueRewrite | undefined {\n const comment = commentStart(line);\n const code = comment < 0 ? line : line.slice(0, comment);\n const trailing = comment < 0 ? '' : ` ${line.slice(comment).trimStart()}`;\n for (const start of openings(code)) {\n const reader = new Reader(code, start);\n const value = reader.value();\n if (value === undefined || value.kind === 'scalar') continue;\n const before = code.slice(0, start);\n const after = code.slice(reader.position).trim();\n if (inlineStepHeader.test(before)) return undefined;\n const header = headers.map(header => header(before, after)).find(text => text !== undefined);\n if (header === undefined) continue;\n const indent = /^\\s*/.exec(line)![0];\n const lines: string[] = [];\n block(header.slice(indent.length), value, indent, unit, lines);\n lines[0] = lines[0] + trailing;\n return { start: indent.length, text: lines.join('\\n').slice(indent.length) };\n }\n return undefined;\n}\n\nfunction* openings(code: string): Generator<number> {\n let inString = false;\n for (let index = 0; index < code.length; index++) {\n const current = code[index];\n if (inString && current === '\\\\') index++;\n else if (current === '\"') inString = !inString;\n else if (!inString && (current === '{' || current === '[')) yield index;\n }\n}\n\nfunction block(header: string, value: Value, indent: string, unit: string, lines: string[]): void {\n if (value.kind === 'list' && value.items.length === 0) {\n lines.push(`${indent}${header} none`);\n return;\n }\n if (value.kind === 'object' && value.members.length === 0) {\n lines.push(`${indent}${header} empty`);\n return;\n }\n lines.push(`${indent}${header}`);\n const child = indent + unit;\n if (value.kind === 'list') {\n for (const item of value.items) {\n if (item.kind === 'scalar') lines.push(`${child}item ${item.text}`);\n else block('item', item, child, unit, lines);\n }\n } else if (value.kind === 'object') {\n for (const member of value.members) {\n const name = memberName(member.name);\n if (member.value.kind === 'scalar') lines.push(`${child}${name} = ${member.value.text}`);\n else block(name, member.value, child, unit, lines);\n }\n }\n}\n\nconst memberName = (name: string): string => name === 'item' ? '@item' : /^[\\p{L}_][\\p{L}\\p{N}_]*$/u.test(name) ? name : quote(name);\n\nconst quote = (text: string): string => '\"' + text.replace(/[\"\\\\\\n\\r\\t]/g, character => JSON.stringify(character).slice(1, -1)) + '\"';\n\nclass Reader {\n constructor(private readonly text: string, public position: number) { }\n\n value(): Value | undefined {\n this.space();\n const current = this.text[this.position];\n if (current === '{') return this.object();\n if (current === '[') return this.list();\n if (current === '\"') {\n const text = this.string();\n return text === undefined ? undefined : { kind: 'scalar', text: quote(text) };\n }\n const token = /^(?:-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?|true|false|null)/.exec(this.text.slice(this.position));\n if (token === null) return undefined;\n this.position += token[0].length;\n return { kind: 'scalar', text: token[0] };\n }\n\n private object(): Value | undefined {\n this.position++;\n const members: { name: string; value: Value }[] = [];\n this.space();\n if (this.text[this.position] === '}') {\n this.position++;\n return { kind: 'object', members };\n }\n for (;;) {\n this.space();\n const name = this.string();\n this.space();\n if (name === undefined || this.text[this.position] !== ':') return undefined;\n this.position++;\n const value = this.value();\n if (value === undefined) return undefined;\n members.push({ name, value });\n this.space();\n const next = this.text[this.position++];\n if (next === '}') return { kind: 'object', members };\n if (next !== ',') return undefined;\n }\n }\n\n private list(): Value | undefined {\n this.position++;\n const items: Value[] = [];\n this.space();\n if (this.text[this.position] === ']') {\n this.position++;\n return { kind: 'list', items };\n }\n for (;;) {\n const value = this.value();\n if (value === undefined) return undefined;\n items.push(value);\n this.space();\n const next = this.text[this.position++];\n if (next === ']') return { kind: 'list', items };\n if (next !== ',') return undefined;\n }\n }\n\n private string(): string | undefined {\n if (this.text[this.position] !== '\"') return undefined;\n let end = this.position + 1;\n while (end < this.text.length && this.text[end] !== '\"') end += this.text[end] === '\\\\' ? 2 : 1;\n if (end >= this.text.length) return undefined;\n try {\n const value = JSON.parse(this.text.slice(this.position, end + 1)) as string;\n this.position = end + 1;\n return value;\n } catch {\n return undefined;\n }\n }\n\n private space(): void {\n while (this.position < this.text.length && /\\s/.test(this.text[this.position])) this.position++;\n }\n}\n"],"mappings":"qHAqBA,MAAMA,EAA8E,EAC/E,EAAQ,IAAU,uBAAuB,KAAKC,CAAM,GAAKC,IAAU,GAAK,GAAGD,EAAO,QA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K,KAAK,KAAK,YAC5B,GAAIA,IAAS,IAAK,MAAO,CAAE,KAAM,SAAU,SAAQ,EACnD,GAAIA,IAAS,IAAK,MACtB,CACJ,CAEA,MAAkC,CAC9B,KAAK,WACL,IAAMC,EAAiB,CAAC,EAExB,GADA,KAAK,MAAM,EACP,KAAK,KAAK,KAAK,YAAc,IAE7B,MADA,MAAK,WACE,CAAE,KAAM,OAAQ,OAAM,EAEjC,OAAS,CACL,IAAMlB,EAAQ,KAAK,MAAM,EACzB,GAAIA,IAAU,IAAA,GAAW,OACzBkB,EAAM,KAAKlB,CAAK,EAChB,KAAK,MAAM,EACX,IAAMiB,EAAO,KAAK,KAAK,KAAK,YAC5B,GAAIA,IAAS,IAAK,MAAO,CAAE,KAAM,OAAQ,OAAM,EAC/C,GAAIA,IAAS,IAAK,MACtB,CACJ,CAEA,QAAqC,CACjC,GAAI,KAAK,KAAK,KAAK,YAAc,IAAK,OACtC,IAAIE,EAAM,KAAK,SAAW,EAC1B,KAAOA,EAAM,KAAK,KAAK,QAAU,KAAK,KAAKA,KAAS,KAAK,GAAO,KAAK,KAAKA,KAAS,KAAO,EAAI,EAC9F,GAAI,KAAO,KAAK,KAAK,QACrB,GAAI,CACA,IAAMnB,EAAQ,KAAK,MAAM,KAAK,KAAK,MAAM,KAAK,SAAUmB,EAAM,CAAC,CAAC,EAEhE,MADA,MAAK,SAAWA,EAAM,EACfnB,CACX,MAAQ,CACJ,MACJ,CACJ,CAEA,OAAsB,CAClB,KAAO,KAAK,SAAW,KAAK,KAAK,QAAU,KAAK,KAAK,KAAK,KAAK,KAAK,SAAS,GAAG,KAAK,UACzF,CACJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../_virtual/_virtual/_rolldown/runtime.js";import{dependencySourcesOf as e}from"../Syntax/DependencySources.js";import{ScreenplaySyntaxWalker as t}from"../Syntax/ScreenplaySyntaxWalker.js";const n={from:`usesFactsFrom`,join:`usesFactsFrom`,remove:`usesFactsFrom`,removeViaJoin:`usesFactsFrom`,clear:`usesFactsFrom`,entersOn:`usesFactsFrom`,reduces:`usesFactsFrom`,uniqueEvent:`usesFactsFrom`,uniqueProperty:`usesFactsFrom`,concurrency:`usesFactsFrom`,trigger:`reactsTo`,reads:`decidesFrom`,invokes:`asks`,action:`asks`,actionAlternative:`asks`,actionOtherwise:`asks`,formCommand:`asks`,dataQuery:`shows`,populate:`shows`,navigate:`shows`,whenRedeliveredEvent:`verifiedWith`,redeliveryReaction:`verifiedWith`,refusalConstraint:null,refusalProduces:null,specificationEvent:`verifiedWith`,givenEvent:`verifiedWith`,whenAppendedEvent:`verifiedWith`,thenEvent:`verifiedWith`,whenCommand:`verifiedWith`,thenInvokes:`verifiedWith`,declares:null,uses:null,commandEventSource:null,commandStream:null,specificationEventSource:null,specificationStream:null,thenOperation:null,givenOperationFailure:null,thenCompensated:null,produces:null,authorizes:null,queryResult:null,dataReadModel:null,type:null,exampleType:null,contributes:null,template:null,specificationReadModel:null,thenAbsentReadModel:null,thenReadModel:null,givenReadModel:null,thenQuery:null,compositeKeyType:null,builds:null,buildsVariant:null,appends:null,seed:null};function sliceReferences(e){let t=new SliceReferenceCollector;return t.visitSlice(e),{references:t.references.sort((e,t)=>e.location.line-t.location.line||e.location.column-t.location.column),shared:t.shared}}function buildingReadModelReferences(t,n){let r=new SliceReferenceCollector(n);return t.projections.forEach(e=>r.visitProjection(e)),e(t).reducers?.filter(e=>e.readModel.toLowerCase()===n.toLowerCase()).forEach(e=>r.visitReducer(e)),r.references}function variants(e){return e.flatMap(e=>e.kind===`ProjectionVariantSyntax`?[e,...variants(e.blocks)]:e.kind===`ChildrenSyntax`||e.kind===`NestedSyntax`?variants(e.blocks):[])}var SliceReferenceCollector=class extends t{readModel;references=[];shared=[];specification;projection=!1;constructor(e){super(),this.readModel=e}matches(e){return e.toLowerCase()===this.readModel?.toLowerCase()}visitSlice(t){super.visitSlice(t),e(t).reducers?.forEach(e=>this.visitReducer(e))}visitCommand(t){let n=e(t);n.reads?.forEach(e=>this.visitReads(e)),n.concurrency!=null&&this.visitConcurrency(n.concurrency),super.visitCommand(t)}visitReactionTrigger(t){let n=e(t);n.data?.forEach(e=>this.visitTriggerData(e)),n.reads?.forEach(e=>this.visitReads(e)),super.visitReactionTrigger(t)}visitProjection(e){if(this.readModel!==void 0){let t=variants(e.blocks);if(t.length===0?!this.matches(e.readModel??e.name):!t.some(e=>this.matches(e.name)))return}this.projection=!0,super.visitProjection(e),this.projection=!1}visitSpecification(e){this.specification=e,super.visitSpecification(e),this.specification=void 0}visitNode(e){let add=(t,r,i)=>{this.references.push({name:t,targetKind:r,role:i,kind:n[i],location:e.location,timeline:this.projection||[`trigger`,`reads`,`reduces`].includes(i)})};switch(e.kind){case`TypeRefSyntax`:{let t=e.name;[`Uuid`,`String`,`Int`,`Decimal`,`Bool`,`Date`,`DateTime`].includes(t)||this.shared.push({kind:`type`,name:t});break}case`PolicyReferenceSyntax`:this.shared.push({kind:`policy`,name:e.name});break;case`EventSpecSyntax`:add(e.event,`Event`,`from`);break;case`JoinEventSyntax`:add(e.event,`Event`,`join`);break;case`RemoveWithSyntax`:add(e.event,`Event`,`remove`);break;case`RemoveViaJoinSyntax`:add(e.event,`Event`,`removeViaJoin`);break;case`ClearWithSyntax`:add(e.event,`Event`,`clear`);break;case`ProjectionEntersOnSyntax`:add(e.event,`Event`,`entersOn`);break;case`ReducerRuleSyntax`:add(e.event,`Event`,`reduces`);break;case`UniqueEventConstraintSyntax`:add(e.event,`Event`,`uniqueEvent`);break;case`UniquePropertyConstraintSyntax`:add(e.event,`Event`,`uniqueProperty`);break;case`NamedTriggerSourceSyntax`:add(e.name,`Event`,`trigger`);break;case`ReadsSyntax`:add(e.readModel,`ReadModel`,`reads`);break;case`InvokesSyntax`:add(e.command,`Command`,`invokes`);break;case`ScreenActionSyntax`:add(e.command,`Command`,`action`);break;case`ScreenActionAlternativeSyntax`:add(e.command,`Command`,`actionAlternative`);break;case`ScreenActionOtherwiseSyntax`:{let t=e.command;t!==null&&add(t,`Command`,`actionOtherwise`);break}case`FormSyntax`:add(e.for,`Command`,`formCommand`);break;case`ScreenDataSyntax`:add(e.query,`Query`,`dataQuery`);break;case`FormPopulateViaQuerySyntax`:add(e.query,`Query`,`populate`);break;case`ScreenNavigateSyntax`:add(e.screen,`Screen`,`navigate`);break;case`SpecificationEventSyntax`:add(e.eventType,`Event`,this.specification?.given.includes(e)===!0?`givenEvent`:this.specification?.whenAppended===e?`whenAppendedEvent`:`thenEvent`);break;case`SpecificationCommandSyntax`:add(e.commandType,`Command`,`whenCommand`);break;case`SpecificationInvocationSyntax`:add(e.command,`Command`,`thenInvokes`);break;case`SpecificationRedeliverySyntax`:{let t=e;add(t.eventType,`Event`,`whenRedeliveredEvent`),add(t.reaction,`Reaction`,`redeliveryReaction`);break}case`ConcurrencySyntax`:e.eventTypes.forEach(e=>add(e,`Event`,`concurrency`))}}};export{SliceReferenceCollector,buildingReadModelReferences,n as referenceClassifications,sliceReferences};
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{dependencySourcesOf as e}from"../Syntax/DependencySources.js";import{ScreenplaySyntaxWalker as t}from"../Syntax/ScreenplaySyntaxWalker.js";const n={from:`usesFactsFrom`,join:`usesFactsFrom`,remove:`usesFactsFrom`,removeViaJoin:`usesFactsFrom`,clear:`usesFactsFrom`,entersOn:`usesFactsFrom`,reduces:`usesFactsFrom`,uniqueEvent:`usesFactsFrom`,uniqueProperty:`usesFactsFrom`,concurrency:`usesFactsFrom`,trigger:`reactsTo`,reads:`decidesFrom`,invokes:`asks`,action:`asks`,actionAlternative:`asks`,actionOtherwise:`asks`,formCommand:`asks`,dataQuery:`shows`,populate:`shows`,navigate:`shows`,whenRedeliveredEvent:`verifiedWith`,redeliveryReaction:`verifiedWith`,refusalConstraint:null,refusalProduces:null,specificationEvent:`verifiedWith`,givenEvent:`verifiedWith`,whenAppendedEvent:`verifiedWith`,thenEvent:`verifiedWith`,whenCommand:`verifiedWith`,thenInvokes:`verifiedWith`,declares:null,uses:null,commandEventSource:null,commandStream:null,specificationEventSource:null,specificationStream:null,thenOperation:null,givenOperationFailure:null,thenCompensated:null,produces:null,authorizes:null,queryResult:null,dataReadModel:null,type:null,exampleType:null,contributes:null,template:null,specificationReadModel:null,thenAbsentReadModel:null,thenReadModel:null,givenReadModel:null,thenQuery:null,compositeKeyType:null,builds:null,buildsVariant:null,appends:null,seed:null,follows:null,entersSend:null,entersStart:null,transitionOn:null,workflowSubject:null,workflowWait:null,workflowTrigger:null,workflowAction:null,workflowApproval:null};function sliceReferences(e){let t=new SliceReferenceCollector;return t.visitSlice(e),{references:t.references.sort((e,t)=>e.location.line-t.location.line||e.location.column-t.location.column),shared:t.shared}}function buildingReadModelReferences(t,n){let r=new SliceReferenceCollector(n);return t.projections.forEach(e=>r.visitProjection(e)),e(t).reducers?.filter(e=>e.readModel.toLowerCase()===n.toLowerCase()).forEach(e=>r.visitReducer(e)),r.references}function variants(e){return e.flatMap(e=>e.kind===`ProjectionVariantSyntax`?[e,...variants(e.blocks)]:e.kind===`ChildrenSyntax`||e.kind===`NestedSyntax`?variants(e.blocks):[])}var SliceReferenceCollector=class extends t{readModel;references=[];shared=[];specification;projection=!1;constructor(e){super(),this.readModel=e}matches(e){return e.toLowerCase()===this.readModel?.toLowerCase()}visitSlice(t){super.visitSlice(t),e(t).reducers?.forEach(e=>this.visitReducer(e))}visitCommand(t){let n=e(t);n.reads?.forEach(e=>this.visitReads(e)),n.concurrency!=null&&this.visitConcurrency(n.concurrency),super.visitCommand(t)}visitReactionTrigger(t){let n=e(t);n.data?.forEach(e=>this.visitTriggerData(e)),n.reads?.forEach(e=>this.visitReads(e)),super.visitReactionTrigger(t)}visitProjection(e){if(this.readModel!==void 0){let t=variants(e.blocks);if(t.length===0?!this.matches(e.readModel??e.name):!t.some(e=>this.matches(e.name)))return}this.projection=!0,super.visitProjection(e),this.projection=!1}visitSpecification(e){this.specification=e,super.visitSpecification(e),this.specification=void 0}visitNode(e){let add=(t,r,i)=>{this.references.push({name:t,targetKind:r,role:i,kind:n[i],location:e.location,timeline:this.projection||[`trigger`,`reads`,`reduces`].includes(i)})};switch(e.kind){case`TypeRefSyntax`:{let t=e.name;[`Uuid`,`String`,`Int`,`Decimal`,`Bool`,`Date`,`DateTime`].includes(t)||this.shared.push({kind:`type`,name:t});break}case`PolicyReferenceSyntax`:this.shared.push({kind:`policy`,name:e.name});break;case`EventSpecSyntax`:add(e.event,`Event`,`from`);break;case`JoinEventSyntax`:add(e.event,`Event`,`join`);break;case`RemoveWithSyntax`:add(e.event,`Event`,`remove`);break;case`RemoveViaJoinSyntax`:add(e.event,`Event`,`removeViaJoin`);break;case`ClearWithSyntax`:add(e.event,`Event`,`clear`);break;case`ProjectionEntersOnSyntax`:add(e.event,`Event`,`entersOn`);break;case`ReducerRuleSyntax`:add(e.event,`Event`,`reduces`);break;case`UniqueEventConstraintSyntax`:add(e.event,`Event`,`uniqueEvent`);break;case`UniquePropertyConstraintSyntax`:add(e.event,`Event`,`uniqueProperty`);break;case`NamedTriggerSourceSyntax`:add(e.name,`Event`,`trigger`);break;case`ReadsSyntax`:add(e.readModel,`ReadModel`,`reads`);break;case`InvokesSyntax`:add(e.command,`Command`,`invokes`);break;case`ScreenActionSyntax`:add(e.command,`Command`,`action`);break;case`ScreenActionAlternativeSyntax`:add(e.command,`Command`,`actionAlternative`);break;case`ScreenActionOtherwiseSyntax`:{let t=e.command;t!==null&&add(t,`Command`,`actionOtherwise`);break}case`FormSyntax`:add(e.for,`Command`,`formCommand`);break;case`ScreenDataSyntax`:add(e.query,`Query`,`dataQuery`);break;case`FormPopulateViaQuerySyntax`:add(e.query,`Query`,`populate`);break;case`ScreenNavigateSyntax`:add(e.screen,`Screen`,`navigate`);break;case`SpecificationEventSyntax`:add(e.eventType,`Event`,this.specification?.given.includes(e)===!0?`givenEvent`:this.specification?.whenAppended===e?`whenAppendedEvent`:`thenEvent`);break;case`SpecificationCommandSyntax`:add(e.commandType,`Command`,`whenCommand`);break;case`SpecificationInvocationSyntax`:add(e.command,`Command`,`thenInvokes`);break;case`SpecificationRedeliverySyntax`:{let t=e;add(t.eventType,`Event`,`whenRedeliveredEvent`),add(t.reaction,`Reaction`,`redeliveryReaction`);break}case`ConcurrencySyntax`:e.eventTypes.forEach(e=>add(e,`Event`,`concurrency`))}}};export{SliceReferenceCollector,buildingReadModelReferences,n as referenceClassifications,sliceReferences};
|
|
2
2
|
//# sourceMappingURL=SliceReferences.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliceReferences.js","names":["referenceClassifications","collector","slice","left","right","readModel","projection","dependencySourcesOf","reducer","blocks","block","ScreenplaySyntaxWalker","name","syntax","node","sources","found","variant","role","command","redelivery"],"sources":["../../../../../../Compiler/Dependencies/SliceReferences.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 { PolicyReferenceSyntax } from '../Syntax/Authorization';\nimport { CommandSyntax } from '../Syntax/Commands';\nimport { ConstraintSyntax } from '../Syntax/Constraints';\nimport { TypeRefSyntax } from '../Syntax/Declarations';\nimport { dependencySourcesOf, ConcurrencySyntax, FormPopulateViaQuerySyntax, FormSyntax, ReadsSyntax, ReducerRuleSyntax } from '../Syntax/DependencySources';\nimport { EventSpecSyntax, JoinEventSyntax, ProjectionSyntax, ProjectionBlockSyntax, ProjectionVariantSyntax, ProjectionEntersOnSyntax, RemoveWithSyntax, RemoveViaJoinSyntax, ClearWithSyntax } from '../Syntax/Projections';\nimport { InvokesSyntax, NamedTriggerSourceSyntax, ReactionTriggerSyntax } from '../Syntax/Reactions';\nimport { ScreenActionAlternativeSyntax, ScreenActionOtherwiseSyntax, ScreenActionSyntax, ScreenDataSyntax, ScreenNavigateSyntax } from '../Syntax/Screens';\nimport { ScreenplaySyntaxWalker } from '../Syntax/ScreenplaySyntaxWalker';\nimport { SpecificationSyntax, SpecificationEventSyntax, SpecificationCommandSyntax, SpecificationInvocationSyntax, SpecificationRedeliverySyntax } from '../Syntax/Specifications';\nimport { SliceSyntax } from '../Syntax/Structure';\nimport { SyntaxNode } from '../Syntax/SyntaxNode';\nimport type { DependencyKind, SliceReference, SharedReference, CollectedSliceReferences } from './index';\n\nexport const referenceClassifications: Readonly<Record<string, DependencyKind | null>> = {\n from: 'usesFactsFrom', join: 'usesFactsFrom', remove: 'usesFactsFrom', removeViaJoin: 'usesFactsFrom',\n clear: 'usesFactsFrom', entersOn: 'usesFactsFrom', reduces: 'usesFactsFrom', uniqueEvent: 'usesFactsFrom',\n uniqueProperty: 'usesFactsFrom', concurrency: 'usesFactsFrom', trigger: 'reactsTo', reads: 'decidesFrom',\n invokes: 'asks', action: 'asks', actionAlternative: 'asks', actionOtherwise: 'asks', formCommand: 'asks', dataQuery: 'shows', populate: 'shows', navigate: 'shows',\n whenRedeliveredEvent: 'verifiedWith', redeliveryReaction: 'verifiedWith', refusalConstraint: null, refusalProduces: null,\n specificationEvent: 'verifiedWith', givenEvent: 'verifiedWith', whenAppendedEvent: 'verifiedWith', thenEvent: 'verifiedWith', whenCommand: 'verifiedWith', thenInvokes: 'verifiedWith',\n declares: null, uses: null, commandEventSource: null, commandStream: null, specificationEventSource: null, specificationStream: null, thenOperation: null,\n givenOperationFailure: null, thenCompensated: null, produces: null, authorizes: null, queryResult: null,\n dataReadModel: null, type: null, exampleType: null, contributes: null, template: null, specificationReadModel: null,\n thenAbsentReadModel: null, thenReadModel: null, givenReadModel: null, thenQuery: null,\n compositeKeyType: null, builds: null, buildsVariant: null, appends: null, seed: null,\n};\n// No resolution or expression/code interpretation: this is the same role inventory as C# SliceReferences.\nexport function sliceReferences(slice: SliceSyntax): CollectedSliceReferences {\n const collector = new SliceReferenceCollector();\n collector.visitSlice(slice);\n return { references: collector.references.sort((left, right) => left.location.line - right.location.line || left.location.column - right.location.column), shared: collector.shared };\n}\n\nexport function buildingReadModelReferences(slice: SliceSyntax, readModel: string): readonly SliceReference[] {\n const collector = new SliceReferenceCollector(readModel);\n slice.projections.forEach(projection => collector.visitProjection(projection));\n dependencySourcesOf(slice).reducers?.filter(reducer => reducer.readModel.toLowerCase() === readModel.toLowerCase()).forEach(reducer => collector.visitReducer(reducer));\n return collector.references;\n}\n\nfunction variants(blocks: readonly ProjectionBlockSyntax[]): ProjectionVariantSyntax[] {\n return blocks.flatMap(block => block.kind === 'ProjectionVariantSyntax' ? [block, ...variants(block.blocks)] : block.kind === 'ChildrenSyntax' || block.kind === 'NestedSyntax' ? variants(block.blocks) : []);\n}\n\nexport class SliceReferenceCollector extends ScreenplaySyntaxWalker {\n readonly references: SliceReference[] = [];\n readonly shared: SharedReference[] = [];\n private specification?: SpecificationSyntax;\n private projection = false;\n\n constructor(private readonly readModel?: string) { super(); }\n\n private matches(name: string): boolean { return name.toLowerCase() === this.readModel?.toLowerCase(); }\n\n override visitSlice(syntax: SliceSyntax): void {\n super.visitSlice(syntax);\n const sources = dependencySourcesOf(syntax);\n sources.reducers?.forEach(node => this.visitReducer(node));\n }\n override visitCommand(syntax: CommandSyntax): void {\n const sources = dependencySourcesOf(syntax);\n sources.reads?.forEach(node => this.visitReads(node));\n if (sources.concurrency != null) this.visitConcurrency(sources.concurrency);\n super.visitCommand(syntax);\n }\n override visitReactionTrigger(syntax: ReactionTriggerSyntax): void {\n const sources = dependencySourcesOf(syntax);\n sources.data?.forEach(node => this.visitTriggerData(node));\n sources.reads?.forEach(node => this.visitReads(node));\n super.visitReactionTrigger(syntax);\n }\n override visitProjection(syntax: ProjectionSyntax): void {\n if (this.readModel !== undefined) {\n const found = variants(syntax.blocks);\n if (found.length === 0 ? !this.matches(syntax.readModel ?? syntax.name) : !found.some(variant => this.matches(variant.name))) return;\n }\n this.projection = true;\n super.visitProjection(syntax);\n this.projection = false;\n }\n override visitSpecification(syntax: SpecificationSyntax): void {\n this.specification = syntax;\n super.visitSpecification(syntax);\n this.specification = undefined;\n }\n override visitNode(node: SyntaxNode): void {\n const add = (name: string, targetKind: SliceReference['targetKind'], role: string) => {\n this.references.push({ name, targetKind, role, kind: referenceClassifications[role]!, location: node.location, timeline: this.projection || ['trigger', 'reads', 'reduces'].includes(role) });\n };\n switch (node.kind) {\n case 'TypeRefSyntax': {\n const name = (node as TypeRefSyntax).name;\n if (!['Uuid', 'String', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime'].includes(name)) this.shared.push({ kind: 'type', name });\n break;\n }\n case 'PolicyReferenceSyntax': this.shared.push({ kind: 'policy', name: (node as PolicyReferenceSyntax).name }); break;\n case 'EventSpecSyntax': add((node as EventSpecSyntax).event, 'Event', 'from'); break;\n case 'JoinEventSyntax': add((node as JoinEventSyntax).event, 'Event', 'join'); break;\n case 'RemoveWithSyntax': add((node as RemoveWithSyntax).event, 'Event', 'remove'); break;\n case 'RemoveViaJoinSyntax': add((node as RemoveViaJoinSyntax).event, 'Event', 'removeViaJoin'); break;\n case 'ClearWithSyntax': add((node as ClearWithSyntax).event, 'Event', 'clear'); break;\n case 'ProjectionEntersOnSyntax': add((node as ProjectionEntersOnSyntax).event, 'Event', 'entersOn'); break;\n case 'ReducerRuleSyntax': add((node as ReducerRuleSyntax).event, 'Event', 'reduces'); break;\n case 'UniqueEventConstraintSyntax': add((node as Extract<ConstraintSyntax, { kind: 'UniqueEventConstraintSyntax' }>).event, 'Event', 'uniqueEvent'); break;\n case 'UniquePropertyConstraintSyntax': add((node as Extract<ConstraintSyntax, { kind: 'UniquePropertyConstraintSyntax' }>).event, 'Event', 'uniqueProperty'); break;\n case 'NamedTriggerSourceSyntax': add((node as NamedTriggerSourceSyntax).name, 'Event', 'trigger'); break;\n case 'ReadsSyntax': add((node as ReadsSyntax).readModel, 'ReadModel', 'reads'); break;\n case 'InvokesSyntax': add((node as InvokesSyntax).command, 'Command', 'invokes'); break;\n case 'ScreenActionSyntax': add((node as ScreenActionSyntax).command, 'Command', 'action'); break;\n case 'ScreenActionAlternativeSyntax': add((node as ScreenActionAlternativeSyntax).command, 'Command', 'actionAlternative'); break;\n case 'ScreenActionOtherwiseSyntax': {\n const command = (node as ScreenActionOtherwiseSyntax).command;\n if (command !== null) add(command, 'Command', 'actionOtherwise');\n break;\n }\n case 'FormSyntax': add((node as FormSyntax).for, 'Command', 'formCommand'); break;\n case 'ScreenDataSyntax': add((node as ScreenDataSyntax).query, 'Query', 'dataQuery'); break;\n case 'FormPopulateViaQuerySyntax': add((node as FormPopulateViaQuerySyntax).query, 'Query', 'populate'); break;\n case 'ScreenNavigateSyntax': add((node as ScreenNavigateSyntax).screen, 'Screen', 'navigate'); break;\n case 'SpecificationEventSyntax': add((node as SpecificationEventSyntax).eventType, 'Event', this.specification?.given.includes(node as SpecificationEventSyntax) === true ? 'givenEvent' : this.specification?.whenAppended === node ? 'whenAppendedEvent' : 'thenEvent'); break;\n case 'SpecificationCommandSyntax': add((node as SpecificationCommandSyntax).commandType, 'Command', 'whenCommand'); break;\n case 'SpecificationInvocationSyntax': add((node as SpecificationInvocationSyntax).command, 'Command', 'thenInvokes'); break;\n case 'SpecificationRedeliverySyntax': {\n const redelivery = node as SpecificationRedeliverySyntax;\n add(redelivery.eventType, 'Event', 'whenRedeliveredEvent');\n add(redelivery.reaction, 'Reaction', 'redeliveryReaction');\n break;\n }\n case 'ConcurrencySyntax': (node as ConcurrencySyntax).eventTypes.forEach(name => add(name, 'Event', 'concurrency')); break;\n }\n }\n}\n"],"mappings":"uMAiBA,MAAaA,EAA4E,CACrF,KAAM,gBAAiB,KAAM,gBAAiB,OAAQ,gBAAiB,cAAe,gBACtF,MAAO,gBAAiB,SAAU,gBAAiB,QAAS,gBAAiB,YAAa,gBAC1F,eAAgB,gBAAiB,YAAa,gBAAiB,QAAS,WAAY,MAAO,cAC3F,QAAS,OAAQ,OAAQ,OAAQ,kBAAmB,OAAQ,gBAAiB,OAAQ,YAAa,OAAQ,UAAW,QAAS,SAAU,QAAS,SAAU,QAC3J,qBAAsB,eAAgB,mBAAoB,eAAgB,kBAAmB,KAAM,gBAAiB,KACpH,mBAAoB,eAAgB,WAA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S,UAAW,QAAQ,EAAG,MAC3F,IAAK,gCAAiC,IAAKA,EAAuC,QAAS,UAAW,mBAAmB,EAAG,MAC5H,IAAK,8BAA+B,CAChC,IAAMK,EAAWL,EAAqC,QAClDK,IAAY,MAAM,IAAIA,EAAS,UAAW,iBAAiB,EAC/D,KACJ,CACA,IAAK,aAAc,IAAKL,EAAoB,IAAK,UAAW,aAAa,EAAG,MAC5E,IAAK,mBAAoB,IAAKA,EAA0B,MAAO,QAAS,WAAW,EAAG,MACtF,IAAK,6BAA8B,IAAKA,EAAoC,MAAO,QAAS,UAAU,EAAG,MACzG,IAAK,uBAAwB,IAAKA,EAA8B,OAAQ,SAAU,UAAU,EAAG,MAC/F,IAAK,2BAA4B,IAAKA,EAAkC,UAAW,QAAS,KAAK,eAAe,MAAM,SAASA,CAAgC,IAAM,GAAO,aAAe,KAAK,eAAe,eAAiBA,EAAO,oBAAsB,WAAW,EAAG,MAC3Q,IAAK,6BAA8B,IAAKA,EAAoC,YAAa,UAAW,aAAa,EAAG,MACpH,IAAK,gCAAiC,IAAKA,EAAuC,QAAS,UAAW,aAAa,EAAG,MACtH,IAAK,gCAAiC,CAClC,IAAMM,EAAaN,EACnB,IAAIM,EAAW,UAAW,QAAS,sBAAsB,EACzD,IAAIA,EAAW,SAAU,WAAY,oBAAoB,EACzD,KACJ,CACA,IAAK,oBAAqBN,EAA4B,WAAW,QAAQ,GAAQ,IAAIF,EAAM,QAAS,aAAa,CAAC,CACtH,CACJ,CACJ"}
|
|
1
|
+
{"version":3,"file":"SliceReferences.js","names":["referenceClassifications","collector","slice","left","right","readModel","projection","dependencySourcesOf","reducer","blocks","block","ScreenplaySyntaxWalker","name","syntax","node","sources","found","variant","role","command","redelivery"],"sources":["../../../../../../Compiler/Dependencies/SliceReferences.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 { PolicyReferenceSyntax } from '../Syntax/Authorization';\nimport { CommandSyntax } from '../Syntax/Commands';\nimport { ConstraintSyntax } from '../Syntax/Constraints';\nimport { TypeRefSyntax } from '../Syntax/Declarations';\nimport { dependencySourcesOf, ConcurrencySyntax, FormPopulateViaQuerySyntax, FormSyntax, ReadsSyntax, ReducerRuleSyntax } from '../Syntax/DependencySources';\nimport { EventSpecSyntax, JoinEventSyntax, ProjectionSyntax, ProjectionBlockSyntax, ProjectionVariantSyntax, ProjectionEntersOnSyntax, RemoveWithSyntax, RemoveViaJoinSyntax, ClearWithSyntax } from '../Syntax/Projections';\nimport { InvokesSyntax, NamedTriggerSourceSyntax, ReactionTriggerSyntax } from '../Syntax/Reactions';\nimport { ScreenActionAlternativeSyntax, ScreenActionOtherwiseSyntax, ScreenActionSyntax, ScreenDataSyntax, ScreenNavigateSyntax } from '../Syntax/Screens';\nimport { ScreenplaySyntaxWalker } from '../Syntax/ScreenplaySyntaxWalker';\nimport { SpecificationSyntax, SpecificationEventSyntax, SpecificationCommandSyntax, SpecificationInvocationSyntax, SpecificationRedeliverySyntax } from '../Syntax/Specifications';\nimport { SliceSyntax } from '../Syntax/Structure';\nimport { SyntaxNode } from '../Syntax/SyntaxNode';\nimport type { DependencyKind, SliceReference, SharedReference, CollectedSliceReferences } from './index';\n\nexport const referenceClassifications: Readonly<Record<string, DependencyKind | null>> = {\n from: 'usesFactsFrom', join: 'usesFactsFrom', remove: 'usesFactsFrom', removeViaJoin: 'usesFactsFrom',\n clear: 'usesFactsFrom', entersOn: 'usesFactsFrom', reduces: 'usesFactsFrom', uniqueEvent: 'usesFactsFrom',\n uniqueProperty: 'usesFactsFrom', concurrency: 'usesFactsFrom', trigger: 'reactsTo', reads: 'decidesFrom',\n invokes: 'asks', action: 'asks', actionAlternative: 'asks', actionOtherwise: 'asks', formCommand: 'asks', dataQuery: 'shows', populate: 'shows', navigate: 'shows',\n whenRedeliveredEvent: 'verifiedWith', redeliveryReaction: 'verifiedWith', refusalConstraint: null, refusalProduces: null,\n specificationEvent: 'verifiedWith', givenEvent: 'verifiedWith', whenAppendedEvent: 'verifiedWith', thenEvent: 'verifiedWith', whenCommand: 'verifiedWith', thenInvokes: 'verifiedWith',\n declares: null, uses: null, commandEventSource: null, commandStream: null, specificationEventSource: null, specificationStream: null, thenOperation: null,\n givenOperationFailure: null, thenCompensated: null, produces: null, authorizes: null, queryResult: null,\n dataReadModel: null, type: null, exampleType: null, contributes: null, template: null, specificationReadModel: null,\n thenAbsentReadModel: null, thenReadModel: null, givenReadModel: null, thenQuery: null,\n compositeKeyType: null, builds: null, buildsVariant: null, appends: null, seed: null,\n // State machines and workflows are top-level declarations owned by no slice, so what they name adds no slice dependency.\n follows: null, entersSend: null, entersStart: null, transitionOn: null, workflowSubject: null,\n workflowWait: null, workflowTrigger: null, workflowAction: null, workflowApproval: null,\n};\n// No resolution or expression/code interpretation: this is the same role inventory as C# SliceReferences.\nexport function sliceReferences(slice: SliceSyntax): CollectedSliceReferences {\n const collector = new SliceReferenceCollector();\n collector.visitSlice(slice);\n return { references: collector.references.sort((left, right) => left.location.line - right.location.line || left.location.column - right.location.column), shared: collector.shared };\n}\n\nexport function buildingReadModelReferences(slice: SliceSyntax, readModel: string): readonly SliceReference[] {\n const collector = new SliceReferenceCollector(readModel);\n slice.projections.forEach(projection => collector.visitProjection(projection));\n dependencySourcesOf(slice).reducers?.filter(reducer => reducer.readModel.toLowerCase() === readModel.toLowerCase()).forEach(reducer => collector.visitReducer(reducer));\n return collector.references;\n}\n\nfunction variants(blocks: readonly ProjectionBlockSyntax[]): ProjectionVariantSyntax[] {\n return blocks.flatMap(block => block.kind === 'ProjectionVariantSyntax' ? [block, ...variants(block.blocks)] : block.kind === 'ChildrenSyntax' || block.kind === 'NestedSyntax' ? variants(block.blocks) : []);\n}\n\nexport class SliceReferenceCollector extends ScreenplaySyntaxWalker {\n readonly references: SliceReference[] = [];\n readonly shared: SharedReference[] = [];\n private specification?: SpecificationSyntax;\n private projection = false;\n\n constructor(private readonly readModel?: string) { super(); }\n\n private matches(name: string): boolean { return name.toLowerCase() === this.readModel?.toLowerCase(); }\n\n override visitSlice(syntax: SliceSyntax): void {\n super.visitSlice(syntax);\n const sources = dependencySourcesOf(syntax);\n sources.reducers?.forEach(node => this.visitReducer(node));\n }\n override visitCommand(syntax: CommandSyntax): void {\n const sources = dependencySourcesOf(syntax);\n sources.reads?.forEach(node => this.visitReads(node));\n if (sources.concurrency != null) this.visitConcurrency(sources.concurrency);\n super.visitCommand(syntax);\n }\n override visitReactionTrigger(syntax: ReactionTriggerSyntax): void {\n const sources = dependencySourcesOf(syntax);\n sources.data?.forEach(node => this.visitTriggerData(node));\n sources.reads?.forEach(node => this.visitReads(node));\n super.visitReactionTrigger(syntax);\n }\n override visitProjection(syntax: ProjectionSyntax): void {\n if (this.readModel !== undefined) {\n const found = variants(syntax.blocks);\n if (found.length === 0 ? !this.matches(syntax.readModel ?? syntax.name) : !found.some(variant => this.matches(variant.name))) return;\n }\n this.projection = true;\n super.visitProjection(syntax);\n this.projection = false;\n }\n override visitSpecification(syntax: SpecificationSyntax): void {\n this.specification = syntax;\n super.visitSpecification(syntax);\n this.specification = undefined;\n }\n override visitNode(node: SyntaxNode): void {\n const add = (name: string, targetKind: SliceReference['targetKind'], role: string) => {\n this.references.push({ name, targetKind, role, kind: referenceClassifications[role]!, location: node.location, timeline: this.projection || ['trigger', 'reads', 'reduces'].includes(role) });\n };\n switch (node.kind) {\n case 'TypeRefSyntax': {\n const name = (node as TypeRefSyntax).name;\n if (!['Uuid', 'String', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime'].includes(name)) this.shared.push({ kind: 'type', name });\n break;\n }\n case 'PolicyReferenceSyntax': this.shared.push({ kind: 'policy', name: (node as PolicyReferenceSyntax).name }); break;\n case 'EventSpecSyntax': add((node as EventSpecSyntax).event, 'Event', 'from'); break;\n case 'JoinEventSyntax': add((node as JoinEventSyntax).event, 'Event', 'join'); break;\n case 'RemoveWithSyntax': add((node as RemoveWithSyntax).event, 'Event', 'remove'); break;\n case 'RemoveViaJoinSyntax': add((node as RemoveViaJoinSyntax).event, 'Event', 'removeViaJoin'); break;\n case 'ClearWithSyntax': add((node as ClearWithSyntax).event, 'Event', 'clear'); break;\n case 'ProjectionEntersOnSyntax': add((node as ProjectionEntersOnSyntax).event, 'Event', 'entersOn'); break;\n case 'ReducerRuleSyntax': add((node as ReducerRuleSyntax).event, 'Event', 'reduces'); break;\n case 'UniqueEventConstraintSyntax': add((node as Extract<ConstraintSyntax, { kind: 'UniqueEventConstraintSyntax' }>).event, 'Event', 'uniqueEvent'); break;\n case 'UniquePropertyConstraintSyntax': add((node as Extract<ConstraintSyntax, { kind: 'UniquePropertyConstraintSyntax' }>).event, 'Event', 'uniqueProperty'); break;\n case 'NamedTriggerSourceSyntax': add((node as NamedTriggerSourceSyntax).name, 'Event', 'trigger'); break;\n case 'ReadsSyntax': add((node as ReadsSyntax).readModel, 'ReadModel', 'reads'); break;\n case 'InvokesSyntax': add((node as InvokesSyntax).command, 'Command', 'invokes'); break;\n case 'ScreenActionSyntax': add((node as ScreenActionSyntax).command, 'Command', 'action'); break;\n case 'ScreenActionAlternativeSyntax': add((node as ScreenActionAlternativeSyntax).command, 'Command', 'actionAlternative'); break;\n case 'ScreenActionOtherwiseSyntax': {\n const command = (node as ScreenActionOtherwiseSyntax).command;\n if (command !== null) add(command, 'Command', 'actionOtherwise');\n break;\n }\n case 'FormSyntax': add((node as FormSyntax).for, 'Command', 'formCommand'); break;\n case 'ScreenDataSyntax': add((node as ScreenDataSyntax).query, 'Query', 'dataQuery'); break;\n case 'FormPopulateViaQuerySyntax': add((node as FormPopulateViaQuerySyntax).query, 'Query', 'populate'); break;\n case 'ScreenNavigateSyntax': add((node as ScreenNavigateSyntax).screen, 'Screen', 'navigate'); break;\n case 'SpecificationEventSyntax': add((node as SpecificationEventSyntax).eventType, 'Event', this.specification?.given.includes(node as SpecificationEventSyntax) === true ? 'givenEvent' : this.specification?.whenAppended === node ? 'whenAppendedEvent' : 'thenEvent'); break;\n case 'SpecificationCommandSyntax': add((node as SpecificationCommandSyntax).commandType, 'Command', 'whenCommand'); break;\n case 'SpecificationInvocationSyntax': add((node as SpecificationInvocationSyntax).command, 'Command', 'thenInvokes'); break;\n case 'SpecificationRedeliverySyntax': {\n const redelivery = node as SpecificationRedeliverySyntax;\n add(redelivery.eventType, 'Event', 'whenRedeliveredEvent');\n add(redelivery.reaction, 'Reaction', 'redeliveryReaction');\n break;\n }\n case 'ConcurrencySyntax': (node as ConcurrencySyntax).eventTypes.forEach(name => add(name, 'Event', 'concurrency')); break;\n }\n }\n}\n"],"mappings":"uMAiBA,MAAaA,EAA4E,CACrF,KAAM,gBAAiB,KAAM,gBAAiB,OAAQ,gBAAiB,cAAe,gBACtF,MAAO,gBAAiB,SAAU,gBAAiB,QAAS,gBAAiB,YAAa,gBAC1F,eAAgB,gBAAiB,YAAa,gBAAiB,QAAS,WAAY,MAAO,cAC3F,QAAS,OAAQ,OAAQ,OAAQ,kBAAmB,OAAQ,gBAAiB,OAAQ,YAAa,OAAQ,UAAW,QAAS,SAAU,QAAS,SAAU,QAC3J,qBAAsB,eAAgB,mBAAoB,eAAgB,kBAAmB,KAAM,gBAAiB,KACpH,mBAAoB,eAAgB,WAAY,eAAgB,kBAAmB,eAAgB,UAAW,eAAgB,YAAa,eAAgB,YAAa,eACxK,SAAU,KAAM,KAAM,KAAM,mBAAoB,KAAM,cAAe,KAAM,yBAA0B,KAAM,oBAAqB,KAAM,cAAe,KACrJ,sBAAuB,KAAM,gBAAiB,KAAM,SAAU,KAAM,WAAY,KAAM,YAAa,KACnG,cAAe,KAAM,KAAM,KAAM,YAAa,KAAM,YAAa,KAAM,SAAU,KAAM,uBAAwB,KAC/G,oBAAqB,KAAM,cAAe,KAAM,eAAgB,KAAM,UAAW,KACjF,iBAAkB,KAAM,OAAQ,KAAM,cAAe,KAAM,QAAS,KAAM,KAAM,KAEhF,QAAS,KAAM,WAAY,KAAM,YAAa,KAAM,aAAc,KAAM,gBAAiB,KACzF,aAAc,KAAM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ACzG,IAAK,uBAAwB,IAAKA,EAA8B,OAAQ,SAAU,UAAU,EAAG,MAC/F,IAAK,2BAA4B,IAAKA,EAAkC,UAAW,QAAS,KAAK,eAAe,MAAM,SAASA,CAAgC,IAAM,GAAO,aAAe,KAAK,eAAe,eAAiBA,EAAO,oBAAsB,WAAW,EAAG,MAC3Q,IAAK,6BAA8B,IAAKA,EAAoC,YAAa,UAAW,aAAa,EAAG,MACpH,IAAK,gCAAiC,IAAKA,EAAuC,QAAS,UAAW,aAAa,EAAG,MACtH,IAAK,gCAAiC,CAClC,IAAMM,EAAaN,EACnB,IAAIM,EAAW,UAAW,QAAS,sBAAsB,EACzD,IAAIA,EAAW,SAAU,WAAY,oBAAoB,EACzD,KACJ,CACA,IAAK,oBAAqBN,EAA4B,WAAW,QAAQ,GAAQ,IAAIF,EAAM,QAAS,aAAa,CAAC,CACtH,CACJ,CACJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e={InvalidSemanticBinding:`PLAY0273`,InvalidActionSubjectClause:`PLAY0817`,InferredActionSubject:`PLAY0818`,ChangedActionSubject:`PLAY0819`,AmbiguousActionInputBinding:`PLAY0820`,UnsupportedActionSubjectContext:`PLAY0821`,DuplicateBehaviorAttachment:`PLAY0340`,UnknownMatchPattern:`PLAY0366`,InvalidMatchPattern:`PLAY0367`,PatternOutsidePortableMatchDialect:`PLAY0699`,AmbiguousMatchPattern:`PLAY0803`,ContextSourcedPerformedQueryArgument:`PLAY0810`,DeprecatedStudioTextRulePattern:`PLAY0787`,InvalidIdentityDeclaration:`PLAY0633`,DuplicateIdentity:`PLAY0634`,InvalidIdentityDetail:`PLAY0635`,UnknownIdentitySource:`PLAY0636`,IdentityDetailWithoutSource:`PLAY0637`,IdentitySourceWithBody:`PLAY0638`,DuplicateIdentityDetail:`PLAY0639`,BuiltInIdentityDetail:`PLAY0640`,UnknownIdentityQuery:`PLAY0641`,InvalidIdentityQuery:`PLAY0642`,IdentityQueryWithoutKey:`PLAY0643`,InvalidIdentityQueryKey:`PLAY0644`,IdentityQueryAuthorizationDependency:`PLAY0645`,IdentityQueryTypeMismatch:`PLAY0646`,InvalidReactionIdentity:`PLAY0647`,GatedInvocationWithoutIdentity:`PLAY0648`,UnusedReactionIdentity:`PLAY0649`,UnusedReactionRole:`PLAY0650`,UnsatisfiedReactionIdentity:`PLAY0651`,ReactionPrivilegeEscalation:`PLAY0652`,CommandProducesPublicEvent:`PLAY0607`,PublicEventRequiresOutboundTranslation:`PLAY0608`,OutboundPublicEventCount:`PLAY0609`,ForeignPublicEventConsumer:`PLAY0610`,OutboundTranslationInput:`PLAY0611`,InboundTranslationOutput:`PLAY0612`,ForeignPublicEventProduced:`PLAY0613`,PublicTranslationRequiresDirection:`PLAY0614`,TranslationConstructDirection:`PLAY0615`,InboundTranslationInput:`PLAY0616`,OutboundTranslationOutput:`PLAY0617`,EventTargetOutsideOutboundTranslation:`PLAY0618`,EventsSourceOutsideInboundTranslation:`PLAY0619`,InvalidCaptureEventsSource:`PLAY0620`,CaptureEventsFromSeveralOrigins:`PLAY0687`,DirectionlessTranslationReactsToOwnCapture:`PLAY0694`,PendingIntentWithOtherHandler:`PLAY0698`,CommandHandlerRequiresAttachment:`PLAY0800`,DescribedCommandNotImplemented:`PLAY0695`,DescribedCommandWithoutProductions:`PLAY0696`,DescribedCommandCardinalityNotAdmitted:`PLAY0697`,CaptureEventsKeyNotRequired:`PLAY0700`,CaptureEventSourceKeyOutsideEvents:`PLAY0809`,CaptureEventsRecordFixture:`PLAY0701`,RefutedGeneratedConceptRule:`PLAY0688`,UnprovenGeneratedConceptRule:`PLAY0689`,InvalidExposureDeclaration:`PLAY0621`,UnknownExposureOwner:`PLAY0622`,ReExposureCycle:`PLAY0623`,ReExposureBroken:`PLAY0624`,InvalidInstanceContribution:`PLAY0625`,UnknownContributionInstance:`PLAY0626`,ContributionNotExposed:`PLAY0627`,ContributionTypeMismatch:`PLAY0628`,UnknownTemplateContentSlot:`PLAY0629`,UnknownNavigationOutlet:`PLAY0630`,TemplateScopeMismatch:`PLAY0631`,IncompatibleComponentPackage:`PLAY0632`,UnknownNavigationDestination:`PLAY0654`,UnknownScreenContributionPoint:`PLAY0655`,TemplateNestingCycle:`PLAY0656`,TemplateCategoryMissing:`PLAY0720`,InvalidTemplateVersionRange:`PLAY0721`,LegacyProfileLayout:`PLAY0791`,UnknownTemplateBlueprint:`PLAY0722`,DuplicateComplianceMarker:`PLAY0653`,LegacyComplianceMarker:`PLAY0565`,UnknownComplianceMarker:`PLAY0566`,InvalidSecretScope:`PLAY0567`,DuplicateSecretScope:`PLAY0568`,SecretScopeIgnoredForPii:`PLAY0569`,InvalidPersonalDataQualifier:`PLAY0570`,DuplicateSpecialCategory:`PLAY0571`,InvalidPurposeDeclaration:`PLAY0596`,InvalidPurposeVocabulary:`PLAY0597`,DuplicatePurposeField:`PLAY0598`,DuplicatePurposeDeclaration:`PLAY0599`,UnknownPurpose:`PLAY0600`,PurposeInterestMismatch:`PLAY0601`,PersonalDataWithoutPurpose:`PLAY0602`,SpecialDataWithoutCondition:`PLAY0603`,CriminalDataWithoutAuthorization:`PLAY0604`,PurposeWithoutBasis:`PLAY0605`,UnusedPurpose:`PLAY0606`,ConflictingScreenDataBinding:`PLAY0530`,ScreenDataQueryMismatch:`PLAY0531`,ActionWithoutInputSurface:`PLAY0532`,CommandWithoutInputSurface:`PLAY0533`,ReadModelFieldWithoutOrigin:`PLAY0534`,QueryParameterNotHeldByView:`PLAY0535`,UnconsumedEvent:`PLAY0536`,UnreachableScreen:`PLAY0537`,UnknownActionSubjectField:`PLAY0345`,UnresolvedActionSubject:`PLAY0346`,UnreachableActionAlternative:`PLAY0347`,UnknownActionArgumentProperty:`PLAY0348`,UnreachableRefusalBranch:`PLAY0540`,InvalidRefusalValue:`PLAY0541`,UnknownRefusalConstraint:`PLAY0542`,UnknownRedeliveryReaction:`PLAY0544`,IndeterminateNegatedClaimTarget:`PLAY0546`,InvalidRefusalBranch:`PLAY0538`,InvalidRefusalBranchBody:`PLAY0539`,UnmatchedRedeliveredOccurrence:`PLAY0543`,InvalidNoEventsExpectation:`PLAY0545`,InvalidProducesDeclaration:`PLAY0042`,ProducesWhenWithoutEvent:`PLAY0043`,InvalidPropertyMapping:`PLAY0044`,DuplicateProducesTarget:`PLAY0193`,EventSourceIdInPayload:`PLAY0469`,ExplicitProducesTargetsRequired:`PLAY0470`,RedundantEventId:`PLAY0471`,InvalidEventId:`PLAY0472`,InlineEventCollision:`PLAY0473`,InlineEventOutsideCommand:`PLAY0474`,InlineEventGeneration:`PLAY0475`,ReservedProductionMetadata:`PLAY0476`,InvalidEventDocumentation:`PLAY0477`,OmittedProductionDestination:`PLAY0478`,UnknownConstraintProperty:`PLAY0391`,UnknownTopLevelConstruct:`PLAY0001`,InvalidDomainDeclaration:`PLAY0002`,DuplicateDomain:`PLAY0003`,DomainNotFirst:`PLAY0004`,InvalidImportDeclaration:`PLAY0005`,TabIndentation:`PLAY0006`,InvalidConceptDeclaration:`PLAY0007`,UnknownPrimitiveType:`PLAY0008`,InvalidEnumerationValue:`PLAY0009`,UnknownConceptDirective:`PLAY0010`,ValidateReadAsEnumerationBlock:`PLAY0011`,AttributeReasonWithoutAttribute:`PLAY0012`,DuplicateAttributeReason:`PLAY0013`,InvalidTypeDeclaration:`PLAY0014`,TypeWithoutProperties:`PLAY0015`,InvalidPropertyDeclaration:`PLAY0016`,IdentifierOutsideCommand:`PLAY0017`,InvalidEventDeclaration:`PLAY0018`,IdentifierOnEventProperty:`PLAY0019`,TagPropertyReadAsTag:`PLAY0020`,InvalidModuleDeclaration:`PLAY0021`,UnknownModuleDirective:`PLAY0022`,InvalidFeatureDeclaration:`PLAY0023`,UnknownFeatureDirective:`PLAY0024`,InvalidSliceDeclaration:`PLAY0027`,UnknownSliceType:`PLAY0028`,UnknownSliceDirective:`PLAY0029`,InvalidPersonaDeclaration:`PLAY0030`,InvalidPersonaPolicyReference:`PLAY0031`,UnknownPersonaDirective:`PLAY0032`,InvalidCommandDeclaration:`PLAY0033`,UnknownCommandDirective:`PLAY0034`,DuplicateCommandIdentifier:`PLAY0036`,InvalidQueryDeclaration:`PLAY0047`,UnknownQueryDirective:`PLAY0048`,InvalidQueryParameter:`PLAY0049`,InvalidProjectionDeclaration:`PLAY0056`,EmptyProjection:`PLAY0057`,UnknownProjectionDirective:`PLAY0058`,FromWithoutEvent:`PLAY0061`,InvalidEventReference:`PLAY0062`,InvalidJoinDeclaration:`PLAY0063`,JoinWithoutEvent:`PLAY0064`,InvalidChildrenDeclaration:`PLAY0065`,InvalidNestedDeclaration:`PLAY0066`,NestedBlockWithoutFrom:`PLAY0067`,InvalidRemoveDeclaration:`PLAY0068`,UnknownRemoveDirective:`PLAY0069`,InvalidClearDeclaration:`PLAY0070`,ClearWithOutsideNestedBlock:`PLAY0071`,InvalidSpecificationDeclaration:`PLAY0094`,UnknownSpecificationDirective:`PLAY0095`,InvalidSpecificationWhen:`PLAY0096`,DuplicateSpecificationWhen:`PLAY0097`,InvalidThenError:`PLAY0098`,InvalidReadModelStep:`PLAY0099`,InvalidEventStep:`PLAY0100`,InvalidSpecificationValue:`PLAY0101`,InvalidScreenDeclaration:`PLAY0102`,UnknownScreenDirective:`PLAY0103`,InvalidDataDirective:`PLAY0104`,InvalidActionDirective:`PLAY0105`,UnknownActionDirective:`PLAY0106`,InvalidNavigation:`PLAY0107`,InvalidScreenLayoutSlot:`PLAY0108`,UnknownLayoutDirective:`PLAY0026`,InvalidTitleDirective:`PLAY0109`,UnknownTableDirective:`PLAY0110`,UnknownSummaryDirective:`PLAY0111`,AuthorizeWithoutPolicy:`PLAY0122`,InvalidPolicyReference:`PLAY0123`,InvalidConstraintDeclaration:`PLAY0132`,ConstraintWithoutRule:`PLAY0133`,InvalidConstraintBody:`PLAY0134`,DuplicateConstraintBody:`PLAY0135`,InvalidReactionDeclaration:`PLAY0136`,InvalidReactionTrigger:`PLAY0137`,ReactionWithoutTrigger:`PLAY0138`,InvalidValidateDeclaration:`PLAY0140`,InvalidValidationRule:`PLAY0141`,InvalidRuleName:`PLAY0143`,UnknownRuleImplementationDirective:`PLAY0144`,InvalidDescription:`PLAY0145`,EmptyDescription:`PLAY0146`,DuplicateDescription:`PLAY0147`,TagWithoutValue:`PLAY0148`,InvalidTagValue:`PLAY0149`,UnknownContextPath:`PLAY0153`,UnknownContextCausedByProperty:`PLAY0154`,UnknownContextIdentityProperty:`PLAY0155`,ExpectedCodeFence:`PLAY0163`,UnclosedCodeBlock:`PLAY0164`,DuplicateDeclaration:`PLAY0168`,RepeatedSingularDeclarationAcrossFiles:`PLAY0172`,RepeatedDeclarationAcrossFiles:`PLAY0173`,ConflictingDescriptionAcrossFiles:`PLAY0174`,UnexpectedTokenInAuthorize:`PLAY0184`,UnclosedAuthorizeGroup:`PLAY0185`,InvalidReadModelDeclaration:`PLAY0186`,InvalidInvokesDeclaration:`PLAY0194`,InvalidScopeDeclaration:`PLAY0199`,DuplicateScope:`PLAY0200`,InvalidIntervalTrigger:`PLAY0249`,InvalidScheduleTrigger:`PLAY0250`,DuplicateReactionTrigger:`PLAY0253`,InvalidSpecificationEventSource:`PLAY0275`,DuplicateSpecificationEventSource:`PLAY0276`,InvalidProjectionVariantDeclaration:`PLAY0277`,InvalidEntersOnDeclaration:`PLAY0279`,NestedProjectionVariantNotAllowed:`PLAY0280`,InvalidStructuredValue:`PLAY0291`,DuplicateStructuredValueMember:`PLAY0294`,ConflictingSpecificationActions:`PLAY0358`,InvalidSpecificationEventOrder:`PLAY0359`,InvalidValidationSeverity:`PLAY0368`,VariantRequiresEnteringEvent:`PLAY0382`,DuplicateEventInProjectionScope:`PLAY0801`,ReservedStoredName:`PLAY0802`,DuplicateProjectionVariant:`PLAY0384`,DuplicateVariantEnteringEvent:`PLAY0385`,InvalidSpecificationDenied:`PLAY0388`,DuplicateAuthorizationAcrossFiles:`PLAY0394`,FileConstraintOnlySupportsUniqueness:`PLAY0396`,LegacyInlineCodeFence:`PLAY0397`,InvalidEventGeneration:`PLAY0446`,InvalidFileImport:`PLAY0454`,FileImportMatchesNothing:`PLAY0455`,ImportedFileNotFound:`PLAY0456`,ConflictingImportPlacement:`PLAY0457`,ImportCycle:`PLAY0458`,ModuleInPlacedFile:`PLAY0459`,UnexpectedInPlacedFile:`PLAY0460`,InvalidSpecificationClock:`PLAY0461`,InvalidSpecificationTrigger:`PLAY0462`,InvalidSpecificationCapture:`PLAY0463`,InvalidSpecificationQueryAction:`PLAY0464`,MismatchedSpecificationQueryResult:`PLAY0465`,UnknownSpecificationQueryArgument:`PLAY0468`,InvalidSpecificationQuery:`PLAY0265`,UnknownSpecificationQueryDirective:`PLAY0266`,DuplicateSpecificationQueryArguments:`PLAY0267`,InvalidAbsentReadModelStep:`PLAY0453`,LegacyOptionalSuffix:`PLAY0479`,InvalidOptionalModifierOrder:`PLAY0480`,OptionalReadsNotSupported:`PLAY0481`,InvalidSpecificationCaller:`PLAY0386`,DuplicateSpecificationCallerOrDenied:`PLAY0387`,GeneratedPropertyOutsideCommand:`PLAY0482`,InvalidGeneratedType:`PLAY0483`,InvalidGeneratedModifierOrder:`PLAY0484`,DuplicateEventSubject:`PLAY0590`,InvalidSubjectType:`PLAY0591`,ProtectedSubjectType:`PLAY0592`,InvalidSubjectOwner:`PLAY0593`,ReadModelSubjectNotSupported:`PLAY0594`,InvalidSubjectModifierOrder:`PLAY0595`,GeneratedPropertySuppliedAsInput:`PLAY0485`,InvalidCommandResponse:`PLAY0486`,InvalidResponseSource:`PLAY0487`,DuplicateResponseField:`PLAY0488`,InvalidResponseShape:`PLAY0489`,InvalidGeneratedFixture:`PLAY0490`,InvalidReturnExpectation:`PLAY0491`,InvalidImplementationBlock:`PLAY0492`,InvalidImplementationHint:`PLAY0493`,ConflictingImplementationSources:`PLAY0494`,UnknownType:`PLAY0165`,InvalidSystemDeclaration:`PLAY0495`,InvalidOperationDeclaration:`PLAY0496`,InvalidProductionReference:`PLAY0497`,ProductionDeclarationCollision:`PLAY0498`,OperationOutsideCommand:`PLAY0499`,InvalidSystemReference:`PLAY0500`,InvalidOperationMapping:`PLAY0501`,InvalidOperationSpecification:`PLAY0502`,InvalidCaptureDeclaration:`PLAY0078`,UnknownCaptureDirective:`PLAY0079`,InvalidMapEntry:`PLAY0080`,InvalidTranslation:`PLAY0081`,InvalidSplitDeclaration:`PLAY0082`,InvalidSplitTarget:`PLAY0083`,InvalidAppendDeclaration:`PLAY0084`,UnknownAppendDirective:`PLAY0085`,WhenWithoutTrigger:`PLAY0086`,InvalidWhenClause:`PLAY0087`,InvalidWhenTransitionClause:`PLAY0088`,MixedWhenCombinators:`PLAY0089`,WhenCombinatorWithoutProperty:`PLAY0090`,UnknownCaptureBlockDirective:`PLAY0091`,InvalidCompositeKeyPart:`PLAY0072`,TemplateInCompositeKey:`PLAY0073`,EmptyCompositeKey:`PLAY0074`,InvalidProjectionMapping:`PLAY0075`,ExpectedLiteralValue:`PLAY0150`,InvalidExpression:`PLAY0152`,UnterminatedInterpolation:`PLAY0157`,UnterminatedTemplateExpression:`PLAY0156`,ProjectionDocumentWithoutProjection:`PLAY0055`,CaptureDocumentWithoutCapture:`PLAY0077`,SpecificationDocumentWithoutSpecification:`PLAY0093`,InvalidSeedDeclaration:`PLAY0128`,InvalidSeedGroup:`PLAY0129`,InvalidSeedEvent:`PLAY0130`,InvalidSeedPropertyAssignment:`PLAY0131`,InvalidPolicyDeclaration:`PLAY0112`,UnknownPolicyDirective:`PLAY0113`,PolicyWithoutRequirement:`PLAY0114`,ExpectedRoleName:`PLAY0118`,ExpectedClaimName:`PLAY0119`,ExpectedClaimMatches:`PLAY0120`,ExpectedClaimMatchTarget:`PLAY0121`,MixedPolicyImplementation:`PLAY0440`,RepeatedPolicyRequirement:`PLAY0441`,AnonymousPolicyCombined:`PLAY0804`,NegatedAnonymousPolicy:`PLAY0805`,UnexpectedTokenInPolicyCondition:`PLAY0115`,ExpectedPolicyCondition:`PLAY0116`,UnclosedPolicyConditionGroup:`PLAY0117`,UnexpectedTokenInCondition:`PLAY0158`,ExpectedCondition:`PLAY0159`,ExpectedComparisonOperator:`PLAY0161`,ExpectedComparisonValue:`PLAY0162`,InvalidActionAlternative:`PLAY0341`,GuardedActionWithoutAlternatives:`PLAY0342`,MisplacedActionOtherwise:`PLAY0343`,UnsupportedActionConditionOperand:`PLAY0344`,InvalidInteractionArgument:`PLAY0319`,UnclosedConditionGroup:`PLAY0160`,InvalidNumericDirective:`PLAY0508`,DuplicateNumericDirective:`PLAY0509`,LateNumericDirective:`PLAY0510`,InexactNumericLiteral:`PLAY0511`,MixedNumericModes:`PLAY0512`,IncompatibleNumericSource:`PLAY0513`,EventFromLaterSlice:`PLAY0516`,TimelineCycleGroup:`PLAY0517`,InvalidSpecificationExample:`PLAY0518`,DuplicateSpecificationAssignment:`PLAY0519`,UnresolvedSpecificationExampleType:`PLAY0520`,SpecificationExampleNameCollision:`PLAY0521`,SpecificationExampleKindMismatch:`PLAY0522`,InvalidSpecificationExampleValue:`PLAY0523`,MissingSpecificationProperty:`PLAY0524`,UnadmittedSpecificationExampleValue:`PLAY0525`,InvalidSpecificationExampleBody:`PLAY0526`,AmbiguousReference:`PLAY0198`,InvalidSpecificationStream:`PLAY0547`,SpecificationStreamOnCommand:`PLAY0548`,InvalidSpecificationStreamRoute:`PLAY0549`,InvalidSpecificationStreamEventSource:`PLAY0550`,SpecificationStreamContradictsCommand:`PLAY0551`,InvalidDependencyTarget:`PLAY0554`,RepeatedDependencyDeclaration:`PLAY0555`,UndeclaredDependency:`PLAY0552`,UnusedDependencyDeclaration:`PLAY0553`,MutualDependencyDeclarations:`PLAY0556`,AuthorizationRefusalWithoutIdentity:`PLAY0557`,InvalidDocumentation:`PLAY0558`,ConflictingDocumentationAcrossFiles:`PLAY0559`,InvalidSpecificationCallerPersona:`PLAY0572`,UnsynthesizablePersonaCaller:`PLAY0573`,PersonaWithoutGate:`PLAY0574`,GateWithoutPersona:`PLAY0575`,AmbiguousPersonaCaller:`PLAY0576`,InvalidSpecificationParameter:`PLAY0577`,InvalidSpecificationCase:`PLAY0578`,DuplicateSpecificationParameter:`PLAY0579`,DuplicateSpecificationCase:`PLAY0580`,IncompleteSpecificationTable:`PLAY0581`,InvalidSpecificationCaseAssignment:`PLAY0582`,InvalidSpecificationCaseValue:`PLAY0583`,InvalidSpecificationCaseReference:`PLAY0584`,OptionalSpecificationParameterTarget:`PLAY0585`,SpecificationCaseNameCollision:`PLAY0586`,IncompatibleSpecificationParameterType:`PLAY0587`,UnusedSpecificationParameter:`PLAY0588`,SingularSpecificationTableExpansion:`PLAY0589`,UnsupportedInteractionAlternatives:`PLAY0560`,MixedInteractionAlternatives:`PLAY0561`,InteractionAlternativeWithoutActions:`PLAY0562`,InlineInteractionAlternative:`PLAY0563`,LegacyInteractionWhere:`PLAY0564`,InvalidEventSourceDeclaration:`PLAY0503`,InvalidCommandStream:`PLAY0504`,AmbiguousCommandStream:`PLAY0505`,UnsupportedStreamIdType:`PLAY0506`,RedundantSourceStreamId:`PLAY0507`,UnknownEvent:`PLAY0166`,UnknownReadModelProperty:`PLAY0514`,PiiNotSupportedOnIdentifier:`PLAY0515`,HandlerWithoutImplementation:`PLAY0045`,UnknownHandlerDirective:`PLAY0046`,CommandWithProducesAndHandler:`PLAY0035`,AbsoluteFileReference:`PLAY0264`,InvalidTriggerData:`PLAY0246`,InvalidReadModelKey:`PLAY0660`,IncompleteReadModelKey:`PLAY0661`,InvalidReadModelKeyLookup:`PLAY0662`,ProductionRouteOutsideCommand:`PLAY0663`,RedundantProductionRoute:`PLAY0664`,InvalidObserverFilter:`PLAY0665`,ObserverFilterExcludesEveryProducer:`PLAY0666`,ReducerIdentityMismatch:`PLAY0690`,InvalidReactionBatchesDeclaration:`PLAY0693`,InvalidCommandReadsDeclaration:`PLAY0780`,InvalidTimeZoneDeclaration:`PLAY0812`,InvalidCommandCalendar:`PLAY0813`,InvalidSpecificationTimeZone:`PLAY0814`,InvalidSpecificationInvocation:`PLAY0815`,UnreachableSpecificationInvocation:`PLAY0816`,GenerationSupportBudgetExceeded:`PLAY0691`,EmptyGenerationSupport:`PLAY0692`,MixedEnumerationNumbering:`PLAY0667`,DuplicateEnumerationNumber:`PLAY0668`,EnumerationNumberOutsideInt32:`PLAY0669`,MalformedEnumerationNumber:`PLAY0670`,UnpinnedStoredEnumeration:`PLAY0671`,ReadsWithChildren:`PLAY0451`,UnknownGenerationStrategy:`PLAY0672`,InvalidGenerationArgument:`PLAY0673`,InvalidGenerationModifier:`PLAY0674`,DuplicateGenerationModifier:`PLAY0675`,DuplicateGeneration:`PLAY0676`,InvalidGenerationPrimitive:`PLAY0677`,InvalidGenerationPrefix:`PLAY0678`,InvalidGenerationAlphabet:`PLAY0679`,InvalidTypeIdPrefix:`PLAY0680`,GenerationSizeOutsideRange:`PLAY0681`,ReservedSequenceGeneration:`PLAY0682`,LowGenerationEntropy:`PLAY0683`,LowGeneratedIdentifierEntropy:`PLAY0684`,ResponseNameUsedOnFailure:`PLAY0685`,EventIdPinNotCarriedToRenderers:`PLAY0686`,InvalidToolbarButton:`PLAY0760`,InvalidPossibleEventsDeclaration:`PLAY0822`,InvalidPossibleEventSet:`PLAY0823`,RedundantCompositeKeyBraces:`PLAY0824`,ImplicitAuthorizationConjunction:`PLAY0825`,InvalidOnboardingDeclaration:`PLAY0826`,DuplicateOnboarding:`PLAY0827`,OnboardingWithoutAuthentication:`PLAY0828`,InvalidOnboardingDirective:`PLAY0829`,DuplicateOnboardingDirective:`PLAY0830`,UnknownOnboardingPersona:`PLAY0831`,UnknownOnboardingEmail:`PLAY0832`};export{e as DiagnosticCodes};
|
|
1
|
+
const e={InvalidSemanticBinding:`PLAY0273`,InvalidActionSubjectClause:`PLAY0817`,InferredActionSubject:`PLAY0818`,ChangedActionSubject:`PLAY0819`,AmbiguousActionInputBinding:`PLAY0820`,UnsupportedActionSubjectContext:`PLAY0821`,DuplicateBehaviorAttachment:`PLAY0340`,UnknownMatchPattern:`PLAY0366`,InvalidMatchPattern:`PLAY0367`,PatternOutsidePortableMatchDialect:`PLAY0699`,AmbiguousMatchPattern:`PLAY0803`,ContextSourcedPerformedQueryArgument:`PLAY0810`,DeprecatedStudioTextRulePattern:`PLAY0787`,InvalidIdentityDeclaration:`PLAY0633`,DuplicateIdentity:`PLAY0634`,InvalidIdentityDetail:`PLAY0635`,UnknownIdentitySource:`PLAY0636`,IdentityDetailWithoutSource:`PLAY0637`,IdentitySourceWithBody:`PLAY0638`,DuplicateIdentityDetail:`PLAY0639`,BuiltInIdentityDetail:`PLAY0640`,UnknownIdentityQuery:`PLAY0641`,InvalidIdentityQuery:`PLAY0642`,IdentityQueryWithoutKey:`PLAY0643`,InvalidIdentityQueryKey:`PLAY0644`,IdentityQueryAuthorizationDependency:`PLAY0645`,IdentityQueryTypeMismatch:`PLAY0646`,InvalidReactionIdentity:`PLAY0647`,GatedInvocationWithoutIdentity:`PLAY0648`,UnusedReactionIdentity:`PLAY0649`,UnusedReactionRole:`PLAY0650`,UnsatisfiedReactionIdentity:`PLAY0651`,ReactionPrivilegeEscalation:`PLAY0652`,CommandProducesPublicEvent:`PLAY0607`,PublicEventRequiresOutboundTranslation:`PLAY0608`,OutboundPublicEventCount:`PLAY0609`,ForeignPublicEventConsumer:`PLAY0610`,OutboundTranslationInput:`PLAY0611`,InboundTranslationOutput:`PLAY0612`,ForeignPublicEventProduced:`PLAY0613`,PublicTranslationRequiresDirection:`PLAY0614`,TranslationConstructDirection:`PLAY0615`,InboundTranslationInput:`PLAY0616`,OutboundTranslationOutput:`PLAY0617`,EventTargetOutsideOutboundTranslation:`PLAY0618`,EventsSourceOutsideInboundTranslation:`PLAY0619`,InvalidCaptureEventsSource:`PLAY0620`,CaptureEventsFromSeveralOrigins:`PLAY0687`,DirectionlessTranslationReactsToOwnCapture:`PLAY0694`,PendingIntentWithOtherHandler:`PLAY0698`,CommandHandlerRequiresAttachment:`PLAY0800`,DescribedCommandNotImplemented:`PLAY0695`,DescribedCommandWithoutProductions:`PLAY0696`,DescribedCommandCardinalityNotAdmitted:`PLAY0697`,CaptureEventsKeyNotRequired:`PLAY0700`,CaptureEventSourceKeyOutsideEvents:`PLAY0809`,CaptureEventsRecordFixture:`PLAY0701`,RefutedGeneratedConceptRule:`PLAY0688`,UnprovenGeneratedConceptRule:`PLAY0689`,InvalidExposureDeclaration:`PLAY0621`,UnknownExposureOwner:`PLAY0622`,ReExposureCycle:`PLAY0623`,ReExposureBroken:`PLAY0624`,InvalidInstanceContribution:`PLAY0625`,UnknownContributionInstance:`PLAY0626`,ContributionNotExposed:`PLAY0627`,ContributionTypeMismatch:`PLAY0628`,UnknownTemplateContentSlot:`PLAY0629`,UnknownNavigationOutlet:`PLAY0630`,TemplateScopeMismatch:`PLAY0631`,IncompatibleComponentPackage:`PLAY0632`,UnknownNavigationDestination:`PLAY0654`,UnknownScreenContributionPoint:`PLAY0655`,TemplateNestingCycle:`PLAY0656`,TemplateCategoryMissing:`PLAY0720`,InvalidTemplateVersionRange:`PLAY0721`,LegacyProfileLayout:`PLAY0791`,UnknownTemplateBlueprint:`PLAY0722`,DuplicateComplianceMarker:`PLAY0653`,LegacyComplianceMarker:`PLAY0565`,UnknownComplianceMarker:`PLAY0566`,InvalidSecretScope:`PLAY0567`,DuplicateSecretScope:`PLAY0568`,SecretScopeIgnoredForPii:`PLAY0569`,InvalidPersonalDataQualifier:`PLAY0570`,DuplicateSpecialCategory:`PLAY0571`,InvalidPurposeDeclaration:`PLAY0596`,InvalidPurposeVocabulary:`PLAY0597`,DuplicatePurposeField:`PLAY0598`,DuplicatePurposeDeclaration:`PLAY0599`,UnknownPurpose:`PLAY0600`,PurposeInterestMismatch:`PLAY0601`,PersonalDataWithoutPurpose:`PLAY0602`,SpecialDataWithoutCondition:`PLAY0603`,CriminalDataWithoutAuthorization:`PLAY0604`,PurposeWithoutBasis:`PLAY0605`,UnusedPurpose:`PLAY0606`,ConflictingScreenDataBinding:`PLAY0530`,ScreenDataQueryMismatch:`PLAY0531`,ActionWithoutInputSurface:`PLAY0532`,CommandWithoutInputSurface:`PLAY0533`,ReadModelFieldWithoutOrigin:`PLAY0534`,QueryParameterNotHeldByView:`PLAY0535`,UnconsumedEvent:`PLAY0536`,UnreachableScreen:`PLAY0537`,UnknownActionSubjectField:`PLAY0345`,UnresolvedActionSubject:`PLAY0346`,UnreachableActionAlternative:`PLAY0347`,UnknownActionArgumentProperty:`PLAY0348`,UnreachableRefusalBranch:`PLAY0540`,InvalidRefusalValue:`PLAY0541`,UnknownRefusalConstraint:`PLAY0542`,UnknownRedeliveryReaction:`PLAY0544`,IndeterminateNegatedClaimTarget:`PLAY0546`,InvalidRefusalBranch:`PLAY0538`,InvalidRefusalBranchBody:`PLAY0539`,UnmatchedRedeliveredOccurrence:`PLAY0543`,InvalidNoEventsExpectation:`PLAY0545`,InvalidProducesDeclaration:`PLAY0042`,ProducesWhenWithoutEvent:`PLAY0043`,InvalidPropertyMapping:`PLAY0044`,DuplicateProducesTarget:`PLAY0193`,EventSourceIdInPayload:`PLAY0469`,ExplicitProducesTargetsRequired:`PLAY0470`,RedundantEventId:`PLAY0471`,InvalidEventId:`PLAY0472`,InlineEventCollision:`PLAY0473`,InlineEventOutsideCommand:`PLAY0474`,InlineEventGeneration:`PLAY0475`,ReservedProductionMetadata:`PLAY0476`,InvalidEventDocumentation:`PLAY0477`,OmittedProductionDestination:`PLAY0478`,UnknownConstraintProperty:`PLAY0391`,UnknownTopLevelConstruct:`PLAY0001`,InvalidDomainDeclaration:`PLAY0002`,DuplicateDomain:`PLAY0003`,DomainNotFirst:`PLAY0004`,InvalidImportDeclaration:`PLAY0005`,TabIndentation:`PLAY0006`,InvalidConceptDeclaration:`PLAY0007`,UnknownPrimitiveType:`PLAY0008`,InvalidEnumerationValue:`PLAY0009`,UnknownConceptDirective:`PLAY0010`,ValidateReadAsEnumerationBlock:`PLAY0011`,AttributeReasonWithoutAttribute:`PLAY0012`,DuplicateAttributeReason:`PLAY0013`,InvalidTypeDeclaration:`PLAY0014`,TypeWithoutProperties:`PLAY0015`,InvalidPropertyDeclaration:`PLAY0016`,IdentifierOutsideCommand:`PLAY0017`,InvalidEventDeclaration:`PLAY0018`,IdentifierOnEventProperty:`PLAY0019`,TagPropertyReadAsTag:`PLAY0020`,InvalidModuleDeclaration:`PLAY0021`,UnknownModuleDirective:`PLAY0022`,InvalidFeatureDeclaration:`PLAY0023`,UnknownFeatureDirective:`PLAY0024`,InvalidSliceDeclaration:`PLAY0027`,UnknownSliceType:`PLAY0028`,UnknownSliceDirective:`PLAY0029`,InvalidPersonaDeclaration:`PLAY0030`,InvalidPersonaPolicyReference:`PLAY0031`,UnknownPersonaDirective:`PLAY0032`,InvalidCommandDeclaration:`PLAY0033`,UnknownCommandDirective:`PLAY0034`,DuplicateCommandIdentifier:`PLAY0036`,InvalidQueryDeclaration:`PLAY0047`,UnknownQueryDirective:`PLAY0048`,InvalidQueryParameter:`PLAY0049`,InvalidProjectionDeclaration:`PLAY0056`,EmptyProjection:`PLAY0057`,UnknownProjectionDirective:`PLAY0058`,FromWithoutEvent:`PLAY0061`,InvalidEventReference:`PLAY0062`,InvalidJoinDeclaration:`PLAY0063`,JoinWithoutEvent:`PLAY0064`,InvalidChildrenDeclaration:`PLAY0065`,InvalidNestedDeclaration:`PLAY0066`,NestedBlockWithoutFrom:`PLAY0067`,InvalidRemoveDeclaration:`PLAY0068`,UnknownRemoveDirective:`PLAY0069`,InvalidClearDeclaration:`PLAY0070`,ClearWithOutsideNestedBlock:`PLAY0071`,InvalidSpecificationDeclaration:`PLAY0094`,UnknownSpecificationDirective:`PLAY0095`,InvalidSpecificationWhen:`PLAY0096`,DuplicateSpecificationWhen:`PLAY0097`,InvalidThenError:`PLAY0098`,InvalidReadModelStep:`PLAY0099`,InvalidEventStep:`PLAY0100`,InvalidSpecificationValue:`PLAY0101`,InvalidScreenDeclaration:`PLAY0102`,UnknownScreenDirective:`PLAY0103`,InvalidDataDirective:`PLAY0104`,InvalidActionDirective:`PLAY0105`,UnknownActionDirective:`PLAY0106`,InvalidNavigation:`PLAY0107`,InvalidScreenLayoutSlot:`PLAY0108`,UnknownLayoutDirective:`PLAY0026`,InvalidTitleDirective:`PLAY0109`,UnknownTableDirective:`PLAY0110`,UnknownSummaryDirective:`PLAY0111`,AuthorizeWithoutPolicy:`PLAY0122`,InvalidPolicyReference:`PLAY0123`,InvalidConstraintDeclaration:`PLAY0132`,ConstraintWithoutRule:`PLAY0133`,InvalidConstraintBody:`PLAY0134`,DuplicateConstraintBody:`PLAY0135`,InvalidReactionDeclaration:`PLAY0136`,InvalidReactionTrigger:`PLAY0137`,ReactionWithoutTrigger:`PLAY0138`,InvalidValidateDeclaration:`PLAY0140`,InvalidValidationRule:`PLAY0141`,InvalidRuleName:`PLAY0143`,UnknownRuleImplementationDirective:`PLAY0144`,InvalidDescription:`PLAY0145`,EmptyDescription:`PLAY0146`,DuplicateDescription:`PLAY0147`,TagWithoutValue:`PLAY0148`,InvalidTagValue:`PLAY0149`,UnknownContextPath:`PLAY0153`,UnknownContextCausedByProperty:`PLAY0154`,UnknownContextIdentityProperty:`PLAY0155`,ExpectedCodeFence:`PLAY0163`,UnclosedCodeBlock:`PLAY0164`,DuplicateDeclaration:`PLAY0168`,RepeatedSingularDeclarationAcrossFiles:`PLAY0172`,RepeatedDeclarationAcrossFiles:`PLAY0173`,ConflictingDescriptionAcrossFiles:`PLAY0174`,UnexpectedTokenInAuthorize:`PLAY0184`,UnclosedAuthorizeGroup:`PLAY0185`,InvalidReadModelDeclaration:`PLAY0186`,InvalidInvokesDeclaration:`PLAY0194`,InvalidScopeDeclaration:`PLAY0199`,DuplicateScope:`PLAY0200`,InvalidIntervalTrigger:`PLAY0249`,InvalidScheduleTrigger:`PLAY0250`,DuplicateReactionTrigger:`PLAY0253`,InvalidSpecificationEventSource:`PLAY0275`,DuplicateSpecificationEventSource:`PLAY0276`,InvalidProjectionVariantDeclaration:`PLAY0277`,InvalidEntersOnDeclaration:`PLAY0279`,NestedProjectionVariantNotAllowed:`PLAY0280`,InvalidStructuredValue:`PLAY0291`,DuplicateStructuredValueMember:`PLAY0294`,ConflictingSpecificationActions:`PLAY0358`,InvalidSpecificationEventOrder:`PLAY0359`,InvalidValidationSeverity:`PLAY0368`,VariantRequiresEnteringEvent:`PLAY0382`,DuplicateEventInProjectionScope:`PLAY0801`,ReservedStoredName:`PLAY0802`,DuplicateProjectionVariant:`PLAY0384`,DuplicateVariantEnteringEvent:`PLAY0385`,InvalidSpecificationDenied:`PLAY0388`,DuplicateAuthorizationAcrossFiles:`PLAY0394`,FileConstraintOnlySupportsUniqueness:`PLAY0396`,LegacyInlineCodeFence:`PLAY0397`,InvalidEventGeneration:`PLAY0446`,InvalidFileImport:`PLAY0454`,FileImportMatchesNothing:`PLAY0455`,ImportedFileNotFound:`PLAY0456`,ConflictingImportPlacement:`PLAY0457`,ImportCycle:`PLAY0458`,ModuleInPlacedFile:`PLAY0459`,UnexpectedInPlacedFile:`PLAY0460`,InvalidSpecificationClock:`PLAY0461`,InvalidSpecificationTrigger:`PLAY0462`,InvalidSpecificationCapture:`PLAY0463`,InvalidSpecificationQueryAction:`PLAY0464`,MismatchedSpecificationQueryResult:`PLAY0465`,UnknownSpecificationQueryArgument:`PLAY0468`,InvalidSpecificationQuery:`PLAY0265`,UnknownSpecificationQueryDirective:`PLAY0266`,DuplicateSpecificationQueryArguments:`PLAY0267`,InvalidAbsentReadModelStep:`PLAY0453`,LegacyOptionalSuffix:`PLAY0479`,InvalidOptionalModifierOrder:`PLAY0480`,OptionalReadsNotSupported:`PLAY0481`,InvalidSpecificationCaller:`PLAY0386`,DuplicateSpecificationCallerOrDenied:`PLAY0387`,GeneratedPropertyOutsideCommand:`PLAY0482`,InvalidGeneratedType:`PLAY0483`,InvalidGeneratedModifierOrder:`PLAY0484`,DuplicateEventSubject:`PLAY0590`,InvalidSubjectType:`PLAY0591`,ProtectedSubjectType:`PLAY0592`,InvalidSubjectOwner:`PLAY0593`,ReadModelSubjectNotSupported:`PLAY0594`,InvalidSubjectModifierOrder:`PLAY0595`,GeneratedPropertySuppliedAsInput:`PLAY0485`,InvalidCommandResponse:`PLAY0486`,InvalidResponseSource:`PLAY0487`,DuplicateResponseField:`PLAY0488`,InvalidResponseShape:`PLAY0489`,InvalidGeneratedFixture:`PLAY0490`,InvalidReturnExpectation:`PLAY0491`,InvalidImplementationBlock:`PLAY0492`,InvalidImplementationHint:`PLAY0493`,ConflictingImplementationSources:`PLAY0494`,UnknownType:`PLAY0165`,InvalidSystemDeclaration:`PLAY0495`,InvalidOperationDeclaration:`PLAY0496`,InvalidProductionReference:`PLAY0497`,ProductionDeclarationCollision:`PLAY0498`,OperationOutsideCommand:`PLAY0499`,InvalidSystemReference:`PLAY0500`,InvalidOperationMapping:`PLAY0501`,InvalidOperationSpecification:`PLAY0502`,InvalidCaptureDeclaration:`PLAY0078`,UnknownCaptureDirective:`PLAY0079`,InvalidMapEntry:`PLAY0080`,InvalidTranslation:`PLAY0081`,InvalidSplitDeclaration:`PLAY0082`,InvalidSplitTarget:`PLAY0083`,InvalidAppendDeclaration:`PLAY0084`,UnknownAppendDirective:`PLAY0085`,WhenWithoutTrigger:`PLAY0086`,InvalidWhenClause:`PLAY0087`,InvalidWhenTransitionClause:`PLAY0088`,MixedWhenCombinators:`PLAY0089`,WhenCombinatorWithoutProperty:`PLAY0090`,UnknownCaptureBlockDirective:`PLAY0091`,InvalidCompositeKeyPart:`PLAY0072`,TemplateInCompositeKey:`PLAY0073`,EmptyCompositeKey:`PLAY0074`,InvalidProjectionMapping:`PLAY0075`,ExpectedLiteralValue:`PLAY0150`,InvalidExpression:`PLAY0152`,UnterminatedInterpolation:`PLAY0157`,UnterminatedTemplateExpression:`PLAY0156`,ProjectionDocumentWithoutProjection:`PLAY0055`,CaptureDocumentWithoutCapture:`PLAY0077`,SpecificationDocumentWithoutSpecification:`PLAY0093`,InvalidSeedDeclaration:`PLAY0128`,InvalidSeedGroup:`PLAY0129`,InvalidSeedEvent:`PLAY0130`,InvalidSeedPropertyAssignment:`PLAY0131`,InvalidPolicyDeclaration:`PLAY0112`,UnknownPolicyDirective:`PLAY0113`,PolicyWithoutRequirement:`PLAY0114`,ExpectedRoleName:`PLAY0118`,ExpectedClaimName:`PLAY0119`,ExpectedClaimMatches:`PLAY0120`,ExpectedClaimMatchTarget:`PLAY0121`,MixedPolicyImplementation:`PLAY0440`,RepeatedPolicyRequirement:`PLAY0441`,AnonymousPolicyCombined:`PLAY0804`,NegatedAnonymousPolicy:`PLAY0805`,UnexpectedTokenInPolicyCondition:`PLAY0115`,ExpectedPolicyCondition:`PLAY0116`,UnclosedPolicyConditionGroup:`PLAY0117`,UnexpectedTokenInCondition:`PLAY0158`,ExpectedCondition:`PLAY0159`,ExpectedComparisonOperator:`PLAY0161`,ExpectedComparisonValue:`PLAY0162`,InvalidActionAlternative:`PLAY0341`,GuardedActionWithoutAlternatives:`PLAY0342`,MisplacedActionOtherwise:`PLAY0343`,UnsupportedActionConditionOperand:`PLAY0344`,InvalidInteractionArgument:`PLAY0319`,UnclosedConditionGroup:`PLAY0160`,InvalidNumericDirective:`PLAY0508`,DuplicateNumericDirective:`PLAY0509`,LateNumericDirective:`PLAY0510`,InexactNumericLiteral:`PLAY0511`,MixedNumericModes:`PLAY0512`,IncompatibleNumericSource:`PLAY0513`,EventFromLaterSlice:`PLAY0516`,TimelineCycleGroup:`PLAY0517`,InvalidSpecificationExample:`PLAY0518`,DuplicateSpecificationAssignment:`PLAY0519`,UnresolvedSpecificationExampleType:`PLAY0520`,SpecificationExampleNameCollision:`PLAY0521`,SpecificationExampleKindMismatch:`PLAY0522`,InvalidSpecificationExampleValue:`PLAY0523`,MissingSpecificationProperty:`PLAY0524`,UnadmittedSpecificationExampleValue:`PLAY0525`,InvalidSpecificationExampleBody:`PLAY0526`,AmbiguousReference:`PLAY0198`,InvalidSpecificationStream:`PLAY0547`,SpecificationStreamOnCommand:`PLAY0548`,InvalidSpecificationStreamRoute:`PLAY0549`,InvalidSpecificationStreamEventSource:`PLAY0550`,SpecificationStreamContradictsCommand:`PLAY0551`,InvalidDependencyTarget:`PLAY0554`,RepeatedDependencyDeclaration:`PLAY0555`,UndeclaredDependency:`PLAY0552`,UnusedDependencyDeclaration:`PLAY0553`,MutualDependencyDeclarations:`PLAY0556`,AuthorizationRefusalWithoutIdentity:`PLAY0557`,InvalidDocumentation:`PLAY0558`,ConflictingDocumentationAcrossFiles:`PLAY0559`,InvalidSpecificationCallerPersona:`PLAY0572`,UnsynthesizablePersonaCaller:`PLAY0573`,PersonaWithoutGate:`PLAY0574`,GateWithoutPersona:`PLAY0575`,AmbiguousPersonaCaller:`PLAY0576`,InvalidSpecificationParameter:`PLAY0577`,InvalidSpecificationCase:`PLAY0578`,DuplicateSpecificationParameter:`PLAY0579`,DuplicateSpecificationCase:`PLAY0580`,IncompleteSpecificationTable:`PLAY0581`,InvalidSpecificationCaseAssignment:`PLAY0582`,InvalidSpecificationCaseValue:`PLAY0583`,InvalidSpecificationCaseReference:`PLAY0584`,OptionalSpecificationParameterTarget:`PLAY0585`,SpecificationCaseNameCollision:`PLAY0586`,IncompatibleSpecificationParameterType:`PLAY0587`,UnusedSpecificationParameter:`PLAY0588`,SingularSpecificationTableExpansion:`PLAY0589`,UnsupportedInteractionAlternatives:`PLAY0560`,MixedInteractionAlternatives:`PLAY0561`,InteractionAlternativeWithoutActions:`PLAY0562`,InlineInteractionAlternative:`PLAY0563`,LegacyInteractionWhere:`PLAY0564`,InvalidEventSourceDeclaration:`PLAY0503`,InvalidCommandStream:`PLAY0504`,AmbiguousCommandStream:`PLAY0505`,UnsupportedStreamIdType:`PLAY0506`,RedundantSourceStreamId:`PLAY0507`,UnknownEvent:`PLAY0166`,UnknownReadModelProperty:`PLAY0514`,PiiNotSupportedOnIdentifier:`PLAY0515`,HandlerWithoutImplementation:`PLAY0045`,UnknownHandlerDirective:`PLAY0046`,CommandWithProducesAndHandler:`PLAY0035`,AbsoluteFileReference:`PLAY0264`,InvalidTriggerData:`PLAY0246`,InvalidReadModelKey:`PLAY0660`,IncompleteReadModelKey:`PLAY0661`,InvalidReadModelKeyLookup:`PLAY0662`,ProductionRouteOutsideCommand:`PLAY0663`,RedundantProductionRoute:`PLAY0664`,InvalidObserverFilter:`PLAY0665`,ObserverFilterExcludesEveryProducer:`PLAY0666`,ReducerIdentityMismatch:`PLAY0690`,InvalidReactionBatchesDeclaration:`PLAY0693`,InvalidCommandReadsDeclaration:`PLAY0780`,InvalidTimeZoneDeclaration:`PLAY0812`,InvalidCommandCalendar:`PLAY0813`,InvalidSpecificationTimeZone:`PLAY0814`,InvalidSpecificationInvocation:`PLAY0815`,UnreachableSpecificationInvocation:`PLAY0816`,GenerationSupportBudgetExceeded:`PLAY0691`,EmptyGenerationSupport:`PLAY0692`,MixedEnumerationNumbering:`PLAY0667`,DuplicateEnumerationNumber:`PLAY0668`,EnumerationNumberOutsideInt32:`PLAY0669`,MalformedEnumerationNumber:`PLAY0670`,UnpinnedStoredEnumeration:`PLAY0671`,ReadsWithChildren:`PLAY0451`,UnknownGenerationStrategy:`PLAY0672`,InvalidGenerationArgument:`PLAY0673`,InvalidGenerationModifier:`PLAY0674`,DuplicateGenerationModifier:`PLAY0675`,DuplicateGeneration:`PLAY0676`,InvalidGenerationPrimitive:`PLAY0677`,InvalidGenerationPrefix:`PLAY0678`,InvalidGenerationAlphabet:`PLAY0679`,InvalidTypeIdPrefix:`PLAY0680`,GenerationSizeOutsideRange:`PLAY0681`,ReservedSequenceGeneration:`PLAY0682`,LowGenerationEntropy:`PLAY0683`,LowGeneratedIdentifierEntropy:`PLAY0684`,ResponseNameUsedOnFailure:`PLAY0685`,EventIdPinNotCarriedToRenderers:`PLAY0686`,InvalidToolbarButton:`PLAY0760`,InvalidPossibleEventsDeclaration:`PLAY0822`,InvalidPossibleEventSet:`PLAY0823`,RedundantCompositeKeyBraces:`PLAY0824`,ImplicitAuthorizationConjunction:`PLAY0825`,InvalidOnboardingDeclaration:`PLAY0826`,DuplicateOnboarding:`PLAY0827`,OnboardingWithoutAuthentication:`PLAY0828`,InvalidOnboardingDirective:`PLAY0829`,DuplicateOnboardingDirective:`PLAY0830`,UnknownOnboardingPersona:`PLAY0831`,UnknownOnboardingEmail:`PLAY0832`,InlineJsonValue:`PLAY0833`,InvalidStateMachineDeclaration:`PLAY0834`,StateMachineInitialState:`PLAY0835`,UnreachableState:`PLAY0836`,StateWithNoWayOut:`PLAY0837`,FinalStateWithTransitions:`PLAY0838`,UnknownState:`PLAY0839`,UnknownStateMachineReference:`PLAY0840`,UnknownConditionProperty:`PLAY0841`,AmbiguousStateTransitions:`PLAY0842`,InvalidWorkflowDeclaration:`PLAY0843`,WorkflowWithoutTrigger:`PLAY0844`,UnreachableWorkflowNode:`PLAY0845`,UnknownWorkflowNode:`PLAY0846`,UnknownWorkflowOutlet:`PLAY0847`,WorkflowDecisionOutletWithoutTarget:`PLAY0848`,WorkflowWithoutExpiry:`PLAY0849`,WorkflowJoinWithOneBranch:`PLAY0850`,UnknownWorkflowReference:`PLAY0851`};export{e as DiagnosticCodes};
|
|
2
2
|
//# sourceMappingURL=DiagnosticCodes.js.map
|