@cratis/screenplay-language 4.146.0 → 4.147.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.
Files changed (45) hide show
  1. package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js +1 -1
  2. package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js.map +1 -1
  3. package/dist/bundles/compiler/Parsing/GenerationParser.js +2 -0
  4. package/dist/bundles/compiler/Parsing/GenerationParser.js.map +1 -0
  5. package/dist/bundles/compiler/Parsing/ResponseValidator.js +1 -1
  6. package/dist/bundles/compiler/Parsing/ResponseValidator.js.map +1 -1
  7. package/dist/bundles/compiler/Parsing/ScreenplayParser.js +1 -1
  8. package/dist/bundles/compiler/Parsing/ScreenplayParser.js.map +1 -1
  9. package/dist/bundles/compiler/Syntax/ScreenplaySyntaxWalker.js +1 -1
  10. package/dist/bundles/compiler/Syntax/ScreenplaySyntaxWalker.js.map +1 -1
  11. package/dist/bundles/compiler/Syntax/SyntaxCollections.js +1 -1
  12. package/dist/bundles/compiler/Syntax/SyntaxCollections.js.map +1 -1
  13. package/dist/bundles/compiler/Syntax/SyntaxJson.js +1 -1
  14. package/dist/bundles/compiler/Syntax/SyntaxJson.js.map +1 -1
  15. package/dist/bundles/completion-items.js +1 -1
  16. package/dist/bundles/completion-items.js.map +1 -1
  17. package/dist/bundles/completion-planner.js +2 -2
  18. package/dist/bundles/completion-planner.js.map +1 -1
  19. package/dist/bundles/diagnostic-codes.js +1 -1
  20. package/dist/bundles/diagnostic-codes.js.map +1 -1
  21. package/dist/bundles/generation-completions.js +2 -0
  22. package/dist/bundles/generation-completions.js.map +1 -0
  23. package/dist/bundles/hover-content.js +5 -5
  24. package/dist/bundles/hover-content.js.map +1 -1
  25. package/dist/bundles/response-completions.js +1 -1
  26. package/dist/bundles/response-completions.js.map +1 -1
  27. package/dist/bundles/symbols.js +1 -1
  28. package/dist/bundles/symbols.js.map +1 -1
  29. package/dist/bundles/tokens.js +1 -1
  30. package/dist/bundles/tokens.js.map +1 -1
  31. package/dist/bundles/validation.js +1 -1
  32. package/dist/bundles/validation.js.map +1 -1
  33. package/dist/completion-items.d.ts.map +1 -1
  34. package/dist/completion-planner.d.ts.map +1 -1
  35. package/dist/diagnostic-codes.d.ts +13 -0
  36. package/dist/diagnostic-codes.d.ts.map +1 -1
  37. package/dist/generation-completions.d.ts +3 -0
  38. package/dist/generation-completions.d.ts.map +1 -0
  39. package/dist/hover-content.d.ts.map +1 -1
  40. package/dist/response-completions.d.ts.map +1 -1
  41. package/dist/symbols.d.ts +1 -0
  42. package/dist/symbols.d.ts.map +1 -1
  43. package/dist/tokens.d.ts.map +1 -1
  44. package/dist/validation.d.ts.map +1 -1
  45. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- const e={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`,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`,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`,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`,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`,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`,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`,MixedEnumerationNumbering:`PLAY0667`,DuplicateEnumerationNumber:`PLAY0668`,EnumerationNumberOutsideInt32:`PLAY0669`,MalformedEnumerationNumber:`PLAY0670`,UnpinnedStoredEnumeration:`PLAY0671`,ReadsWithChildren:`PLAY0451`};export{e as DiagnosticCodes};
1
+ const e={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`,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`,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`,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`,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`,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`,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`,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`};export{e as DiagnosticCodes};
2
2
  //# sourceMappingURL=DiagnosticCodes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DiagnosticCodes.js","names":["DiagnosticCodes"],"sources":["../../../../../../Compiler/Diagnostics/DiagnosticCodes.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\n// Shared diagnostic names, including the explicitly C#-only checks below. Catalogue membership does\n// not imply TypeScript validation support; see Documentation/screenplay/editor-diagnostics.md.\nexport const DiagnosticCodes = {\n InvalidIdentityDeclaration: 'PLAY0633',\n DuplicateIdentity: 'PLAY0634',\n InvalidIdentityDetail: 'PLAY0635',\n UnknownIdentitySource: 'PLAY0636',\n IdentityDetailWithoutSource: 'PLAY0637',\n IdentitySourceWithBody: 'PLAY0638',\n DuplicateIdentityDetail: 'PLAY0639',\n BuiltInIdentityDetail: 'PLAY0640',\n UnknownIdentityQuery: 'PLAY0641',\n InvalidIdentityQuery: 'PLAY0642',\n IdentityQueryWithoutKey: 'PLAY0643',\n InvalidIdentityQueryKey: 'PLAY0644',\n IdentityQueryAuthorizationDependency: 'PLAY0645',\n IdentityQueryTypeMismatch: 'PLAY0646',\n InvalidReactionIdentity: 'PLAY0647',\n GatedInvocationWithoutIdentity: 'PLAY0648',\n UnusedReactionIdentity: 'PLAY0649',\n UnusedReactionRole: 'PLAY0650',\n UnsatisfiedReactionIdentity: 'PLAY0651',\n ReactionPrivilegeEscalation: 'PLAY0652',\n // C#-only whole-model public event boundaries; membership is not TypeScript validation support.\n CommandProducesPublicEvent: 'PLAY0607',\n PublicEventRequiresOutboundTranslation: 'PLAY0608',\n OutboundPublicEventCount: 'PLAY0609',\n ForeignPublicEventConsumer: 'PLAY0610',\n OutboundTranslationInput: 'PLAY0611',\n InboundTranslationOutput: 'PLAY0612',\n ForeignPublicEventProduced: 'PLAY0613',\n PublicTranslationRequiresDirection: 'PLAY0614',\n TranslationConstructDirection: 'PLAY0615',\n InboundTranslationInput: 'PLAY0616',\n OutboundTranslationOutput: 'PLAY0617',\n EventTargetOutsideOutboundTranslation: 'PLAY0618',\n EventsSourceOutsideInboundTranslation: 'PLAY0619',\n InvalidCaptureEventsSource: 'PLAY0620',\n // Syntax shared with C#; the reference checks (owners, instances, cycles, outlets, scopes, packages) are C#-only.\n InvalidExposureDeclaration: 'PLAY0621',\n UnknownExposureOwner: 'PLAY0622',\n ReExposureCycle: 'PLAY0623',\n ReExposureBroken: 'PLAY0624',\n InvalidInstanceContribution: 'PLAY0625',\n UnknownContributionInstance: 'PLAY0626',\n ContributionNotExposed: 'PLAY0627',\n ContributionTypeMismatch: 'PLAY0628',\n UnknownTemplateContentSlot: 'PLAY0629',\n UnknownNavigationOutlet: 'PLAY0630',\n TemplateScopeMismatch: 'PLAY0631',\n IncompatibleComponentPackage: 'PLAY0632',\n UnknownNavigationDestination: 'PLAY0654',\n UnknownScreenContributionPoint: 'PLAY0655',\n TemplateNestingCycle: 'PLAY0656',\n DuplicateComplianceMarker: 'PLAY0653',\n LegacyComplianceMarker: 'PLAY0565',\n UnknownComplianceMarker: 'PLAY0566',\n InvalidSecretScope: 'PLAY0567',\n DuplicateSecretScope: 'PLAY0568',\n SecretScopeIgnoredForPii: 'PLAY0569',\n InvalidPersonalDataQualifier: 'PLAY0570',\n DuplicateSpecialCategory: 'PLAY0571',\n InvalidPurposeDeclaration: 'PLAY0596',\n InvalidPurposeVocabulary: 'PLAY0597',\n DuplicatePurposeField: 'PLAY0598',\n DuplicatePurposeDeclaration: 'PLAY0599',\n UnknownPurpose: 'PLAY0600',\n PurposeInterestMismatch: 'PLAY0601',\n PersonalDataWithoutPurpose: 'PLAY0602',\n SpecialDataWithoutCondition: 'PLAY0603',\n CriminalDataWithoutAuthorization: 'PLAY0604',\n PurposeWithoutBasis: 'PLAY0605',\n UnusedPurpose: 'PLAY0606',\n // C#-only: opt-in completeness, scoped action/refusal reference validation, and semantic binding.\n ConflictingScreenDataBinding: 'PLAY0530',\n ScreenDataQueryMismatch: 'PLAY0531',\n ActionWithoutInputSurface: 'PLAY0532',\n CommandWithoutInputSurface: 'PLAY0533',\n ReadModelFieldWithoutOrigin: 'PLAY0534',\n QueryParameterNotHeldByView: 'PLAY0535',\n UnconsumedEvent: 'PLAY0536',\n UnreachableScreen: 'PLAY0537',\n UnknownActionSubjectField: 'PLAY0345',\n UnresolvedActionSubject: 'PLAY0346',\n UnreachableActionAlternative: 'PLAY0347',\n UnknownActionArgumentProperty: 'PLAY0348',\n UnreachableRefusalBranch: 'PLAY0540',\n InvalidRefusalValue: 'PLAY0541',\n UnknownRefusalConstraint: 'PLAY0542',\n UnknownRedeliveryReaction: 'PLAY0544',\n IndeterminateNegatedClaimTarget: 'PLAY0546',\n InvalidRefusalBranch: 'PLAY0538',\n InvalidRefusalBranchBody: 'PLAY0539',\n UnmatchedRedeliveredOccurrence: 'PLAY0543',\n InvalidNoEventsExpectation: 'PLAY0545',\n InvalidProducesDeclaration: 'PLAY0042',\n ProducesWhenWithoutEvent: 'PLAY0043',\n InvalidPropertyMapping: 'PLAY0044',\n DuplicateProducesTarget: 'PLAY0193',\n EventSourceIdInPayload: 'PLAY0469',\n ExplicitProducesTargetsRequired: 'PLAY0470',\n RedundantEventId: 'PLAY0471',\n InvalidEventId: 'PLAY0472',\n InlineEventCollision: 'PLAY0473',\n InlineEventOutsideCommand: 'PLAY0474',\n InlineEventGeneration: 'PLAY0475',\n ReservedProductionMetadata: 'PLAY0476',\n InvalidEventDocumentation: 'PLAY0477',\n OmittedProductionDestination: 'PLAY0478',\n UnknownConstraintProperty: 'PLAY0391',\n UnknownTopLevelConstruct: 'PLAY0001',\n InvalidDomainDeclaration: 'PLAY0002',\n DuplicateDomain: 'PLAY0003',\n DomainNotFirst: 'PLAY0004',\n InvalidImportDeclaration: 'PLAY0005',\n TabIndentation: 'PLAY0006',\n InvalidConceptDeclaration: 'PLAY0007',\n UnknownPrimitiveType: 'PLAY0008',\n InvalidEnumerationValue: 'PLAY0009',\n UnknownConceptDirective: 'PLAY0010',\n ValidateReadAsEnumerationBlock: 'PLAY0011',\n AttributeReasonWithoutAttribute: 'PLAY0012',\n DuplicateAttributeReason: 'PLAY0013',\n InvalidTypeDeclaration: 'PLAY0014',\n TypeWithoutProperties: 'PLAY0015',\n InvalidPropertyDeclaration: 'PLAY0016',\n IdentifierOutsideCommand: 'PLAY0017',\n InvalidEventDeclaration: 'PLAY0018',\n IdentifierOnEventProperty: 'PLAY0019',\n TagPropertyReadAsTag: 'PLAY0020',\n InvalidModuleDeclaration: 'PLAY0021',\n UnknownModuleDirective: 'PLAY0022',\n InvalidFeatureDeclaration: 'PLAY0023',\n UnknownFeatureDirective: 'PLAY0024',\n InvalidSliceDeclaration: 'PLAY0027',\n UnknownSliceType: 'PLAY0028',\n UnknownSliceDirective: 'PLAY0029',\n InvalidPersonaDeclaration: 'PLAY0030',\n InvalidPersonaPolicyReference: 'PLAY0031',\n UnknownPersonaDirective: 'PLAY0032',\n InvalidCommandDeclaration: 'PLAY0033',\n UnknownCommandDirective: 'PLAY0034',\n DuplicateCommandIdentifier: 'PLAY0036',\n InvalidQueryDeclaration: 'PLAY0047',\n UnknownQueryDirective: 'PLAY0048',\n InvalidQueryParameter: 'PLAY0049',\n InvalidProjectionDeclaration: 'PLAY0056',\n EmptyProjection: 'PLAY0057',\n UnknownProjectionDirective: 'PLAY0058',\n FromWithoutEvent: 'PLAY0061',\n InvalidEventReference: 'PLAY0062',\n InvalidJoinDeclaration: 'PLAY0063',\n JoinWithoutEvent: 'PLAY0064',\n InvalidChildrenDeclaration: 'PLAY0065',\n InvalidNestedDeclaration: 'PLAY0066',\n NestedBlockWithoutFrom: 'PLAY0067',\n InvalidRemoveDeclaration: 'PLAY0068',\n UnknownRemoveDirective: 'PLAY0069',\n InvalidClearDeclaration: 'PLAY0070',\n ClearWithOutsideNestedBlock: 'PLAY0071',\n InvalidSpecificationDeclaration: 'PLAY0094',\n UnknownSpecificationDirective: 'PLAY0095',\n InvalidSpecificationWhen: 'PLAY0096',\n DuplicateSpecificationWhen: 'PLAY0097',\n InvalidThenError: 'PLAY0098',\n InvalidReadModelStep: 'PLAY0099',\n InvalidEventStep: 'PLAY0100',\n InvalidSpecificationValue: 'PLAY0101',\n InvalidScreenDeclaration: 'PLAY0102',\n UnknownScreenDirective: 'PLAY0103',\n InvalidDataDirective: 'PLAY0104',\n InvalidActionDirective: 'PLAY0105',\n UnknownActionDirective: 'PLAY0106',\n InvalidNavigation: 'PLAY0107',\n InvalidScreenLayoutSlot: 'PLAY0108',\n InvalidTitleDirective: 'PLAY0109',\n UnknownTableDirective: 'PLAY0110',\n UnknownSummaryDirective: 'PLAY0111',\n AuthorizeWithoutPolicy: 'PLAY0122',\n InvalidPolicyReference: 'PLAY0123',\n InvalidConstraintDeclaration: 'PLAY0132',\n ConstraintWithoutRule: 'PLAY0133',\n InvalidConstraintBody: 'PLAY0134',\n DuplicateConstraintBody: 'PLAY0135',\n InvalidReactionDeclaration: 'PLAY0136',\n InvalidReactionTrigger: 'PLAY0137',\n ReactionWithoutTrigger: 'PLAY0138',\n InvalidValidateDeclaration: 'PLAY0140',\n InvalidValidationRule: 'PLAY0141',\n InvalidRuleName: 'PLAY0143',\n UnknownRuleImplementationDirective: 'PLAY0144',\n InvalidDescription: 'PLAY0145',\n EmptyDescription: 'PLAY0146',\n DuplicateDescription: 'PLAY0147',\n TagWithoutValue: 'PLAY0148',\n InvalidTagValue: 'PLAY0149',\n UnknownContextPath: 'PLAY0153',\n UnknownContextCausedByProperty: 'PLAY0154',\n UnknownContextIdentityProperty: 'PLAY0155',\n ExpectedCodeFence: 'PLAY0163',\n UnclosedCodeBlock: 'PLAY0164',\n DuplicateDeclaration: 'PLAY0168',\n RepeatedSingularDeclarationAcrossFiles: 'PLAY0172',\n RepeatedDeclarationAcrossFiles: 'PLAY0173',\n ConflictingDescriptionAcrossFiles: 'PLAY0174',\n UnexpectedTokenInAuthorize: 'PLAY0184',\n UnclosedAuthorizeGroup: 'PLAY0185',\n InvalidReadModelDeclaration: 'PLAY0186',\n InvalidInvokesDeclaration: 'PLAY0194',\n InvalidScopeDeclaration: 'PLAY0199',\n DuplicateScope: 'PLAY0200',\n InvalidIntervalTrigger: 'PLAY0249',\n InvalidScheduleTrigger: 'PLAY0250',\n DuplicateReactionTrigger: 'PLAY0253',\n InvalidSpecificationEventSource: 'PLAY0275',\n DuplicateSpecificationEventSource: 'PLAY0276',\n InvalidProjectionVariantDeclaration: 'PLAY0277',\n InvalidEntersOnDeclaration: 'PLAY0279',\n NestedProjectionVariantNotAllowed: 'PLAY0280',\n InvalidStructuredValue: 'PLAY0291',\n DuplicateStructuredValueMember: 'PLAY0294',\n ConflictingSpecificationActions: 'PLAY0358',\n InvalidSpecificationEventOrder: 'PLAY0359',\n InvalidValidationSeverity: 'PLAY0368',\n VariantRequiresEnteringEvent: 'PLAY0382',\n DuplicateProjectionVariant: 'PLAY0384',\n DuplicateVariantEnteringEvent: 'PLAY0385',\n InvalidSpecificationDenied: 'PLAY0388',\n DuplicateAuthorizationAcrossFiles: 'PLAY0394',\n FileConstraintOnlySupportsUniqueness: 'PLAY0396',\n LegacyInlineCodeFence: 'PLAY0397',\n InvalidEventGeneration: 'PLAY0446',\n InvalidFileImport: 'PLAY0454',\n FileImportMatchesNothing: 'PLAY0455',\n ImportedFileNotFound: 'PLAY0456',\n ConflictingImportPlacement: 'PLAY0457',\n ImportCycle: 'PLAY0458',\n ModuleInPlacedFile: 'PLAY0459',\n UnexpectedInPlacedFile: 'PLAY0460',\n InvalidSpecificationClock: 'PLAY0461',\n InvalidSpecificationTrigger: 'PLAY0462',\n InvalidSpecificationCapture: 'PLAY0463',\n InvalidSpecificationQueryAction: 'PLAY0464',\n UnknownSpecificationQueryArgument: 'PLAY0468',\n InvalidSpecificationQuery: 'PLAY0265',\n UnknownSpecificationQueryDirective: 'PLAY0266',\n DuplicateSpecificationQueryArguments: 'PLAY0267',\n InvalidAbsentReadModelStep: 'PLAY0453',\n LegacyOptionalSuffix: 'PLAY0479',\n InvalidOptionalModifierOrder: 'PLAY0480',\n OptionalReadsNotSupported: 'PLAY0481',\n InvalidSpecificationCaller: 'PLAY0386',\n DuplicateSpecificationCallerOrDenied: 'PLAY0387',\n GeneratedPropertyOutsideCommand: 'PLAY0482',\n InvalidGeneratedType: 'PLAY0483',\n InvalidGeneratedModifierOrder: 'PLAY0484',\n DuplicateEventSubject: 'PLAY0590',\n InvalidSubjectType: 'PLAY0591',\n ProtectedSubjectType: 'PLAY0592',\n InvalidSubjectOwner: 'PLAY0593',\n ReadModelSubjectNotSupported: 'PLAY0594',\n InvalidSubjectModifierOrder: 'PLAY0595',\n GeneratedPropertySuppliedAsInput: 'PLAY0485',\n InvalidCommandResponse: 'PLAY0486',\n InvalidResponseSource: 'PLAY0487',\n DuplicateResponseField: 'PLAY0488',\n InvalidResponseShape: 'PLAY0489',\n InvalidGeneratedFixture: 'PLAY0490',\n InvalidReturnExpectation: 'PLAY0491',\n InvalidImplementationBlock: 'PLAY0492',\n InvalidImplementationHint: 'PLAY0493',\n ConflictingImplementationSources: 'PLAY0494',\n UnknownType: 'PLAY0165',\n InvalidSystemDeclaration: 'PLAY0495',\n InvalidOperationDeclaration: 'PLAY0496',\n InvalidProductionReference: 'PLAY0497',\n ProductionDeclarationCollision: 'PLAY0498',\n OperationOutsideCommand: 'PLAY0499',\n InvalidSystemReference: 'PLAY0500',\n InvalidOperationMapping: 'PLAY0501',\n InvalidOperationSpecification: 'PLAY0502',\n InvalidCaptureDeclaration: 'PLAY0078',\n UnknownCaptureDirective: 'PLAY0079',\n InvalidMapEntry: 'PLAY0080',\n InvalidTranslation: 'PLAY0081',\n InvalidSplitDeclaration: 'PLAY0082',\n InvalidSplitTarget: 'PLAY0083',\n InvalidAppendDeclaration: 'PLAY0084',\n UnknownAppendDirective: 'PLAY0085',\n WhenWithoutTrigger: 'PLAY0086',\n InvalidWhenClause: 'PLAY0087',\n InvalidWhenTransitionClause: 'PLAY0088',\n MixedWhenCombinators: 'PLAY0089',\n WhenCombinatorWithoutProperty: 'PLAY0090',\n UnknownCaptureBlockDirective: 'PLAY0091',\n InvalidCompositeKeyPart: 'PLAY0072',\n TemplateInCompositeKey: 'PLAY0073',\n EmptyCompositeKey: 'PLAY0074',\n InvalidProjectionMapping: 'PLAY0075',\n ExpectedLiteralValue: 'PLAY0150',\n InvalidExpression: 'PLAY0152',\n UnterminatedInterpolation: 'PLAY0157',\n UnterminatedTemplateExpression: 'PLAY0156',\n ProjectionDocumentWithoutProjection: 'PLAY0055',\n CaptureDocumentWithoutCapture: 'PLAY0077',\n SpecificationDocumentWithoutSpecification: 'PLAY0093',\n InvalidSeedDeclaration: 'PLAY0128',\n InvalidSeedGroup: 'PLAY0129',\n InvalidSeedEvent: 'PLAY0130',\n InvalidSeedPropertyAssignment: 'PLAY0131',\n InvalidPolicyDeclaration: 'PLAY0112',\n UnknownPolicyDirective: 'PLAY0113',\n PolicyWithoutRequirement: 'PLAY0114',\n ExpectedRoleName: 'PLAY0118',\n ExpectedClaimName: 'PLAY0119',\n ExpectedClaimMatches: 'PLAY0120',\n ExpectedClaimMatchTarget: 'PLAY0121',\n MixedPolicyImplementation: 'PLAY0440',\n RepeatedPolicyRequirement: 'PLAY0441',\n UnexpectedTokenInPolicyCondition: 'PLAY0115',\n ExpectedPolicyCondition: 'PLAY0116',\n UnclosedPolicyConditionGroup: 'PLAY0117',\n UnexpectedTokenInCondition: 'PLAY0158',\n ExpectedCondition: 'PLAY0159',\n ExpectedComparisonOperator: 'PLAY0161',\n ExpectedComparisonValue: 'PLAY0162',\n InvalidActionAlternative: 'PLAY0341',\n GuardedActionWithoutAlternatives: 'PLAY0342',\n MisplacedActionOtherwise: 'PLAY0343',\n UnsupportedActionConditionOperand: 'PLAY0344',\n InvalidInteractionArgument: 'PLAY0319',\n UnclosedConditionGroup: 'PLAY0160',\n InvalidNumericDirective: 'PLAY0508',\n DuplicateNumericDirective: 'PLAY0509',\n LateNumericDirective: 'PLAY0510',\n InexactNumericLiteral: 'PLAY0511',\n MixedNumericModes: 'PLAY0512',\n IncompatibleNumericSource: 'PLAY0513',\n EventFromLaterSlice: 'PLAY0516',\n TimelineCycleGroup: 'PLAY0517',\n InvalidSpecificationExample: 'PLAY0518',\n DuplicateSpecificationAssignment: 'PLAY0519',\n UnresolvedSpecificationExampleType: 'PLAY0520',\n SpecificationExampleNameCollision: 'PLAY0521',\n SpecificationExampleKindMismatch: 'PLAY0522',\n InvalidSpecificationExampleValue: 'PLAY0523',\n MissingSpecificationProperty: 'PLAY0524',\n UnadmittedSpecificationExampleValue: 'PLAY0525',\n InvalidSpecificationExampleBody: 'PLAY0526',\n AmbiguousReference: 'PLAY0198',\n InvalidSpecificationStream: 'PLAY0547',\n SpecificationStreamOnCommand: 'PLAY0548',\n InvalidSpecificationStreamRoute: 'PLAY0549',\n InvalidSpecificationStreamEventSource: 'PLAY0550',\n SpecificationStreamContradictsCommand: 'PLAY0551',\n InvalidDependencyTarget: 'PLAY0554',\n RepeatedDependencyDeclaration: 'PLAY0555',\n UndeclaredDependency: 'PLAY0552',\n UnusedDependencyDeclaration: 'PLAY0553',\n MutualDependencyDeclarations: 'PLAY0556',\n AuthorizationRefusalWithoutIdentity: 'PLAY0557',\n InvalidDocumentation: 'PLAY0558',\n ConflictingDocumentationAcrossFiles: 'PLAY0559',\n InvalidSpecificationCallerPersona: 'PLAY0572',\n UnsynthesizablePersonaCaller: 'PLAY0573',\n PersonaWithoutGate: 'PLAY0574',\n GateWithoutPersona: 'PLAY0575',\n AmbiguousPersonaCaller: 'PLAY0576',\n InvalidSpecificationParameter: 'PLAY0577',\n InvalidSpecificationCase: 'PLAY0578',\n DuplicateSpecificationParameter: 'PLAY0579',\n DuplicateSpecificationCase: 'PLAY0580',\n IncompleteSpecificationTable: 'PLAY0581',\n InvalidSpecificationCaseAssignment: 'PLAY0582',\n InvalidSpecificationCaseValue: 'PLAY0583',\n InvalidSpecificationCaseReference: 'PLAY0584',\n OptionalSpecificationParameterTarget: 'PLAY0585',\n SpecificationCaseNameCollision: 'PLAY0586',\n IncompatibleSpecificationParameterType: 'PLAY0587',\n UnusedSpecificationParameter: 'PLAY0588',\n SingularSpecificationTableExpansion: 'PLAY0589',\n UnsupportedInteractionAlternatives: 'PLAY0560',\n MixedInteractionAlternatives: 'PLAY0561',\n InteractionAlternativeWithoutActions: 'PLAY0562',\n InlineInteractionAlternative: 'PLAY0563',\n LegacyInteractionWhere: 'PLAY0564',\n InvalidEventSourceDeclaration: 'PLAY0503',\n InvalidCommandStream: 'PLAY0504',\n AmbiguousCommandStream: 'PLAY0505',\n UnsupportedStreamIdType: 'PLAY0506',\n RedundantSourceStreamId: 'PLAY0507',\n UnknownEvent: 'PLAY0166',\n UnknownReadModelProperty: 'PLAY0514',\n PiiNotSupportedOnIdentifier: 'PLAY0515',\n HandlerWithoutImplementation: 'PLAY0045',\n UnknownHandlerDirective: 'PLAY0046',\n CommandWithProducesAndHandler: 'PLAY0035',\n AbsoluteFileReference: 'PLAY0264',\n InvalidTriggerData: 'PLAY0246',\n InvalidReadModelKey: 'PLAY0660',\n IncompleteReadModelKey: 'PLAY0661', // C# only: scoped read-model key resolution.\n InvalidReadModelKeyLookup: 'PLAY0662', // Shape checks shared; scoped lookup checks are C# only.\n ProductionRouteOutsideCommand: 'PLAY0663',\n RedundantProductionRoute: 'PLAY0664',\n InvalidObserverFilter: 'PLAY0665',\n ObserverFilterExcludesEveryProducer: 'PLAY0666', // C# only: statically known producer routes.\n MixedEnumerationNumbering: 'PLAY0667',\n DuplicateEnumerationNumber: 'PLAY0668',\n EnumerationNumberOutsideInt32: 'PLAY0669',\n MalformedEnumerationNumber: 'PLAY0670',\n UnpinnedStoredEnumeration: 'PLAY0671',\n ReadsWithChildren: 'PLAY0451',\n} as const;\n"],"mappings":"AAKA,MAAaA,EAAkB,CAC3B,2BAA4B,WAC5B,kBAAmB,WACnB,sBAAuB,WACvB,sBAAuB,WACvB,4BAA6B,WAC7B,uBAAwB,WACxB,wBAAyB,WACzB,sBAAuB,WACv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C,WAClC,6BAA8B,WAC9B,oCAAqC,WACrC,gCAAiC,WACjC,mBAAoB,WACpB,2BAA4B,WAC5B,6BAA8B,WAC9B,gCAAiC,WACjC,sCAAuC,WACvC,sCAAuC,WACvC,wBAAyB,WACzB,8BAA+B,WAC/B,qBAAsB,WACtB,4BAA6B,WAC7B,6BAA8B,WAC9B,oCAAqC,WACrC,qBAAsB,WACtB,oCAAqC,WACrC,kCAAmC,WACnC,6BAA8B,WAC9B,mBAAoB,WACpB,mBAAoB,WACpB,uBAAwB,WACxB,8BAA+B,WAC/B,yBAA0B,WAC1B,gCAAiC,WACjC,2BAA4B,WAC5B,6BAA8B,WAC9B,mCAAoC,WACpC,8BAA+B,WAC/B,kCAAmC,WACnC,qCAAsC,WACtC,+BAAgC,WAChC,uCAAwC,WACxC,6BAA8B,WAC9B,oCAAqC,WACrC,mCAAoC,WACpC,6BAA8B,WAC9B,qCAAsC,WACtC,6BAA8B,WAC9B,uBAAwB,WACxB,8BAA+B,WAC/B,qBAAsB,WACtB,uBAAwB,WACxB,wBAAyB,WACzB,wBAAyB,WACzB,aAAc,WACd,yBAA0B,WAC1B,4BAA6B,WAC7B,6BAA8B,WAC9B,wBAAyB,WACzB,8BAA+B,WAC/B,sBAAuB,WACvB,mBAAoB,WACpB,oBAAqB,WACrB,uBAAwB,WACxB,0BAA2B,WAC3B,8BAA+B,WAC/B,yBAA0B,WAC1B,sBAAuB,WACvB,oCAAqC,WACrC,0BAA2B,WAC3B,2BAA4B,WAC5B,8BAA+B,WAC/B,2BAA4B,WAC5B,0BAA2B,WAC3B,kBAAmB,UACvB"}
1
+ {"version":3,"file":"DiagnosticCodes.js","names":["DiagnosticCodes"],"sources":["../../../../../../Compiler/Diagnostics/DiagnosticCodes.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\n// Shared diagnostic names, including the explicitly C#-only checks below. Catalogue membership does\n// not imply TypeScript validation support; see Documentation/screenplay/editor-diagnostics.md.\nexport const DiagnosticCodes = {\n InvalidIdentityDeclaration: 'PLAY0633',\n DuplicateIdentity: 'PLAY0634',\n InvalidIdentityDetail: 'PLAY0635',\n UnknownIdentitySource: 'PLAY0636',\n IdentityDetailWithoutSource: 'PLAY0637',\n IdentitySourceWithBody: 'PLAY0638',\n DuplicateIdentityDetail: 'PLAY0639',\n BuiltInIdentityDetail: 'PLAY0640',\n UnknownIdentityQuery: 'PLAY0641',\n InvalidIdentityQuery: 'PLAY0642',\n IdentityQueryWithoutKey: 'PLAY0643',\n InvalidIdentityQueryKey: 'PLAY0644',\n IdentityQueryAuthorizationDependency: 'PLAY0645',\n IdentityQueryTypeMismatch: 'PLAY0646',\n InvalidReactionIdentity: 'PLAY0647',\n GatedInvocationWithoutIdentity: 'PLAY0648',\n UnusedReactionIdentity: 'PLAY0649',\n UnusedReactionRole: 'PLAY0650',\n UnsatisfiedReactionIdentity: 'PLAY0651',\n ReactionPrivilegeEscalation: 'PLAY0652',\n // C#-only whole-model public event boundaries; membership is not TypeScript validation support.\n CommandProducesPublicEvent: 'PLAY0607',\n PublicEventRequiresOutboundTranslation: 'PLAY0608',\n OutboundPublicEventCount: 'PLAY0609',\n ForeignPublicEventConsumer: 'PLAY0610',\n OutboundTranslationInput: 'PLAY0611',\n InboundTranslationOutput: 'PLAY0612',\n ForeignPublicEventProduced: 'PLAY0613',\n PublicTranslationRequiresDirection: 'PLAY0614',\n TranslationConstructDirection: 'PLAY0615',\n InboundTranslationInput: 'PLAY0616',\n OutboundTranslationOutput: 'PLAY0617',\n EventTargetOutsideOutboundTranslation: 'PLAY0618',\n EventsSourceOutsideInboundTranslation: 'PLAY0619',\n InvalidCaptureEventsSource: 'PLAY0620',\n // Syntax shared with C#; the reference checks (owners, instances, cycles, outlets, scopes, packages) are C#-only.\n InvalidExposureDeclaration: 'PLAY0621',\n UnknownExposureOwner: 'PLAY0622',\n ReExposureCycle: 'PLAY0623',\n ReExposureBroken: 'PLAY0624',\n InvalidInstanceContribution: 'PLAY0625',\n UnknownContributionInstance: 'PLAY0626',\n ContributionNotExposed: 'PLAY0627',\n ContributionTypeMismatch: 'PLAY0628',\n UnknownTemplateContentSlot: 'PLAY0629',\n UnknownNavigationOutlet: 'PLAY0630',\n TemplateScopeMismatch: 'PLAY0631',\n IncompatibleComponentPackage: 'PLAY0632',\n UnknownNavigationDestination: 'PLAY0654',\n UnknownScreenContributionPoint: 'PLAY0655',\n TemplateNestingCycle: 'PLAY0656',\n DuplicateComplianceMarker: 'PLAY0653',\n LegacyComplianceMarker: 'PLAY0565',\n UnknownComplianceMarker: 'PLAY0566',\n InvalidSecretScope: 'PLAY0567',\n DuplicateSecretScope: 'PLAY0568',\n SecretScopeIgnoredForPii: 'PLAY0569',\n InvalidPersonalDataQualifier: 'PLAY0570',\n DuplicateSpecialCategory: 'PLAY0571',\n InvalidPurposeDeclaration: 'PLAY0596',\n InvalidPurposeVocabulary: 'PLAY0597',\n DuplicatePurposeField: 'PLAY0598',\n DuplicatePurposeDeclaration: 'PLAY0599',\n UnknownPurpose: 'PLAY0600',\n PurposeInterestMismatch: 'PLAY0601',\n PersonalDataWithoutPurpose: 'PLAY0602',\n SpecialDataWithoutCondition: 'PLAY0603',\n CriminalDataWithoutAuthorization: 'PLAY0604',\n PurposeWithoutBasis: 'PLAY0605',\n UnusedPurpose: 'PLAY0606',\n // C#-only: opt-in completeness, scoped action/refusal reference validation, and semantic binding.\n ConflictingScreenDataBinding: 'PLAY0530',\n ScreenDataQueryMismatch: 'PLAY0531',\n ActionWithoutInputSurface: 'PLAY0532',\n CommandWithoutInputSurface: 'PLAY0533',\n ReadModelFieldWithoutOrigin: 'PLAY0534',\n QueryParameterNotHeldByView: 'PLAY0535',\n UnconsumedEvent: 'PLAY0536',\n UnreachableScreen: 'PLAY0537',\n UnknownActionSubjectField: 'PLAY0345',\n UnresolvedActionSubject: 'PLAY0346',\n UnreachableActionAlternative: 'PLAY0347',\n UnknownActionArgumentProperty: 'PLAY0348',\n UnreachableRefusalBranch: 'PLAY0540',\n InvalidRefusalValue: 'PLAY0541',\n UnknownRefusalConstraint: 'PLAY0542',\n UnknownRedeliveryReaction: 'PLAY0544',\n IndeterminateNegatedClaimTarget: 'PLAY0546',\n InvalidRefusalBranch: 'PLAY0538',\n InvalidRefusalBranchBody: 'PLAY0539',\n UnmatchedRedeliveredOccurrence: 'PLAY0543',\n InvalidNoEventsExpectation: 'PLAY0545',\n InvalidProducesDeclaration: 'PLAY0042',\n ProducesWhenWithoutEvent: 'PLAY0043',\n InvalidPropertyMapping: 'PLAY0044',\n DuplicateProducesTarget: 'PLAY0193',\n EventSourceIdInPayload: 'PLAY0469',\n ExplicitProducesTargetsRequired: 'PLAY0470',\n RedundantEventId: 'PLAY0471',\n InvalidEventId: 'PLAY0472',\n InlineEventCollision: 'PLAY0473',\n InlineEventOutsideCommand: 'PLAY0474',\n InlineEventGeneration: 'PLAY0475',\n ReservedProductionMetadata: 'PLAY0476',\n InvalidEventDocumentation: 'PLAY0477',\n OmittedProductionDestination: 'PLAY0478',\n UnknownConstraintProperty: 'PLAY0391',\n UnknownTopLevelConstruct: 'PLAY0001',\n InvalidDomainDeclaration: 'PLAY0002',\n DuplicateDomain: 'PLAY0003',\n DomainNotFirst: 'PLAY0004',\n InvalidImportDeclaration: 'PLAY0005',\n TabIndentation: 'PLAY0006',\n InvalidConceptDeclaration: 'PLAY0007',\n UnknownPrimitiveType: 'PLAY0008',\n InvalidEnumerationValue: 'PLAY0009',\n UnknownConceptDirective: 'PLAY0010',\n ValidateReadAsEnumerationBlock: 'PLAY0011',\n AttributeReasonWithoutAttribute: 'PLAY0012',\n DuplicateAttributeReason: 'PLAY0013',\n InvalidTypeDeclaration: 'PLAY0014',\n TypeWithoutProperties: 'PLAY0015',\n InvalidPropertyDeclaration: 'PLAY0016',\n IdentifierOutsideCommand: 'PLAY0017',\n InvalidEventDeclaration: 'PLAY0018',\n IdentifierOnEventProperty: 'PLAY0019',\n TagPropertyReadAsTag: 'PLAY0020',\n InvalidModuleDeclaration: 'PLAY0021',\n UnknownModuleDirective: 'PLAY0022',\n InvalidFeatureDeclaration: 'PLAY0023',\n UnknownFeatureDirective: 'PLAY0024',\n InvalidSliceDeclaration: 'PLAY0027',\n UnknownSliceType: 'PLAY0028',\n UnknownSliceDirective: 'PLAY0029',\n InvalidPersonaDeclaration: 'PLAY0030',\n InvalidPersonaPolicyReference: 'PLAY0031',\n UnknownPersonaDirective: 'PLAY0032',\n InvalidCommandDeclaration: 'PLAY0033',\n UnknownCommandDirective: 'PLAY0034',\n DuplicateCommandIdentifier: 'PLAY0036',\n InvalidQueryDeclaration: 'PLAY0047',\n UnknownQueryDirective: 'PLAY0048',\n InvalidQueryParameter: 'PLAY0049',\n InvalidProjectionDeclaration: 'PLAY0056',\n EmptyProjection: 'PLAY0057',\n UnknownProjectionDirective: 'PLAY0058',\n FromWithoutEvent: 'PLAY0061',\n InvalidEventReference: 'PLAY0062',\n InvalidJoinDeclaration: 'PLAY0063',\n JoinWithoutEvent: 'PLAY0064',\n InvalidChildrenDeclaration: 'PLAY0065',\n InvalidNestedDeclaration: 'PLAY0066',\n NestedBlockWithoutFrom: 'PLAY0067',\n InvalidRemoveDeclaration: 'PLAY0068',\n UnknownRemoveDirective: 'PLAY0069',\n InvalidClearDeclaration: 'PLAY0070',\n ClearWithOutsideNestedBlock: 'PLAY0071',\n InvalidSpecificationDeclaration: 'PLAY0094',\n UnknownSpecificationDirective: 'PLAY0095',\n InvalidSpecificationWhen: 'PLAY0096',\n DuplicateSpecificationWhen: 'PLAY0097',\n InvalidThenError: 'PLAY0098',\n InvalidReadModelStep: 'PLAY0099',\n InvalidEventStep: 'PLAY0100',\n InvalidSpecificationValue: 'PLAY0101',\n InvalidScreenDeclaration: 'PLAY0102',\n UnknownScreenDirective: 'PLAY0103',\n InvalidDataDirective: 'PLAY0104',\n InvalidActionDirective: 'PLAY0105',\n UnknownActionDirective: 'PLAY0106',\n InvalidNavigation: 'PLAY0107',\n InvalidScreenLayoutSlot: 'PLAY0108',\n InvalidTitleDirective: 'PLAY0109',\n UnknownTableDirective: 'PLAY0110',\n UnknownSummaryDirective: 'PLAY0111',\n AuthorizeWithoutPolicy: 'PLAY0122',\n InvalidPolicyReference: 'PLAY0123',\n InvalidConstraintDeclaration: 'PLAY0132',\n ConstraintWithoutRule: 'PLAY0133',\n InvalidConstraintBody: 'PLAY0134',\n DuplicateConstraintBody: 'PLAY0135',\n InvalidReactionDeclaration: 'PLAY0136',\n InvalidReactionTrigger: 'PLAY0137',\n ReactionWithoutTrigger: 'PLAY0138',\n InvalidValidateDeclaration: 'PLAY0140',\n InvalidValidationRule: 'PLAY0141',\n InvalidRuleName: 'PLAY0143',\n UnknownRuleImplementationDirective: 'PLAY0144',\n InvalidDescription: 'PLAY0145',\n EmptyDescription: 'PLAY0146',\n DuplicateDescription: 'PLAY0147',\n TagWithoutValue: 'PLAY0148',\n InvalidTagValue: 'PLAY0149',\n UnknownContextPath: 'PLAY0153',\n UnknownContextCausedByProperty: 'PLAY0154',\n UnknownContextIdentityProperty: 'PLAY0155',\n ExpectedCodeFence: 'PLAY0163',\n UnclosedCodeBlock: 'PLAY0164',\n DuplicateDeclaration: 'PLAY0168',\n RepeatedSingularDeclarationAcrossFiles: 'PLAY0172',\n RepeatedDeclarationAcrossFiles: 'PLAY0173',\n ConflictingDescriptionAcrossFiles: 'PLAY0174',\n UnexpectedTokenInAuthorize: 'PLAY0184',\n UnclosedAuthorizeGroup: 'PLAY0185',\n InvalidReadModelDeclaration: 'PLAY0186',\n InvalidInvokesDeclaration: 'PLAY0194',\n InvalidScopeDeclaration: 'PLAY0199',\n DuplicateScope: 'PLAY0200',\n InvalidIntervalTrigger: 'PLAY0249',\n InvalidScheduleTrigger: 'PLAY0250',\n DuplicateReactionTrigger: 'PLAY0253',\n InvalidSpecificationEventSource: 'PLAY0275',\n DuplicateSpecificationEventSource: 'PLAY0276',\n InvalidProjectionVariantDeclaration: 'PLAY0277',\n InvalidEntersOnDeclaration: 'PLAY0279',\n NestedProjectionVariantNotAllowed: 'PLAY0280',\n InvalidStructuredValue: 'PLAY0291',\n DuplicateStructuredValueMember: 'PLAY0294',\n ConflictingSpecificationActions: 'PLAY0358',\n InvalidSpecificationEventOrder: 'PLAY0359',\n InvalidValidationSeverity: 'PLAY0368',\n VariantRequiresEnteringEvent: 'PLAY0382',\n DuplicateProjectionVariant: 'PLAY0384',\n DuplicateVariantEnteringEvent: 'PLAY0385',\n InvalidSpecificationDenied: 'PLAY0388',\n DuplicateAuthorizationAcrossFiles: 'PLAY0394',\n FileConstraintOnlySupportsUniqueness: 'PLAY0396',\n LegacyInlineCodeFence: 'PLAY0397',\n InvalidEventGeneration: 'PLAY0446',\n InvalidFileImport: 'PLAY0454',\n FileImportMatchesNothing: 'PLAY0455',\n ImportedFileNotFound: 'PLAY0456',\n ConflictingImportPlacement: 'PLAY0457',\n ImportCycle: 'PLAY0458',\n ModuleInPlacedFile: 'PLAY0459',\n UnexpectedInPlacedFile: 'PLAY0460',\n InvalidSpecificationClock: 'PLAY0461',\n InvalidSpecificationTrigger: 'PLAY0462',\n InvalidSpecificationCapture: 'PLAY0463',\n InvalidSpecificationQueryAction: 'PLAY0464',\n UnknownSpecificationQueryArgument: 'PLAY0468',\n InvalidSpecificationQuery: 'PLAY0265',\n UnknownSpecificationQueryDirective: 'PLAY0266',\n DuplicateSpecificationQueryArguments: 'PLAY0267',\n InvalidAbsentReadModelStep: 'PLAY0453',\n LegacyOptionalSuffix: 'PLAY0479',\n InvalidOptionalModifierOrder: 'PLAY0480',\n OptionalReadsNotSupported: 'PLAY0481',\n InvalidSpecificationCaller: 'PLAY0386',\n DuplicateSpecificationCallerOrDenied: 'PLAY0387',\n GeneratedPropertyOutsideCommand: 'PLAY0482',\n InvalidGeneratedType: 'PLAY0483',\n InvalidGeneratedModifierOrder: 'PLAY0484',\n DuplicateEventSubject: 'PLAY0590',\n InvalidSubjectType: 'PLAY0591',\n ProtectedSubjectType: 'PLAY0592',\n InvalidSubjectOwner: 'PLAY0593',\n ReadModelSubjectNotSupported: 'PLAY0594',\n InvalidSubjectModifierOrder: 'PLAY0595',\n GeneratedPropertySuppliedAsInput: 'PLAY0485',\n InvalidCommandResponse: 'PLAY0486',\n InvalidResponseSource: 'PLAY0487',\n DuplicateResponseField: 'PLAY0488',\n InvalidResponseShape: 'PLAY0489',\n InvalidGeneratedFixture: 'PLAY0490',\n InvalidReturnExpectation: 'PLAY0491',\n InvalidImplementationBlock: 'PLAY0492',\n InvalidImplementationHint: 'PLAY0493',\n ConflictingImplementationSources: 'PLAY0494',\n UnknownType: 'PLAY0165',\n InvalidSystemDeclaration: 'PLAY0495',\n InvalidOperationDeclaration: 'PLAY0496',\n InvalidProductionReference: 'PLAY0497',\n ProductionDeclarationCollision: 'PLAY0498',\n OperationOutsideCommand: 'PLAY0499',\n InvalidSystemReference: 'PLAY0500',\n InvalidOperationMapping: 'PLAY0501',\n InvalidOperationSpecification: 'PLAY0502',\n InvalidCaptureDeclaration: 'PLAY0078',\n UnknownCaptureDirective: 'PLAY0079',\n InvalidMapEntry: 'PLAY0080',\n InvalidTranslation: 'PLAY0081',\n InvalidSplitDeclaration: 'PLAY0082',\n InvalidSplitTarget: 'PLAY0083',\n InvalidAppendDeclaration: 'PLAY0084',\n UnknownAppendDirective: 'PLAY0085',\n WhenWithoutTrigger: 'PLAY0086',\n InvalidWhenClause: 'PLAY0087',\n InvalidWhenTransitionClause: 'PLAY0088',\n MixedWhenCombinators: 'PLAY0089',\n WhenCombinatorWithoutProperty: 'PLAY0090',\n UnknownCaptureBlockDirective: 'PLAY0091',\n InvalidCompositeKeyPart: 'PLAY0072',\n TemplateInCompositeKey: 'PLAY0073',\n EmptyCompositeKey: 'PLAY0074',\n InvalidProjectionMapping: 'PLAY0075',\n ExpectedLiteralValue: 'PLAY0150',\n InvalidExpression: 'PLAY0152',\n UnterminatedInterpolation: 'PLAY0157',\n UnterminatedTemplateExpression: 'PLAY0156',\n ProjectionDocumentWithoutProjection: 'PLAY0055',\n CaptureDocumentWithoutCapture: 'PLAY0077',\n SpecificationDocumentWithoutSpecification: 'PLAY0093',\n InvalidSeedDeclaration: 'PLAY0128',\n InvalidSeedGroup: 'PLAY0129',\n InvalidSeedEvent: 'PLAY0130',\n InvalidSeedPropertyAssignment: 'PLAY0131',\n InvalidPolicyDeclaration: 'PLAY0112',\n UnknownPolicyDirective: 'PLAY0113',\n PolicyWithoutRequirement: 'PLAY0114',\n ExpectedRoleName: 'PLAY0118',\n ExpectedClaimName: 'PLAY0119',\n ExpectedClaimMatches: 'PLAY0120',\n ExpectedClaimMatchTarget: 'PLAY0121',\n MixedPolicyImplementation: 'PLAY0440',\n RepeatedPolicyRequirement: 'PLAY0441',\n UnexpectedTokenInPolicyCondition: 'PLAY0115',\n ExpectedPolicyCondition: 'PLAY0116',\n UnclosedPolicyConditionGroup: 'PLAY0117',\n UnexpectedTokenInCondition: 'PLAY0158',\n ExpectedCondition: 'PLAY0159',\n ExpectedComparisonOperator: 'PLAY0161',\n ExpectedComparisonValue: 'PLAY0162',\n InvalidActionAlternative: 'PLAY0341',\n GuardedActionWithoutAlternatives: 'PLAY0342',\n MisplacedActionOtherwise: 'PLAY0343',\n UnsupportedActionConditionOperand: 'PLAY0344',\n InvalidInteractionArgument: 'PLAY0319',\n UnclosedConditionGroup: 'PLAY0160',\n InvalidNumericDirective: 'PLAY0508',\n DuplicateNumericDirective: 'PLAY0509',\n LateNumericDirective: 'PLAY0510',\n InexactNumericLiteral: 'PLAY0511',\n MixedNumericModes: 'PLAY0512',\n IncompatibleNumericSource: 'PLAY0513',\n EventFromLaterSlice: 'PLAY0516',\n TimelineCycleGroup: 'PLAY0517',\n InvalidSpecificationExample: 'PLAY0518',\n DuplicateSpecificationAssignment: 'PLAY0519',\n UnresolvedSpecificationExampleType: 'PLAY0520',\n SpecificationExampleNameCollision: 'PLAY0521',\n SpecificationExampleKindMismatch: 'PLAY0522',\n InvalidSpecificationExampleValue: 'PLAY0523',\n MissingSpecificationProperty: 'PLAY0524',\n UnadmittedSpecificationExampleValue: 'PLAY0525',\n InvalidSpecificationExampleBody: 'PLAY0526',\n AmbiguousReference: 'PLAY0198',\n InvalidSpecificationStream: 'PLAY0547',\n SpecificationStreamOnCommand: 'PLAY0548',\n InvalidSpecificationStreamRoute: 'PLAY0549',\n InvalidSpecificationStreamEventSource: 'PLAY0550',\n SpecificationStreamContradictsCommand: 'PLAY0551',\n InvalidDependencyTarget: 'PLAY0554',\n RepeatedDependencyDeclaration: 'PLAY0555',\n UndeclaredDependency: 'PLAY0552',\n UnusedDependencyDeclaration: 'PLAY0553',\n MutualDependencyDeclarations: 'PLAY0556',\n AuthorizationRefusalWithoutIdentity: 'PLAY0557',\n InvalidDocumentation: 'PLAY0558',\n ConflictingDocumentationAcrossFiles: 'PLAY0559',\n InvalidSpecificationCallerPersona: 'PLAY0572',\n UnsynthesizablePersonaCaller: 'PLAY0573',\n PersonaWithoutGate: 'PLAY0574',\n GateWithoutPersona: 'PLAY0575',\n AmbiguousPersonaCaller: 'PLAY0576',\n InvalidSpecificationParameter: 'PLAY0577',\n InvalidSpecificationCase: 'PLAY0578',\n DuplicateSpecificationParameter: 'PLAY0579',\n DuplicateSpecificationCase: 'PLAY0580',\n IncompleteSpecificationTable: 'PLAY0581',\n InvalidSpecificationCaseAssignment: 'PLAY0582',\n InvalidSpecificationCaseValue: 'PLAY0583',\n InvalidSpecificationCaseReference: 'PLAY0584',\n OptionalSpecificationParameterTarget: 'PLAY0585',\n SpecificationCaseNameCollision: 'PLAY0586',\n IncompatibleSpecificationParameterType: 'PLAY0587',\n UnusedSpecificationParameter: 'PLAY0588',\n SingularSpecificationTableExpansion: 'PLAY0589',\n UnsupportedInteractionAlternatives: 'PLAY0560',\n MixedInteractionAlternatives: 'PLAY0561',\n InteractionAlternativeWithoutActions: 'PLAY0562',\n InlineInteractionAlternative: 'PLAY0563',\n LegacyInteractionWhere: 'PLAY0564',\n InvalidEventSourceDeclaration: 'PLAY0503',\n InvalidCommandStream: 'PLAY0504',\n AmbiguousCommandStream: 'PLAY0505',\n UnsupportedStreamIdType: 'PLAY0506',\n RedundantSourceStreamId: 'PLAY0507',\n UnknownEvent: 'PLAY0166',\n UnknownReadModelProperty: 'PLAY0514',\n PiiNotSupportedOnIdentifier: 'PLAY0515',\n HandlerWithoutImplementation: 'PLAY0045',\n UnknownHandlerDirective: 'PLAY0046',\n CommandWithProducesAndHandler: 'PLAY0035',\n AbsoluteFileReference: 'PLAY0264',\n InvalidTriggerData: 'PLAY0246',\n InvalidReadModelKey: 'PLAY0660',\n IncompleteReadModelKey: 'PLAY0661', // C# only: scoped read-model key resolution.\n InvalidReadModelKeyLookup: 'PLAY0662', // Shape checks shared; scoped lookup checks are C# only.\n ProductionRouteOutsideCommand: 'PLAY0663',\n RedundantProductionRoute: 'PLAY0664',\n InvalidObserverFilter: 'PLAY0665',\n ObserverFilterExcludesEveryProducer: 'PLAY0666', // C# only: statically known producer routes.\n MixedEnumerationNumbering: 'PLAY0667',\n DuplicateEnumerationNumber: 'PLAY0668',\n EnumerationNumberOutsideInt32: 'PLAY0669',\n MalformedEnumerationNumber: 'PLAY0670',\n UnpinnedStoredEnumeration: 'PLAY0671',\n ReadsWithChildren: 'PLAY0451',\n UnknownGenerationStrategy: 'PLAY0672',\n InvalidGenerationArgument: 'PLAY0673',\n InvalidGenerationModifier: 'PLAY0674',\n DuplicateGenerationModifier: 'PLAY0675',\n DuplicateGeneration: 'PLAY0676',\n InvalidGenerationPrimitive: 'PLAY0677',\n InvalidGenerationPrefix: 'PLAY0678',\n InvalidGenerationAlphabet: 'PLAY0679',\n InvalidTypeIdPrefix: 'PLAY0680',\n GenerationSizeOutsideRange: 'PLAY0681',\n ReservedSequenceGeneration: 'PLAY0682',\n LowGenerationEntropy: 'PLAY0683',\n LowGeneratedIdentifierEntropy: 'PLAY0684',\n} as const;\n"],"mappings":"AAKA,MAAaA,EAAkB,CAC3B,2BAA4B,WAC5B,kBAAmB,WACnB,sBAAuB,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C5B,qBAAsB,WACtB,8BAA+B,UACnC"}
@@ -0,0 +1,2 @@
1
+ import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{stringBodyPattern as t,unescapeString as n}from"../Text/StringLiteral.js";import{locationOf as r}from"./SourceLine.js";const i=RegExp(`"${t}"|\\S+`,`g`),a=/^([a-z]([a-z_]{0,61}[a-z])?)?$(?![\s\S])/,printable=e=>[...e].every(e=>e>=` `&&e<=`~`),literal=e=>e!==void 0&&e.length>=2&&e.startsWith(`"`)&&e.endsWith(`"`)?n(e.slice(1,-1)):void 0,integer=e=>e!==void 0&&/^-?[0-9]+$(?![\s\S])/.test(e)&&Number(e)>=-2147483648&&Number(e)<=2147483647?Number(e):void 0;function parseGeneration(t,n,o){let s=[...n.content.matchAll(i)].map(e=>e[0]).slice(1),error=(e,i)=>t.error(e,i,r(n));if(s.length===0)return error(e.InvalidGenerationArgument,`Expected 'generate <strategy> [modifiers]'.`),null;let c=s[0];if(![`uuid`,`uuidv7`,`ulid`,`typeid`,`nanoid`,`bytes`,`pattern`,`random`,`rule`,`sequence`].includes(c))return error(e.UnknownGenerationStrategy,`Unknown generation strategy '${c}'.`),null;let l={kind:`GenerationSyntax`,strategy:c,location:r(n)},u=1,d=!0;switch(c){case`typeid`:case`pattern`:{let e=literal(s[u++]);d=e!==void 0,l=c===`typeid`?{...l,prefix:e}:{...l,pattern:e};break}case`nanoid`:{let e=integer(s[u]);e!==void 0&&(l={...l,size:e},u++);break}case`bytes`:{let e=integer(s[u++]),t=s[u++];d=e!==void 0&&[`base64url`,`hex`,`base32`].includes(t),l={...l,count:e,encoding:t};break}case`random`:{let e=s[u++],t=e?.match(/^(-?(?:0|[1-9][0-9]*))\.\.(-?(?:0|[1-9][0-9]*))$/);d=t!=null&&BigInt(t[1])>=-9223372036854775808n&&BigInt(t[2])<=9223372036854775807n&&BigInt(t[1])<=BigInt(t[2]),l={...l,range:e};break}case`rule`:{let e=s[u++];d=e!==void 0&&/^[A-Za-z_][A-Za-z0-9_]*$/.test(e),l={...l,rule:e};break}}if(!d)return error(e.InvalidGenerationArgument,`Missing or invalid argument for generation strategy '${c}'.`),l;let f=/* @__PURE__ */ new Set;for(;u<s.length;){let t=s[u++],n=s[u++];if(f.has(t)&&error(e.DuplicateGenerationModifier,`Generation modifier '${t}' is repeated.`),f.add(t),!allows(c,o,l.encoding,t)){error(e.InvalidGenerationModifier,`Generation modifier '${t}' is not allowed for '${c}' on '${o}'.`);continue}let r=literal(n);if(t===`prefix`||t===`alphabet`?r===void 0:t===`case`?![`lower`,`upper`].includes(n):![`luhn`,`mod11`,`mod97`].includes(n))error(e.InvalidGenerationArgument,`Missing or invalid value for generation modifier '${t}'.`);else switch(t){case`prefix`:l={...l,prefix:r};break;case`alphabet`:l={...l,alphabet:r};break;case`case`:l={...l,case:n};break;default:l={...l,checksum:n}}}return c===`sequence`||(o===`Uuid`?[`uuid`,`uuidv7`].includes(c):o===`String`?c!==`random`:o===`Int`&&c===`random`)||error(e.InvalidGenerationPrimitive,`Generation strategy '${c}' is not allowed on '${o}'.`),l.prefix!==void 0&&l.prefix!==null&&(c===`typeid`?a.test(l.prefix)||error(e.InvalidTypeIdPrefix,`TypeID prefix must be empty or 1..63 lowercase letters and underscores, starting and ending with a letter.`):(l.prefix.length>32||!printable(l.prefix))&&error(e.InvalidGenerationPrefix,`Generation prefix must contain at most 32 printable ASCII characters.`)),l.alphabet!==void 0&&l.alphabet!==null&&(l.alphabet.length<2||l.alphabet.length>256||!printable(l.alphabet)||new Set(l.alphabet).size!==l.alphabet.length)&&error(e.InvalidGenerationAlphabet,`NanoID alphabet must contain 2..256 distinct printable ASCII characters.`),(l.size!==void 0&&l.size!==null&&(l.size<1||l.size>256)||l.count!==void 0&&l.count!==null&&(l.count<1||l.count>512))&&error(e.GenerationSizeOutsideRange,`NanoID size must be 1..256 and bytes count must be 1..512.`),l}function allows(e,t,n,r){switch(r){case`prefix`:return t===`String`&&[`uuid`,`uuidv7`,`ulid`,`nanoid`,`bytes`].includes(e);case`alphabet`:return e===`nanoid`;case`case`:return e===`ulid`||t===`String`&&[`uuid`,`uuidv7`].includes(e)||e===`bytes`&&[`hex`,`base32`].includes(n??``);case`checksum`:return e===`pattern`;default:return!1}}export{parseGeneration};
2
+ //# sourceMappingURL=GenerationParser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenerationParser.js","names":["tokenPattern","stringBodyPattern","typeIdPrefix","value","character","unescapeString","tokens","line","match","context","code","message","locationOf","DiagnosticCodes","strategy","result","index","valid","text","size","count","encoding","range","rule","seen","modifier","primitive"],"sources":["../../../../../../Compiler/Parsing/GenerationParser.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 { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { GenerationSyntax } from '../Syntax/GenerationSyntax';\nimport { stringBodyPattern, unescapeString } from '../Text/StringLiteral';\nimport { ParserContext } from './ParserContext';\nimport { locationOf, SourceLine } from './SourceLine';\n\nconst tokenPattern = new RegExp(`\"${stringBodyPattern}\"|\\\\S+`, 'g');\nconst typeIdPrefix = /^([a-z]([a-z_]{0,61}[a-z])?)?$(?![\\s\\S])/;\nconst printable = (value: string): boolean => [...value].every(character => character >= ' ' && character <= '~');\nconst literal = (value: string | undefined): string | undefined => value !== undefined && value.length >= 2 && value.startsWith('\"') && value.endsWith('\"') ? unescapeString(value.slice(1, -1)) : undefined;\nconst integer = (value: string | undefined): number | undefined => value !== undefined && /^-?[0-9]+$(?![\\s\\S])/.test(value) && Number(value) >= -2147483648 && Number(value) <= 2147483647 ? Number(value) : undefined;\n\nexport function parseGeneration(context: ParserContext, line: SourceLine, primitive: string): GenerationSyntax | null {\n const tokens = [...line.content.matchAll(tokenPattern)].map(match => match[0]).slice(1);\n const error = (code: string, message: string): void => context.error(code, message, locationOf(line));\n if (tokens.length === 0) {\n error(DiagnosticCodes.InvalidGenerationArgument, \"Expected 'generate <strategy> [modifiers]'.\");\n return null;\n }\n const strategy = tokens[0];\n if (!['uuid', 'uuidv7', 'ulid', 'typeid', 'nanoid', 'bytes', 'pattern', 'random', 'rule', 'sequence'].includes(strategy)) {\n error(DiagnosticCodes.UnknownGenerationStrategy, `Unknown generation strategy '${strategy}'.`);\n return null;\n }\n let result: GenerationSyntax = { kind: 'GenerationSyntax', strategy, location: locationOf(line) };\n let index = 1;\n let valid = true;\n switch (strategy) {\n case 'typeid':\n case 'pattern': {\n const text = literal(tokens[index++]);\n valid = text !== undefined;\n result = strategy === 'typeid' ? { ...result, prefix: text } : { ...result, pattern: text };\n break;\n }\n case 'nanoid': {\n const size = integer(tokens[index]);\n if (size !== undefined) { result = { ...result, size }; index++; }\n break;\n }\n case 'bytes': {\n const count = integer(tokens[index++]);\n const encoding = tokens[index++];\n valid = count !== undefined && ['base64url', 'hex', 'base32'].includes(encoding);\n result = { ...result, count, encoding };\n break;\n }\n case 'random': {\n const range = tokens[index++];\n const match = range?.match(/^(-?(?:0|[1-9][0-9]*))\\.\\.(-?(?:0|[1-9][0-9]*))$/);\n valid = match !== null && match !== undefined && BigInt(match[1]) >= -9223372036854775808n && BigInt(match[2]) <= 9223372036854775807n && BigInt(match[1]) <= BigInt(match[2]);\n result = { ...result, range };\n break;\n }\n case 'rule': {\n const rule = tokens[index++];\n valid = rule !== undefined && /^[A-Za-z_][A-Za-z0-9_]*$/.test(rule);\n result = { ...result, rule };\n break;\n }\n }\n if (!valid) {\n error(DiagnosticCodes.InvalidGenerationArgument, `Missing or invalid argument for generation strategy '${strategy}'.`);\n return result;\n }\n const seen = new Set<string>();\n while (index < tokens.length) {\n const modifier = tokens[index++];\n const value = tokens[index++];\n if (seen.has(modifier)) error(DiagnosticCodes.DuplicateGenerationModifier, `Generation modifier '${modifier}' is repeated.`);\n seen.add(modifier);\n if (!allows(strategy, primitive, result.encoding, modifier)) {\n error(DiagnosticCodes.InvalidGenerationModifier, `Generation modifier '${modifier}' is not allowed for '${strategy}' on '${primitive}'.`);\n continue;\n }\n const text = literal(value);\n if (modifier === 'prefix' || modifier === 'alphabet' ? text === undefined : modifier === 'case' ? !['lower', 'upper'].includes(value) : !['luhn', 'mod11', 'mod97'].includes(value)) {\n error(DiagnosticCodes.InvalidGenerationArgument, `Missing or invalid value for generation modifier '${modifier}'.`);\n continue;\n }\n switch (modifier) {\n case 'prefix': result = { ...result, prefix: text }; break;\n case 'alphabet': result = { ...result, alphabet: text }; break;\n case 'case': result = { ...result, case: value }; break;\n default: result = { ...result, checksum: value };\n }\n }\n const allowed = strategy === 'sequence' || (primitive === 'Uuid' ? ['uuid', 'uuidv7'].includes(strategy) : primitive === 'String' ? strategy !== 'random' : primitive === 'Int' && strategy === 'random');\n if (!allowed) error(DiagnosticCodes.InvalidGenerationPrimitive, `Generation strategy '${strategy}' is not allowed on '${primitive}'.`);\n if (result.prefix !== undefined && result.prefix !== null) {\n if (strategy === 'typeid') {\n if (!typeIdPrefix.test(result.prefix)) error(DiagnosticCodes.InvalidTypeIdPrefix, 'TypeID prefix must be empty or 1..63 lowercase letters and underscores, starting and ending with a letter.');\n } else if (result.prefix.length > 32 || !printable(result.prefix)) error(DiagnosticCodes.InvalidGenerationPrefix, 'Generation prefix must contain at most 32 printable ASCII characters.');\n }\n if (result.alphabet !== undefined && result.alphabet !== null && (result.alphabet.length < 2 || result.alphabet.length > 256 || !printable(result.alphabet) || new Set(result.alphabet).size !== result.alphabet.length)) {\n error(DiagnosticCodes.InvalidGenerationAlphabet, 'NanoID alphabet must contain 2..256 distinct printable ASCII characters.');\n }\n if ((result.size !== undefined && result.size !== null && (result.size < 1 || result.size > 256)) || (result.count !== undefined && result.count !== null && (result.count < 1 || result.count > 512))) {\n error(DiagnosticCodes.GenerationSizeOutsideRange, 'NanoID size must be 1..256 and bytes count must be 1..512.');\n }\n return result;\n}\n\nfunction allows(strategy: string, primitive: string, encoding: string | null | undefined, modifier: string): boolean {\n switch (modifier) {\n case 'prefix': return primitive === 'String' && ['uuid', 'uuidv7', 'ulid', 'nanoid', 'bytes'].includes(strategy);\n case 'alphabet': return strategy === 'nanoid';\n case 'case': return strategy === 'ulid' || (primitive === 'String' && ['uuid', 'uuidv7'].includes(strategy)) || (strategy === 'bytes' && ['hex', 'base32'].includes(encoding ?? ''));\n case 'checksum': return strategy === 'pattern';\n default: return false;\n }\n}\n"],"mappings":"uPASA,MAAMA,EAAmB,OAAO,IAAIC,EAAkB,QAAS,GAAG,EAC5DC,EAAe,2CACf,UAAa,GAA2B,CAAC,GAAGC,CAAK,CAAC,CAAC,MAAM,GAAaC,GAAa,KAAOA,GAAa,GAAG,EAC1G,QAAW,GAAkDD,IAAU,IAAA,IAAaA,EAAM,QAAU,GAAKA,EAAM,WAAW,GAAG,GAAKA,EAAM,SAAS,GAAG,EAAIE,EAAeF,EAAM,MAAM,EAAG,EAAE,CAAC,EAAI,IAAA,GAC7L,QAAW,GAAkDA,IAAU,IAAA,IAAa,uBAAuB,KAAKA,CAAK,GAAK,OAAOA,CAAK,GAAK,aAAe,OAAOA,CAAK,GAAK,WAAa,OAAOA,CAAK,EAAI,IAAA,GAE9M,SAAgB,gBAAgB,EAAwB,EAAkB,EAA4C,CAClH,IAAMG,EAAS,CAAC,GAAGC,EAAK,QAAQ,SAASP,CAAY,CAAC,CAAC,CAAC,IAAI,GAASQ,EAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAChF,OAAS,EAAc,IAA0BC,EAAQ,MAAMC,EAAMC,EAASC,EAAWL,CAAI,CAAC,EACpG,GAAID,EAAO,SAAW,EAElB,OADA,MAAMO,EAAgB,0BAA2B,6CAA6C,EACvF,KAEX,IAAMC,EAAWR,EAAO,GACxB,GAAI,CAAC,CAAC,OAAQ,SAAU,OAAQ,SAAU,SAAU,QAAS,UAAW,SAAU,OAAQ,UAAU,CAAC,CAAC,SAASQ,CAAQ,EAEnH,OADA,MAAMD,EAAgB,0BAA2B,gCAAgCC,EAAS,GAAG,EACtF,KAE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O,OAAS,IAAM,CAAC,UAAUA,EAAO,MAAM,IAAG,MAAMF,EAAgB,wBAAyB,uEAAuE,GAEzLE,EAAO,WAAa,IAAA,IAAaA,EAAO,WAAa,OAASA,EAAO,SAAS,OAAS,GAAKA,EAAO,SAAS,OAAS,KAAO,CAAC,UAAUA,EAAO,QAAQ,GAAK,IAAI,IAAIA,EAAO,QAAQ,CAAC,CAAC,OAASA,EAAO,SAAS,SAC7M,MAAMF,EAAgB,0BAA2B,0EAA0E,GAE1HE,EAAO,OAAS,IAAA,IAAaA,EAAO,OAAS,OAASA,EAAO,KAAO,GAAKA,EAAO,KAAO,MAAUA,EAAO,QAAU,IAAA,IAAaA,EAAO,QAAU,OAASA,EAAO,MAAQ,GAAKA,EAAO,MAAQ,OAC7L,MAAMF,EAAgB,2BAA4B,4DAA4D,EAE3GE,CACX,CAEA,SAAS,OAAO,EAAkB,EAAmB,EAAqC,EAA2B,CACjH,OAAQU,EAAR,CACI,IAAK,SAAU,OAAOC,IAAc,UAAY,CAAC,OAAQ,SAAU,OAAQ,SAAU,OAAO,CAAC,CAAC,SAASZ,CAAQ,EAC/G,IAAK,WAAY,OAAOA,IAAa,SACrC,IAAK,OAAQ,OAAOA,IAAa,QAAWY,IAAc,UAAY,CAAC,OAAQ,QAAQ,CAAC,CAAC,SAASZ,CAAQ,GAAOA,IAAa,SAAW,CAAC,MAAO,QAAQ,CAAC,CAAC,SAASO,GAAY,EAAE,EAClL,IAAK,WAAY,OAAOP,IAAa,UACrC,QAAS,MAAO,EACpB,CACJ"}
@@ -1,2 +1,2 @@
1
- import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{exactIsIntegral as t}from"../Syntax/ExactMathFacts.js";import{responseDateValue as n}from"./ResponseDateValues.js";import{specificationCommandExamples as r}from"./SpecificationCommandExamples.js";const i=/* @__PURE__ */ new Set([`Uuid`,`String`,`Int`,`Decimal`,`Bool`,`Date`,`DateTime`]);function validateResponses(t,n,a=n.inputUses){let o=r(t),s=[],collect=(e,t)=>{let n=[...t,e.name];e.slices.forEach(e=>s.push({slice:e,scope:[...n,e.name]})),e.features.forEach(e=>collect(e,n))};t.modules.forEach(e=>e.features.forEach(t=>collect(t,[e.name])));let c=/* @__PURE__ */ new Map,l=/* @__PURE__ */ new Map,u=/* @__PURE__ */ new Map;for(let{slice:e,scope:t}of s)for(let n of e.commands){let e=c.get(n.name)??[];e.push({command:n,scope:t}),c.set(n.name,e),l.set(n,uniqueByName(n.properties)),n.response?.kind===`RecordCommandResponseSyntax`&&u.set(n,uniqueByName(n.response.fields))}let d=/* @__PURE__ */ new Map;for(let e of t.imports){let t=e.qualifiedName.split(`.`).at(-1);d.set(t,[...d.get(t)??[],e.qualifiedName])}let f=/* @__PURE__ */ new Map,resolve=(e,t)=>{let n=`${t.join(`.`)}|${e}`;if(f.has(n))return f.get(n);let r=d.get(e)??[],i=((c.get(e.split(`.`).at(-1))??[]).length===0&&r.length===1?r[0]:e).split(`.`),a=c.get(i.at(-1))??[];if(i.length>1){let e=i.slice(0,-1);a=a.filter(t=>e.length<=t.scope.length&&e.every((n,r)=>t.scope[t.scope.length-e.length+r]===n))}else for(let e=t.length;e>=0;e--){let n=a.filter(n=>e<=n.scope.length&&t.slice(0,e).every((e,t)=>n.scope[t]===e));if(n.length>0){a=n;break}}let o=a.length===1?a[0].command:null;return f.set(n,o),o},p=uniqueByName(t.concepts),m=new Set(t.concepts.map(e=>e.name)),h=new Map([...uniqueByName(t.types)].map(([e,t])=>[e,uniqueByName(t.properties)])),g=new Set(s.flatMap(e=>e.slice.readModels.map(e=>e.name))),_=new Set([...l.keys()].flatMap(e=>[...e.properties])),checkDeclarations=t=>{for(let r of t)r.isGenerated&&!_.has(r)&&n.error(e.GeneratedPropertyOutsideCommand,`Generated properties can only be declared on commands.`,r.location)},checkFeature=e=>{e.features.forEach(checkFeature);for(let t of e.slices){for(let e of t.commands)for(let t of e.produces)t.inlineEvent!==null&&checkDeclarations(t.inlineEvent.properties);t.events.forEach(e=>checkDeclarations(e.properties)),t.readModels.forEach(e=>checkDeclarations(e.properties));for(let e of t.reactions)for(let t of e.triggers)for(let e of t.produces)e.inlineEvent!==null&&checkDeclarations(e.inlineEvent.properties)}};t.types.forEach(e=>checkDeclarations(e.properties)),t.modules.forEach(e=>e.features.forEach(checkFeature));let validateSource=(t,r,i)=>{let a=l.get(i).get(t.property);if(a===void 0){n.error(e.InvalidResponseSource,`Response source '${t.property}' must reference one direct command property.`,t.location);return}let o=a.type;(o.isCollection||g.has(o.name))&&n.error(e.InvalidResponseShape,`Collection and whole-read-model responses are not supported.`,t.location),r!==null&&(r.name!==o.name||r.isCollection!==o.isCollection||r.isOptional!==o.isOptional)&&n.error(e.InvalidResponseShape,`An explicit response field type must match its source's declared type, collection shape and optionality.`,r.location)};for(let t of l.keys()){for(let r of t.properties){if(!r.isGenerated)continue;let t=p.get(r.type.name);(r.type.isOptional||r.type.isCollection||(t===void 0?i.has(r.type.name)||h.has(r.type.name)||m.has(r.type.name)||g.has(r.type.name):t.type!==`Uuid`))&&n.error(e.InvalidGeneratedType,`A generated property must be a required, noncollection concept backed by Uuid.`,r.location)}let r=t.response;if(r?.kind===`ScalarCommandResponseSyntax`)validateSource(r.source,null,t);else if(r?.kind===`RecordCommandResponseSyntax`){r.fields.length===0&&n.error(e.InvalidCommandResponse,`A response block requires at least one field.`,r.location);let i=/* @__PURE__ */ new Set;for(let a of r.fields)i.has(a.name)&&n.error(e.DuplicateResponseField,`Duplicate response field '${a.name}'.`,a.location),i.add(a.name),validateSource(a.source,a.type,t)}}let validateSpecification=(t,r)=>{let a=o(t.when,r),s=a===null?null:resolve(a.commandType,r);if(a!==null&&s!==null){let t=l.get(s);for(let r of a.values)t.get(r.property.split(`.`)[0])?.isGenerated&&n.error(e.GeneratedPropertySuppliedAsInput,`Generated property '${r.property}' cannot be supplied as request or form input.`,r.location);let r=[...t.values()].filter(e=>e.isIdentifier);if(a.for!==null&&r.length===1&&r[0].isGenerated){let t=r[0].type;(i.has(t.name)||p.has(t.name)||h.has(t.name))&&(t.isOptional||t.isCollection||p.get(t.name)?.type!==`Uuid`||a.for.kind!==`LiteralExpressionSyntax`||typeof a.for.value!=`string`||!uuidValue(a.for.value))&&n.error(e.InvalidGeneratedFixture,`A generated identifier fixture must supply one compatible concrete UUID value through 'for'.`,a.for.location)}let o=/* @__PURE__ */ new Set;for(let r of a.generatedValues??[]){let i=t.get(r.property);(o.has(r.property)||i===void 0||!i.isGenerated||i.isIdentifier||!compatibleValue(r.source,i.type,p,h))&&n.error(e.InvalidGeneratedFixture,`A generated fixture must uniquely supply a compatible value for a nonidentifier generated command property.`,r.location),o.add(r.property)}}let c=t.thenReturns;if(c==null||((a===null||t.thenErrors.length>0||t.thenDenied!=null)&&n.error(e.InvalidReturnExpectation,`A return expectation requires a command action and cannot accompany an error or denial.`,c.location),s===null))return;let d=s.response,f=l.get(s);if(c.kind===`ScalarSpecificationReturnSyntax`&&d?.kind===`ScalarCommandResponseSyntax`&&f.has(d.source.property))compatibleValue(c.value,f.get(d.source.property).type,p,h)||n.error(e.InvalidReturnExpectation,`The expected return value must match the response source's type.`,c.location);else if(c.kind===`RecordSpecificationReturnSyntax`&&d?.kind===`RecordCommandResponseSyntax`){c.fields.length===0&&n.error(e.InvalidReturnExpectation,`A record return expectation requires at least one field.`,c.location);let t=u.get(s),r=/* @__PURE__ */ new Set;for(let i of c.fields){let a=t.get(i.property),o=a===void 0?void 0:f.get(a.source.property);(r.has(i.property)||o===void 0||!compatibleValue(i.source,o.type,p,h))&&n.error(e.InvalidReturnExpectation,`A return assertion must uniquely name a response field and supply a compatible concrete value.`,i.location),r.add(i.property)}}else n.error(e.InvalidReturnExpectation,`The return expectation must match the command's scalar or record response shape.`,c.location)};for(let{slice:e,scope:t}of s)e.specifications.forEach(e=>validateSpecification(e,t));for(let t of a){if(t.isParameter===!0)continue;let r=resolve(t.command,t.scope);r!==null&&l.get(r).get(t.property.split(`.`)[0])?.isGenerated&&n.error(e.GeneratedPropertySuppliedAsInput,`Generated property '${t.property}' cannot be supplied as request or form input.`,t.location)}}function uniqueByName(e){let t=/* @__PURE__ */ new Map,n=/* @__PURE__ */ new Set;for(let r of e)t.has(r.name)&&n.add(r.name),t.set(r.name,r);return n.forEach(e=>t.delete(e)),t}function compatibleValue(e,r,a,o){if(e.kind===`LiteralExpressionSyntax`&&e.value===null)return r.isOptional;if(r.isCollection)return e.kind===`ListExpressionSyntax`&&e.items.every(e=>compatibleValue(e,{...r,isCollection:!1,isOptional:!1},a,o));let s=o.get(r.name);if(s!==void 0)return e.kind===`ObjectExpressionSyntax`&&e.members.every(e=>{let t=s.get(e.name);return t!==void 0&&compatibleValue(e.value,t.type,a,o)});let c=a.get(r.name),l=c?.type??r.name;if(c?.type===`Enum`)return e.kind===`LiteralExpressionSyntax`&&typeof e.value==`string`&&c.values.includes(e.value);if(e.kind===`LiteralExpressionSyntax`)switch(l){case`Uuid`:return typeof e.value==`string`&&uuidValue(e.value);case`String`:return typeof e.value==`string`;case`Bool`:return typeof e.value==`boolean`;case`Int`:return typeof e.value==`number`?Number.isFinite(e.value)&&Number.isInteger(e.value):typeof e.value==`object`&&e.value!==null&&t(e.value);case`Decimal`:return typeof e.value==`number`?Number.isFinite(e.value):typeof e.value==`object`&&e.value!==null&&e.value.literalType===`ExactNumber`;case`Date`:return typeof e.value==`string`&&n(e.value,!1);case`DateTime`:return typeof e.value==`string`&&n(e.value,!0);default:return!i.has(l)}return!i.has(l)&&c===void 0}const a=/^(?:[0-9a-f]{32}|[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}|\{[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}\}|\([0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}\))(?![\s\S])/i;function uuidValue(e){return a.test(e)}export{compatibleValue,uniqueByName,validateResponses};
1
+ import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{exactIsIntegral as t}from"../Syntax/ExactMathFacts.js";import{responseDateValue as n}from"./ResponseDateValues.js";import{specificationCommandExamples as r}from"./SpecificationCommandExamples.js";const i=/* @__PURE__ */ new Set([`Uuid`,`String`,`Int`,`Decimal`,`Bool`,`Date`,`DateTime`]);function validateResponses(t,n,a=n.inputUses){let o=r(t),s=[],collect=(e,t)=>{let n=[...t,e.name];e.slices.forEach(e=>s.push({slice:e,scope:[...n,e.name]})),e.features.forEach(e=>collect(e,n))};t.modules.forEach(e=>e.features.forEach(t=>collect(t,[e.name])));let c=/* @__PURE__ */ new Map,l=/* @__PURE__ */ new Map,u=/* @__PURE__ */ new Map;for(let{slice:e,scope:t}of s)for(let n of e.commands){let e=c.get(n.name)??[];e.push({command:n,scope:t}),c.set(n.name,e),l.set(n,uniqueByName(n.properties)),n.response?.kind===`RecordCommandResponseSyntax`&&u.set(n,uniqueByName(n.response.fields))}let d=/* @__PURE__ */ new Map;for(let e of t.imports){let t=e.qualifiedName.split(`.`).at(-1);d.set(t,[...d.get(t)??[],e.qualifiedName])}let f=/* @__PURE__ */ new Map,resolve=(e,t)=>{let n=`${t.join(`.`)}|${e}`;if(f.has(n))return f.get(n);let r=d.get(e)??[],i=((c.get(e.split(`.`).at(-1))??[]).length===0&&r.length===1?r[0]:e).split(`.`),a=c.get(i.at(-1))??[];if(i.length>1){let e=i.slice(0,-1);a=a.filter(t=>e.length<=t.scope.length&&e.every((n,r)=>t.scope[t.scope.length-e.length+r]===n))}else for(let e=t.length;e>=0;e--){let n=a.filter(n=>e<=n.scope.length&&t.slice(0,e).every((e,t)=>n.scope[t]===e));if(n.length>0){a=n;break}}let o=a.length===1?a[0].command:null;return f.set(n,o),o},p=uniqueByName(t.concepts),m=new Set(t.concepts.map(e=>e.name)),h=new Map([...uniqueByName(t.types)].map(([e,t])=>[e,uniqueByName(t.properties)])),g=new Set(s.flatMap(e=>e.slice.readModels.map(e=>e.name))),_=new Set([...l.keys()].flatMap(e=>[...e.properties])),checkDeclarations=t=>{for(let r of t)r.isGenerated&&!_.has(r)&&n.error(e.GeneratedPropertyOutsideCommand,`Generated properties can only be declared on commands.`,r.location)},checkFeature=e=>{e.features.forEach(checkFeature);for(let t of e.slices){for(let e of t.commands)for(let t of e.produces)t.inlineEvent!==null&&checkDeclarations(t.inlineEvent.properties);t.events.forEach(e=>checkDeclarations(e.properties)),t.readModels.forEach(e=>checkDeclarations(e.properties));for(let e of t.reactions)for(let t of e.triggers)for(let e of t.produces)e.inlineEvent!==null&&checkDeclarations(e.inlineEvent.properties)}};t.types.forEach(e=>checkDeclarations(e.properties)),t.modules.forEach(e=>e.features.forEach(checkFeature));let validateSource=(t,r,i)=>{let a=l.get(i).get(t.property);if(a===void 0){n.error(e.InvalidResponseSource,`Response source '${t.property}' must reference one direct command property.`,t.location);return}let o=a.type;(o.isCollection||g.has(o.name))&&n.error(e.InvalidResponseShape,`Collection and whole-read-model responses are not supported.`,t.location),r!==null&&(r.name!==o.name||r.isCollection!==o.isCollection||r.isOptional!==o.isOptional)&&n.error(e.InvalidResponseShape,`An explicit response field type must match its source's declared type, collection shape and optionality.`,r.location)};for(let t of l.keys()){for(let r of t.properties){if(!r.isGenerated)continue;let t=p.get(r.type.name);(r.type.isOptional||r.type.isCollection||(t===void 0?i.has(r.type.name)||h.has(r.type.name)||m.has(r.type.name)||g.has(r.type.name):t.type!==`Uuid`&&t.generation==null))&&n.error(e.InvalidGeneratedType,`A generated property must be a required, noncollection generatable concept.`,r.location)}let r=t.response;if(r?.kind===`ScalarCommandResponseSyntax`)validateSource(r.source,null,t);else if(r?.kind===`RecordCommandResponseSyntax`){r.fields.length===0&&n.error(e.InvalidCommandResponse,`A response block requires at least one field.`,r.location);let i=/* @__PURE__ */ new Set;for(let a of r.fields)i.has(a.name)&&n.error(e.DuplicateResponseField,`Duplicate response field '${a.name}'.`,a.location),i.add(a.name),validateSource(a.source,a.type,t)}}let validateSpecification=(t,r)=>{let a=o(t.when,r),s=a===null?null:resolve(a.commandType,r);if(a!==null&&s!==null){let t=l.get(s);for(let r of a.values)t.get(r.property.split(`.`)[0])?.isGenerated&&n.error(e.GeneratedPropertySuppliedAsInput,`Generated property '${r.property}' cannot be supplied as request or form input.`,r.location);let r=[...t.values()].filter(e=>e.isIdentifier);if(a.for!==null&&r.length===1&&r[0].isGenerated){let t=r[0].type;(i.has(t.name)||p.has(t.name)||h.has(t.name))&&(t.isOptional||t.isCollection||![`Uuid`,`String`].includes(p.get(t.name)?.type??``)||!compatibleValue(a.for,t,p,h))&&n.error(e.InvalidGeneratedFixture,`A generated identifier fixture must supply one compatible concrete UUID value through 'for'.`,a.for.location)}let o=/* @__PURE__ */ new Set;for(let r of a.generatedValues??[]){let i=t.get(r.property);(o.has(r.property)||i===void 0||!i.isGenerated||i.isIdentifier||!compatibleValue(r.source,i.type,p,h))&&n.error(e.InvalidGeneratedFixture,`A generated fixture must uniquely supply a compatible value for a nonidentifier generated command property.`,r.location),o.add(r.property)}}let c=t.thenReturns;if(c==null||((a===null||t.thenErrors.length>0||t.thenDenied!=null)&&n.error(e.InvalidReturnExpectation,`A return expectation requires a command action and cannot accompany an error or denial.`,c.location),s===null))return;let d=s.response,f=l.get(s);if(c.kind===`ScalarSpecificationReturnSyntax`&&d?.kind===`ScalarCommandResponseSyntax`&&f.has(d.source.property))compatibleValue(c.value,f.get(d.source.property).type,p,h)||n.error(e.InvalidReturnExpectation,`The expected return value must match the response source's type.`,c.location);else if(c.kind===`RecordSpecificationReturnSyntax`&&d?.kind===`RecordCommandResponseSyntax`){c.fields.length===0&&n.error(e.InvalidReturnExpectation,`A record return expectation requires at least one field.`,c.location);let t=u.get(s),r=/* @__PURE__ */ new Set;for(let i of c.fields){let a=t.get(i.property),o=a===void 0?void 0:f.get(a.source.property);(r.has(i.property)||o===void 0||!compatibleValue(i.source,o.type,p,h))&&n.error(e.InvalidReturnExpectation,`A return assertion must uniquely name a response field and supply a compatible concrete value.`,i.location),r.add(i.property)}}else n.error(e.InvalidReturnExpectation,`The return expectation must match the command's scalar or record response shape.`,c.location)};for(let{slice:e,scope:t}of s)e.specifications.forEach(e=>validateSpecification(e,t));for(let t of a){if(t.isParameter===!0)continue;let r=resolve(t.command,t.scope);r!==null&&l.get(r).get(t.property.split(`.`)[0])?.isGenerated&&n.error(e.GeneratedPropertySuppliedAsInput,`Generated property '${t.property}' cannot be supplied as request or form input.`,t.location)}}function uniqueByName(e){let t=/* @__PURE__ */ new Map,n=/* @__PURE__ */ new Set;for(let r of e)t.has(r.name)&&n.add(r.name),t.set(r.name,r);return n.forEach(e=>t.delete(e)),t}function compatibleValue(e,r,a,o){if(e.kind===`LiteralExpressionSyntax`&&e.value===null)return r.isOptional;if(r.isCollection)return e.kind===`ListExpressionSyntax`&&e.items.every(e=>compatibleValue(e,{...r,isCollection:!1,isOptional:!1},a,o));let s=o.get(r.name);if(s!==void 0)return e.kind===`ObjectExpressionSyntax`&&e.members.every(e=>{let t=s.get(e.name);return t!==void 0&&compatibleValue(e.value,t.type,a,o)});let c=a.get(r.name),l=c?.type??r.name;if(c?.type===`Enum`)return e.kind===`LiteralExpressionSyntax`&&typeof e.value==`string`&&c.values.includes(e.value);if(e.kind===`LiteralExpressionSyntax`)switch(l){case`Uuid`:return typeof e.value==`string`&&uuidValue(e.value);case`String`:return typeof e.value==`string`;case`Bool`:return typeof e.value==`boolean`;case`Int`:return typeof e.value==`number`?Number.isFinite(e.value)&&Number.isInteger(e.value):typeof e.value==`object`&&e.value!==null&&t(e.value);case`Decimal`:return typeof e.value==`number`?Number.isFinite(e.value):typeof e.value==`object`&&e.value!==null&&e.value.literalType===`ExactNumber`;case`Date`:return typeof e.value==`string`&&n(e.value,!1);case`DateTime`:return typeof e.value==`string`&&n(e.value,!0);default:return!i.has(l)}return!i.has(l)&&c===void 0}const a=/^(?:[0-9a-f]{32}|[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}|\{[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}\}|\([0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}\))(?![\s\S])/i;function uuidValue(e){return a.test(e)}export{compatibleValue,uniqueByName,validateResponses};
2
2
  //# sourceMappingURL=ResponseValidator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResponseValidator.js","names":["primitiveTypes","context","effectiveCommand","specificationCommandExamples","application","slices","scope","parent","feature","slice","child","module","commands","properties","responseFields","command","entries","imports","imported","name","resolved","key","from","segments","candidates","qualifiers","entry","index","value","depth","visible","concepts","conceptNames","concept","composites","type","readModels","model","commandProperties","property","declared","DiagnosticCodes","production","event","reaction","trigger","source","explicit","response","names","field","action","specification","input","identifiers","fixture","expectation","fields","asserted","contract","inputs","result","duplicates","item","items","member","primitive","exactIsIntegral","responseDateValue","uuidValuePattern","text"],"sources":["../../../../../../Compiler/Parsing/ResponseValidator.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 { exactIsIntegral } from '../Syntax/ExactMathFacts';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { CommandSyntax } from '../Syntax/Commands';\nimport { ConceptSyntax, PropertySyntax, TypeRefSyntax } from '../Syntax/Declarations';\nimport { ExpressionSyntax } from '../Syntax/Expressions';\nimport { PropertyResponseSourceSyntax, ResponseFieldSyntax } from '../Syntax/Responses';\nimport { SpecificationSyntax } from '../Syntax/Specifications';\nimport { ApplicationSyntax, FeatureSyntax, SliceSyntax } from '../Syntax/Structure';\nimport { InputUse } from './InputUses';\nimport { ParserContext } from './ParserContext';\nimport { responseDateValue } from './ResponseDateValues';\nimport { specificationCommandExamples } from './SpecificationCommandExamples';\n\nconst primitiveTypes = new Set(['Uuid', 'String', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime']);\ninterface ScopedCommand { command: CommandSyntax; scope: readonly string[] }\n\nexport function validateResponses(application: ApplicationSyntax, context: ParserContext, inputs: readonly InputUse[] = context.inputUses): void {\n const effectiveCommand = specificationCommandExamples(application);\n const slices: { slice: SliceSyntax; scope: readonly string[] }[] = [];\n const collect = (feature: FeatureSyntax, parent: readonly string[]): void => {\n const scope = [...parent, feature.name];\n feature.slices.forEach(slice => slices.push({ slice, scope: [...scope, slice.name] }));\n feature.features.forEach(child => collect(child, scope));\n };\n application.modules.forEach(module => module.features.forEach(feature => collect(feature, [module.name])));\n const commands = new Map<string, ScopedCommand[]>();\n const properties = new Map<CommandSyntax, Map<string, PropertySyntax>>();\n const responseFields = new Map<CommandSyntax, Map<string, ResponseFieldSyntax>>();\n for (const { slice, scope } of slices) {\n for (const command of slice.commands) {\n const entries = commands.get(command.name) ?? [];\n entries.push({ command, scope });\n commands.set(command.name, entries);\n properties.set(command, uniqueByName(command.properties));\n if (command.response?.kind === 'RecordCommandResponseSyntax') responseFields.set(command, uniqueByName(command.response.fields));\n }\n }\n const imports = new Map<string, string[]>();\n for (const imported of application.imports) {\n const name = imported.qualifiedName.split('.').at(-1)!;\n imports.set(name, [...(imports.get(name) ?? []), imported.qualifiedName]);\n }\n const resolved = new Map<string, CommandSyntax | null>();\n const resolve = (name: string, from: readonly string[]): CommandSyntax | null => {\n const key = `${from.join('.')}|${name}`;\n if (resolved.has(key)) return resolved.get(key)!;\n const imported = imports.get(name) ?? [];\n const local = commands.get(name.split('.').at(-1)!) ?? [];\n const reference = local.length === 0 && imported.length === 1 ? imported[0] : name;\n const segments = reference.split('.');\n let candidates = commands.get(segments.at(-1)!) ?? [];\n if (segments.length > 1) {\n const qualifiers = segments.slice(0, -1);\n candidates = candidates.filter(entry => qualifiers.length <= entry.scope.length && qualifiers.every((value, index) => entry.scope[entry.scope.length - qualifiers.length + index] === value));\n } else {\n for (let depth = from.length; depth >= 0; depth--) {\n const visible = candidates.filter(entry => depth <= entry.scope.length && from.slice(0, depth).every((value, index) => entry.scope[index] === value));\n if (visible.length > 0) { candidates = visible; break; }\n }\n }\n const command = candidates.length === 1 ? candidates[0].command : null;\n resolved.set(key, command);\n return command;\n };\n const concepts = uniqueByName(application.concepts);\n const conceptNames = new Set(application.concepts.map(concept => concept.name));\n const composites = new Map([...uniqueByName(application.types)].map(([name, type]) => [name, uniqueByName(type.properties)]));\n const readModels = new Set(slices.flatMap(entry => entry.slice.readModels.map(model => model.name)));\n const commandProperties = new Set([...properties.keys()].flatMap(command => [...command.properties]));\n const checkDeclarations = (declared: readonly PropertySyntax[]): void => {\n for (const property of declared) {\n if (property.isGenerated && !commandProperties.has(property)) context.error(DiagnosticCodes.GeneratedPropertyOutsideCommand, 'Generated properties can only be declared on commands.', property.location);\n }\n };\n // Only these typed declarations carry PropertySyntax. Do not pull the complete extensible walker\n // into every browser parser just to inspect their generated flags.\n const checkFeature = (feature: FeatureSyntax): void => {\n feature.features.forEach(checkFeature);\n for (const slice of feature.slices) {\n for (const command of slice.commands) {\n for (const production of command.produces) if (production.inlineEvent !== null) checkDeclarations(production.inlineEvent.properties);\n }\n slice.events.forEach(event => checkDeclarations(event.properties));\n slice.readModels.forEach(model => checkDeclarations(model.properties));\n for (const reaction of slice.reactions) {\n for (const trigger of reaction.triggers) {\n for (const production of trigger.produces) if (production.inlineEvent !== null) checkDeclarations(production.inlineEvent.properties);\n }\n }\n }\n };\n application.types.forEach(type => checkDeclarations(type.properties));\n application.modules.forEach(module => module.features.forEach(checkFeature));\n const validateSource = (source: PropertyResponseSourceSyntax, explicit: TypeRefSyntax | null, command: CommandSyntax): void => {\n const property = properties.get(command)!.get(source.property);\n if (property === undefined) {\n context.error(DiagnosticCodes.InvalidResponseSource, `Response source '${source.property}' must reference one direct command property.`, source.location);\n return;\n }\n const type = property.type;\n if (type.isCollection || readModels.has(type.name)) context.error(DiagnosticCodes.InvalidResponseShape, 'Collection and whole-read-model responses are not supported.', source.location);\n if (explicit !== null && (explicit.name !== type.name || explicit.isCollection !== type.isCollection || explicit.isOptional !== type.isOptional)) context.error(DiagnosticCodes.InvalidResponseShape, \"An explicit response field type must match its source's declared type, collection shape and optionality.\", explicit.location);\n };\n for (const command of properties.keys()) {\n for (const property of command.properties) {\n if (!property.isGenerated) continue;\n const concept = concepts.get(property.type.name);\n if (property.type.isOptional || property.type.isCollection || (concept === undefined ? primitiveTypes.has(property.type.name) || composites.has(property.type.name) || conceptNames.has(property.type.name) || readModels.has(property.type.name) : concept.type !== 'Uuid')) context.error(DiagnosticCodes.InvalidGeneratedType, 'A generated property must be a required, noncollection concept backed by Uuid.', property.location);\n }\n const response = command.response;\n if (response?.kind === 'ScalarCommandResponseSyntax') validateSource(response.source, null, command);\n else if (response?.kind === 'RecordCommandResponseSyntax') {\n if (response.fields.length === 0) context.error(DiagnosticCodes.InvalidCommandResponse, 'A response block requires at least one field.', response.location);\n const names = new Set<string>();\n for (const field of response.fields) {\n if (names.has(field.name)) context.error(DiagnosticCodes.DuplicateResponseField, `Duplicate response field '${field.name}'.`, field.location);\n names.add(field.name);\n validateSource(field.source, field.type, command);\n }\n }\n }\n const validateSpecification = (specification: SpecificationSyntax, scope: readonly string[]): void => {\n const action = effectiveCommand(specification.when, scope);\n const command = action === null ? null : resolve(action.commandType, scope);\n if (action !== null && command !== null) {\n const declared = properties.get(command)!;\n for (const input of action.values) {\n if (declared.get(input.property.split('.')[0])?.isGenerated) context.error(DiagnosticCodes.GeneratedPropertySuppliedAsInput, `Generated property '${input.property}' cannot be supplied as request or form input.`, input.location);\n }\n const identifiers = [...declared.values()].filter(property => property.isIdentifier);\n if (action.for !== null && identifiers.length === 1 && identifiers[0].isGenerated) {\n const type = identifiers[0].type;\n const known = primitiveTypes.has(type.name) || concepts.has(type.name) || composites.has(type.name);\n if (known && (type.isOptional || type.isCollection || concepts.get(type.name)?.type !== 'Uuid' || action.for.kind !== 'LiteralExpressionSyntax' || typeof action.for.value !== 'string' || !uuidValue(action.for.value))) {\n context.error(DiagnosticCodes.InvalidGeneratedFixture, \"A generated identifier fixture must supply one compatible concrete UUID value through 'for'.\", action.for.location);\n }\n }\n const names = new Set<string>();\n for (const fixture of action.generatedValues ?? []) {\n const property = declared.get(fixture.property);\n if (names.has(fixture.property) || property === undefined || !property.isGenerated || property.isIdentifier || !compatibleValue(fixture.source, property.type, concepts, composites)) context.error(DiagnosticCodes.InvalidGeneratedFixture, 'A generated fixture must uniquely supply a compatible value for a nonidentifier generated command property.', fixture.location);\n names.add(fixture.property);\n }\n }\n const expectation = specification.thenReturns;\n if (expectation == null) return;\n if (action === null || specification.thenErrors.length > 0 || specification.thenDenied != null) context.error(DiagnosticCodes.InvalidReturnExpectation, 'A return expectation requires a command action and cannot accompany an error or denial.', expectation.location);\n if (command === null) return;\n const response = command.response;\n const declared = properties.get(command)!;\n if (expectation.kind === 'ScalarSpecificationReturnSyntax' && response?.kind === 'ScalarCommandResponseSyntax' && declared.has(response.source.property)) {\n if (!compatibleValue(expectation.value, declared.get(response.source.property)!.type, concepts, composites)) context.error(DiagnosticCodes.InvalidReturnExpectation, \"The expected return value must match the response source's type.\", expectation.location);\n } else if (expectation.kind === 'RecordSpecificationReturnSyntax' && response?.kind === 'RecordCommandResponseSyntax') {\n if (expectation.fields.length === 0) context.error(DiagnosticCodes.InvalidReturnExpectation, 'A record return expectation requires at least one field.', expectation.location);\n const fields = responseFields.get(command)!;\n const asserted = new Set<string>();\n for (const field of expectation.fields) {\n const contract = fields.get(field.property);\n const property = contract === undefined ? undefined : declared.get(contract.source.property);\n if (asserted.has(field.property) || property === undefined || !compatibleValue(field.source, property.type, concepts, composites)) context.error(DiagnosticCodes.InvalidReturnExpectation, 'A return assertion must uniquely name a response field and supply a compatible concrete value.', field.location);\n asserted.add(field.property);\n }\n } else {\n context.error(DiagnosticCodes.InvalidReturnExpectation, \"The return expectation must match the command's scalar or record response shape.\", expectation.location);\n }\n };\n for (const { slice, scope } of slices) slice.specifications.forEach(specification => validateSpecification(specification, scope));\n for (const input of inputs) {\n if (input.isParameter === true) continue;\n const command = resolve(input.command, input.scope);\n if (command !== null && properties.get(command)!.get(input.property.split('.')[0])?.isGenerated) context.error(DiagnosticCodes.GeneratedPropertySuppliedAsInput, `Generated property '${input.property}' cannot be supplied as request or form input.`, input.location);\n }\n}\n\nexport function uniqueByName<T extends { readonly name: string }>(items: readonly T[]): Map<string, T> {\n const result = new Map<string, T>();\n const duplicates = new Set<string>();\n for (const item of items) {\n if (result.has(item.name)) duplicates.add(item.name);\n result.set(item.name, item);\n }\n duplicates.forEach(name => result.delete(name));\n return result;\n}\n\nexport function compatibleValue(value: ExpressionSyntax, type: TypeRefSyntax, concepts: ReadonlyMap<string, ConceptSyntax>, composites: ReadonlyMap<string, ReadonlyMap<string, PropertySyntax>>): boolean {\n if (value.kind === 'LiteralExpressionSyntax' && value.value === null) return type.isOptional;\n if (type.isCollection) return value.kind === 'ListExpressionSyntax' && value.items.every(item => compatibleValue(item, { ...type, isCollection: false, isOptional: false }, concepts, composites));\n const properties = composites.get(type.name);\n if (properties !== undefined) return value.kind === 'ObjectExpressionSyntax' && value.members.every(member => {\n const property = properties.get(member.name);\n return property !== undefined && compatibleValue(member.value, property.type, concepts, composites);\n });\n const concept = concepts.get(type.name);\n const primitive = concept?.type ?? type.name;\n if (concept?.type === 'Enum') return value.kind === 'LiteralExpressionSyntax' && typeof value.value === 'string' && concept.values.includes(value.value);\n if (value.kind === 'LiteralExpressionSyntax') {\n switch (primitive) {\n case 'Uuid': return typeof value.value === 'string' && uuidValue(value.value);\n case 'String': return typeof value.value === 'string';\n case 'Bool': return typeof value.value === 'boolean';\n case 'Int': return typeof value.value === 'number' ? Number.isFinite(value.value) && Number.isInteger(value.value) : typeof value.value === 'object' && value.value !== null && exactIsIntegral(value.value);\n case 'Decimal': return typeof value.value === 'number' ? Number.isFinite(value.value) : typeof value.value === 'object' && value.value !== null && value.value.literalType === 'ExactNumber';\n case 'Date': return typeof value.value === 'string' && responseDateValue(value.value, false);\n case 'DateTime': return typeof value.value === 'string' && responseDateValue(value.value, true);\n default: return !primitiveTypes.has(primitive);\n }\n }\n return !primitiveTypes.has(primitive) && concept === undefined;\n}\n\n// Shared with ResponseValueTypes.cs: 32 hex digits (N), hyphenated UUIDs (D), or D wrapped in\n// braces (B) / parentheses (P). Hex is case-insensitive; whitespace and X initializer notation\n// are not admitted in response/fixture values. The lookahead requires the true end, even after a newline.\nconst uuidValuePattern = /^(?:[0-9a-f]{32}|[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}|\\{[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}\\}|\\([0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}\\))(?![\\s\\S])/i;\n\nfunction uuidValue(text: string): boolean {\n return uuidValuePattern.test(text);\n}\n"],"mappings":"oUAgBA,MAAMA,kBAAiB,IAAI,IAAI,CAAC,OAAQ,SAAU,MAAO,UAAW,OAAQ,OAAQ,UAAU,CAAC,EAG/F,SAAgB,kBAAkB,EAAgC,EAAwB,EAA8BC,EAAQ,UAAiB,CAC7I,IAAMC,EAAmBC,EAA6BC,CAAW,EAC3DC,EAA6D,CAAC,EAC9D,SAAW,EAAwB,IAAoC,CACzE,IAAMC,EAAQ,CAAC,GAAGC,EAAQC,EAAQ,IAAI,EACtCA,EAAQ,OAAO,QAAQ,GAASH,EAAO,KAAK,CAAE,QAAO,MAAO,CAAC,GAAGC,EAAOG,EAAM,IAAI,CAAE,CAAC,CAAC,EACrFD,EAAQ,SAAS,QAAQ,GAAS,QAAQE,EAAOJ,CAAK,CAAC,CAC3D,EACAF,EAAY,QAAQ,QAAQ,GAAUO,EAAO,SAAS,QAAQ,GAAW,QAAQH,EAAS,CAACG,EAAO,IAAI,CAAC,CAAC,CAAC,EACzG,IAAMC,kBAAW,IAAI,IACfC,kBAAa,IAAI,IACjBC,kBAAiB,IAAI,IAC3B,IAAK,GAAM,CAAE,QAAO,WAAWT,EAC3B,IAAK,IAAMU,KAAWN,EAAM,SAAU,CAClC,IAAMO,EAAUJ,EAAS,IAAIG,EAAQ,IAAI,GAAK,CAAC,EAC/CC,EAA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AAOA,EAAM,OAAU,SAAW,OAAO,SAASA,EAAM,KAAK,GAAK,OAAO,UAAUA,EAAM,KAAK,EAAI,OAAOA,EAAM,OAAU,UAAYA,EAAM,QAAU,MAAQuC,EAAgBvC,EAAM,KAAK,EAC3M,IAAK,UAAW,OAAO,OAAOA,EAAM,OAAU,SAAW,OAAO,SAASA,EAAM,KAAK,EAAI,OAAOA,EAAM,OAAU,UAAYA,EAAM,QAAU,MAAQA,EAAM,MAAM,cAAgB,cAC/K,IAAK,OAAQ,OAAO,OAAOA,EAAM,OAAU,UAAYwC,EAAkBxC,EAAM,MAAO,EAAK,EAC3F,IAAK,WAAY,OAAO,OAAOA,EAAM,OAAU,UAAYwC,EAAkBxC,EAAM,MAAO,EAAI,EAC9F,QAAS,MAAO,CAAC5B,EAAe,IAAIkE,CAAS,CACjD,CAEJ,MAAO,CAAClE,EAAe,IAAIkE,CAAS,GAAKjC,IAAY,IAAA,EACzD,CAKA,MAAMoC,EAAmB,2KAEzB,SAAS,UAAU,EAAuB,CACtC,OAAOA,EAAiB,KAAKC,CAAI,CACrC"}
