@intentius/chant-lexicon-aws 0.124.30 → 0.124.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/dynamodb.js +41 -0
- package/dist/actions/ecr.js +9 -0
- package/dist/actions/ecs.js +5 -0
- package/dist/actions/iam.js +3 -0
- package/dist/actions/index.js +9 -0
- package/dist/actions/lambda.js +11 -0
- package/dist/actions/logs.js +4 -0
- package/dist/actions/s3.js +40 -0
- package/dist/actions/sns.js +5 -0
- package/dist/actions/sqs.js +15 -0
- package/dist/agentcore/trace-fetch.d.ts.map +1 -1
- package/dist/agentcore/trace-fetch.js +472 -0
- package/dist/agentcore/trace-render.js +359 -0
- package/dist/ambient.js +148 -0
- package/dist/api/credential-chain.d.ts +30 -3
- package/dist/api/credential-chain.d.ts.map +1 -1
- package/dist/api/credential-chain.js +509 -0
- package/dist/api/read-client.d.ts +16 -43
- package/dist/api/read-client.d.ts.map +1 -1
- package/dist/api/read-client.js +458 -0
- package/dist/api/sigv4.d.ts +4 -4
- package/dist/api/sigv4.js +185 -0
- package/dist/behaviour-kinds.js +114 -0
- package/dist/caller-identity.d.ts +3 -5
- package/dist/caller-identity.d.ts.map +1 -1
- package/dist/caller-identity.js +146 -0
- package/dist/codegen/docs-cli.js +2 -0
- package/dist/codegen/docs.js +120 -0
- package/dist/codegen/enum-overlay.js +162 -0
- package/dist/codegen/extensions.js +139 -0
- package/dist/codegen/fallback.js +32 -0
- package/dist/codegen/generate-cli.js +15 -0
- package/dist/codegen/generate-lexicon.js +70 -0
- package/dist/codegen/generate-typescript.js +226 -0
- package/dist/codegen/generate.d.ts.map +1 -1
- package/dist/codegen/generate.js +234 -0
- package/dist/codegen/naming.js +135 -0
- package/dist/codegen/package.js +67 -0
- package/dist/codegen/patches.d.ts +26 -1
- package/dist/codegen/patches.d.ts.map +1 -1
- package/dist/codegen/patches.js +90 -0
- package/dist/codegen/property-overlay.js +85 -0
- package/dist/codegen/property-overlay.json +1 -16
- package/dist/codegen/sam.js +402 -0
- package/dist/codegen/typecheck.js +4 -0
- package/dist/codegen/versions.js +31 -0
- package/dist/components/__tests__/mock-cloud-executor.js +326 -0
- package/dist/components/apply.d.ts +44 -1
- package/dist/components/apply.d.ts.map +1 -1
- package/dist/components/apply.js +752 -0
- package/dist/components/builders.js +37 -0
- package/dist/components/capability-plugin.js +66 -0
- package/dist/components/cloud-executor.d.ts +35 -0
- package/dist/components/cloud-executor.d.ts.map +1 -1
- package/dist/components/cloud-executor.js +576 -0
- package/dist/components/config-bom.js +207 -0
- package/dist/components/host-delivery.js +117 -0
- package/dist/components/index.js +18 -0
- package/dist/components/job-submission.js +77 -0
- package/dist/components/publish.js +234 -0
- package/dist/components/safety.js +62 -0
- package/dist/components/wait-aws.js +68 -0
- package/dist/composites/agentcore-agent.js +187 -0
- package/dist/composites/agentcore-trust-policy.js +13 -0
- package/dist/composites/alb-shared.js +84 -0
- package/dist/composites/bucket-deployment.js +93 -0
- package/dist/composites/catalog.js +2714 -0
- package/dist/composites/dynamodb-table.js +66 -0
- package/dist/composites/ec2-instance-bundle.js +75 -0
- package/dist/composites/ec2-instance-role.js +26 -0
- package/dist/composites/ecr-repository.js +64 -0
- package/dist/composites/ecs-trust-policy.js +10 -0
- package/dist/composites/efs-with-access-point.js +44 -0
- package/dist/composites/eks-cluster.js +118 -0
- package/dist/composites/fargate-alb.js +216 -0
- package/dist/composites/fargate-service.js +222 -0
- package/dist/composites/index.js +28 -0
- package/dist/composites/lambda-api.js +15 -0
- package/dist/composites/lambda-dynamodb.js +77 -0
- package/dist/composites/lambda-eventbridge.js +27 -0
- package/dist/composites/lambda-function.js +54 -0
- package/dist/composites/lambda-s3.js +93 -0
- package/dist/composites/lambda-sns.js +23 -0
- package/dist/composites/lambda-sqs.js +34 -0
- package/dist/composites/landing-zone.js +82 -0
- package/dist/composites/microvm-app.js +293 -0
- package/dist/composites/minimal-vpc.js +40 -0
- package/dist/composites/monitoring-stack.js +105 -0
- package/dist/composites/nlb-service.js +61 -0
- package/dist/composites/rds-instance.js +98 -0
- package/dist/composites/scheduled-lambda.js +28 -0
- package/dist/composites/solr-fargate-service.js +33 -0
- package/dist/composites/step-functions-workflow.js +78 -0
- package/dist/composites/vpc-default.js +132 -0
- package/dist/condition.js +43 -0
- package/dist/coverage.js +4 -0
- package/dist/deep-observe.d.ts.map +1 -1
- package/dist/deep-observe.js +709 -0
- package/dist/deep-topology.js +226 -0
- package/dist/default-tags.js +50 -0
- package/dist/defaults.js +85 -0
- package/dist/dependencies.js +269 -0
- package/dist/detect.js +21 -0
- package/dist/disruption.d.ts.map +1 -1
- package/dist/disruption.js +129 -0
- package/dist/effect-receipt-row.js +107 -0
- package/dist/generated/index.d.ts +1297 -82
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +12382 -0
- package/dist/generated/runtime.js +4 -0
- package/dist/governance.js +131 -0
- package/dist/identity-observe.d.ts.map +1 -1
- package/dist/identity-observe.js +127 -0
- package/dist/import/generator.js +757 -0
- package/dist/import/live-export.js +34 -0
- package/dist/import/parser.js +394 -0
- package/dist/index.js +69 -0
- package/dist/integrity.json +6 -6
- package/dist/intrinsics.js +393 -0
- package/dist/lint/audit-catalog.js +87 -0
- package/dist/lint/audit-lineage.js +150 -0
- package/dist/lint/post-synth/cf-refs.js +247 -0
- package/dist/lint/post-synth/cor020.js +60 -0
- package/dist/lint/post-synth/ext001.d.ts.map +1 -1
- package/dist/lint/post-synth/ext001.js +197 -0
- package/dist/lint/post-synth/index.js +124 -0
- package/dist/lint/post-synth/waw010.js +41 -0
- package/dist/lint/post-synth/waw011.js +41 -0
- package/dist/lint/post-synth/waw013.js +38 -0
- package/dist/lint/post-synth/waw014.js +42 -0
- package/dist/lint/post-synth/waw015.js +88 -0
- package/dist/lint/post-synth/waw016.d.ts.map +1 -1
- package/dist/lint/post-synth/waw016.js +116 -0
- package/dist/lint/post-synth/waw017.js +43 -0
- package/dist/lint/post-synth/waw018.js +61 -0
- package/dist/lint/post-synth/waw019.js +64 -0
- package/dist/lint/post-synth/waw020.js +56 -0
- package/dist/lint/post-synth/waw021.js +44 -0
- package/dist/lint/post-synth/waw022.js +36 -0
- package/dist/lint/post-synth/waw023.js +40 -0
- package/dist/lint/post-synth/waw024.js +46 -0
- package/dist/lint/post-synth/waw025.js +36 -0
- package/dist/lint/post-synth/waw026.js +38 -0
- package/dist/lint/post-synth/waw027.js +41 -0
- package/dist/lint/post-synth/waw028.js +39 -0
- package/dist/lint/post-synth/waw029.js +54 -0
- package/dist/lint/post-synth/waw030.js +282 -0
- package/dist/lint/post-synth/waw031.js +58 -0
- package/dist/lint/post-synth/waw032.js +45 -0
- package/dist/lint/post-synth/waw033.js +75 -0
- package/dist/lint/post-synth/waw034.js +52 -0
- package/dist/lint/post-synth/waw035.js +56 -0
- package/dist/lint/post-synth/waw036.js +79 -0
- package/dist/lint/post-synth/waw037.js +67 -0
- package/dist/lint/post-synth/waw038.js +42 -0
- package/dist/lint/post-synth/waw039.js +42 -0
- package/dist/lint/post-synth/waw040.js +45 -0
- package/dist/lint/post-synth/waw041.js +40 -0
- package/dist/lint/post-synth/waw042.js +99 -0
- package/dist/lint/post-synth/waw043.js +51 -0
- package/dist/lint/post-synth/waw044.js +64 -0
- package/dist/lint/post-synth/waw045.js +49 -0
- package/dist/lint/post-synth/waw046.js +52 -0
- package/dist/lint/post-synth/waw047.js +43 -0
- package/dist/lint/post-synth/waw048.js +40 -0
- package/dist/lint/post-synth/waw049.js +78 -0
- package/dist/lint/post-synth/waw050.js +44 -0
- package/dist/lint/post-synth/waw051.js +41 -0
- package/dist/lint/post-synth/waw052.js +43 -0
- package/dist/lint/post-synth/waw053.js +43 -0
- package/dist/lint/post-synth/waw054.js +41 -0
- package/dist/lint/post-synth/waw055.js +41 -0
- package/dist/lint/post-synth/waw056.js +65 -0
- package/dist/lint/post-synth/waw057.js +43 -0
- package/dist/lint/post-synth/waw058.js +61 -0
- package/dist/lint/post-synth/waw059.js +338 -0
- package/dist/lint/post-synth/waw060.js +83 -0
- package/dist/lint/post-synth/waw061.js +60 -0
- package/dist/lint/post-synth/waw062.js +0 -0
- package/dist/lint/post-synth/waw063.js +0 -0
- package/dist/lint/post-synth/waw064.js +45 -0
- package/dist/lint/post-synth/waw065.js +104 -0
- package/dist/lint/post-synth/waw066.js +145 -0
- package/dist/lint/post-synth/waw067.js +115 -0
- package/dist/lint/post-synth/waw068.js +69 -0
- package/dist/lint/post-synth/waw069.js +0 -0
- package/dist/lint/rules/hardcoded-region.js +38 -0
- package/dist/lint/rules/iam-wildcard.js +60 -0
- package/dist/lint/rules/index.js +6 -0
- package/dist/lint/rules/s3-encryption.js +60 -0
- package/dist/live-attrs.js +42 -0
- package/dist/lsp/completions.d.ts.map +1 -1
- package/dist/lsp/completions.js +18 -0
- package/dist/lsp/hover.d.ts.map +1 -1
- package/dist/lsp/hover.js +66 -0
- package/dist/manifest.json +1 -1
- package/dist/mapping.js +33 -0
- package/dist/meta.json +17359 -784
- package/dist/nested-stack.js +95 -0
- package/dist/okf/index.md +203 -0
- package/dist/okf/rules/EXT001.md +1 -0
- package/dist/okf/rules/WAW016.md +2 -0
- package/dist/okf/rules/WAW019.md +1 -0
- package/dist/okf/rules/WAW028.md +1 -0
- package/dist/okf/rules/WAW030.md +2 -0
- package/dist/okf/rules/WAW039.md +1 -0
- package/dist/okf/rules/WAW049.md +1 -0
- package/dist/okf/rules/WAW056.md +1 -0
- package/dist/okf/rules/WAW058.md +1 -0
- package/dist/okf/rules/WAW062.md +1 -0
- package/dist/okf/rules/WAW064.md +1 -0
- package/dist/okf/rules/WAW065.md +1 -0
- package/dist/okf/rules/WAW066.md +1 -0
- package/dist/okf/rules/WAW067.md +1 -0
- package/dist/okf/rules/WAW068.md +1 -0
- package/dist/okf/rules/WAW069.md +4 -0
- package/dist/okf/types/AIWorkloadConfig.md +23 -0
- package/dist/okf/types/ARCRegionSwitchPlan.md +1 -0
- package/dist/okf/types/AccountAccessApplication.md +28 -0
- package/dist/okf/types/AccountAccessEntitlement.md +22 -0
- package/dist/okf/types/ActionTarget.md +20 -0
- package/dist/okf/types/AdConfiguration.md +21 -0
- package/dist/okf/types/Adapter.md +26 -0
- package/dist/okf/types/AgentContext.md +35 -0
- package/dist/okf/types/AgentGoal.md +31 -0
- package/dist/okf/types/AgentProfile.md +34 -0
- package/dist/okf/types/Alarm.md +3 -1
- package/dist/okf/types/AlarmModel.md +14 -9
- package/dist/okf/types/AmplifyWebhook.md +25 -0
- package/dist/okf/types/ApiCache.md +8 -8
- package/dist/okf/types/ApiGatewayManagedOverrides.md +5 -5
- package/dist/okf/types/AppAuthorization.md +35 -0
- package/dist/okf/types/AppBlockBuilder.md +1 -0
- package/dist/okf/types/AppInstance.md +2 -2
- package/dist/okf/types/AppInstanceBot.md +2 -2
- package/dist/okf/types/AppStreamFleet.md +3 -2
- package/dist/okf/types/AppSyncApiKey.md +6 -6
- package/dist/okf/types/AppSyncType.md +22 -0
- package/dist/okf/types/ApplicationStatusCheck.md +36 -0
- package/dist/okf/types/ApplicationVersion.md +4 -1
- package/dist/okf/types/ApplicationsList.md +26 -0
- package/dist/okf/types/ApprovalPolicy.md +28 -0
- package/dist/okf/types/ArchiveRule.md +24 -0
- package/dist/okf/types/Asset.md +30 -0
- package/dist/okf/types/Backup.md +31 -0
- package/dist/okf/types/BedrockAgentCoreDataset.md +1 -1
- package/dist/okf/types/BedrockAgentCoreGateway.md +3 -0
- package/dist/okf/types/BedrockSession.md +28 -0
- package/dist/okf/types/BillEstimate.md +35 -0
- package/dist/okf/types/Brand.md +32 -0
- package/dist/okf/types/CallAnalyticsCategory.md +25 -0
- package/dist/okf/types/Campaign.md +28 -0
- package/dist/okf/types/CapacityProvider.md +30 -0
- package/dist/okf/types/Case.md +24 -0
- package/dist/okf/types/CertificateAssociation.md +13 -0
- package/dist/okf/types/ChangeSet.md +36 -0
- package/dist/okf/types/ChannelFlow.md +29 -0
- package/dist/okf/types/ChimeChannel.md +39 -0
- package/dist/okf/types/Classifier.md +6 -6
- package/dist/okf/types/ClientVpnAuthorizationRule.md +6 -6
- package/dist/okf/types/ClientVpnEndpoint.md +2 -0
- package/dist/okf/types/ClientVpnRoute.md +5 -5
- package/dist/okf/types/CloudConnector.md +29 -0
- package/dist/okf/types/Cluster.md +39 -0
- package/dist/okf/types/ClusterSchedulerConfig.md +30 -0
- package/dist/okf/types/CodeCommitRepository.md +12 -12
- package/dist/okf/types/CodeConnectionsHost.md +26 -0
- package/dist/okf/types/CodeRepository.md +5 -5
- package/dist/okf/types/CompositeAlarm.md +1 -0
- package/dist/okf/types/ComputeEnvironment.md +2 -0
- package/dist/okf/types/ComputeNodeGroup.md +1 -1
- package/dist/okf/types/ComputeQuota.md +34 -0
- package/dist/okf/types/ConfigRule.md +1 -1
- package/dist/okf/types/ConfigurationRecorder.md +7 -6
- package/dist/okf/types/ConnectAttachment.md +2 -0
- package/dist/okf/types/ConnectQueue.md +5 -1
- package/dist/okf/types/ConnectVocabulary.md +28 -0
- package/dist/okf/types/ConnectionType.md +24 -0
- package/dist/okf/types/ConsentPortal.md +33 -0
- package/dist/okf/types/ContactMethod.md +29 -0
- package/dist/okf/types/ContainerAssociation.md +26 -0
- package/dist/okf/types/ContainerFleet.md +1 -1
- package/dist/okf/types/ContainerGroupDefinition.md +1 -1
- package/dist/okf/types/Content.md +40 -0
- package/dist/okf/types/ContentAssociation.md +28 -0
- package/dist/okf/types/CustomDetectionRuleAssociation.md +28 -0
- package/dist/okf/types/CustomEntityType.md +4 -9
- package/dist/okf/types/Customization.md +22 -0
- package/dist/okf/types/CwIntegration.md +31 -0
- package/dist/okf/types/DAXParameterGroup.md +3 -8
- package/dist/okf/types/DAXSubnetGroup.md +0 -5
- package/dist/okf/types/DBClusterEndpoint.md +31 -0
- package/dist/okf/types/DBProxyTargetGroup.md +1 -0
- package/dist/okf/types/DBSnapshot.md +62 -0
- package/dist/okf/types/DLMLifecyclePolicy.md +12 -12
- package/dist/okf/types/DLPSetting.md +31 -0
- package/dist/okf/types/DMSInstanceProfile.md +1 -1
- package/dist/okf/types/DRSLaunchConfigurationTemplate.md +28 -0
- package/dist/okf/types/Daemon.md +1 -0
- package/dist/okf/types/DataExchangeDataSet.md +29 -0
- package/dist/okf/types/DataIntegrationFlow.md +27 -0
- package/dist/okf/types/DataMigration.md +1 -1
- package/dist/okf/types/DataProvider.md +2 -1
- package/dist/okf/types/DataQualityRuleset.md +6 -11
- package/dist/okf/types/DataSource.md +23 -0
- package/dist/okf/types/Dataset.md +20 -0
- package/dist/okf/types/DatasetIntegration.md +23 -0
- package/dist/okf/types/DbCluster.md +1 -1
- package/dist/okf/types/DbInstance.md +8 -2
- package/dist/okf/types/DeadlineBudget.md +29 -0
- package/dist/okf/types/DelegationSet.md +23 -0
- package/dist/okf/types/DeliveryChannel.md +6 -11
- package/dist/okf/types/DevOpsAgentAgentSpace.md +4 -0
- package/dist/okf/types/DevOpsAgentService.md +1 -0
- package/dist/okf/types/DevOpsAgentTrigger.md +28 -0
- package/dist/okf/types/DirectConnectGatewayAttachment.md +2 -0
- package/dist/okf/types/Directory.md +60 -0
- package/dist/okf/types/DocDBDBClusterParameterGroup.md +5 -10
- package/dist/okf/types/DocDBDBSubnetGroup.md +4 -9
- package/dist/okf/types/DocDBElasticClusterSnapshot.md +36 -0
- package/dist/okf/types/DocumentClassifierEndpoint.md +27 -0
- package/dist/okf/types/Domain.md +27 -0
- package/dist/okf/types/EKSCertificateAuthority.md +42 -0
- package/dist/okf/types/EKSCluster.md +8 -0
- package/dist/okf/types/EcSnapshot.md +66 -0
- package/dist/okf/types/EmailIdentityCertificate.md +15 -0
- package/dist/okf/types/EndpointConfig.md +14 -13
- package/dist/okf/types/EntityRecognizer.md +27 -0
- package/dist/okf/types/EntityRecognizerEndpoint.md +31 -0
- package/dist/okf/types/EnvironmentEC2.md +13 -13
- package/dist/okf/types/EvaluationForm.md +1 -0
- package/dist/okf/types/Evaluator.md +6 -2
- package/dist/okf/types/EventAction.md +26 -0
- package/dist/okf/types/EventRule.md +2 -0
- package/dist/okf/types/EventSource.md +30 -0
- package/dist/okf/types/EventTracker.md +22 -0
- package/dist/okf/types/EventsV2EventBus.md +28 -0
- package/dist/okf/types/EventsV2ResourcePolicy.md +19 -0
- package/dist/okf/types/EventsV2Subscriber.md +39 -0
- package/dist/okf/types/ExperimentDefinition.md +39 -0
- package/dist/okf/types/ExperimentRun.md +33 -0
- package/dist/okf/types/ExperimentTrialComponent.md +13 -11
- package/dist/okf/types/FHIRDatastore.md +3 -0
- package/dist/okf/types/FSxSnapshot.md +5 -5
- package/dist/okf/types/FSxVolume.md +9 -9
- package/dist/okf/types/FeaturedResultsSet.md +26 -0
- package/dist/okf/types/Feed.md +1 -0
- package/dist/okf/types/FieldLevelEncryptionConfig.md +25 -0
- package/dist/okf/types/FieldLevelEncryptionProfile.md +22 -0
- package/dist/okf/types/FileCache.md +45 -0
- package/dist/okf/types/Filter.md +27 -0
- package/dist/okf/types/Firewall.md +6 -0
- package/dist/okf/types/FlowMediaStream.md +28 -0
- package/dist/okf/types/FlowOutput.md +1 -0
- package/dist/okf/types/FpgaImage.md +38 -0
- package/dist/okf/types/Function.md +2 -2
- package/dist/okf/types/Gateway.md +41 -0
- package/dist/okf/types/GatewayClusterAssociations.md +23 -0
- package/dist/okf/types/GatewayRateLimit.md +26 -0
- package/dist/okf/types/GatewayRule.md +32 -0
- package/dist/okf/types/GlobalReplicationGroup.md +3 -0
- package/dist/okf/types/GlobalResolver.md +1 -1
- package/dist/okf/types/GlobalTable.md +1 -0
- package/dist/okf/types/GlueConnection.md +5 -4
- package/dist/okf/types/GlueSecurityConfiguration.md +1 -6
- package/dist/okf/types/GlueSession.md +38 -0
- package/dist/okf/types/GlueTable.md +5 -10
- package/dist/okf/types/GlueWorkflow.md +5 -10
- package/dist/okf/types/Group.md +27 -0
- package/dist/okf/types/Harness.md +1 -0
- package/dist/okf/types/HostKey.md +33 -0
- package/dist/okf/types/HostedZone.md +1 -0
- package/dist/okf/types/HttpApi.md +2 -0
- package/dist/okf/types/HttpNamespace.md +5 -5
- package/dist/okf/types/HubV2.md +1 -0
- package/dist/okf/types/HumanTaskUi.md +22 -0
- package/dist/okf/types/IPv4Pool.md +28 -0
- package/dist/okf/types/ImageBuilder.md +1 -0
- package/dist/okf/types/ImageBuilderImage.md +1 -1
- package/dist/okf/types/ImagePipeline.md +1 -1
- package/dist/okf/types/InferenceComponent.md +5 -1
- package/dist/okf/types/InfluxDBBackup.md +65 -0
- package/dist/okf/types/InfluxDBCluster.md +3 -0
- package/dist/okf/types/InfrastructureConfiguration.md +2 -0
- package/dist/okf/types/IngestionDestination.md +28 -0
- package/dist/okf/types/InputSecurityGroup.md +6 -4
- package/dist/okf/types/InspectorV2Connector.md +38 -0
- package/dist/okf/types/InstanceEventWindow.md +25 -0
- package/dist/okf/types/InstanceFleetConfig.md +10 -10
- package/dist/okf/types/InstanceGroupConfig.md +3 -3
- package/dist/okf/types/InstrumentationConfig.md +31 -0
- package/dist/okf/types/IntegrationAssociation.md +3 -0
- package/dist/okf/types/IoTSiteWiseApplication.md +34 -0
- package/dist/okf/types/IoTSiteWiseDataset.md +5 -2
- package/dist/okf/types/IoTSiteWiseTask.md +24 -0
- package/dist/okf/types/IpamExternalResourceVerificationToken.md +35 -0
- package/dist/okf/types/IpamInternetRegistryAssociation.md +32 -0
- package/dist/okf/types/Job.md +35 -0
- package/dist/okf/types/JobTemplate.md +26 -0
- package/dist/okf/types/KinesisChannel.md +31 -0
- package/dist/okf/types/KinesisStream.md +1 -0
- package/dist/okf/types/LambdaResourcePolicy.md +14 -0
- package/dist/okf/types/Lexicon.md +34 -0
- package/dist/okf/types/LicenseAssetGroup.md +23 -0
- package/dist/okf/types/LicenseConfiguration.md +33 -0
- package/dist/okf/types/LicenseServerEndpoint.md +32 -0
- package/dist/okf/types/LightsailKeyPair.md +29 -0
- package/dist/okf/types/LimitsProfile.md +27 -0
- package/dist/okf/types/LocationAzureBlob.md +2 -1
- package/dist/okf/types/LocationObjectStorage.md +1 -0
- package/dist/okf/types/LogAlarm.md +2 -0
- package/dist/okf/types/MGNConnector.md +23 -0
- package/dist/okf/types/MGNLaunchConfigurationTemplate.md +37 -0
- package/dist/okf/types/MLTransform.md +15 -15
- package/dist/okf/types/MWAAServerlessWorkflow.md +3 -0
- package/dist/okf/types/ManagedNotificationAccountContactAssociation.md +1 -0
- package/dist/okf/types/ManagedNotificationAdditionalChannelAssociation.md +1 -0
- package/dist/okf/types/MediaConvertJobTemplate.md +11 -13
- package/dist/okf/types/MediaConvertQueue.md +8 -10
- package/dist/okf/types/MediaInsightsPipelineConfiguration.md +28 -0
- package/dist/okf/types/MediaLiveInput.md +41 -18
- package/dist/okf/types/MediaPackageV2Channel.md +3 -0
- package/dist/okf/types/MediaPackageV2OriginEndpoint.md +1 -0
- package/dist/okf/types/MediaPipelineKinesisVideoStreamPool.md +28 -0
- package/dist/okf/types/MediaTailorFunction.md +27 -0
- package/dist/okf/types/MedicalVocabulary.md +21 -0
- package/dist/okf/types/Member.md +26 -0
- package/dist/okf/types/Memory.md +6 -0
- package/dist/okf/types/MemoryDBSnapshot.md +29 -0
- package/dist/okf/types/Metric.md +59 -0
- package/dist/okf/types/MetricAttribution.md +23 -0
- package/dist/okf/types/MicrosoftAD.md +11 -11
- package/dist/okf/types/MigrationProject.md +8 -1
- package/dist/okf/types/Monitor.md +26 -0
- package/dist/okf/types/NFSFileShare.md +44 -0
- package/dist/okf/types/NeptuneGraphGraph.md +1 -0
- package/dist/okf/types/NetworkConnector.md +4 -0
- package/dist/okf/types/NetworkFlowMonitorScope.md +23 -0
- package/dist/okf/types/NetworkMigrationDefinition.md +31 -0
- package/dist/okf/types/NetworkSecurityManagerDeployment.md +31 -0
- package/dist/okf/types/NetworkSecurityManagerPolicy.md +32 -0
- package/dist/okf/types/NetworkSecurityManagerScope.md +29 -0
- package/dist/okf/types/NotebookInstance.md +18 -18
- package/dist/okf/types/NotebookInstanceLifecycleConfig.md +6 -5
- package/dist/okf/types/NotifyConfiguration.md +35 -0
- package/dist/okf/types/OTelEnrichment.md +2 -0
- package/dist/okf/types/OnlineEvaluationConfig.md +0 -1
- package/dist/okf/types/OrganizationConfigRule.md +7 -7
- package/dist/okf/types/Outpost.md +32 -0
- package/dist/okf/types/ParallelData.md +40 -0
- package/dist/okf/types/Partition.md +5 -5
- package/dist/okf/types/PaymentConnector.md +4 -1
- package/dist/okf/types/Pentest.md +1 -0
- package/dist/okf/types/PerfReports.md +28 -0
- package/dist/okf/types/PermissionAssociation.md +30 -0
- package/dist/okf/types/PersonalizeDataset.md +1 -0
- package/dist/okf/types/PersonalizeDatasetGroup.md +1 -0
- package/dist/okf/types/PersonalizeSchema.md +1 -0
- package/dist/okf/types/Pipeline.md +25 -0
- package/dist/okf/types/PlaybackConfiguration.md +1 -0
- package/dist/okf/types/PolicyAssociation.md +1 -1
- package/dist/okf/types/PolicyGrant.md +2 -2
- package/dist/okf/types/PolicyPrincipalAttachment.md +2 -7
- package/dist/okf/types/PortalProduct.md +24 -0
- package/dist/okf/types/PrefetchSchedule.md +25 -0
- package/dist/okf/types/PricingPlanManagerSubscription.md +31 -0
- package/dist/okf/types/PrincipalAssociation.md +27 -0
- package/dist/okf/types/PrivateDnsNamespace.md +8 -8
- package/dist/okf/types/PrivateVirtualInterface.md +1 -0
- package/dist/okf/types/ProcurementPortalPreference.md +45 -0
- package/dist/okf/types/Program.md +33 -0
- package/dist/okf/types/ProjectMembership.md +1 -1
- package/dist/okf/types/ProtocolsList.md +26 -0
- package/dist/okf/types/PublicDnsNamespace.md +7 -7
- package/dist/okf/types/PublicVirtualInterface.md +1 -0
- package/dist/okf/types/QEV2IdcApplication.md +25 -0
- package/dist/okf/types/QueryLoggingConfig.md +21 -0
- package/dist/okf/types/QuerySuggestionsBlockList.md +25 -0
- package/dist/okf/types/QuickSightAssignment.md +24 -0
- package/dist/okf/types/RAMResourceAssociation.md +27 -0
- package/dist/okf/types/RDSClusterSnapshot.md +54 -0
- package/dist/okf/types/RDSDBParameterGroup.md +5 -0
- package/dist/okf/types/RDSDeployment.md +41 -0
- package/dist/okf/types/RcsAgent.md +38 -0
- package/dist/okf/types/ReceiptRule.md +5 -5
- package/dist/okf/types/ReceiptRuleSet.md +1 -6
- package/dist/okf/types/RecommenderFilter.md +27 -0
- package/dist/okf/types/RecommenderSchema.md +25 -0
- package/dist/okf/types/RecordSet.md +16 -22
- package/dist/okf/types/RecoveryPlan.md +28 -0
- package/dist/okf/types/RedshiftIdcApplication.md +31 -0
- package/dist/okf/types/RedshiftSnapshot.md +59 -0
- package/dist/okf/types/RegistrationAttachment.md +28 -0
- package/dist/okf/types/Registry.md +41 -0
- package/dist/okf/types/RegistryRecord.md +38 -0
- package/dist/okf/types/RelatedItem.md +24 -0
- package/dist/okf/types/ReplicationConfigurationTemplate.md +35 -0
- package/dist/okf/types/ReplicationSubnetGroup.md +4 -9
- package/dist/okf/types/ReplicationTask.md +14 -14
- package/dist/okf/types/ReportGenerator.md +29 -0
- package/dist/okf/types/ReportGroup.md +1 -3
- package/dist/okf/types/ResilienceHubV2Policy.md +1 -0
- package/dist/okf/types/ResilienceHubV2Service.md +1 -0
- package/dist/okf/types/ResourceConfiguration.md +1 -1
- package/dist/okf/types/ResourceMetricsConfiguration.md +21 -0
- package/dist/okf/types/RestApi.md +1 -0
- package/dist/okf/types/RetrievalInstruction.md +32 -0
- package/dist/okf/types/RouterOutput.md +1 -0
- package/dist/okf/types/Rule.md +31 -0
- package/dist/okf/types/RunCache.md +29 -0
- package/dist/okf/types/Runtime.md +2 -1
- package/dist/okf/types/SCNInstance.md +33 -0
- package/dist/okf/types/SDBDomain.md +2 -2
- package/dist/okf/types/SMBFileShare.md +49 -0
- package/dist/okf/types/SageMakerArtifact.md +27 -0
- package/dist/okf/types/SageMakerEndpoint.md +0 -1
- package/dist/okf/types/ScalableTarget.md +1 -0
- package/dist/okf/types/ScalingPlan.md +6 -6
- package/dist/okf/types/ScheduledReport.md +31 -0
- package/dist/okf/types/SecondaryNetwork.md +26 -0
- package/dist/okf/types/SecurityAgentArtifact.md +25 -0
- package/dist/okf/types/SecurityAgentIntegration.md +31 -0
- package/dist/okf/types/Server.md +1 -0
- package/dist/okf/types/ServerlessCache.md +2 -0
- package/dist/okf/types/ServerlessCacheSnapshot.md +31 -0
- package/dist/okf/types/ServerlessRepoApplication.md +32 -0
- package/dist/okf/types/ServiceDiscoveryInstance.md +3 -7
- package/dist/okf/types/SipMediaApplication.md +27 -0
- package/dist/okf/types/SiteToSiteVpnAttachment.md +2 -0
- package/dist/okf/types/SnapshotCopyGrant.md +20 -0
- package/dist/okf/types/Solution.md +1 -0
- package/dist/okf/types/SourceAssociation.md +25 -0
- package/dist/okf/types/SourceCredential.md +6 -6
- package/dist/okf/types/SourceNetwork.md +23 -0
- package/dist/okf/types/StackFleetAssociation.md +2 -7
- package/dist/okf/types/StorageTierPolicy.md +20 -0
- package/dist/okf/types/StorageVirtualMachine.md +9 -9
- package/dist/okf/types/Stream.md +28 -0
- package/dist/okf/types/SubnetCidrReservation.md +26 -0
- package/dist/okf/types/SubscriptionProvider.md +26 -0
- package/dist/okf/types/SupportPermit.md +29 -0
- package/dist/okf/types/Table.md +2 -1
- package/dist/okf/types/TableOptimizer.md +5 -10
- package/dist/okf/types/Tape.md +31 -0
- package/dist/okf/types/Template.md +36 -0
- package/dist/okf/types/Tenant.md +2 -0
- package/dist/okf/types/Terminology.md +39 -0
- package/dist/okf/types/Thesaurus.md +25 -0
- package/dist/okf/types/ThingPrincipalAttachment.md +3 -8
- package/dist/okf/types/Topic.md +1 -0
- package/dist/okf/types/TopicRuleDestination.md +1 -0
- package/dist/okf/types/TrafficPolicy.md +26 -0
- package/dist/okf/types/TrafficPolicyInstance.md +28 -0
- package/dist/okf/types/TranscribeVocabulary.md +27 -0
- package/dist/okf/types/TransitGatewayRouteTableAttachment.md +2 -0
- package/dist/okf/types/TransitVirtualInterface.md +1 -0
- package/dist/okf/types/Tunnel.md +25 -0
- package/dist/okf/types/UsageLimit.md +26 -0
- package/dist/okf/types/UseCase.md +23 -0
- package/dist/okf/types/User.md +47 -0
- package/dist/okf/types/VPCEndpoint.md +1 -1
- package/dist/okf/types/VPCEndpointService.md +6 -0
- package/dist/okf/types/VPCPeeringConnection.md +2 -2
- package/dist/okf/types/VPNConcentrator.md +1 -1
- package/dist/okf/types/VPNConnection.md +1 -1
- package/dist/okf/types/VerifiedDestinationNumber.md +25 -0
- package/dist/okf/types/View.md +27 -0
- package/dist/okf/types/VoiceConnector.md +30 -0
- package/dist/okf/types/Volume.md +44 -0
- package/dist/okf/types/Vpc.md +1 -1
- package/dist/okf/types/VpcAttachment.md +2 -0
- package/dist/okf/types/WebFunction.md +27 -0
- package/dist/okf/types/WebFunctionEndpoint.md +44 -0
- package/dist/okf/types/WebFunctionRevision.md +32 -0
- package/dist/okf/types/WickrNetwork.md +27 -0
- package/dist/okf/types/Worker.md +29 -0
- package/dist/okf/types/Workforce.md +26 -0
- package/dist/okf/types/Workload.md +35 -0
- package/dist/okf/types/WorkloadEstimate.md +35 -0
- package/dist/okf/types/Workspace.md +28 -0
- package/dist/okf/types/Workteam.md +8 -8
- package/dist/op/activities/aws-apply.js +214 -0
- package/dist/op/activities/floci.js +97 -0
- package/dist/op/activities/index.js +32 -0
- package/dist/op/builders.js +50 -0
- package/dist/ownership.js +52 -0
- package/dist/package-cli.js +25 -0
- package/dist/parameter.js +19 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +1006 -0
- package/dist/properties.js +166 -0
- package/dist/pseudo.js +25 -0
- package/dist/receipt-store.d.ts.map +1 -1
- package/dist/receipt-store.js +233 -0
- package/dist/reference-catalog.js +106 -0
- package/dist/rules/ext001.ts +3 -3
- package/dist/rules/waw016.ts +2 -2
- package/dist/serializer.js +529 -0
- package/dist/spec/fetch.js +193 -0
- package/dist/spec/parse.js +259 -0
- package/dist/spec/pin.js +185 -0
- package/dist/spec/pinned-types.json +203 -0
- package/dist/stack-errors.js +14 -0
- package/dist/taggable.d.ts.map +1 -1
- package/dist/taggable.js +33 -0
- package/dist/teardown.js +199 -0
- package/dist/template-sections.js +53 -0
- package/dist/template-transform.js +50 -0
- package/dist/types/index.d.ts +18847 -1124
- package/dist/validate-cli.js +16 -0
- package/dist/validate.js +33 -0
- package/package.json +9 -9
- package/src/agentcore/trace-fetch.ts +2 -1
- package/src/api/credential-chain.ts +119 -9
- package/src/api/credential-isolation.test.ts +72 -0
- package/src/api/read-client-chain.test.ts +159 -0
- package/src/api/read-client.ts +42 -6
- package/src/api/sigv4.ts +4 -4
- package/src/caller-identity.ts +3 -5
- package/src/codegen/any-budget.test.ts +12 -2
- package/src/codegen/generate.ts +9 -0
- package/src/codegen/package.ts +2 -2
- package/src/codegen/patches.test.ts +95 -0
- package/src/codegen/patches.ts +53 -9
- package/src/codegen/property-overlay.json +1 -16
- package/src/components/apply.ts +218 -6
- package/src/components/cfn-plan-floci.e2e.test.ts +76 -0
- package/src/components/cfn-plan.test.ts +225 -16
- package/src/components/cloud-executor.ts +73 -25
- package/src/deep-observe.ts +2 -1
- package/src/disruption.ts +2 -1
- package/src/generated/index.d.ts +18847 -1124
- package/src/generated/index.ts +1376 -161
- package/src/generated/lexicon-aws.json +17359 -784
- package/src/identity-observe.ts +2 -1
- package/src/lint/post-synth/ext001.ts +3 -3
- package/src/lint/post-synth/waw016.ts +2 -2
- package/src/lsp/completions.ts +2 -1
- package/src/lsp/hover.ts +2 -1
- package/src/plugin.ts +2 -1
- package/src/receipt-store.ts +2 -1
- package/src/spec/pin.ts +3 -3
- package/src/spec/pinned-types.json +203 -0
- package/src/taggable.ts +2 -2
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What this lexicon's entity types are worth to a behaviour engine (#2382).
|
|
3
|
+
*
|
|
4
|
+
* Contributed as rows through the plugin's `behaviourKinds` field; the
|
|
5
|
+
* vocabulary, the resolution and the prediction are
|
|
6
|
+
* `packages/core/src/behaviour-kinds.ts`. These rows were a section of one
|
|
7
|
+
* cross-lexicon table in one lexicon until #2382 moved each substrate's
|
|
8
|
+
* rows to the lexicon that owns the types — this file can say what
|
|
9
|
+
* `AWS::EC2::Instance` means because it is the file that defines it.
|
|
10
|
+
*
|
|
11
|
+
* A table rather than a heuristic over type names: a heuristic would map
|
|
12
|
+
* `AWS::EC2::VolumeAttachment` to storage and price a join table.
|
|
13
|
+
*/
|
|
14
|
+
/** Types an engine prices, with the declared property its size is read from. */
|
|
15
|
+
const MAPPED = {
|
|
16
|
+
"AWS::EC2::Instance": { kind: "compute", sizeProp: "InstanceType", sizeType: "string" },
|
|
17
|
+
"AWS::EC2::Volume": { kind: "block-store", sizeProp: "Size", sizeType: "number", regionProp: "AvailabilityZone" },
|
|
18
|
+
"AWS::Lambda::Function": { kind: "serverless", sizeProp: "MemorySize", sizeType: "number" },
|
|
19
|
+
"AWS::RDS::DBInstance": { kind: "database", sizeProp: "DBInstanceClass", sizeType: "string" },
|
|
20
|
+
"AWS::RDS::DBCluster": { kind: "database", sizeProp: "DBClusterInstanceClass", sizeType: "string" },
|
|
21
|
+
"AWS::DynamoDB::Table": { kind: "database", sizeProp: "BillingMode", sizeType: "string" },
|
|
22
|
+
"AWS::ElastiCache::CacheCluster": { kind: "cache", sizeProp: "CacheNodeType", sizeType: "string" },
|
|
23
|
+
"AWS::SQS::Queue": { kind: "queue" },
|
|
24
|
+
"AWS::SNS::Topic": { kind: "queue" },
|
|
25
|
+
"AWS::S3::Bucket": { kind: "object-store" },
|
|
26
|
+
"AWS::ElasticLoadBalancingV2::LoadBalancer": { kind: "load-balancer", sizeProp: "Type", sizeType: "string" },
|
|
27
|
+
"AWS::CloudFront::Distribution": { kind: "cdn" },
|
|
28
|
+
/** A flat hourly fee for the managed control plane. It does not move with the estate's traffic. */
|
|
29
|
+
"AWS::EKS::Cluster": { kind: "control-plane" },
|
|
30
|
+
/**
|
|
31
|
+
* A set of EC2 instances, and what an EKS estate actually costs. No size:
|
|
32
|
+
* `InstanceTypes` is a list, and this contract's `size` is one string.
|
|
33
|
+
*/
|
|
34
|
+
"AWS::EKS::Nodegroup": { kind: "compute" },
|
|
35
|
+
/** The running thing. Its task definition is the template and carries no rate. */
|
|
36
|
+
"AWS::ECS::Service": { kind: "compute" },
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Types considered and declared unsendable, each with the reason it carries no
|
|
40
|
+
* rate. Four of the five families core's contributor guidance names appear
|
|
41
|
+
* here: a grant is not a resource, a boundary is not a node, a meter chant
|
|
42
|
+
* cannot read is not a figure, and a template is not an instance.
|
|
43
|
+
*/
|
|
44
|
+
const UNMAPPED = {
|
|
45
|
+
// ── Grants ───────────────────────────────────────────────────────
|
|
46
|
+
"AWS::IAM::Role": "a role is a grant, not a resource traffic flows through: no rate, no capacity, no verdict under a lost zone",
|
|
47
|
+
"AWS::IAM::Policy": "a policy document is a statement about permission; nothing about it saturates or accrues",
|
|
48
|
+
"AWS::IAM::ManagedPolicy": "a policy document is a statement about permission; nothing about it saturates or accrues",
|
|
49
|
+
"AWS::IAM::InstanceProfile": "a wrapper that hands a role to an instance; the instance carries the figures",
|
|
50
|
+
"AWS::S3::BucketPolicy": "a bucket policy is a grant on the bucket beside it, and the bucket carries the figures",
|
|
51
|
+
"AWS::SQS::QueuePolicy": "a queue policy is a grant on the queue beside it, and the queue carries the figures",
|
|
52
|
+
"AWS::Lambda::Permission": "a grant letting one service invoke a function; the function carries the figures",
|
|
53
|
+
// ── Boundaries, and the wiring that puts things inside them ──────
|
|
54
|
+
"AWS::EC2::VPC": "a network boundary rather than a node: its contribution to a prediction is the zone membership that reaches the engine as containment coverage",
|
|
55
|
+
"AWS::EC2::Subnet": "a network boundary rather than a node: its contribution to a prediction is the zone membership that reaches the engine as containment coverage",
|
|
56
|
+
"AWS::EC2::SecurityGroup": "a filter on edges that already exist, not a thing at either end of one",
|
|
57
|
+
"AWS::EC2::RouteTable": "routing, which decides where an edge goes and is not itself at either end of one",
|
|
58
|
+
"AWS::EC2::Route": "routing, which decides where an edge goes and is not itself at either end of one",
|
|
59
|
+
"AWS::EC2::SubnetRouteTableAssociation": "an association between two boundaries; nothing flows through it that does not already flow through them",
|
|
60
|
+
"AWS::EC2::InternetGateway": "a boundary crossing rather than a resource: no rate of its own and no capacity to saturate",
|
|
61
|
+
"AWS::EC2::VPCGatewayAttachment": "an attachment between two boundaries, and neither end is priced by it",
|
|
62
|
+
"AWS::RDS::DBSubnetGroup": "the set of subnets a database may sit in; the database carries the figures",
|
|
63
|
+
"AWS::ECS::Cluster": "a namespace for services rather than capacity of its own; the services and their nodes carry the figures",
|
|
64
|
+
// ── Meters chant cannot read ─────────────────────────────────────
|
|
65
|
+
"AWS::Logs::LogGroup": "priced by the volume ingested into it, which the declaration does not state and no engine can infer from a graph",
|
|
66
|
+
"AWS::WAFv2::WebACL": "priced by the requests inspected through it, which the declaration does not state",
|
|
67
|
+
"AWS::EC2::NatGateway": "priced as an hourly rate plus a per-gigabyte meter on everything that crosses it. The declaration states the first and nothing at all about the second, and no engine kind here models a half-known price. A figure covering the hourly half alone would read as the cost of the gateway and be wrong by whatever the traffic did",
|
|
68
|
+
"AWS::EC2::EIP": "priced only while it is attached to nothing, which is a fact about the running account rather than about the declaration",
|
|
69
|
+
"AWS::ECR::Repository": "priced by the gigabytes stored in it, which the declaration does not state",
|
|
70
|
+
"AWS::KMS::Key": "priced per key per month plus a per-request meter the declaration does not state, and neither half is an hourly rate",
|
|
71
|
+
"AWS::Route53::HostedZone": "priced per zone per month plus a per-query meter the declaration does not state",
|
|
72
|
+
"AWS::SNS::Subscription": "priced by the notifications delivered through it; the topic is what the graph has an edge to",
|
|
73
|
+
"AWS::Events::Rule": "priced by the events matched, which is a fact about traffic the declaration does not state",
|
|
74
|
+
// ── Templates, not instances ─────────────────────────────────────
|
|
75
|
+
"AWS::ECS::TaskDefinition": "a template a service runs copies of; the service carries the figures, and pricing both would count the estate twice",
|
|
76
|
+
"AWS::Lambda::EventSourceMapping": "the wiring between a queue and a function, both of which are priced where they are declared",
|
|
77
|
+
"AWS::ElasticLoadBalancingV2::TargetGroup": "a set of targets behind a load balancer; the load balancer carries the rate",
|
|
78
|
+
"AWS::ElasticLoadBalancingV2::Listener": "a port on a load balancer; the load balancer carries the rate",
|
|
79
|
+
"AWS::ElasticLoadBalancingV2::ListenerRule": "a routing rule on a listener, and a rule is not a thing at either end of an edge",
|
|
80
|
+
// ── Not resources at all ─────────────────────────────────────────
|
|
81
|
+
"AWS::CloudFormation::Parameter": "a template input, not a thing the account holds. It shapes what is created and is never created itself",
|
|
82
|
+
"AWS::CloudFormation::Condition": "a template predicate deciding whether something is created; it is never created itself",
|
|
83
|
+
// ── Meters on a managed agent runtime ────────────────────────────
|
|
84
|
+
// Bedrock AgentCore is billed per invocation and per token consumed. Neither
|
|
85
|
+
// is in a declaration, and an hourly rate for an agent that ran twice this
|
|
86
|
+
// week would be a number with no relationship to the bill.
|
|
87
|
+
"AWS::BedrockAgentCore::Runtime": "an agent runtime billed per invocation and per token, neither of which the declaration states; there is no hour of existence to price",
|
|
88
|
+
"AWS::BedrockAgentCore::Gateway": "a front door to an agent runtime, billed by what passes through it rather than by existing",
|
|
89
|
+
"AWS::BedrockAgentCore::GatewayTarget": "one target behind a gateway; the gateway and the runtime are where the meters are",
|
|
90
|
+
"AWS::BedrockAgentCore::Memory": "agent memory billed by what is stored and retrieved, which the declaration does not state",
|
|
91
|
+
"AWS::BedrockAgentCore::WorkloadIdentity": "an identity a runtime acts as; a grant, with no rate and no capacity",
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* A CloudFormation **property** type — `AWS::S3::Bucket.VersioningConfiguration`
|
|
95
|
+
* — recognised by the dot. These are nested blocks of the resource above them
|
|
96
|
+
* that became entities of their own in the build; there are hundreds, they are
|
|
97
|
+
* never separately priced, and enumerating them one row at a time would bury
|
|
98
|
+
* this table's real decisions under boilerplate.
|
|
99
|
+
*/
|
|
100
|
+
function propertyType(type) {
|
|
101
|
+
return type.includes(".")
|
|
102
|
+
? "a CloudFormation property type: a nested block of the resource above it, which became an " +
|
|
103
|
+
"entity of its own in the build. The resource carries the figures, and pricing the block as " +
|
|
104
|
+
"well would count part of the estate twice"
|
|
105
|
+
: undefined;
|
|
106
|
+
}
|
|
107
|
+
/** This lexicon's answer for its own types. */
|
|
108
|
+
export const awsBehaviourKinds = {
|
|
109
|
+
provider: "aws",
|
|
110
|
+
prefixes: ["AWS::"],
|
|
111
|
+
mapped: MAPPED,
|
|
112
|
+
unmapped: UNMAPPED,
|
|
113
|
+
unmappedWhen: propertyType,
|
|
114
|
+
};
|
|
@@ -29,11 +29,9 @@
|
|
|
29
29
|
* while `aws sts get-caller-identity` answered with a principal. An expired
|
|
30
30
|
* SSO session is `no-credentials` naming `aws sso login --profile <p>`.
|
|
31
31
|
*
|
|
32
|
-
* The native read transport
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* yet say what `describeResources` signs with. The `source` column names the
|
|
36
|
-
* profile, so the difference is visible.
|
|
32
|
+
* The native read transport walks the same chain (`transportCredentials`,
|
|
33
|
+
* #3958), so a profile-sourced row also says what `describeResources` signs
|
|
34
|
+
* with.
|
|
37
35
|
*
|
|
38
36
|
* Against an endpoint override the chain is not walked: the emulator call is
|
|
39
37
|
* unsigned whatever resolves, and a whoami against Floci should not start an
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caller-identity.d.ts","sourceRoot":"","sources":["../src/caller-identity.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"caller-identity.d.ts","sourceRoot":"","sources":["../src/caller-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAChG,OAAO,EAKL,KAAK,oBAAoB,EAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAA0B,KAAK,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AA+B7F,2FAA2F;AAC3F,MAAM,WAAW,qBAAsB,SAAQ,uBAAuB;IACpE,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B;;;;OAIG;IACH,KAAK,CAAC,EAAE,sBAAsB,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAuEtG"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who chant would act as in AWS — the lexicon half of `chant lifecycle whoami`
|
|
3
|
+
* (chant #1982).
|
|
4
|
+
*
|
|
5
|
+
* `sts:GetCallerIdentity` on the same transport every read uses, so the answer
|
|
6
|
+
* cannot describe a target the read does not reach: the endpoint override, the
|
|
7
|
+
* region and the signing decision are resolved by `read-client.ts` once, for
|
|
8
|
+
* both. That parity is the point of the command — a whoami that reports real
|
|
9
|
+
* AWS while `describeResources` reads Floci is worse than none — and a test
|
|
10
|
+
* pins it.
|
|
11
|
+
*
|
|
12
|
+
* ## What the region actually is
|
|
13
|
+
*
|
|
14
|
+
* The native read transport takes its region from the stack being observed
|
|
15
|
+
* (`stacks[].region`, #1261) and falls back to `us-east-1` inside `serviceUrl`.
|
|
16
|
+
* It does NOT read `AWS_REGION`. So that is what is reported, including the
|
|
17
|
+
* awkward case: an operator whose shell exports `AWS_REGION=eu-west-1` and
|
|
18
|
+
* whose project declares no stack region is reading us-east-1, and has had no
|
|
19
|
+
* way to find that out short of a wrong answer. `source` names it.
|
|
20
|
+
*
|
|
21
|
+
* ## Credentials
|
|
22
|
+
*
|
|
23
|
+
* Resolved the way the AWS CLI resolves them (#3954), by
|
|
24
|
+
* `./api/credential-chain.ts`: environment keys, then the profile
|
|
25
|
+
* `AWS_PROFILE` names (or `default`) from the shared config and credentials
|
|
26
|
+
* files, through static keys, `role_arn`, SSO sessions and
|
|
27
|
+
* `credential_process`. Before #3954 only the environment keys were read, so
|
|
28
|
+
* `AWS_PROFILE=dev` on an SSO session answered "no identity is configured"
|
|
29
|
+
* while `aws sts get-caller-identity` answered with a principal. An expired
|
|
30
|
+
* SSO session is `no-credentials` naming `aws sso login --profile <p>`.
|
|
31
|
+
*
|
|
32
|
+
* The native read transport walks the same chain (`transportCredentials`,
|
|
33
|
+
* #3958), so a profile-sourced row also says what `describeResources` signs
|
|
34
|
+
* with.
|
|
35
|
+
*
|
|
36
|
+
* Against an endpoint override the chain is not walked: the emulator call is
|
|
37
|
+
* unsigned whatever resolves, and a whoami against Floci should not start an
|
|
38
|
+
* SSO refresh or a `credential_process`.
|
|
39
|
+
*
|
|
40
|
+
* No credential value is ever returned. The identity is the principal ARN the
|
|
41
|
+
* service itself answers with, and the scope is an account and a region.
|
|
42
|
+
*/
|
|
43
|
+
import { AwsReadError, getCallerIdentity, resolveEndpointOverride, serviceUrl, } from "./api/read-client.js";
|
|
44
|
+
import { resolveCredentialChain } from "./api/credential-chain.js";
|
|
45
|
+
/** The region the read transport falls back to when no stack declares one. */
|
|
46
|
+
const DEFAULT_REGION = "us-east-1";
|
|
47
|
+
/** True when the failure says the call was refused rather than broken. */
|
|
48
|
+
function isAuthFailure(err) {
|
|
49
|
+
if (err.status === 401 || err.status === 403)
|
|
50
|
+
return true;
|
|
51
|
+
return /credential|token|expired|AccessDenied|not authorized|Unauthorized|InvalidClientTokenId|SignatureDoesNotMatch/i.test(`${err.code ?? ""} ${err.message}`);
|
|
52
|
+
}
|
|
53
|
+
/** Where the region came from, said plainly enough to act on. */
|
|
54
|
+
function regionSource(declared, env) {
|
|
55
|
+
if (declared)
|
|
56
|
+
return `stacks[].region`;
|
|
57
|
+
const ambient = env.AWS_REGION ?? env.AWS_DEFAULT_REGION;
|
|
58
|
+
if (ambient && ambient !== DEFAULT_REGION) {
|
|
59
|
+
return `chant default (no stacks[].region; AWS_REGION=${ambient} is not read by this transport)`;
|
|
60
|
+
}
|
|
61
|
+
return "chant default (no stacks[].region)";
|
|
62
|
+
}
|
|
63
|
+
/** The environment-key label, used against an endpoint override where the chain is not walked. */
|
|
64
|
+
function envCredentialLabel(env) {
|
|
65
|
+
if (!env.AWS_ACCESS_KEY_ID || !env.AWS_SECRET_ACCESS_KEY)
|
|
66
|
+
return undefined;
|
|
67
|
+
return env.AWS_SESSION_TOKEN
|
|
68
|
+
? "env AWS_ACCESS_KEY_ID + AWS_SESSION_TOKEN"
|
|
69
|
+
: "env AWS_ACCESS_KEY_ID";
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The AWS `describeIdentity`. Returns the STS principal and the account+region
|
|
73
|
+
* scope, or a typed refusal — never a guessed identity and never an empty one.
|
|
74
|
+
*/
|
|
75
|
+
export async function describeIdentity(options) {
|
|
76
|
+
const client = {
|
|
77
|
+
...options.client,
|
|
78
|
+
...(options.region ? { region: options.region } : {}),
|
|
79
|
+
};
|
|
80
|
+
const env = client.env ?? process.env;
|
|
81
|
+
const override = resolveEndpointOverride("sts", client.endpoint, env);
|
|
82
|
+
// The region the transport resolves, not the one an operator might assume:
|
|
83
|
+
// `serviceUrl` defaults it, so this is the host the read is actually sent to.
|
|
84
|
+
const region = client.region ?? DEFAULT_REGION;
|
|
85
|
+
const endpoint = serviceUrl("sts", override, client.region);
|
|
86
|
+
// Against an emulator the call is unsigned by design (Floci verifies no
|
|
87
|
+
// signature), so an absent credential is not yet a refusal — the emulator
|
|
88
|
+
// answers with the identity it models — and the chain is not walked.
|
|
89
|
+
let credential;
|
|
90
|
+
if (override) {
|
|
91
|
+
credential = envCredentialLabel(env);
|
|
92
|
+
}
|
|
93
|
+
else if (client.credentials) {
|
|
94
|
+
credential = "credentials injected by the caller";
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
const chain = await resolveCredentialChain({
|
|
98
|
+
env,
|
|
99
|
+
...options.chain,
|
|
100
|
+
sts: { ...(client.http ? { http: client.http } : {}), ...options.chain?.sts, env },
|
|
101
|
+
});
|
|
102
|
+
if ("unresolved" in chain)
|
|
103
|
+
return { unresolved: chain.unresolved };
|
|
104
|
+
credential = chain.resolved.source;
|
|
105
|
+
client.credentials = chain.resolved.credentials;
|
|
106
|
+
}
|
|
107
|
+
let identity;
|
|
108
|
+
try {
|
|
109
|
+
identity = await getCallerIdentity(client);
|
|
110
|
+
}
|
|
111
|
+
catch (err) {
|
|
112
|
+
if (err instanceof AwsReadError) {
|
|
113
|
+
return {
|
|
114
|
+
unresolved: {
|
|
115
|
+
reason: isAuthFailure(err) ? "no-credentials" : "read-failed",
|
|
116
|
+
detail: `sts:GetCallerIdentity against ${endpoint} failed: ${err.code ? `${err.code}: ` : ""}${err.message}`,
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
unresolved: {
|
|
122
|
+
reason: "read-failed",
|
|
123
|
+
detail: `sts:GetCallerIdentity against ${endpoint} failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
if (!identity.arn) {
|
|
128
|
+
return {
|
|
129
|
+
unresolved: {
|
|
130
|
+
reason: "read-failed",
|
|
131
|
+
detail: `sts:GetCallerIdentity against ${endpoint} answered without an Arn`,
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
const sources = [
|
|
136
|
+
credential ?? "unsigned (endpoint override)",
|
|
137
|
+
regionSource(client.region, env),
|
|
138
|
+
...(override ? [`endpoint override ${override}`] : []),
|
|
139
|
+
];
|
|
140
|
+
return {
|
|
141
|
+
identity: identity.arn,
|
|
142
|
+
scope: identity.account ? `${identity.account} ${region}` : region,
|
|
143
|
+
source: sources.join("; "),
|
|
144
|
+
endpoint,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AWS CloudFormation documentation generator.
|
|
3
|
+
*
|
|
4
|
+
* Calls the core docsPipeline with AWS-specific config:
|
|
5
|
+
* service grouping, resource type URLs, and overview content.
|
|
6
|
+
*
|
|
7
|
+
* writeDocsSite puts the pages in the main docs site under
|
|
8
|
+
* docs/src/content/docs/lexicons/aws/ (chant #3993).
|
|
9
|
+
*/
|
|
10
|
+
import { dirname, join } from "path";
|
|
11
|
+
import { fileURLToPath } from "url";
|
|
12
|
+
import { docsPipeline, writeDocsSite } from "@intentius/chant/codegen/docs";
|
|
13
|
+
const __dirname_ = dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
const pkgDir = join(__dirname_, "..", "..");
|
|
15
|
+
/**
|
|
16
|
+
* Extract the AWS service name from a CloudFormation resource type.
|
|
17
|
+
* e.g. "AWS::S3::Bucket" → "S3", "AWS::Lambda::Function" → "Lambda"
|
|
18
|
+
*/
|
|
19
|
+
function serviceFromType(resourceType) {
|
|
20
|
+
const parts = resourceType.split("::");
|
|
21
|
+
return parts.length >= 2 ? parts[1] : "Other";
|
|
22
|
+
}
|
|
23
|
+
const overview = `The **AWS CloudFormation** lexicon provides full support for defining AWS infrastructure using chant's declarative TypeScript syntax. Resources are serialized to CloudFormation JSON templates.
|
|
24
|
+
|
|
25
|
+
This lexicon is generated from the official [CloudFormation Resource Provider Schemas](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html) and includes coverage for all publicly available resource types.
|
|
26
|
+
|
|
27
|
+
Install it with:
|
|
28
|
+
|
|
29
|
+
\`\`\`bash
|
|
30
|
+
npm install --save-dev @intentius/chant-lexicon-aws
|
|
31
|
+
\`\`\``;
|
|
32
|
+
const outputFormat = `The AWS lexicon serializes resources into **CloudFormation JSON templates**.
|
|
33
|
+
|
|
34
|
+
## Building
|
|
35
|
+
|
|
36
|
+
Run \`chant build\` to produce a CloudFormation template from your declarations:
|
|
37
|
+
|
|
38
|
+
\`\`\`bash
|
|
39
|
+
chant build
|
|
40
|
+
# Writes dist/template.json
|
|
41
|
+
\`\`\`
|
|
42
|
+
|
|
43
|
+
The generated template includes:
|
|
44
|
+
|
|
45
|
+
- \`AWSTemplateFormatVersion\` header
|
|
46
|
+
- \`Parameters\` section (if any parameters are declared)
|
|
47
|
+
- \`Resources\` section with typed resource definitions
|
|
48
|
+
- \`Outputs\` section for exported values
|
|
49
|
+
- Full support for intrinsic functions (\`Fn::Sub\`, \`Ref\`, \`Fn::GetAtt\`, etc.)
|
|
50
|
+
|
|
51
|
+
## Deploying
|
|
52
|
+
|
|
53
|
+
The output is standard CloudFormation JSON. Deploy with any CF-compatible tool:
|
|
54
|
+
|
|
55
|
+
\`\`\`bash
|
|
56
|
+
# AWS CLI
|
|
57
|
+
aws cloudformation deploy \\
|
|
58
|
+
--template-file dist/template.json \\
|
|
59
|
+
--stack-name my-stack \\
|
|
60
|
+
--capabilities CAPABILITY_IAM
|
|
61
|
+
|
|
62
|
+
# Rain (faster, with diff preview)
|
|
63
|
+
rain deploy dist/template.json my-stack
|
|
64
|
+
|
|
65
|
+
# SAM CLI (if using serverless transforms)
|
|
66
|
+
sam deploy --template-file dist/template.json --stack-name my-stack
|
|
67
|
+
\`\`\`
|
|
68
|
+
|
|
69
|
+
## Compatibility
|
|
70
|
+
|
|
71
|
+
The output is compatible with:
|
|
72
|
+
- AWS CloudFormation service (direct deployment)
|
|
73
|
+
- AWS SAM CLI
|
|
74
|
+
- AWS CDK (as an escape hatch via \`CfnInclude\`)
|
|
75
|
+
- Rain and other CloudFormation tooling
|
|
76
|
+
- Any tool that accepts CloudFormation JSON templates`;
|
|
77
|
+
/**
|
|
78
|
+
* Generate the AWS lexicon's documentation pages.
|
|
79
|
+
*/
|
|
80
|
+
export async function generateDocs(options) {
|
|
81
|
+
const log = options?.verbose
|
|
82
|
+
? (msg) => console.error(msg)
|
|
83
|
+
: (_msg) => { };
|
|
84
|
+
const distDir = join(pkgDir, "dist");
|
|
85
|
+
const srcDir = join(pkgDir, "src");
|
|
86
|
+
const outDir = join(pkgDir, "docs");
|
|
87
|
+
const config = {
|
|
88
|
+
name: "aws",
|
|
89
|
+
basePath: process.env.DOCS_BASE_PATH ?? "/chant/lexicons/aws/",
|
|
90
|
+
displayName: "AWS CloudFormation",
|
|
91
|
+
description: "AWS CloudFormation lexicon for chant — resource types, intrinsics, and lint rules",
|
|
92
|
+
distDir,
|
|
93
|
+
outDir,
|
|
94
|
+
srcDir,
|
|
95
|
+
overview,
|
|
96
|
+
outputFormat,
|
|
97
|
+
serviceFromType,
|
|
98
|
+
// "intrinsics" is no longer suppressed (chant #1067) — the reference
|
|
99
|
+
// table at that slug is now generated from the plugin's own
|
|
100
|
+
// `intrinsics()` registration (docsPipeline's generateIntrinsics, same
|
|
101
|
+
// mechanism azure/helm already use), so its "Folds?" column can never
|
|
102
|
+
// drift from the registration the way #1062's foldability matrix
|
|
103
|
+
// depends on. The hand-written usage guide with full worked examples
|
|
104
|
+
// moves to a separate "intrinsics-guide" page in docs/pages/ — content
|
|
105
|
+
// unchanged, just no longer sharing a slug with generated data.
|
|
106
|
+
// `rules` is NOT suppressed: the hand-written `lint-rules` page in docs/pages/
|
|
107
|
+
// explains 26 of the lexicon's 50 rules in depth, and the whole WAW032+
|
|
108
|
+
// hardening pass had no entry there at all (#1312). The generated table is
|
|
109
|
+
// the complete, always-current list, so both ship: a hand-written overview
|
|
110
|
+
// beside a generated reference. Duplicating 24 descriptions into the prose
|
|
111
|
+
// page would just create a third copy to drift.
|
|
112
|
+
suppressPages: ["pseudo-parameters"],
|
|
113
|
+
examplesDir: join(pkgDir, "examples"),
|
|
114
|
+
};
|
|
115
|
+
log("Generating AWS documentation...");
|
|
116
|
+
const result = docsPipeline(config);
|
|
117
|
+
log(`Writing docs pages for ${outDir}`);
|
|
118
|
+
writeDocsSite(config, result);
|
|
119
|
+
console.error(`Docs generated: ${result.stats.resources} resources, ${result.stats.services} services, ${result.stats.rules} rules`);
|
|
120
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Curated enum overlay (chant #1497).
|
|
3
|
+
*
|
|
4
|
+
* The CloudFormation Registry spec declares `enum` on some properties and not
|
|
5
|
+
* on others, and the split does not follow how often a property is written:
|
|
6
|
+
* `AWS::SageMaker::NotebookInstance.InstanceType` is a union while
|
|
7
|
+
* `AWS::EC2::Instance.InstanceType` is a bare `string`. Where the spec is
|
|
8
|
+
* silent the generated type stops teaching the API, and a wrong value survives
|
|
9
|
+
* `tsc` and `chant build` to fail at deploy.
|
|
10
|
+
*
|
|
11
|
+
* This overlay is a checked-in list of `(CFN type, JSON pointer, values)`
|
|
12
|
+
* entries merged into the raw schema before parsing, so a curated enum reaches
|
|
13
|
+
* the generated `.d.ts` and the lexicon registry by exactly the path a spec
|
|
14
|
+
* enum reaches them. Nothing here is fetched at build time: the values live in
|
|
15
|
+
* `enum-overlay.json` beside this file, each with the source it was read from
|
|
16
|
+
* and the date it was read, so `scripts/refresh-enum-overlay.ts` can diff them
|
|
17
|
+
* later.
|
|
18
|
+
*
|
|
19
|
+
* Precedence: the overlay only fills gaps. An entry whose target already
|
|
20
|
+
* declares `enum` (from the Registry spec or from a cfn-lint patch) leaves the
|
|
21
|
+
* spec alone and reports itself as redundant. Upstream is refreshed on every
|
|
22
|
+
* `generate`, so it is the source that keeps tracking AWS; a hand list allowed
|
|
23
|
+
* to win would rot invisibly and would make the generated type depend on which
|
|
24
|
+
* of two sources happened to be newer. Reporting the overlap instead surfaces
|
|
25
|
+
* the entry for retirement the moment upstream catches up.
|
|
26
|
+
*
|
|
27
|
+
* An entry that matches nothing is an error, not a shrug: a renamed or removed
|
|
28
|
+
* property means the curated values are being applied to a property that no
|
|
29
|
+
* longer exists, and silence there is how an overlay goes stale.
|
|
30
|
+
*/
|
|
31
|
+
import overlayDocument from "./enum-overlay.json" with { type: "json" };
|
|
32
|
+
/** The curated entries, in file order. */
|
|
33
|
+
export function enumOverlayEntries() {
|
|
34
|
+
return overlayDocument.entries;
|
|
35
|
+
}
|
|
36
|
+
/** Entries grouped by CloudFormation type name. */
|
|
37
|
+
export function enumOverlayByType(entries = enumOverlayEntries()) {
|
|
38
|
+
const byType = new Map();
|
|
39
|
+
for (const entry of entries) {
|
|
40
|
+
const list = byType.get(entry.type);
|
|
41
|
+
if (list)
|
|
42
|
+
list.push(entry);
|
|
43
|
+
else
|
|
44
|
+
byType.set(entry.type, [entry]);
|
|
45
|
+
}
|
|
46
|
+
return byType;
|
|
47
|
+
}
|
|
48
|
+
/** A pointer segment that is not a plain object key is not addressable. */
|
|
49
|
+
function pointerSegments(pointer) {
|
|
50
|
+
if (!pointer.startsWith("/")) {
|
|
51
|
+
throw new Error(`enum overlay pointer must start with "/": ${pointer}`);
|
|
52
|
+
}
|
|
53
|
+
return pointer.split("/").slice(1);
|
|
54
|
+
}
|
|
55
|
+
function resolvePointer(doc, pointer) {
|
|
56
|
+
let node = doc;
|
|
57
|
+
for (const segment of pointerSegments(pointer)) {
|
|
58
|
+
if (typeof node !== "object" || node === null || Array.isArray(node))
|
|
59
|
+
return undefined;
|
|
60
|
+
node = node[segment];
|
|
61
|
+
if (node === undefined)
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
if (typeof node !== "object" || node === null || Array.isArray(node))
|
|
65
|
+
return undefined;
|
|
66
|
+
return node;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Apply the entries for one CloudFormation type to its raw schema bytes.
|
|
70
|
+
*
|
|
71
|
+
* Returns the (possibly rewritten) schema and one {@link EnumOverlayApplication}
|
|
72
|
+
* per entry. Throws when an entry cannot be honoured, which is always a
|
|
73
|
+
* curation bug rather than a spec quirk.
|
|
74
|
+
*
|
|
75
|
+
* `strict` is on for a run over the real schema zip and off for a run over the
|
|
76
|
+
* trimmed fixtures under `src/testdata/schemas`, which legitimately drop
|
|
77
|
+
* properties the overlay names. Only a strict run treats a missing property as
|
|
78
|
+
* an error.
|
|
79
|
+
*/
|
|
80
|
+
export function applyEnumOverlay(typeName, data, entries, opts = {}) {
|
|
81
|
+
if (entries.length === 0)
|
|
82
|
+
return { data, applications: [] };
|
|
83
|
+
const strict = opts.strict ?? false;
|
|
84
|
+
const text = typeof data === "string" ? data : data.toString("utf-8");
|
|
85
|
+
const doc = JSON.parse(text);
|
|
86
|
+
const applications = [];
|
|
87
|
+
let changed = false;
|
|
88
|
+
for (const entry of entries) {
|
|
89
|
+
const where = `${entry.type}${entry.pointer}`;
|
|
90
|
+
const target = resolvePointer(doc, entry.pointer);
|
|
91
|
+
if (!target) {
|
|
92
|
+
if (!strict) {
|
|
93
|
+
applications.push({ entry, outcome: "absent" });
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
throw new Error(`enum overlay entry ${where} names a property the schema does not declare. ` +
|
|
97
|
+
`Either the property was renamed upstream or the entry is stale; fix or drop it in ` +
|
|
98
|
+
`src/codegen/enum-overlay.json.`);
|
|
99
|
+
}
|
|
100
|
+
if (Array.isArray(target.enum) && target.enum.length > 0) {
|
|
101
|
+
applications.push({
|
|
102
|
+
entry,
|
|
103
|
+
outcome: "redundant",
|
|
104
|
+
upstreamValues: target.enum,
|
|
105
|
+
});
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
if (typeof target.$ref === "string") {
|
|
109
|
+
throw new Error(`enum overlay entry ${where} targets a property that already refers to ` +
|
|
110
|
+
`${target.$ref}; the overlay cannot own its type.`);
|
|
111
|
+
}
|
|
112
|
+
const definitions = (doc.definitions ?? (doc.definitions = {}));
|
|
113
|
+
if (entry.enumName in definitions) {
|
|
114
|
+
throw new Error(`enum overlay entry ${where} would define ${entry.type}.${entry.enumName}, ` +
|
|
115
|
+
`which the schema already declares. Pick a different enumName.`);
|
|
116
|
+
}
|
|
117
|
+
// The definition gives the generator a name to export; the `enum` left on
|
|
118
|
+
// the property is what `extractConstraints` copies into the lexicon
|
|
119
|
+
// registry, where the LSP and the docs build read it.
|
|
120
|
+
definitions[entry.enumName] = { type: "string", enum: [...entry.values] };
|
|
121
|
+
target.$ref = `#/definitions/${entry.enumName}`;
|
|
122
|
+
target.enum = [...entry.values];
|
|
123
|
+
changed = true;
|
|
124
|
+
applications.push({ entry, outcome: "applied" });
|
|
125
|
+
}
|
|
126
|
+
if (!changed)
|
|
127
|
+
return { data, applications };
|
|
128
|
+
const rewritten = JSON.stringify(doc);
|
|
129
|
+
return {
|
|
130
|
+
data: typeof data === "string" ? rewritten : Buffer.from(rewritten),
|
|
131
|
+
applications,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Fail on any entry the run never reached.
|
|
136
|
+
*
|
|
137
|
+
* `strict` is on for a run over the real schema zip and off for a run over a
|
|
138
|
+
* fixture subset, where most types are legitimately absent. A missing type in
|
|
139
|
+
* a full run means the resource left the Registry and the entry is dead.
|
|
140
|
+
*/
|
|
141
|
+
export function assertOverlayCoverage(entries, seenTypes, strict) {
|
|
142
|
+
if (!strict)
|
|
143
|
+
return;
|
|
144
|
+
const missing = entries.filter((e) => !seenTypes.has(e.type));
|
|
145
|
+
if (missing.length === 0)
|
|
146
|
+
return;
|
|
147
|
+
const names = [...new Set(missing.map((e) => e.type))].sort().join(", ");
|
|
148
|
+
throw new Error(`enum overlay names ${missing.length} entr${missing.length === 1 ? "y" : "ies"} on ` +
|
|
149
|
+
`type(s) the spec does not contain: ${names}. Drop them from ` +
|
|
150
|
+
`src/codegen/enum-overlay.json or fix the type name.`);
|
|
151
|
+
}
|
|
152
|
+
/** One warning line per entry upstream has caught up with. */
|
|
153
|
+
export function redundantOverlayWarnings(applications) {
|
|
154
|
+
return applications
|
|
155
|
+
.filter((a) => a.outcome === "redundant")
|
|
156
|
+
.map((a) => ({
|
|
157
|
+
file: `${a.entry.type}${a.entry.pointer}`,
|
|
158
|
+
error: `enum overlay entry is redundant: the spec already declares ` +
|
|
159
|
+
`${(a.upstreamValues ?? []).length} allowed value(s) here, and the spec wins. ` +
|
|
160
|
+
`Retire the entry from src/codegen/enum-overlay.json.`,
|
|
161
|
+
}));
|
|
162
|
+
}
|