1
+ {"version":3,"file":"ResponseValidator.js","names":["primitiveTypes","context","effectiveCommand","specificationCommandExamples","application","slices","scope","parent","feature","slice","child","module","commands","properties","responseFields","command","entries","imports","imported","name","resolved","key","from","segments","candidates","qualifiers","entry","index","value","depth","visible","concepts","conceptNames","concept","composites","type","readModels","model","commandProperties","property","declared","DiagnosticCodes","production","event","reaction","trigger","source","explicit","response","names","field","action","specification","input","identifiers","fixture","expectation","fields","asserted","contract","inputs","result","duplicates","item","items","member","primitive","exactIsIntegral","responseDateValue","uuidValuePattern","text"],"sources":["../../../../../../Compiler/Parsing/ResponseValidator.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 { exactIsIntegral } from '../Syntax/ExactMathFacts';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { CommandSyntax } from '../Syntax/Commands';\nimport { ConceptSyntax, PropertySyntax, TypeRefSyntax } from '../Syntax/Declarations';\nimport { ExpressionSyntax } from '../Syntax/Expressions';\nimport { PropertyResponseSourceSyntax, ResponseFieldSyntax } from '../Syntax/Responses';\nimport { SpecificationSyntax } from '../Syntax/Specifications';\nimport { ApplicationSyntax, FeatureSyntax, SliceSyntax } from '../Syntax/Structure';\nimport { InputUse } from './InputUses';\nimport { ParserContext } from './ParserContext';\nimport { responseDateValue } from './ResponseDateValues';\nimport { specificationCommandExamples } from './SpecificationCommandExamples';\n\nconst primitiveTypes = new Set(['Uuid', 'String', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime']);\ninterface ScopedCommand { command: CommandSyntax; scope: readonly string[] }\n\nexport function validateResponses(application: ApplicationSyntax, context: ParserContext, inputs: readonly InputUse[] = context.inputUses): void {\n const effectiveCommand = specificationCommandExamples(application);\n const slices: { slice: SliceSyntax; scope: readonly string[] }[] = [];\n const collect = (feature: FeatureSyntax, parent: readonly string[]): void => {\n const scope = [...parent, feature.name];\n feature.slices.forEach(slice => slices.push({ slice, scope: [...scope, slice.name] }));\n feature.features.forEach(child => collect(child, scope));\n };\n application.modules.forEach(module => module.features.forEach(feature => collect(feature, [module.name])));\n const commands = new Map<string, ScopedCommand[]>();\n const properties = new Map<CommandSyntax, Map<string, PropertySyntax>>();\n const responseFields = new Map<CommandSyntax, Map<string, ResponseFieldSyntax>>();\n for (const { slice, scope } of slices) {\n for (const command of slice.commands) {\n const entries = commands.get(command.name) ?? [];\n entries.push({ command, scope });\n commands.set(command.name, entries);\n properties.set(command, uniqueByName(command.properties));\n if (command.response?.kind === 'RecordCommandResponseSyntax') responseFields.set(command, uniqueByName(command.response.fields));\n }\n }\n const imports = new Map<string, string[]>();\n for (const imported of application.imports) {\n const name = imported.qualifiedName.split('.').at(-1)!;\n imports.set(name, [...(imports.get(name) ?? []), imported.qualifiedName]);\n }\n const resolved = new Map<string, CommandSyntax | null>();\n const resolve = (name: string, from: readonly string[]): CommandSyntax | null => {\n const key = `${from.join('.')}|${name}`;\n if (resolved.has(key)) return resolved.get(key)!;\n const imported = imports.get(name) ?? [];\n const local = commands.get(name.split('.').at(-1)!) ?? [];\n const reference = local.length === 0 && imported.length === 1 ? imported[0] : name;\n const segments = reference.split('.');\n let candidates = commands.get(segments.at(-1)!) ?? [];\n if (segments.length > 1) {\n const qualifiers = segments.slice(0, -1);\n candidates = candidates.filter(entry => qualifiers.length <= entry.scope.length && qualifiers.every((value, index) => entry.scope[entry.scope.length - qualifiers.length + index] === value));\n } else {\n for (let depth = from.length; depth >= 0; depth--) {\n const visible = candidates.filter(entry => depth <= entry.scope.length && from.slice(0, depth).every((value, index) => entry.scope[index] === value));\n if (visible.length > 0) { candidates = visible; break; }\n }\n }\n const command = candidates.length === 1 ? candidates[0].command : null;\n resolved.set(key, command);\n return command;\n };\n const concepts = uniqueByName(application.concepts);\n const conceptNames = new Set(application.concepts.map(concept => concept.name));\n const composites = new Map([...uniqueByName(application.types)].map(([name, type]) => [name, uniqueByName(type.properties)]));\n const readModels = new Set(slices.flatMap(entry => entry.slice.readModels.map(model => model.name)));\n const commandProperties = new Set([...properties.keys()].flatMap(command => [...command.properties]));\n const checkDeclarations = (declared: readonly PropertySyntax[]): void => {\n for (const property of declared) {\n if (property.isGenerated && !commandProperties.has(property)) context.error(DiagnosticCodes.GeneratedPropertyOutsideCommand, 'Generated properties can only be declared on commands.', property.location);\n }\n };\n // Only these typed declarations carry PropertySyntax. Do not pull the complete extensible walker\n // into every browser parser just to inspect their generated flags.\n const checkFeature = (feature: FeatureSyntax): void => {\n feature.features.forEach(checkFeature);\n for (const slice of feature.slices) {\n for (const command of slice.commands) {\n for (const production of command.produces) if (production.inlineEvent !== null) checkDeclarations(production.inlineEvent.properties);\n }\n slice.events.forEach(event => checkDeclarations(event.properties));\n slice.readModels.forEach(model => checkDeclarations(model.properties));\n for (const reaction of slice.reactions) {\n for (const trigger of reaction.triggers) {\n for (const production of trigger.produces) if (production.inlineEvent !== null) checkDeclarations(production.inlineEvent.properties);\n }\n }\n }\n };\n application.types.forEach(type => checkDeclarations(type.properties));\n application.modules.forEach(module => module.features.forEach(checkFeature));\n const validateSource = (source: PropertyResponseSourceSyntax, explicit: TypeRefSyntax | null, command: CommandSyntax): void => {\n const property = properties.get(command)!.get(source.property);\n if (property === undefined) {\n context.error(DiagnosticCodes.InvalidResponseSource, `Response source '${source.property}' must reference one direct command property.`, source.location);\n return;\n }\n const type = property.type;\n if (type.isCollection || readModels.has(type.name)) context.error(DiagnosticCodes.InvalidResponseShape, 'Collection and whole-read-model responses are not supported.', source.location);\n if (explicit !== null && (explicit.name !== type.name || explicit.isCollection !== type.isCollection || explicit.isOptional !== type.isOptional)) context.error(DiagnosticCodes.InvalidResponseShape, \"An explicit response field type must match its source's declared type, collection shape and optionality.\", explicit.location);\n };\n for (const command of properties.keys()) {\n for (const property of command.properties) {\n if (!property.isGenerated) continue;\n const concept = concepts.get(property.type.name);\n if (property.type.isOptional || property.type.isCollection || (concept === undefined ? primitiveTypes.has(property.type.name) || composites.has(property.type.name) || conceptNames.has(property.type.name) || readModels.has(property.type.name) : concept.type !== 'Uuid' && concept.generation == null)) context.error(DiagnosticCodes.InvalidGeneratedType, 'A generated property must be a required, noncollection generatable concept.', property.location);\n }\n const response = command.response;\n if (response?.kind === 'ScalarCommandResponseSyntax') validateSource(response.source, null, command);\n else if (response?.kind === 'RecordCommandResponseSyntax') {\n if (response.fields.length === 0) context.error(DiagnosticCodes.InvalidCommandResponse, 'A response block requires at least one field.', response.location);\n const names = new Set<string>();\n for (const field of response.fields) {\n if (names.has(field.name)) context.error(DiagnosticCodes.DuplicateResponseField, `Duplicate response field '${field.name}'.`, field.location);\n names.add(field.name);\n validateSource(field.source, field.type, command);\n }\n }\n }\n const validateSpecification = (specification: SpecificationSyntax, scope: readonly string[]): void => {\n const action = effectiveCommand(specification.when, scope);\n const command = action === null ? null : resolve(action.commandType, scope);\n if (action !== null && command !== null) {\n const declared = properties.get(command)!;\n for (const input of action.values) {\n if (declared.get(input.property.split('.')[0])?.isGenerated) context.error(DiagnosticCodes.GeneratedPropertySuppliedAsInput, `Generated property '${input.property}' cannot be supplied as request or form input.`, input.location);\n }\n const identifiers = [...declared.values()].filter(property => property.isIdentifier);\n if (action.for !== null && identifiers.length === 1 && identifiers[0].isGenerated) {\n const type = identifiers[0].type;\n const known = primitiveTypes.has(type.name) || concepts.has(type.name) || composites.has(type.name);\n if (known && (type.isOptional || type.isCollection || !['Uuid', 'String'].includes(concepts.get(type.name)?.type ?? '') || !compatibleValue(action.for, type, concepts, composites))) {\n context.error(DiagnosticCodes.InvalidGeneratedFixture, \"A generated identifier fixture must supply one compatible concrete UUID value through 'for'.\", action.for.location);\n }\n }\n const names = new Set<string>();\n for (const fixture of action.generatedValues ?? []) {\n const property = declared.get(fixture.property);\n if (names.has(fixture.property) || property === undefined || !property.isGenerated || property.isIdentifier || !compatibleValue(fixture.source, property.type, concepts, composites)) context.error(DiagnosticCodes.InvalidGeneratedFixture, 'A generated fixture must uniquely supply a compatible value for a nonidentifier generated command property.', fixture.location);\n names.add(fixture.property);\n }\n }\n const expectation = specification.thenReturns;\n if (expectation == null) return;\n if (action === null || specification.thenErrors.length > 0 || specification.thenDenied != null) context.error(DiagnosticCodes.InvalidReturnExpectation, 'A return expectation requires a command action and cannot accompany an error or denial.', expectation.location);\n if (command === null) return;\n const response = command.response;\n const declared = properties.get(command)!;\n if (expectation.kind === 'ScalarSpecificationReturnSyntax' && response?.kind === 'ScalarCommandResponseSyntax' && declared.has(response.source.property)) {\n if (!compatibleValue(expectation.value, declared.get(response.source.property)!.type, concepts, composites)) context.error(DiagnosticCodes.InvalidReturnExpectation, \"The expected return value must match the response source's type.\", expectation.location);\n } else if (expectation.kind === 'RecordSpecificationReturnSyntax' && response?.kind === 'RecordCommandResponseSyntax') {\n if (expectation.fields.length === 0) context.error(DiagnosticCodes.InvalidReturnExpectation, 'A record return expectation requires at least one field.', expectation.location);\n const fields = responseFields.get(command)!;\n const asserted = new Set<string>();\n for (const field of expectation.fields) {\n const contract = fields.get(field.property);\n const property = contract === undefined ? undefined : declared.get(contract.source.property);\n if (asserted.has(field.property) || property === undefined || !compatibleValue(field.source, property.type, concepts, composites)) context.error(DiagnosticCodes.InvalidReturnExpectation, 'A return assertion must uniquely name a response field and supply a compatible concrete value.', field.location);\n asserted.add(field.property);\n }\n } else {\n context.error(DiagnosticCodes.InvalidReturnExpectation, \"The return expectation must match the command's scalar or record response shape.\", expectation.location);\n }\n };\n for (const { slice, scope } of slices) slice.specifications.forEach(specification => validateSpecification(specification, scope));\n for (const input of inputs) {\n if (input.isParameter === true) continue;\n const command = resolve(input.command, input.scope);\n if (command !== null && properties.get(command)!.get(input.property.split('.')[0])?.isGenerated) context.error(DiagnosticCodes.GeneratedPropertySuppliedAsInput, `Generated property '${input.property}' cannot be supplied as request or form input.`, input.location);\n }\n}\n\nexport function uniqueByName<T extends { readonly name: string }>(items: readonly T[]): Map<string, T> {\n const result = new Map<string, T>();\n const duplicates = new Set<string>();\n for (const item of items) {\n if (result.has(item.name)) duplicates.add(item.name);\n result.set(item.name, item);\n }\n duplicates.forEach(name => result.delete(name));\n return result;\n}\n\nexport function compatibleValue(value: ExpressionSyntax, type: TypeRefSyntax, concepts: ReadonlyMap<string, ConceptSyntax>, composites: ReadonlyMap<string, ReadonlyMap<string, PropertySyntax>>): boolean {\n if (value.kind === 'LiteralExpressionSyntax' && value.value === null) return type.isOptional;\n if (type.isCollection) return value.kind === 'ListExpressionSyntax' && value.items.every(item => compatibleValue(item, { ...type, isCollection: false, isOptional: false }, concepts, composites));\n const properties = composites.get(type.name);\n if (properties !== undefined) return value.kind === 'ObjectExpressionSyntax' && value.members.every(member => {\n const property = properties.get(member.name);\n return property !== undefined && compatibleValue(member.value, property.type, concepts, composites);\n });\n const concept = concepts.get(type.name);\n const primitive = concept?.type ?? type.name;\n if (concept?.type === 'Enum') return value.kind === 'LiteralExpressionSyntax' && typeof value.value === 'string' && concept.values.includes(value.value);\n if (value.kind === 'LiteralExpressionSyntax') {\n switch (primitive) {\n case 'Uuid': return typeof value.value === 'string' && uuidValue(value.value);\n case 'String': return typeof value.value === 'string';\n case 'Bool': return typeof value.value === 'boolean';\n case 'Int': return typeof value.value === 'number' ? Number.isFinite(value.value) && Number.isInteger(value.value) : typeof value.value === 'object' && value.value !== null && exactIsIntegral(value.value);\n case 'Decimal': return typeof value.value === 'number' ? Number.isFinite(value.value) : typeof value.value === 'object' && value.value !== null && value.value.literalType === 'ExactNumber';\n case 'Date': return typeof value.value === 'string' && responseDateValue(value.value, false);\n case 'DateTime': return typeof value.value === 'string' && responseDateValue(value.value, true);\n default: return !primitiveTypes.has(primitive);\n }\n }\n return !primitiveTypes.has(primitive) && concept === undefined;\n}\n\n// Shared with ResponseValueTypes.cs: 32 hex digits (N), hyphenated UUIDs (D), or D wrapped in\n// braces (B) / parentheses (P). Hex is case-insensitive; whitespace and X initializer notation\n// are not admitted in response/fixture values. The lookahead requires the true end, even after a newline.\nconst uuidValuePattern = /^(?:[0-9a-f]{32}|[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}|\\{[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}\\}|\\([0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}\\))(?![\\s\\S])/i;\n\nfunction uuidValue(text: string): boolean {\n return uuidValuePattern.test(text);\n}\n"],"mappings":"oUAgBA,MAAMA,kBAAiB,IAAI,IAAI,CAAC,OAAQ,SAAU,MAAO,UAAW,OAAQ,OAAQ,UAAU,CAAC,EAG/F,SAAgB,kBAAkB,EAAgC,EAAwB,EAA8BC,EAAQ,UAAiB,CAC7I,IAAMC,EAAmBC,EAA6BC,CAAW,EAC3DC,EAA6D,CAAC,EAC9D,SAAW,EAAwB,IAAoC,CACzE,IAAMC,EAAQ,CAAC,GAAGC,EAAQC,EAAQ,IAAI,EACtCA,EAAQ,OAAO,QAAQ,GAASH,EAAO,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js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{stringBodyPattern as t,unescapeString as n}from"../Text/StringLiteral.js";import{pattern as r}from"../Text/patterns.js";import{locationOf as i,startOf as a}from"./SourceLine.js";import{parseComplianceDirective as o,parseComplianceMarkers as s}from"./ConceptComplianceParser.js";import{firstWord as c,unescapeIdentifier as l}from"./LineText.js";import{describePlacement as u,documentPlacement as d,isDocumentPlacement as f}from"../Files/PlayPlacement.js";import{parseDescription as p}from"./DescriptionParser.js";import{parsePurpose as m}from"./PurposeParser.js";import{isFileImport as h,parseFileImport as g}from"./FileImportParser.js";import{recordAuthoredDocument as _}from"../Syntax/SourceOptions.js";import{collectInputUses as v}from"./InputUses.js";import{misplacedReactionIdentity as y}from"./ReactionIdentityParser.js";import{parseEventSource as b}from"./EventSourceParser.js";import{isFileDirective as x}from"./FileReferences.js";import{parseSystem as S}from"./OperationParser.js";import{parseExample as C}from"./SpecificationExampleParser.js";import{isBlankPublicEventOrigin as w}from"../Syntax/PublicEventInvariants.js";import{parseType as T}from"./DeclarationParsers.js";import{parseValidate as E}from"./CommandParser.js";import{parseTriggerDeclaration as D}from"./TriggerDataParser.js";import{FeatureBody as O,featureBodyExpected as k}from"./FeatureBody.js";import{ModuleBody as A,moduleBodyExpected as j,modulePattern as M,parseModule as N}from"./ModuleBody.js";import{EnumerationMembers as P}from"./EnumerationMembers.js";import{parseIdentity as F}from"./IdentityParser.js";import{parsePolicy as I}from"./PolicyParser.js";import{parseSeed as L}from"./SeedParser.js";import{parseExposure as R,parseInstance as z}from"./CompositionParser.js";const B=r(`^domain\\s+([A-Za-z_]\\w*(?:\\.[A-Za-z_]\\w*)*)$`),V=r(`^import\\s+([\\w.]+)(?:\\s+from\\s+"(?<origin>${t})")?$`),H=r(`^concept\\s+(\\w+)\\s*:\\s*(\\w+)((?:\\s+@?\\w+)*)$`),U=r(`^@?[a-z_]\\w*$`),W=r(`^persona\\s+([A-Za-z_]\\w*)$`),G=r(`^policy\\s+([A-Za-z_]\\w*)$`),K=/^[ ]*\t/,q=[`Uuid`,`String`,`Int`,`Decimal`,`Bool`,`Date`,`DateTime`],J=/* @__PURE__ */ new Set([`policy`,`authentication`,`seed`,`ui`,`theme`,`trigger`,`layout`,`behavior`]),Y=/* @__PURE__ */ new Set([`slice`,`feature`,`description`,`documentation`,`authorize`,`screen`,`dialog`,`form`,`contribute`,`on`,`uses`]);function parseApplication(t,r,a=d){t.deferIdentityValidation=!0,warnOnTabIndentation(t,r);let o=a.length===1?new A(a[0]):void 0,s=a.length>1?new O(a[a.length-1]):void 0,l=o??s,u=null,p=null,x=[],E=[],k=[],j=[],M=[],P=[],B=[],H=[],U=[],W=[],G=[],K=[],q=[],Y=[],X=[],Z=!1;for(let r=t.reader.peekSignificant();r!==void 0;r=t.reader.peekSignificant()){t.reader.takeSignificant();let s=c(r.content);if(s===`runs`)y(t,r);else if(s===`domain`)t.authoredDeclarations=!0,p=parseDomain(t,r,p,Z);else if(Z||=declaresConstruct(s,r,a),t.authoredDeclarations||=s!==`import`&&declaresConstruct(s,r,a),s===`import`&&h(r.content))l===void 0?g(t,r,E):l.tryParse(t,r);else if(s===`import`){let a=V.exec(r.content);if(a===null)t.error(e.InvalidImportDeclaration,`Invalid import '${r.content}' - expected 'import <Qualified.Name> [from "<origin>"]'`,i(r));else{let o=a.groups?.origin===void 0?null:n(a.groups.origin);o!==null&&w(o)&&t.error(e.InvalidImportDeclaration,`An import origin must be a nonblank quoted string`,i(r)),x.push({kind:`ImportSyntax`,qualifiedName:a[1],origin:o,visibility:o===null?`Private`:`Public`,location:i(r)})}}else if(s===`example`)l===void 0?K.push(C(t,r)):l.tryParse(t,r);else if(s===`eventsource`)P.push(b(t,r));else if(s===`system`)M.push(S(t,r));else if(s===`concept`)k.push(parseConcept(t,r));else if(s===`type`)j.push(T(t,r));else if(s===`module`&&!f(a))parseModuleInPlacedFile(t,r,a,o);else if(s===`module`)B.push(N(t,r));else if(s===`persona`)H.push(parsePersona(t,r));else if(s===`seed`)G.push(L(t.valueContext,r));else if(s===`purpose`&&l!==void 0)l.tryParse(t,r);else if(s===`purpose`)W.push(m(t,r));else if(s===`identity`)u=F(t,r,u);else if(s===`policy`)U.push(I(t,r));else if(s===`exposure`)Y.push(R(t,r));else if(s===`instance`)X.push(z(t,r));else if(s===`trigger`){let e=D(t,r),n=/^trigger\s+([A-Za-z_]\w*)$/.exec(r.content)?.[1];n!==void 0&&q.push({name:n,data:e})}else J.has(s)?s===`behavior`||s===`layout`?v(t,r):t.skipOpaqueBlock(r.indent):l?.tryParse(t,r)!==!0&&reportUnexpectedTopLevel(t,r,a)}o===void 0?s!==void 0&&B.unshift(place(a,s.build(t.start,!0),t.start)):B.unshift(o.build(t.start,!0));let Q={kind:`ApplicationSyntax`,...u===null?{}:{identity:u},sourceOptions:t.sourceOptions,domain:p,imports:x,concepts:k,types:j,systems:M,eventSources:P,examples:K,modules:B,personas:H,policies:U,purposes:W,seeds:G,declaredTriggers:q,fileImports:E,...Y.length>0?{exposures:Y}:{},...X.length>0?{instanceContributions:X}:{},location:t.start};return t.authoredDeclarations&&_(Q),Q}function declaresConstruct(e,t,n){return e===`import`?V.test(t.content):e===`module`?f(n):e===`identity`?t.content===`identity`:e===`purpose`||e===`example`||e===`exposure`||e===`instance`||e===`eventsource`||e===`system`||e===`concept`||e===`type`||e===`persona`||J.has(e)}function parseModuleInPlacedFile(t,n,r,a){let o=M.exec(n.content)?.[1]??``;a!==void 0&&o===r[0]?(t.authoredDeclarations=!0,a.parseChildren(t,n)):(t.error(e.ModuleInPlacedFile,`This file is imported into ${u(r)}, so it cannot declare module '${o}' - import it at the top level of a document instead`,i(n)),t.skipBlock(n.indent))}function reportUnexpectedTopLevel(t,n,r){let a=c(n.content);if(f(r)){let r=Y.has(a)?` - '${a}' belongs in a module or feature; wrap it in one, or import this file from inside one`:` - expected domain, import, concept, type, policy, persona, authentication, identity, module, seed, trigger, behavior, ui profile, theme or layout`;t.error(e.UnknownTopLevelConstruct,`Unexpected '${a}' at the top level${r}`,i(n))}else{let o=r.length===1?j:k;t.error(e.UnexpectedInPlacedFile,`Unexpected '${a}' in a file imported into ${u(r)} - expected an application declaration or ${o}`,i(n))}t.skipBlock(n.indent)}function place(e,t,n){let r=t;for(let t=e.length-2;t>=1;t--)r={kind:`FeatureSyntax`,name:e[t],description:null,authorize:null,features:[r],slices:[],fileImports:[],isPlacement:!0,location:n};return{kind:`ModuleSyntax`,name:e[0],description:null,authorize:null,features:[r],fileImports:[],isPlacement:!0,location:n}}function parseDomain(t,n,r,a){let o=B.exec(n.content);return o===null?(t.error(e.InvalidDomainDeclaration,`Invalid domain declaration '${n.content}' - expected 'domain <Qualified.Name>'`,i(n)),r):r===null?(a&&t.error(e.DomainNotFirst,`'domain' must be declared before any other construct`,i(n)),{kind:`DomainSyntax`,name:o[1],location:i(n)}):(t.error(e.DuplicateDomain,`The document already declares a domain - a document can have at most one`,i(n)),r)}function warnOnTabIndentation(t,n){let r=!1;for(let i of n)i.raw.trimStart().startsWith("```")?r=!r:!r&&K.test(i.raw)&&t.warning(e.TabIndentation,`Screenplay is indentation based - use spaces, not tabs`,a(i))}function parseConcept(t,n){let r=H.exec(n.content);if(r===null)return t.error(e.InvalidConceptDeclaration,`Invalid concept declaration '${n.content}' - expected 'concept <Name> : <Type>'`,i(n)),t.skipBlock(n.indent),{kind:`ConceptSyntax`,name:c(n.content),type:``,attributes:[],values:[],location:i(n)};let[,a,u,d]=r,f=s(t,n,a,d);u!==`Enum`&&!q.includes(u)&&t.error(e.UnknownPrimitiveType,`Unknown primitive type '${u}' - expected ${q.join(`, `)} or Enum`,i(n));let m=[],h=new P,g=null,_=[];for(let r=t.peekChild(n.indent);r!==void 0;r=t.peekChild(n.indent)){t.reader.takeSignificant();let n=u===`Enum`?h.tryNumbered(t,r):void 0;if(n!==void 0)m.push(n);else if(c(r.content)===`description`&&(u!==`Enum`||r.content!==`description`||t.peekChild(r.indent)?.content.startsWith("```")===!0))g=p(t,r,g,`Concept '${a}'`);else if(x(r))continue;else if(c(r.content)===`validate`){u===`Enum`&&r.content===`validate`&&t.peekChild(r.indent)===void 0&&t.warning(e.ValidateReadAsEnumerationBlock,`'validate' in enumeration concept '${a}' declares an empty validate block, not a value named 'validate' - write '@validate' for the value`,i(r));let n=E(t,r,`concept`);n!==void 0&&_.push(n)}else o(t,r,a,f)||(u===`Enum`&&U.test(r.content)?m.push(l(r.content)):u===`Enum`?t.error(e.InvalidEnumerationValue,`Invalid enum value '${r.content}' - expected an identifier`,i(r)):(t.error(e.UnknownConceptDirective,`Unexpected '${r.content}' in concept body - expected validate, 'file <path>' or '<attribute> reason "<text>"'`,i(r)),t.skipBlock(r.indent)))}let v=h.finish(t,n,m.length);return{kind:`ConceptSyntax`,name:a,type:u,attributes:f,values:m,validations:_,description:g,...v===void 0?{}:{valueNumbers:v},location:i(n)}}function parsePersona(t,n){let r=W.exec(n.content)?.[1]??``;r===``&&t.error(e.InvalidPersonaDeclaration,`Invalid persona declaration '${n.content}' - expected 'persona <Name>'`,i(n));let a=null,o=[];for(let s=t.peekChild(n.indent);s!==void 0;s=t.peekChild(n.indent)){t.reader.takeSignificant();let n=c(s.content);if(n===`description`)a=p(t,s,a,`Persona '${r}'`);else if(n===`policy`){let n=G.exec(s.content);n===null?t.error(e.InvalidPersonaPolicyReference,`Invalid policy reference '${s.content}' - expected 'policy <Name>'`,i(s)):o.push(n[1])}else t.error(e.UnknownPersonaDirective,`Unexpected '${n}' in persona body - expected description or policy`,i(s)),t.skipBlock(s.indent)}return{kind:`PersonaSyntax`,name:r,description:a,policies:o,location:i(n)}}export{parseApplication};
1
+ import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{stringBodyPattern as t,unescapeString as n}from"../Text/StringLiteral.js";import{pattern as r}from"../Text/patterns.js";import{locationOf as i,startOf as a}from"./SourceLine.js";import{parseComplianceDirective as o,parseComplianceMarkers as s}from"./ConceptComplianceParser.js";import{firstWord as c,unescapeIdentifier as l}from"./LineText.js";import{describePlacement as u,documentPlacement as d,isDocumentPlacement as f}from"../Files/PlayPlacement.js";import{parseDescription as p}from"./DescriptionParser.js";import{parsePurpose as m}from"./PurposeParser.js";import{isFileImport as h,parseFileImport as g}from"./FileImportParser.js";import{recordAuthoredDocument as _}from"../Syntax/SourceOptions.js";import{collectInputUses as v}from"./InputUses.js";import{misplacedReactionIdentity as y}from"./ReactionIdentityParser.js";import{parseEventSource as b}from"./EventSourceParser.js";import{isFileDirective as x}from"./FileReferences.js";import{parseSystem as S}from"./OperationParser.js";import{parseExample as C}from"./SpecificationExampleParser.js";import{isBlankPublicEventOrigin as w}from"../Syntax/PublicEventInvariants.js";import{parseType as T}from"./DeclarationParsers.js";import{parseValidate as E}from"./CommandParser.js";import{parseTriggerDeclaration as D}from"./TriggerDataParser.js";import{FeatureBody as O,featureBodyExpected as k}from"./FeatureBody.js";import{ModuleBody as A,moduleBodyExpected as j,modulePattern as M,parseModule as N}from"./ModuleBody.js";import{EnumerationMembers as P}from"./EnumerationMembers.js";import{parseGeneration as F}from"./GenerationParser.js";import{parseIdentity as I}from"./IdentityParser.js";import{parsePolicy as L}from"./PolicyParser.js";import{parseSeed as R}from"./SeedParser.js";import{parseExposure as z,parseInstance as B}from"./CompositionParser.js";const V=r(`^domain\\s+([A-Za-z_]\\w*(?:\\.[A-Za-z_]\\w*)*)$`),H=r(`^import\\s+([\\w.]+)(?:\\s+from\\s+"(?<origin>${t})")?$`),U=r(`^concept\\s+(\\w+)\\s*:\\s*(\\w+)((?:\\s+@?\\w+)*)$`),W=r(`^@?[a-z_]\\w*$`),G=r(`^persona\\s+([A-Za-z_]\\w*)$`),K=r(`^policy\\s+([A-Za-z_]\\w*)$`),q=/^[ ]*\t/,J=[`Uuid`,`String`,`Int`,`Decimal`,`Bool`,`Date`,`DateTime`],Y=/* @__PURE__ */ new Set([`policy`,`authentication`,`seed`,`ui`,`theme`,`trigger`,`layout`,`behavior`]),X=/* @__PURE__ */ new Set([`slice`,`feature`,`description`,`documentation`,`authorize`,`screen`,`dialog`,`form`,`contribute`,`on`,`uses`]);function parseApplication(t,r,a=d){t.deferIdentityValidation=!0,warnOnTabIndentation(t,r);let o=a.length===1?new A(a[0]):void 0,s=a.length>1?new O(a[a.length-1]):void 0,l=o??s,u=null,p=null,x=[],E=[],k=[],j=[],M=[],P=[],F=[],V=[],U=[],W=[],G=[],K=[],q=[],J=[],X=[],Z=!1;for(let r=t.reader.peekSignificant();r!==void 0;r=t.reader.peekSignificant()){t.reader.takeSignificant();let s=c(r.content);if(s===`runs`)y(t,r);else if(s===`domain`)t.authoredDeclarations=!0,p=parseDomain(t,r,p,Z);else if(Z||=declaresConstruct(s,r,a),t.authoredDeclarations||=s!==`import`&&declaresConstruct(s,r,a),s===`import`&&h(r.content))l===void 0?g(t,r,E):l.tryParse(t,r);else if(s===`import`){let a=H.exec(r.content);if(a===null)t.error(e.InvalidImportDeclaration,`Invalid import '${r.content}' - expected 'import <Qualified.Name> [from "<origin>"]'`,i(r));else{let o=a.groups?.origin===void 0?null:n(a.groups.origin);o!==null&&w(o)&&t.error(e.InvalidImportDeclaration,`An import origin must be a nonblank quoted string`,i(r)),x.push({kind:`ImportSyntax`,qualifiedName:a[1],origin:o,visibility:o===null?`Private`:`Public`,location:i(r)})}}else if(s===`example`)l===void 0?K.push(C(t,r)):l.tryParse(t,r);else if(s===`eventsource`)P.push(b(t,r));else if(s===`system`)M.push(S(t,r));else if(s===`concept`)k.push(parseConcept(t,r));else if(s===`type`)j.push(T(t,r));else if(s===`module`&&!f(a))parseModuleInPlacedFile(t,r,a,o);else if(s===`module`)F.push(N(t,r));else if(s===`persona`)V.push(parsePersona(t,r));else if(s===`seed`)G.push(R(t.valueContext,r));else if(s===`purpose`&&l!==void 0)l.tryParse(t,r);else if(s===`purpose`)W.push(m(t,r));else if(s===`identity`)u=I(t,r,u);else if(s===`policy`)U.push(L(t,r));else if(s===`exposure`)J.push(z(t,r));else if(s===`instance`)X.push(B(t,r));else if(s===`trigger`){let e=D(t,r),n=/^trigger\s+([A-Za-z_]\w*)$/.exec(r.content)?.[1];n!==void 0&&q.push({name:n,data:e})}else Y.has(s)?s===`behavior`||s===`layout`?v(t,r):t.skipOpaqueBlock(r.indent):l?.tryParse(t,r)!==!0&&reportUnexpectedTopLevel(t,r,a)}o===void 0?s!==void 0&&F.unshift(place(a,s.build(t.start,!0),t.start)):F.unshift(o.build(t.start,!0));let Q={kind:`ApplicationSyntax`,...u===null?{}:{identity:u},sourceOptions:t.sourceOptions,domain:p,imports:x,concepts:k,types:j,systems:M,eventSources:P,examples:K,modules:F,personas:V,policies:U,purposes:W,seeds:G,declaredTriggers:q,fileImports:E,...J.length>0?{exposures:J}:{},...X.length>0?{instanceContributions:X}:{},location:t.start};return t.authoredDeclarations&&_(Q),Q}function declaresConstruct(e,t,n){return e===`import`?H.test(t.content):e===`module`?f(n):e===`identity`?t.content===`identity`:e===`purpose`||e===`example`||e===`exposure`||e===`instance`||e===`eventsource`||e===`system`||e===`concept`||e===`type`||e===`persona`||Y.has(e)}function parseModuleInPlacedFile(t,n,r,a){let o=M.exec(n.content)?.[1]??``;a!==void 0&&o===r[0]?(t.authoredDeclarations=!0,a.parseChildren(t,n)):(t.error(e.ModuleInPlacedFile,`This file is imported into ${u(r)}, so it cannot declare module '${o}' - import it at the top level of a document instead`,i(n)),t.skipBlock(n.indent))}function reportUnexpectedTopLevel(t,n,r){let a=c(n.content);if(f(r)){let r=X.has(a)?` - '${a}' belongs in a module or feature; wrap it in one, or import this file from inside one`:` - expected domain, import, concept, type, policy, persona, authentication, identity, module, seed, trigger, behavior, ui profile, theme or layout`;t.error(e.UnknownTopLevelConstruct,`Unexpected '${a}' at the top level${r}`,i(n))}else{let o=r.length===1?j:k;t.error(e.UnexpectedInPlacedFile,`Unexpected '${a}' in a file imported into ${u(r)} - expected an application declaration or ${o}`,i(n))}t.skipBlock(n.indent)}function place(e,t,n){let r=t;for(let t=e.length-2;t>=1;t--)r={kind:`FeatureSyntax`,name:e[t],description:null,authorize:null,features:[r],slices:[],fileImports:[],isPlacement:!0,location:n};return{kind:`ModuleSyntax`,name:e[0],description:null,authorize:null,features:[r],fileImports:[],isPlacement:!0,location:n}}function parseDomain(t,n,r,a){let o=V.exec(n.content);return o===null?(t.error(e.InvalidDomainDeclaration,`Invalid domain declaration '${n.content}' - expected 'domain <Qualified.Name>'`,i(n)),r):r===null?(a&&t.error(e.DomainNotFirst,`'domain' must be declared before any other construct`,i(n)),{kind:`DomainSyntax`,name:o[1],location:i(n)}):(t.error(e.DuplicateDomain,`The document already declares a domain - a document can have at most one`,i(n)),r)}function warnOnTabIndentation(t,n){let r=!1;for(let i of n)i.raw.trimStart().startsWith("```")?r=!r:!r&&q.test(i.raw)&&t.warning(e.TabIndentation,`Screenplay is indentation based - use spaces, not tabs`,a(i))}function parseConcept(t,n){let r=U.exec(n.content);if(r===null)return t.error(e.InvalidConceptDeclaration,`Invalid concept declaration '${n.content}' - expected 'concept <Name> : <Type>'`,i(n)),t.skipBlock(n.indent),{kind:`ConceptSyntax`,name:c(n.content),type:``,attributes:[],values:[],location:i(n)};let[,a,u,d]=r,f=s(t,n,a,d);u!==`Enum`&&!J.includes(u)&&t.error(e.UnknownPrimitiveType,`Unknown primitive type '${u}' - expected ${J.join(`, `)} or Enum`,i(n));let m=[],h=new P,g=null,_=!1,v=null,y=[];for(let r=t.peekChild(n.indent);r!==void 0;r=t.peekChild(n.indent)){t.reader.takeSignificant();let n=u===`Enum`?h.tryNumbered(t,r):void 0;if(n!==void 0)m.push(n);else if(c(r.content)===`description`&&(u!==`Enum`||r.content!==`description`||t.peekChild(r.indent)?.content.startsWith("```")===!0))v=p(t,r,v,`Concept '${a}'`);else if(x(r))continue;else if(c(r.content)===`validate`){u===`Enum`&&r.content===`validate`&&t.peekChild(r.indent)===void 0&&t.warning(e.ValidateReadAsEnumerationBlock,`'validate' in enumeration concept '${a}' declares an empty validate block, not a value named 'validate' - write '@validate' for the value`,i(r));let n=E(t,r,`concept`);n!==void 0&&y.push(n)}else if(c(r.content)===`generate`&&(u!==`Enum`||r.content!==`generate`)){_&&t.error(e.DuplicateGeneration,`Concept '${a}' declares generation more than once.`,i(r));let n=F(t,r,u);_||(g=n),_=!0}else o(t,r,a,f)||(u===`Enum`&&W.test(r.content)?m.push(l(r.content)):u===`Enum`?t.error(e.InvalidEnumerationValue,`Invalid enum value '${r.content}' - expected an identifier`,i(r)):(t.error(e.UnknownConceptDirective,`Unexpected '${r.content}' in concept body - expected validate, generate, 'file <path>' or '<attribute> reason "<text>"'`,i(r)),t.skipBlock(r.indent)))}let b=h.finish(t,n,m.length);return{kind:`ConceptSyntax`,name:a,type:u,attributes:f,values:m,validations:y,description:v,...g===null?{}:{generation:g},...b===void 0?{}:{valueNumbers:b},location:i(n)}}function parsePersona(t,n){let r=G.exec(n.content)?.[1]??``;r===``&&t.error(e.InvalidPersonaDeclaration,`Invalid persona declaration '${n.content}' - expected 'persona <Name>'`,i(n));let a=null,o=[];for(let s=t.peekChild(n.indent);s!==void 0;s=t.peekChild(n.indent)){t.reader.takeSignificant();let n=c(s.content);if(n===`description`)a=p(t,s,a,`Persona '${r}'`);else if(n===`policy`){let n=K.exec(s.content);n===null?t.error(e.InvalidPersonaPolicyReference,`Invalid policy reference '${s.content}' - expected 'policy <Name>'`,i(s)):o.push(n[1])}else t.error(e.UnknownPersonaDirective,`Unexpected '${n}' in persona body - expected description or policy`,i(s)),t.skipBlock(s.indent)}return{kind:`PersonaSyntax`,name:r,description:a,policies:o,location:i(n)}}export{parseApplication};
2
2
  //# sourceMappingURL=ScreenplayParser.js.map