@spottoai/types-package 1.0.2-dev1138.12 → 1.0.2-dev1138.14
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/README.md +3 -0
- package/dist/accounts/accounts.d.ts +13 -0
- package/dist/accounts/accounts.d.ts.map +1 -1
- package/dist/accounts/azureSpSetup.d.ts +5 -0
- package/dist/accounts/azureSpSetup.d.ts.map +1 -1
- package/dist/accounts/azureSpSetup.js.map +1 -1
- package/dist/accounts/index.d.ts +1 -0
- package/dist/accounts/index.d.ts.map +1 -1
- package/dist/accounts/index.js +1 -0
- package/dist/accounts/index.js.map +1 -1
- package/dist/accounts/subscriptionWriteAccess.d.ts +76 -0
- package/dist/accounts/subscriptionWriteAccess.d.ts.map +1 -0
- package/dist/accounts/subscriptionWriteAccess.js +119 -0
- package/dist/accounts/subscriptionWriteAccess.js.map +1 -0
- package/dist/accounts/writePermissions.d.ts +17 -1
- package/dist/accounts/writePermissions.d.ts.map +1 -1
- package/dist/accounts/writePermissions.js +47 -1
- package/dist/accounts/writePermissions.js.map +1 -1
- package/dist/ai/followUps.d.ts +16 -0
- package/dist/ai/followUps.d.ts.map +1 -0
- package/dist/ai/followUps.js +21 -0
- package/dist/ai/followUps.js.map +1 -0
- package/dist/ai/grounding.d.ts +42 -5
- package/dist/ai/grounding.d.ts.map +1 -1
- package/dist/ai/grounding.js +76 -8
- package/dist/ai/grounding.js.map +1 -1
- package/dist/ai/index.d.ts +4 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +1 -0
- package/dist/ai/index.js.map +1 -1
- package/dist/aws/commitments-planning.d.ts +1 -1
- package/dist/aws/commitments-planning.d.ts.map +1 -1
- package/dist/aws/commitments-planning.js +1 -0
- package/dist/aws/commitments-planning.js.map +1 -1
- package/dist/aws/commitmentsPlanningValidation.d.ts +1 -1
- package/dist/aws/commitmentsPlanningValidation.d.ts.map +1 -1
- package/dist/aws/commitmentsPlanningValidation.js +26 -25
- package/dist/aws/commitmentsPlanningValidation.js.map +1 -1
- package/dist/aws/commitmentsPlanningView.d.ts +49 -0
- package/dist/aws/commitmentsPlanningView.d.ts.map +1 -0
- package/dist/aws/{pluginPublicArtifactEvidence.js → commitmentsPlanningView.js} +1 -1
- package/dist/aws/commitmentsPlanningView.js.map +1 -0
- package/dist/aws/index.d.ts +2 -14
- package/dist/aws/index.d.ts.map +1 -1
- package/dist/aws/index.js +2 -13
- package/dist/aws/index.js.map +1 -1
- package/dist/aws/organizationCommitments.d.ts +2 -1
- package/dist/aws/organizationCommitments.d.ts.map +1 -1
- package/dist/aws/organizationCommitments.js +2 -2
- package/dist/aws/organizationCommitments.js.map +1 -1
- package/dist/aws/organizationCommitmentsApiValidation.d.ts.map +1 -1
- package/dist/aws/organizationCommitmentsApiValidation.js +64 -64
- package/dist/aws/organizationCommitmentsApiValidation.js.map +1 -1
- package/dist/aws/organizationCommitmentsValidation.d.ts.map +1 -1
- package/dist/aws/organizationCommitmentsValidation.js +45 -44
- package/dist/aws/organizationCommitmentsValidation.js.map +1 -1
- package/dist/aws/portalOrganizationCommitmentsPlanningPublicArtifactValidation.d.ts.map +1 -1
- package/dist/aws/portalOrganizationCommitmentsPlanningPublicArtifactValidation.js +79 -76
- package/dist/aws/portalOrganizationCommitmentsPlanningPublicArtifactValidation.js.map +1 -1
- package/dist/aws/portalOrganizationCommitmentsPlanningPublicArtifacts.d.ts +1 -2
- package/dist/aws/portalOrganizationCommitmentsPlanningPublicArtifacts.d.ts.map +1 -1
- package/dist/aws/portalOrganizationCommitmentsPlanningPublicArtifacts.js.map +1 -1
- package/dist/aws/publicArtifacts.d.ts +2 -37
- package/dist/aws/publicArtifacts.d.ts.map +1 -1
- package/dist/aws/publicArtifacts.js +3 -1
- package/dist/aws/publicArtifacts.js.map +1 -1
- package/dist/aws/relationships.d.ts +5 -3
- package/dist/aws/relationships.d.ts.map +1 -1
- package/dist/aws/relationships.js +18 -3
- package/dist/aws/relationships.js.map +1 -1
- package/dist/aws/requests.d.ts +35 -3
- package/dist/aws/requests.d.ts.map +1 -1
- package/dist/aws/requests.js +5 -3
- package/dist/aws/requests.js.map +1 -1
- package/dist/aws/resourceGraph.d.ts +14 -0
- package/dist/aws/resourceGraph.d.ts.map +1 -0
- package/dist/aws/resourceGraph.js +68 -0
- package/dist/aws/resourceGraph.js.map +1 -0
- package/dist/aws/validationHelpers.d.ts +8 -0
- package/dist/aws/validationHelpers.d.ts.map +1 -0
- package/dist/aws/validationHelpers.js +54 -0
- package/dist/aws/validationHelpers.js.map +1 -0
- package/dist/azure/commitmentsPlanning.d.ts +15 -46
- package/dist/azure/commitmentsPlanning.d.ts.map +1 -1
- package/dist/azure/commitmentsPlanning.js +9 -0
- package/dist/azure/commitmentsPlanning.js.map +1 -1
- package/dist/azure/commitmentsPlanningValidation.d.ts +18 -0
- package/dist/azure/commitmentsPlanningValidation.d.ts.map +1 -0
- package/dist/azure/commitmentsPlanningValidation.js +50 -0
- package/dist/azure/commitmentsPlanningValidation.js.map +1 -0
- package/dist/azure/dataProtection.d.ts +40 -0
- package/dist/azure/dataProtection.d.ts.map +1 -1
- package/dist/azure/governance.d.ts +5 -0
- package/dist/azure/governance.d.ts.map +1 -1
- package/dist/azure/metrics.d.ts +2 -27
- package/dist/azure/metrics.d.ts.map +1 -1
- package/dist/azure/payloads.d.ts +24 -0
- package/dist/azure/payloads.d.ts.map +1 -1
- package/dist/azure/payloads.js +87 -0
- package/dist/azure/payloads.js.map +1 -1
- package/dist/azure/recommendationTracks.d.ts +1 -1
- package/dist/azure/recommendationTracks.d.ts.map +1 -1
- package/dist/azure/reportEvidence.d.ts +192 -11
- package/dist/azure/reportEvidence.d.ts.map +1 -1
- package/dist/azure/reportEvidence.js +9 -1
- package/dist/azure/reportEvidence.js.map +1 -1
- package/dist/azure/reportEvidenceValidation.d.ts.map +1 -1
- package/dist/azure/reportEvidenceValidation.js +201 -5
- package/dist/azure/reportEvidenceValidation.js.map +1 -1
- package/dist/azure/reportEvidenceValidationHelpers.d.ts +3 -16
- package/dist/azure/reportEvidenceValidationHelpers.d.ts.map +1 -1
- package/dist/azure/reportEvidenceValidationHelpers.js +80 -92
- package/dist/azure/reportEvidenceValidationHelpers.js.map +1 -1
- package/dist/azure/resilienceFacts.d.ts +100 -0
- package/dist/azure/resilienceFacts.d.ts.map +1 -0
- package/dist/azure/resilienceFacts.js +20 -0
- package/dist/azure/resilienceFacts.js.map +1 -0
- package/dist/azure/resilienceFactsValidation.d.ts +4 -0
- package/dist/azure/resilienceFactsValidation.d.ts.map +1 -0
- package/dist/azure/resilienceFactsValidation.js +70 -0
- package/dist/azure/resilienceFactsValidation.js.map +1 -0
- package/dist/azure/savings.d.ts +4 -2
- package/dist/azure/savings.d.ts.map +1 -1
- package/dist/azure/serviceRetirement.d.ts +21 -2
- package/dist/azure/serviceRetirement.d.ts.map +1 -1
- package/dist/azure/views.d.ts +24 -1
- package/dist/azure/views.d.ts.map +1 -1
- package/dist/azure/views.js.map +1 -1
- package/dist/common/boundedRows.d.ts +7 -0
- package/dist/common/boundedRows.d.ts.map +1 -0
- package/dist/{scheduler/scheduler.js → common/boundedRows.js} +1 -1
- package/dist/common/boundedRows.js.map +1 -0
- package/dist/common/index.d.ts +3 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +3 -0
- package/dist/common/index.js.map +1 -1
- package/dist/common/metricStats.d.ts +29 -0
- package/dist/common/metricStats.d.ts.map +1 -0
- package/dist/{scheduler/bastionSchedule.js → common/metricStats.js} +1 -1
- package/dist/common/metricStats.js.map +1 -0
- package/dist/common/provider.d.ts +2 -0
- package/dist/common/provider.d.ts.map +1 -1
- package/dist/common/relationships.d.ts +3 -3
- package/dist/common/relationships.d.ts.map +1 -1
- package/dist/common/resourceGraph.d.ts +137 -0
- package/dist/common/resourceGraph.d.ts.map +1 -0
- package/dist/common/resourceGraph.js +17 -0
- package/dist/common/resourceGraph.js.map +1 -0
- package/dist/common/resourceGraphValidation.d.ts +30 -0
- package/dist/common/resourceGraphValidation.d.ts.map +1 -0
- package/dist/common/resourceGraphValidation.js +369 -0
- package/dist/common/resourceGraphValidation.js.map +1 -0
- package/dist/common/resourceIdentity.d.ts +28 -0
- package/dist/common/resourceIdentity.d.ts.map +1 -0
- package/dist/common/resourceIdentity.js +35 -0
- package/dist/common/resourceIdentity.js.map +1 -0
- package/dist/common/sha256.d.ts +2 -0
- package/dist/common/sha256.d.ts.map +1 -1
- package/dist/common/sha256.js +3 -0
- package/dist/common/sha256.js.map +1 -1
- package/dist/common/utilizationStories.d.ts +695 -0
- package/dist/common/utilizationStories.d.ts.map +1 -0
- package/dist/common/utilizationStories.js +21 -0
- package/dist/common/utilizationStories.js.map +1 -0
- package/dist/common/utilizationStoriesValidation.d.ts +60 -0
- package/dist/common/utilizationStoriesValidation.d.ts.map +1 -0
- package/dist/common/utilizationStoriesValidation.js +762 -0
- package/dist/common/utilizationStoriesValidation.js.map +1 -0
- package/dist/common/validationHelpers.d.ts +37 -0
- package/dist/common/validationHelpers.d.ts.map +1 -0
- package/dist/common/validationHelpers.js +147 -0
- package/dist/common/validationHelpers.js.map +1 -0
- package/dist/esm/accounts/index.js +1 -0
- package/dist/esm/accounts/subscriptionWriteAccess.js +112 -0
- package/dist/esm/accounts/writePermissions.js +46 -0
- package/dist/esm/ai/followUps.js +16 -0
- package/dist/esm/ai/grounding.js +74 -7
- package/dist/esm/ai/index.js +1 -0
- package/dist/esm/aws/commitments-planning.js +1 -0
- package/dist/esm/aws/commitmentsPlanningValidation.js +2 -1
- package/dist/esm/aws/index.js +2 -13
- package/dist/esm/aws/organizationCommitments.js +2 -2
- package/dist/esm/aws/organizationCommitmentsApiValidation.js +5 -5
- package/dist/esm/aws/organizationCommitmentsValidation.js +2 -1
- package/dist/esm/aws/portalOrganizationCommitmentsPlanningPublicArtifactValidation.js +8 -5
- package/dist/esm/aws/publicArtifacts.js +2 -0
- package/dist/esm/aws/relationships.js +4 -1
- package/dist/esm/aws/requests.js +4 -2
- package/dist/esm/aws/resourceGraph.js +63 -0
- package/dist/esm/aws/validationHelpers.js +46 -0
- package/dist/esm/azure/commitmentsPlanning.js +8 -1
- package/dist/esm/azure/commitmentsPlanningValidation.js +39 -0
- package/dist/esm/azure/payloads.js +84 -1
- package/dist/esm/azure/reportEvidence.js +8 -0
- package/dist/esm/azure/reportEvidenceValidation.js +202 -6
- package/dist/esm/azure/reportEvidenceValidationHelpers.js +7 -19
- package/dist/esm/azure/resilienceFacts.js +16 -0
- package/dist/esm/azure/resilienceFactsValidation.js +64 -0
- package/dist/esm/common/index.js +3 -0
- package/dist/esm/common/resourceGraph.js +13 -0
- package/dist/esm/common/resourceGraphValidation.js +365 -0
- package/dist/esm/common/resourceIdentity.js +24 -0
- package/dist/esm/common/sha256.js +2 -0
- package/dist/esm/common/utilizationStories.js +17 -0
- package/dist/esm/common/utilizationStoriesValidation.js +718 -0
- package/dist/esm/common/validationHelpers.js +115 -0
- package/dist/esm/entries/relationships.js +2 -2
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.vite.js +1 -0
- package/dist/esm/reporting/jobs/index.js +13 -0
- package/dist/esm/reporting/jobs/reportJobIdentity.js +76 -0
- package/dist/esm/reporting/jobs/reportJobMessages.js +47 -0
- package/dist/esm/reporting/jobs/reportJobRow.js +264 -0
- package/dist/esm/reporting/jobs/reportJobSpec.js +295 -0
- package/dist/esm/reporting/jobs/reportJobStatus.js +87 -0
- package/dist/esm/reporting/shared/reportTableEntities.js +41 -0
- package/dist/esm/reporting/shared/reportingDigest.js +57 -0
- package/dist/esm/reporting/shared/reportingIds.js +88 -0
- package/dist/esm/reporting/shared/reportingPaths.js +23 -0
- package/dist/esm/scheduler/index.js +4 -4
- package/dist/esm/scheduler/resourceStrategy.js +2 -0
- package/dist/esm/scheduler/resourceStrategyCapabilityValidation.js +265 -0
- package/dist/esm/scheduler/resourceStrategyContracts.js +20 -0
- package/dist/esm/scheduler/resourceStrategyFinancialValidation.js +145 -0
- package/dist/esm/scheduler/resourceStrategyPermissionValidation.js +190 -0
- package/dist/esm/scheduler/resourceStrategyScheduleValidation.js +506 -0
- package/dist/esm/scheduler/resourceStrategyValidation.js +4 -0
- package/dist/esm/scheduler/resourceStrategyValidationShared.js +261 -0
- package/dist/esm/scheduler/schedulerValidation.js +372 -0
- package/dist/esm/scheduler/weeklyAvailabilityFixtures.js +140 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/index.vite.d.ts +1 -0
- package/dist/index.vite.d.ts.map +1 -1
- package/dist/index.vite.js +1 -0
- package/dist/index.vite.js.map +1 -1
- package/dist/reporting/jobs/index.d.ts +14 -0
- package/dist/reporting/jobs/index.d.ts.map +1 -0
- package/dist/reporting/jobs/index.js +45 -0
- package/dist/reporting/jobs/index.js.map +1 -0
- package/dist/reporting/jobs/reportJobIdentity.d.ts +44 -0
- package/dist/reporting/jobs/reportJobIdentity.d.ts.map +1 -0
- package/dist/reporting/jobs/reportJobIdentity.js +88 -0
- package/dist/reporting/jobs/reportJobIdentity.js.map +1 -0
- package/dist/reporting/jobs/reportJobMessages.d.ts +30 -0
- package/dist/reporting/jobs/reportJobMessages.d.ts.map +1 -0
- package/dist/reporting/jobs/reportJobMessages.js +54 -0
- package/dist/reporting/jobs/reportJobMessages.js.map +1 -0
- package/dist/reporting/jobs/reportJobRow.d.ts +98 -0
- package/dist/reporting/jobs/reportJobRow.d.ts.map +1 -0
- package/dist/reporting/jobs/reportJobRow.js +270 -0
- package/dist/reporting/jobs/reportJobRow.js.map +1 -0
- package/dist/reporting/jobs/reportJobSpec.d.ts +92 -0
- package/dist/reporting/jobs/reportJobSpec.d.ts.map +1 -0
- package/dist/reporting/jobs/reportJobSpec.js +304 -0
- package/dist/reporting/jobs/reportJobSpec.js.map +1 -0
- package/dist/reporting/jobs/reportJobStatus.d.ts +60 -0
- package/dist/reporting/jobs/reportJobStatus.d.ts.map +1 -0
- package/dist/reporting/jobs/reportJobStatus.js +98 -0
- package/dist/reporting/jobs/reportJobStatus.js.map +1 -0
- package/dist/reporting/shared/reportTableEntities.d.ts +23 -0
- package/dist/reporting/shared/reportTableEntities.d.ts.map +1 -0
- package/dist/reporting/shared/reportTableEntities.js +47 -0
- package/dist/reporting/shared/reportTableEntities.js.map +1 -0
- package/dist/reporting/shared/reportingDigest.d.ts +6 -0
- package/dist/reporting/shared/reportingDigest.d.ts.map +1 -0
- package/dist/reporting/shared/reportingDigest.js +63 -0
- package/dist/reporting/shared/reportingDigest.js.map +1 -0
- package/dist/reporting/shared/reportingIds.d.ts +34 -0
- package/dist/reporting/shared/reportingIds.d.ts.map +1 -0
- package/dist/reporting/shared/reportingIds.js +102 -0
- package/dist/reporting/shared/reportingIds.js.map +1 -0
- package/dist/reporting/shared/reportingPaths.d.ts +14 -0
- package/dist/reporting/shared/reportingPaths.d.ts.map +1 -0
- package/dist/reporting/shared/reportingPaths.js +29 -0
- package/dist/reporting/shared/reportingPaths.js.map +1 -0
- package/dist/scheduler/index.d.ts +4 -4
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js +4 -4
- package/dist/scheduler/index.js.map +1 -1
- package/dist/scheduler/resourceStrategy.d.ts +3 -0
- package/dist/scheduler/resourceStrategy.d.ts.map +1 -0
- package/dist/scheduler/resourceStrategy.js +19 -0
- package/dist/scheduler/resourceStrategy.js.map +1 -0
- package/dist/scheduler/resourceStrategyCapabilityValidation.d.ts +4 -0
- package/dist/scheduler/resourceStrategyCapabilityValidation.d.ts.map +1 -0
- package/dist/scheduler/resourceStrategyCapabilityValidation.js +270 -0
- package/dist/scheduler/resourceStrategyCapabilityValidation.js.map +1 -0
- package/dist/scheduler/resourceStrategyContracts.d.ts +466 -0
- package/dist/scheduler/resourceStrategyContracts.d.ts.map +1 -0
- package/dist/scheduler/resourceStrategyContracts.js +24 -0
- package/dist/scheduler/resourceStrategyContracts.js.map +1 -0
- package/dist/scheduler/resourceStrategyFinancialValidation.d.ts +5 -0
- package/dist/scheduler/resourceStrategyFinancialValidation.d.ts.map +1 -0
- package/dist/scheduler/resourceStrategyFinancialValidation.js +151 -0
- package/dist/scheduler/resourceStrategyFinancialValidation.js.map +1 -0
- package/dist/scheduler/resourceStrategyPermissionValidation.d.ts +4 -0
- package/dist/scheduler/resourceStrategyPermissionValidation.d.ts.map +1 -0
- package/dist/scheduler/resourceStrategyPermissionValidation.js +195 -0
- package/dist/scheduler/resourceStrategyPermissionValidation.js.map +1 -0
- package/dist/scheduler/resourceStrategyScheduleValidation.d.ts +14 -0
- package/dist/scheduler/resourceStrategyScheduleValidation.d.ts.map +1 -0
- package/dist/scheduler/resourceStrategyScheduleValidation.js +519 -0
- package/dist/scheduler/resourceStrategyScheduleValidation.js.map +1 -0
- package/dist/scheduler/resourceStrategyValidation.d.ts +5 -0
- package/dist/scheduler/resourceStrategyValidation.d.ts.map +1 -0
- package/dist/scheduler/resourceStrategyValidation.js +21 -0
- package/dist/scheduler/resourceStrategyValidation.js.map +1 -0
- package/dist/scheduler/resourceStrategyValidationShared.d.ts +19 -0
- package/dist/scheduler/resourceStrategyValidationShared.d.ts.map +1 -0
- package/dist/scheduler/resourceStrategyValidationShared.js +281 -0
- package/dist/scheduler/resourceStrategyValidationShared.js.map +1 -0
- package/dist/scheduler/schedulerContracts.d.ts +184 -0
- package/dist/scheduler/schedulerContracts.d.ts.map +1 -0
- package/dist/{aws/portalPublicArtifactNestedEvidence.js → scheduler/schedulerContracts.js} +1 -1
- package/dist/scheduler/schedulerContracts.js.map +1 -0
- package/dist/scheduler/schedulerValidation.d.ts +15 -0
- package/dist/scheduler/schedulerValidation.d.ts.map +1 -0
- package/dist/scheduler/schedulerValidation.js +388 -0
- package/dist/scheduler/schedulerValidation.js.map +1 -0
- package/dist/scheduler/weeklyAvailabilityFixtures.d.ts +26 -0
- package/dist/scheduler/weeklyAvailabilityFixtures.d.ts.map +1 -0
- package/dist/scheduler/weeklyAvailabilityFixtures.js +144 -0
- package/dist/scheduler/weeklyAvailabilityFixtures.js.map +1 -0
- package/package.json +26 -7
- package/dist/aws/pluginPublicArtifactBodyValidation.d.ts +0 -10
- package/dist/aws/pluginPublicArtifactBodyValidation.d.ts.map +0 -1
- package/dist/aws/pluginPublicArtifactBodyValidation.js +0 -225
- package/dist/aws/pluginPublicArtifactBodyValidation.js.map +0 -1
- package/dist/aws/pluginPublicArtifactEvidence.d.ts +0 -161
- package/dist/aws/pluginPublicArtifactEvidence.d.ts.map +0 -1
- package/dist/aws/pluginPublicArtifactEvidence.js.map +0 -1
- package/dist/aws/pluginPublicArtifactManifestValidation.d.ts +0 -4
- package/dist/aws/pluginPublicArtifactManifestValidation.d.ts.map +0 -1
- package/dist/aws/pluginPublicArtifactManifestValidation.js +0 -259
- package/dist/aws/pluginPublicArtifactManifestValidation.js.map +0 -1
- package/dist/aws/pluginPublicArtifactSectionValidation.d.ts +0 -6
- package/dist/aws/pluginPublicArtifactSectionValidation.d.ts.map +0 -1
- package/dist/aws/pluginPublicArtifactSectionValidation.js +0 -471
- package/dist/aws/pluginPublicArtifactSectionValidation.js.map +0 -1
- package/dist/aws/pluginPublicArtifactValidation.d.ts +0 -3
- package/dist/aws/pluginPublicArtifactValidation.d.ts.map +0 -1
- package/dist/aws/pluginPublicArtifactValidation.js +0 -9
- package/dist/aws/pluginPublicArtifactValidation.js.map +0 -1
- package/dist/aws/pluginPublicArtifactValidationHelpers.d.ts +0 -23
- package/dist/aws/pluginPublicArtifactValidationHelpers.d.ts.map +0 -1
- package/dist/aws/pluginPublicArtifactValidationHelpers.js +0 -240
- package/dist/aws/pluginPublicArtifactValidationHelpers.js.map +0 -1
- package/dist/aws/pluginPublicArtifacts.d.ts +0 -253
- package/dist/aws/pluginPublicArtifacts.d.ts.map +0 -1
- package/dist/aws/pluginPublicArtifacts.js +0 -51
- package/dist/aws/pluginPublicArtifacts.js.map +0 -1
- package/dist/aws/portalCommitmentsPlanningPublicArtifactValidation.d.ts +0 -4
- package/dist/aws/portalCommitmentsPlanningPublicArtifactValidation.d.ts.map +0 -1
- package/dist/aws/portalCommitmentsPlanningPublicArtifactValidation.js +0 -513
- package/dist/aws/portalCommitmentsPlanningPublicArtifactValidation.js.map +0 -1
- package/dist/aws/portalCommitmentsPlanningPublicArtifacts.d.ts +0 -13
- package/dist/aws/portalCommitmentsPlanningPublicArtifacts.d.ts.map +0 -1
- package/dist/aws/portalCommitmentsPlanningPublicArtifacts.js +0 -5
- package/dist/aws/portalCommitmentsPlanningPublicArtifacts.js.map +0 -1
- package/dist/aws/portalPublicArtifactCurrentValidation.d.ts +0 -4
- package/dist/aws/portalPublicArtifactCurrentValidation.d.ts.map +0 -1
- package/dist/aws/portalPublicArtifactCurrentValidation.js +0 -333
- package/dist/aws/portalPublicArtifactCurrentValidation.js.map +0 -1
- package/dist/aws/portalPublicArtifactEvidenceValidation.d.ts +0 -6
- package/dist/aws/portalPublicArtifactEvidenceValidation.d.ts.map +0 -1
- package/dist/aws/portalPublicArtifactEvidenceValidation.js +0 -301
- package/dist/aws/portalPublicArtifactEvidenceValidation.js.map +0 -1
- package/dist/aws/portalPublicArtifactHistoryAiValidation.d.ts +0 -8
- package/dist/aws/portalPublicArtifactHistoryAiValidation.d.ts.map +0 -1
- package/dist/aws/portalPublicArtifactHistoryAiValidation.js +0 -377
- package/dist/aws/portalPublicArtifactHistoryAiValidation.js.map +0 -1
- package/dist/aws/portalPublicArtifactHistoryTypes.d.ts +0 -178
- package/dist/aws/portalPublicArtifactHistoryTypes.d.ts.map +0 -1
- package/dist/aws/portalPublicArtifactHistoryTypes.js +0 -44
- package/dist/aws/portalPublicArtifactHistoryTypes.js.map +0 -1
- package/dist/aws/portalPublicArtifactNestedEvidence.d.ts +0 -127
- package/dist/aws/portalPublicArtifactNestedEvidence.d.ts.map +0 -1
- package/dist/aws/portalPublicArtifactNestedEvidence.js.map +0 -1
- package/dist/aws/portalPublicArtifactNestedEvidenceValidation.d.ts +0 -6
- package/dist/aws/portalPublicArtifactNestedEvidenceValidation.d.ts.map +0 -1
- package/dist/aws/portalPublicArtifactNestedEvidenceValidation.js +0 -405
- package/dist/aws/portalPublicArtifactNestedEvidenceValidation.js.map +0 -1
- package/dist/aws/portalPublicArtifactValidation.d.ts +0 -3
- package/dist/aws/portalPublicArtifactValidation.d.ts.map +0 -1
- package/dist/aws/portalPublicArtifactValidation.js +0 -14
- package/dist/aws/portalPublicArtifactValidation.js.map +0 -1
- package/dist/aws/portalPublicArtifactValidationCommon.d.ts +0 -30
- package/dist/aws/portalPublicArtifactValidationCommon.d.ts.map +0 -1
- package/dist/aws/portalPublicArtifactValidationCommon.js +0 -167
- package/dist/aws/portalPublicArtifactValidationCommon.js.map +0 -1
- package/dist/aws/portalPublicArtifacts.d.ts +0 -400
- package/dist/aws/portalPublicArtifacts.d.ts.map +0 -1
- package/dist/aws/portalPublicArtifacts.js +0 -85
- package/dist/aws/portalPublicArtifacts.js.map +0 -1
- package/dist/aws/portalRelationshipPublicArtifactValidation.d.ts +0 -4
- package/dist/aws/portalRelationshipPublicArtifactValidation.d.ts.map +0 -1
- package/dist/aws/portalRelationshipPublicArtifactValidation.js +0 -338
- package/dist/aws/portalRelationshipPublicArtifactValidation.js.map +0 -1
- package/dist/aws/portalRelationshipPublicArtifacts.d.ts +0 -196
- package/dist/aws/portalRelationshipPublicArtifacts.d.ts.map +0 -1
- package/dist/aws/portalRelationshipPublicArtifacts.js +0 -63
- package/dist/aws/portalRelationshipPublicArtifacts.js.map +0 -1
- package/dist/aws/portalRelationshipResourceNodeTypes.d.ts +0 -269
- package/dist/aws/portalRelationshipResourceNodeTypes.d.ts.map +0 -1
- package/dist/aws/portalRelationshipResourceNodeTypes.js +0 -3
- package/dist/aws/portalRelationshipResourceNodeTypes.js.map +0 -1
- package/dist/aws/portalRelationshipResourceNodeValidation.d.ts +0 -2
- package/dist/aws/portalRelationshipResourceNodeValidation.d.ts.map +0 -1
- package/dist/aws/portalRelationshipResourceNodeValidation.js +0 -372
- package/dist/aws/portalRelationshipResourceNodeValidation.js.map +0 -1
- package/dist/esm/aws/pluginPublicArtifactBodyValidation.js +0 -217
- package/dist/esm/aws/pluginPublicArtifactManifestValidation.js +0 -255
- package/dist/esm/aws/pluginPublicArtifactSectionValidation.js +0 -464
- package/dist/esm/aws/pluginPublicArtifactValidation.js +0 -2
- package/dist/esm/aws/pluginPublicArtifactValidationHelpers.js +0 -216
- package/dist/esm/aws/pluginPublicArtifacts.js +0 -44
- package/dist/esm/aws/portalCommitmentsPlanningPublicArtifactValidation.js +0 -509
- package/dist/esm/aws/portalCommitmentsPlanningPublicArtifacts.js +0 -1
- package/dist/esm/aws/portalPublicArtifactCurrentValidation.js +0 -328
- package/dist/esm/aws/portalPublicArtifactEvidenceValidation.js +0 -294
- package/dist/esm/aws/portalPublicArtifactHistoryAiValidation.js +0 -368
- package/dist/esm/aws/portalPublicArtifactHistoryTypes.js +0 -40
- package/dist/esm/aws/portalPublicArtifactNestedEvidenceValidation.js +0 -397
- package/dist/esm/aws/portalPublicArtifactValidation.js +0 -2
- package/dist/esm/aws/portalPublicArtifactValidationCommon.js +0 -139
- package/dist/esm/aws/portalPublicArtifacts.js +0 -73
- package/dist/esm/aws/portalRelationshipPublicArtifactValidation.js +0 -334
- package/dist/esm/aws/portalRelationshipPublicArtifacts.js +0 -59
- package/dist/esm/aws/portalRelationshipResourceNodeValidation.js +0 -368
- package/dist/esm/scheduler/bastionScheduleProfile.js +0 -206
- package/dist/esm/scheduler/bastionScheduleValidation.js +0 -401
- package/dist/esm/scheduler/scheduler.js +0 -1
- package/dist/scheduler/bastionSchedule.d.ts +0 -113
- package/dist/scheduler/bastionSchedule.d.ts.map +0 -1
- package/dist/scheduler/bastionSchedule.js.map +0 -1
- package/dist/scheduler/bastionScheduleProfile.d.ts +0 -24
- package/dist/scheduler/bastionScheduleProfile.d.ts.map +0 -1
- package/dist/scheduler/bastionScheduleProfile.js +0 -210
- package/dist/scheduler/bastionScheduleProfile.js.map +0 -1
- package/dist/scheduler/bastionScheduleValidation.d.ts +0 -10
- package/dist/scheduler/bastionScheduleValidation.d.ts.map +0 -1
- package/dist/scheduler/bastionScheduleValidation.js +0 -412
- package/dist/scheduler/bastionScheduleValidation.js.map +0 -1
- package/dist/scheduler/scheduler.d.ts +0 -267
- package/dist/scheduler/scheduler.d.ts.map +0 -1
- package/dist/scheduler/scheduler.js.map +0 -1
- /package/dist/esm/aws/{pluginPublicArtifactEvidence.js → commitmentsPlanningView.js} +0 -0
- /package/dist/esm/{aws/portalPublicArtifactNestedEvidence.js → common/boundedRows.js} +0 -0
- /package/dist/esm/{aws/portalRelationshipResourceNodeTypes.js → common/metricStats.js} +0 -0
- /package/dist/esm/scheduler/{bastionSchedule.js → schedulerContracts.js} +0 -0
|
@@ -1,464 +0,0 @@
|
|
|
1
|
-
import { AWS_PLUGIN_SOURCE_ARTIFACT_TYPES, } from './pluginPublicArtifacts.js';
|
|
2
|
-
import { asRecord, assertAccount, assertExactKeys, assertJsonEqual, assertPublicJson, assertRequiredKeys, assertValue, isoTimestamp, requiredEnum, requiredString, sha256, stringArray, validateBilling, validateMetricWindow, validateSelector, validateTagRuleScope, } from './pluginPublicArtifactValidationHelpers.js';
|
|
3
|
-
export function validateSubscriptionSections(value, target, outputGeneratedAt) {
|
|
4
|
-
const sections = asRecord(value, 'artifact.sections');
|
|
5
|
-
assertExactKeys(sections, [
|
|
6
|
-
'accountSummary',
|
|
7
|
-
'resources',
|
|
8
|
-
'aiCostSummary',
|
|
9
|
-
'serviceRetirement',
|
|
10
|
-
'recommendations',
|
|
11
|
-
'commitmentAnalysis',
|
|
12
|
-
'reliability',
|
|
13
|
-
'accountGovernance',
|
|
14
|
-
], 'artifact.sections');
|
|
15
|
-
validateSection(sections.accountSummary, 'account-summary', target, outputGeneratedAt);
|
|
16
|
-
validateSection(sections.resources, 'resources', target, outputGeneratedAt);
|
|
17
|
-
validateDeclaredOptionalSection(sections.aiCostSummary, 'ai-cost-summary', target.aiCostSummaryTargetKey, target, outputGeneratedAt);
|
|
18
|
-
validateSection(sections.serviceRetirement, 'service-retirement', target, outputGeneratedAt);
|
|
19
|
-
validateSection(sections.recommendations, 'recommendations', target, outputGeneratedAt);
|
|
20
|
-
validateDeclaredOptionalSection(sections.commitmentAnalysis, 'commitment-analysis', target.commitmentAnalysisTargetKey, target, outputGeneratedAt);
|
|
21
|
-
validateDeclaredOptionalSection(sections.reliability, 'reliability', target.reliabilityTargetKey, target, outputGeneratedAt);
|
|
22
|
-
validateDeclaredOptionalSection(sections.accountGovernance, 'account-governance', target.accountGovernanceTargetKey, target, outputGeneratedAt);
|
|
23
|
-
}
|
|
24
|
-
export function validateResourceSections(value, target, outputGeneratedAt) {
|
|
25
|
-
const sections = asRecord(value, 'artifact.sections');
|
|
26
|
-
assertExactKeys(sections, ['resource', 'relationships', 'serviceRetirement', 'recommendations'], 'artifact.sections');
|
|
27
|
-
const resource = validateSection(sections.resource, 'resource', target, outputGeneratedAt);
|
|
28
|
-
if (resource.status !== 'available')
|
|
29
|
-
throw new Error('artifact.sections.resource must be available.');
|
|
30
|
-
assertValue(resource.sourceGeneration.stableKey, target.stableKey, 'artifact.sections.resource.sourceGeneration.stableKey');
|
|
31
|
-
const item = asRecord(asRecord(resource.evidence, 'section.resource.evidence').item, 'section.resource.evidence.item');
|
|
32
|
-
assertValue(item.stableKey, target.stableKey, 'section.resource.evidence.item.stableKey');
|
|
33
|
-
validateSection(sections.relationships, 'relationships', target, outputGeneratedAt);
|
|
34
|
-
validateSection(sections.serviceRetirement, 'service-retirement', target, outputGeneratedAt);
|
|
35
|
-
validateSection(sections.recommendations, 'recommendations', target, outputGeneratedAt);
|
|
36
|
-
}
|
|
37
|
-
function validateDeclaredOptionalSection(value, section, targetKey, target, outputGeneratedAt) {
|
|
38
|
-
if (targetKey === undefined) {
|
|
39
|
-
if (value !== undefined)
|
|
40
|
-
throw new Error(`section.${section} is undeclared by its target.`);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
if (value === undefined)
|
|
44
|
-
throw new Error(`section.${section} is required by its declared target.`);
|
|
45
|
-
validateSection(value, section, target, outputGeneratedAt);
|
|
46
|
-
}
|
|
47
|
-
function validateSection(value, section, target, outputGeneratedAt) {
|
|
48
|
-
const field = `section.${section}`;
|
|
49
|
-
const bodySection = asRecord(value, field);
|
|
50
|
-
if (bodySection.status === 'available') {
|
|
51
|
-
assertExactKeys(bodySection, ['status', 'section', 'targetKey', 'generatedAt', 'sourceGeneration', 'additionalSourceGenerations', 'evidence'], field);
|
|
52
|
-
assertValue(bodySection.section, section, `${field}.section`);
|
|
53
|
-
const targetKey = requiredString(bodySection.targetKey, `${field}.targetKey`);
|
|
54
|
-
assertValue(targetKey, bodySectionTargetKey(section, target), `${field}.targetKey`);
|
|
55
|
-
const generatedAt = isoTimestamp(bodySection.generatedAt, `${field}.generatedAt`);
|
|
56
|
-
const source = validateSourceBinding(bodySection.sourceGeneration, target.accountId, section, `${field}.sourceGeneration`);
|
|
57
|
-
validateSourceBindingForTarget(source, target, `${field}.sourceGeneration`);
|
|
58
|
-
if (section !== 'recommendations') {
|
|
59
|
-
assertValue(source.targetKey, targetKey, `${field}.sourceGeneration.targetKey`);
|
|
60
|
-
assertValue(source.generatedAt, generatedAt, `${field}.sourceGeneration.generatedAt`);
|
|
61
|
-
}
|
|
62
|
-
if (generatedAt > outputGeneratedAt)
|
|
63
|
-
throw new Error(`${field}.generatedAt cannot exceed output generation time.`);
|
|
64
|
-
validateAdditionalSources(bodySection.additionalSourceGenerations, target, section, source);
|
|
65
|
-
const sources = [source, ...(bodySection.additionalSourceGenerations ?? [])];
|
|
66
|
-
if (section === 'recommendations')
|
|
67
|
-
validateCompleteRecommendationSources(sources, target, field);
|
|
68
|
-
validateEvidence(bodySection.evidence, section, target, source, generatedAt);
|
|
69
|
-
}
|
|
70
|
-
else if (bodySection.status === 'not-found') {
|
|
71
|
-
assertExactKeys(bodySection, ['status', 'section', 'targetKey'], field);
|
|
72
|
-
assertValue(bodySection.section, section, `${field}.section`);
|
|
73
|
-
assertValue(requiredString(bodySection.targetKey, `${field}.targetKey`), bodySectionTargetKey(section, target), `${field}.targetKey`);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
throw new Error(`${field}.status is not declared.`);
|
|
77
|
-
}
|
|
78
|
-
return bodySection;
|
|
79
|
-
}
|
|
80
|
-
function bodySectionTargetKey(section, target) {
|
|
81
|
-
if (section === 'recommendations')
|
|
82
|
-
return target.recommendationsTargetKey;
|
|
83
|
-
if (target.kind === 'resource-detail') {
|
|
84
|
-
if (section === 'resource')
|
|
85
|
-
return target.resourceCollectionTargetKey;
|
|
86
|
-
if (section === 'relationships')
|
|
87
|
-
return target.relationshipTargetKey;
|
|
88
|
-
if (section === 'service-retirement')
|
|
89
|
-
return target.serviceRetirementTargetKey;
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
const keys = {
|
|
93
|
-
'account-summary': target.accountSummaryTargetKey,
|
|
94
|
-
resources: target.resourceCollectionTargetKey,
|
|
95
|
-
'ai-cost-summary': target.aiCostSummaryTargetKey,
|
|
96
|
-
'service-retirement': target.serviceRetirementTargetKey,
|
|
97
|
-
'commitment-analysis': target.commitmentAnalysisTargetKey,
|
|
98
|
-
reliability: target.reliabilityTargetKey,
|
|
99
|
-
'account-governance': target.accountGovernanceTargetKey,
|
|
100
|
-
};
|
|
101
|
-
const key = keys[section];
|
|
102
|
-
if (key)
|
|
103
|
-
return key;
|
|
104
|
-
}
|
|
105
|
-
throw new Error(`section.${section} has no declared target key.`);
|
|
106
|
-
}
|
|
107
|
-
export function validateSourceBinding(value, accountId, section, field) {
|
|
108
|
-
const source = asRecord(value, field);
|
|
109
|
-
assertExactKeys(source, [
|
|
110
|
-
'provider',
|
|
111
|
-
'accountId',
|
|
112
|
-
'section',
|
|
113
|
-
'sourceArtifactType',
|
|
114
|
-
'generationId',
|
|
115
|
-
'generatedAt',
|
|
116
|
-
'targetKey',
|
|
117
|
-
'artifactSha256',
|
|
118
|
-
'billing',
|
|
119
|
-
'resourceRegions',
|
|
120
|
-
'selector',
|
|
121
|
-
'stableKey',
|
|
122
|
-
'metricTimeWindow',
|
|
123
|
-
'tagRuleScope',
|
|
124
|
-
], field);
|
|
125
|
-
assertValue(source.provider, 'aws', `${field}.provider`);
|
|
126
|
-
assertAccount(source.accountId, accountId, `${field}.accountId`);
|
|
127
|
-
assertValue(source.section, section, `${field}.section`);
|
|
128
|
-
requiredEnum(source.sourceArtifactType, AWS_PLUGIN_SOURCE_ARTIFACT_TYPES, `${field}.sourceArtifactType`);
|
|
129
|
-
if (!sourceTypesForSection(section).includes(String(source.sourceArtifactType))) {
|
|
130
|
-
throw new Error(`${field}.sourceArtifactType does not match section ${section}.`);
|
|
131
|
-
}
|
|
132
|
-
requiredString(source.generationId, `${field}.generationId`);
|
|
133
|
-
isoTimestamp(source.generatedAt, `${field}.generatedAt`);
|
|
134
|
-
requiredString(source.targetKey, `${field}.targetKey`);
|
|
135
|
-
sha256(source.artifactSha256, `${field}.artifactSha256`);
|
|
136
|
-
validateBilling(source.billing, `${field}.billing`);
|
|
137
|
-
stringArray(source.resourceRegions, `${field}.resourceRegions`);
|
|
138
|
-
validateMetricWindow(source.metricTimeWindow, `${field}.metricTimeWindow`);
|
|
139
|
-
if (source.selector !== undefined)
|
|
140
|
-
validateSelector(source.selector, `${field}.selector`);
|
|
141
|
-
if (source.stableKey !== undefined)
|
|
142
|
-
requiredString(source.stableKey, `${field}.stableKey`);
|
|
143
|
-
validateTagRuleScope(source.tagRuleScope);
|
|
144
|
-
return value;
|
|
145
|
-
}
|
|
146
|
-
export function validateSourceBindingForTarget(source, target, field) {
|
|
147
|
-
assertJsonEqual(source.billing, target.billing, `${field}.billing`);
|
|
148
|
-
const expectedRegions = target.kind === 'subscription-detail' && source.section === 'service-retirement'
|
|
149
|
-
? target.serviceRetirementRegions
|
|
150
|
-
: target.kind === 'subscription-detail' && source.section === 'commitment-analysis'
|
|
151
|
-
? target.commitmentAnalysis?.resourceRegions
|
|
152
|
-
: target.resourceRegions;
|
|
153
|
-
assertJsonEqual(source.resourceRegions, expectedRegions, `${field}.resourceRegions`);
|
|
154
|
-
assertJsonEqual(source.metricTimeWindow, target.metricTimeWindow, `${field}.metricTimeWindow`);
|
|
155
|
-
const expectedTargetKeys = expectedSourceTargetKeys(source, target);
|
|
156
|
-
if (!expectedTargetKeys.includes(source.targetKey)) {
|
|
157
|
-
throw new Error(`${field}.targetKey does not match the exact declared section target.`);
|
|
158
|
-
}
|
|
159
|
-
if (target.kind === 'resource-detail') {
|
|
160
|
-
assertJsonEqual(source.selector, target.selector, `${field}.selector`);
|
|
161
|
-
assertValue(source.stableKey, target.stableKey, `${field}.stableKey`);
|
|
162
|
-
assertJsonEqual(source.tagRuleScope, target.tagRuleScope, `${field}.tagRuleScope`);
|
|
163
|
-
}
|
|
164
|
-
else if (source.selector !== undefined || source.stableKey !== undefined || source.tagRuleScope !== undefined) {
|
|
165
|
-
throw new Error(`${field} contains resource-only selector, stable-key, or tag-rule scope.`);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
function expectedSourceTargetKeys(source, target) {
|
|
169
|
-
if (source.section === 'recommendations') {
|
|
170
|
-
return target.recommendationScopes.map(scope => source.sourceArtifactType === 'recommendation-actionability' ? scope.actionabilityTargetKey : scope.targetKey);
|
|
171
|
-
}
|
|
172
|
-
if (target.kind === 'resource-detail') {
|
|
173
|
-
if (source.section === 'resource')
|
|
174
|
-
return [target.resourceCollectionTargetKey];
|
|
175
|
-
if (source.section === 'relationships')
|
|
176
|
-
return [target.relationshipTargetKey];
|
|
177
|
-
if (source.section === 'service-retirement')
|
|
178
|
-
return [target.serviceRetirementTargetKey];
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
const targetBySection = {
|
|
182
|
-
'account-summary': target.accountSummaryTargetKey,
|
|
183
|
-
resources: target.resourceCollectionTargetKey,
|
|
184
|
-
'ai-cost-summary': target.aiCostSummaryTargetKey,
|
|
185
|
-
'service-retirement': target.serviceRetirementTargetKey,
|
|
186
|
-
'commitment-analysis': target.commitmentAnalysisTargetKey,
|
|
187
|
-
reliability: target.reliabilityTargetKey,
|
|
188
|
-
'account-governance': target.accountGovernanceTargetKey,
|
|
189
|
-
};
|
|
190
|
-
const targetKey = targetBySection[source.section];
|
|
191
|
-
if (targetKey)
|
|
192
|
-
return [targetKey];
|
|
193
|
-
}
|
|
194
|
-
throw new Error(`No exact target is declared for ${source.section}/${source.sourceArtifactType}.`);
|
|
195
|
-
}
|
|
196
|
-
function validateAdditionalSources(value, target, section, primary) {
|
|
197
|
-
if (value === undefined)
|
|
198
|
-
return;
|
|
199
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
200
|
-
throw new Error(`section.${section}.additionalSourceGenerations must be a non-empty array when declared.`);
|
|
201
|
-
}
|
|
202
|
-
const identities = new Set([sourceIdentity(primary)]);
|
|
203
|
-
value.forEach((source, index) => {
|
|
204
|
-
const field = `section.${section}.additionalSourceGenerations[${index}]`;
|
|
205
|
-
const binding = validateSourceBinding(source, target.accountId, section, field);
|
|
206
|
-
validateSourceBindingForTarget(binding, target, field);
|
|
207
|
-
const identity = sourceIdentity(binding);
|
|
208
|
-
if (identities.has(identity))
|
|
209
|
-
throw new Error(`section.${section} contains a duplicate source-generation binding.`);
|
|
210
|
-
identities.add(identity);
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
function sourceIdentity(source) {
|
|
214
|
-
return [source.section, source.sourceArtifactType, source.generationId, source.targetKey, source.artifactSha256].join('|');
|
|
215
|
-
}
|
|
216
|
-
function validateCompleteRecommendationSources(sources, target, field) {
|
|
217
|
-
const expected = target.recommendationScopes.flatMap(scope => [
|
|
218
|
-
`recommendations|${scope.targetKey}`,
|
|
219
|
-
`recommendation-actionability|${scope.actionabilityTargetKey}`,
|
|
220
|
-
]);
|
|
221
|
-
const actual = sources.map(source => `${source.sourceArtifactType}|${source.targetKey}`);
|
|
222
|
-
assertJsonEqual([...actual].sort(), [...expected].sort(), `${field}.sourceGenerations complete recommendation source set`);
|
|
223
|
-
}
|
|
224
|
-
function sourceTypesForSection(section) {
|
|
225
|
-
const sourceBySection = {
|
|
226
|
-
'account-summary': ['account-summary'],
|
|
227
|
-
resources: ['resource-collection'],
|
|
228
|
-
resource: ['resource-collection'],
|
|
229
|
-
'ai-cost-summary': ['ai-cost-summary'],
|
|
230
|
-
relationships: ['relationships'],
|
|
231
|
-
'service-retirement': ['lifecycle'],
|
|
232
|
-
recommendations: ['recommendations', 'recommendation-actionability'],
|
|
233
|
-
'commitment-analysis': ['commitment-analysis'],
|
|
234
|
-
reliability: ['reliability'],
|
|
235
|
-
'account-governance': ['account-governance'],
|
|
236
|
-
};
|
|
237
|
-
const source = sourceBySection[section];
|
|
238
|
-
if (!source)
|
|
239
|
-
throw new Error(`section ${section} is not declared.`);
|
|
240
|
-
return source;
|
|
241
|
-
}
|
|
242
|
-
function validateEvidence(value, section, target, source, generatedAt) {
|
|
243
|
-
const field = `section.${section}.evidence`;
|
|
244
|
-
const evidence = asRecord(value, field);
|
|
245
|
-
const shape = EVIDENCE_SHAPES[section];
|
|
246
|
-
if (!shape)
|
|
247
|
-
throw new Error(`section ${section} has no declared evidence contract.`);
|
|
248
|
-
assertExactKeys(evidence, shape.allowed, field);
|
|
249
|
-
const required = section === 'service-retirement'
|
|
250
|
-
? 'summary' in evidence || 'entries' in evidence
|
|
251
|
-
? ['summary', 'entries']
|
|
252
|
-
: ['stats', 'refreshMetadataBySource', 'refreshMetadataByFamily', 'highlights']
|
|
253
|
-
: shape.required;
|
|
254
|
-
assertRequiredKeys(evidence, required, field);
|
|
255
|
-
assertPublicJson(evidence, field);
|
|
256
|
-
validateEvidenceStructure(evidence, section, target, source, generatedAt, field);
|
|
257
|
-
}
|
|
258
|
-
function validateEvidenceStructure(evidence, section, target, source, generatedAt, field) {
|
|
259
|
-
if (section === 'account-summary') {
|
|
260
|
-
const artifact = asRecord(evidence.artifact, `${field}.artifact`);
|
|
261
|
-
assertExactKeys(artifact, ['artifactType', 'artifactVersion', 'generatedAt', 'scope', 'account', 'billing', 'discovery', 'metrics', 'recommendations'], `${field}.artifact`);
|
|
262
|
-
assertValue(artifact.artifactType, 'account-summary', `${field}.artifact.artifactType`);
|
|
263
|
-
assertValue(artifact.artifactVersion, 1, `${field}.artifact.artifactVersion`);
|
|
264
|
-
assertValue(isoTimestamp(artifact.generatedAt, `${field}.artifact.generatedAt`), generatedAt, `${field}.artifact.generatedAt`);
|
|
265
|
-
assertValue(source.generatedAt, generatedAt, `${field}.sourceGeneration.generatedAt`);
|
|
266
|
-
validatePortalScope(artifact.scope, target, `${field}.artifact.scope`);
|
|
267
|
-
}
|
|
268
|
-
else if (section === 'resources') {
|
|
269
|
-
validateResourceSummary(evidence.summary, `${field}.summary`);
|
|
270
|
-
asRecord(evidence.coverage, `${field}.coverage`);
|
|
271
|
-
validateResourceItems(evidence.highlights, `${field}.highlights`);
|
|
272
|
-
}
|
|
273
|
-
else if (section === 'resource') {
|
|
274
|
-
validateResourceItems([evidence.item], `${field}.item`);
|
|
275
|
-
}
|
|
276
|
-
else if (section === 'ai-cost-summary') {
|
|
277
|
-
requiredEnum(evidence.audience, ['portal', 'plugin'], `${field}.audience`);
|
|
278
|
-
assertValue(evidence.audience, target.kind === 'subscription-detail' ? target.aiCostSummaryAudience : undefined, `${field}.audience`);
|
|
279
|
-
isoTimestamp(evidence.sourceAccountSummaryGeneratedAt, `${field}.sourceAccountSummaryGeneratedAt`);
|
|
280
|
-
asRecord(evidence.artifact, `${field}.artifact`);
|
|
281
|
-
}
|
|
282
|
-
else if (section === 'recommendations') {
|
|
283
|
-
validateRecommendationEvidence(evidence, target, field);
|
|
284
|
-
}
|
|
285
|
-
else if (section === 'relationships') {
|
|
286
|
-
requiredString(evidence.anchorNodeId, `${field}.anchorNodeId`);
|
|
287
|
-
const stats = asRecord(evidence.stats, `${field}.stats`);
|
|
288
|
-
assertExactKeys(stats, ['directNodeCount', 'directEdgeCount', 'unresolvedCount'], `${field}.stats`);
|
|
289
|
-
['directNodeCount', 'directEdgeCount', 'unresolvedCount'].forEach(key => nonNegativeInteger(stats[key], `${field}.stats.${key}`));
|
|
290
|
-
['nodes', 'edges', 'unresolved'].forEach(key => jsonArray(evidence[key], `${field}.${key}`));
|
|
291
|
-
}
|
|
292
|
-
else if (section === 'service-retirement') {
|
|
293
|
-
if ('summary' in evidence) {
|
|
294
|
-
const summary = asRecord(evidence.summary, `${field}.summary`);
|
|
295
|
-
assertExactKeys(summary, ['matchedEntryCount', 'totalArtifactEntryCount'], `${field}.summary`);
|
|
296
|
-
nonNegativeInteger(summary.matchedEntryCount, `${field}.summary.matchedEntryCount`);
|
|
297
|
-
nonNegativeInteger(summary.totalArtifactEntryCount, `${field}.summary.totalArtifactEntryCount`);
|
|
298
|
-
jsonArray(evidence.entries, `${field}.entries`);
|
|
299
|
-
}
|
|
300
|
-
else {
|
|
301
|
-
const stats = asRecord(evidence.stats, `${field}.stats`);
|
|
302
|
-
assertExactKeys(stats, ['entryCount', 'matchedResourceCount', 'unmatchedSourceEntryCount', 'truncated'], `${field}.stats`);
|
|
303
|
-
['entryCount', 'matchedResourceCount', 'unmatchedSourceEntryCount'].forEach(key => nonNegativeInteger(stats[key], `${field}.stats.${key}`));
|
|
304
|
-
assertValue(stats.truncated, false, `${field}.stats.truncated`);
|
|
305
|
-
jsonArray(evidence.highlights, `${field}.highlights`);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
else if (section === 'reliability') {
|
|
309
|
-
asRecord(evidence.request, `${field}.request`);
|
|
310
|
-
asRecord(evidence.summary, `${field}.summary`);
|
|
311
|
-
jsonArray(evidence.sections, `${field}.sections`);
|
|
312
|
-
}
|
|
313
|
-
else if (section === 'account-governance') {
|
|
314
|
-
asRecord(evidence.workflow, `${field}.workflow`);
|
|
315
|
-
const checklist = asRecord(evidence.checklist, `${field}.checklist`);
|
|
316
|
-
assertRequiredKeys(checklist, ['present', 'targetKey'], `${field}.checklist`);
|
|
317
|
-
if (typeof checklist.present !== 'boolean')
|
|
318
|
-
throw new Error(`${field}.checklist.present must be boolean.`);
|
|
319
|
-
requiredString(checklist.targetKey, `${field}.checklist.targetKey`);
|
|
320
|
-
}
|
|
321
|
-
else {
|
|
322
|
-
for (const [key, child] of Object.entries(evidence)) {
|
|
323
|
-
if (key !== 'evidenceSource' && !Array.isArray(child))
|
|
324
|
-
asRecord(child, `${field}.${key}`);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
function validatePortalScope(value, target, field) {
|
|
329
|
-
const scope = asRecord(value, field);
|
|
330
|
-
assertExactKeys(scope, ['provider', 'accountId', 'billing', 'resourceRegions', 'metricTimeWindow'], field);
|
|
331
|
-
assertValue(scope.provider, 'aws', `${field}.provider`);
|
|
332
|
-
assertAccount(scope.accountId, target.accountId, `${field}.accountId`);
|
|
333
|
-
assertJsonEqual(scope.billing, target.billing, `${field}.billing`);
|
|
334
|
-
assertJsonEqual(scope.resourceRegions, target.resourceRegions, `${field}.resourceRegions`);
|
|
335
|
-
assertJsonEqual(scope.metricTimeWindow, target.metricTimeWindow, `${field}.metricTimeWindow`);
|
|
336
|
-
}
|
|
337
|
-
function validateResourceSummary(value, field) {
|
|
338
|
-
const summary = asRecord(value, field);
|
|
339
|
-
const keys = [
|
|
340
|
-
'totalDiscoveredResourceCount',
|
|
341
|
-
'returnedResourceCount',
|
|
342
|
-
'emptyCollection',
|
|
343
|
-
'truncated',
|
|
344
|
-
'unmatchedRecommendationResourceCount',
|
|
345
|
-
'unmatchedBillingExpenseCount',
|
|
346
|
-
];
|
|
347
|
-
assertExactKeys(summary, keys, field);
|
|
348
|
-
keys.filter(key => !['emptyCollection', 'truncated'].includes(key)).forEach(key => nonNegativeInteger(summary[key], `${field}.${key}`));
|
|
349
|
-
if (typeof summary.emptyCollection !== 'boolean' || typeof summary.truncated !== 'boolean')
|
|
350
|
-
throw new Error(`${field} flags must be boolean.`);
|
|
351
|
-
}
|
|
352
|
-
function validateResourceItems(value, field) {
|
|
353
|
-
jsonArray(value, field).forEach((item, index) => {
|
|
354
|
-
const itemField = `${field}[${index}]`;
|
|
355
|
-
const resource = asRecord(item, itemField);
|
|
356
|
-
assertRequiredKeys(resource, ['stableKey', 'family', 'resourceRegion', 'resourceType', 'discovery'], itemField);
|
|
357
|
-
['stableKey', 'family', 'resourceRegion', 'resourceType'].forEach(key => requiredString(resource[key], `${itemField}.${key}`));
|
|
358
|
-
asRecord(resource.discovery, `${itemField}.discovery`);
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
function validateRecommendationEvidence(evidence, target, field) {
|
|
362
|
-
const summary = asRecord(evidence.summary, `${field}.summary`);
|
|
363
|
-
['requestedScopeCount', 'availableScopeCount', 'notFoundScopeCount'].forEach(key => nonNegativeInteger(summary[key], `${field}.summary.${key}`));
|
|
364
|
-
const allowedSummary = ['requestedScopeCount', 'availableScopeCount', 'notFoundScopeCount', 'unsupportedScopeCount'];
|
|
365
|
-
assertExactKeys(summary, allowedSummary, `${field}.summary`);
|
|
366
|
-
assertValue(summary.requestedScopeCount, target.recommendationScopes.length, `${field}.summary.requestedScopeCount`);
|
|
367
|
-
const sections = jsonArray(evidence.sections, `${field}.sections`);
|
|
368
|
-
assertValue(sections.length, target.recommendationScopes.length, `${field}.sections.length`);
|
|
369
|
-
const matchedTargets = new Set();
|
|
370
|
-
const statusCounts = { available: 0, 'not-found': 0, 'unsupported-resource-identity': 0 };
|
|
371
|
-
sections.forEach((value, index) => {
|
|
372
|
-
const section = asRecord(value, `${field}.sections[${index}]`);
|
|
373
|
-
const status = requiredEnum(section.status, ['available', 'not-found', 'unsupported-resource-identity'], `${field}.sections[${index}].status`);
|
|
374
|
-
const source = requiredEnum(section.source, ['custom', 'compute-optimizer', 'cost-optimization-hub', 'resilience-hub', 'security-hub', 'trusted-advisor', 'well-architected'], `${field}.sections[${index}].source`);
|
|
375
|
-
statusCounts[status] += 1;
|
|
376
|
-
const targetKey = status === 'unsupported-resource-identity'
|
|
377
|
-
? target.recommendationScopes.find(scope => scope.source === source && !matchedTargets.has(scope.targetKey))?.targetKey
|
|
378
|
-
: requiredString(section.targetKey, `${field}.sections[${index}].targetKey`);
|
|
379
|
-
const scope = target.recommendationScopes.find(candidate => candidate.targetKey === targetKey && candidate.source === source);
|
|
380
|
-
if (!scope || matchedTargets.has(scope.targetKey))
|
|
381
|
-
throw new Error(`${field}.sections[${index}] does not match one exact declared recommendation scope.`);
|
|
382
|
-
matchedTargets.add(scope.targetKey);
|
|
383
|
-
if (status === 'available') {
|
|
384
|
-
assertExactKeys(section, target.kind === 'subscription-detail'
|
|
385
|
-
? [
|
|
386
|
-
'status',
|
|
387
|
-
'source',
|
|
388
|
-
'targetKey',
|
|
389
|
-
'generatedAt',
|
|
390
|
-
'scope',
|
|
391
|
-
'filters',
|
|
392
|
-
'summary',
|
|
393
|
-
'counts',
|
|
394
|
-
'savings',
|
|
395
|
-
'evidenceFreshness',
|
|
396
|
-
'templateProvenance',
|
|
397
|
-
'actionability',
|
|
398
|
-
'highlights',
|
|
399
|
-
]
|
|
400
|
-
: ['status', 'source', 'targetKey', 'generatedAt', 'evidenceFreshness', 'templateProvenance', 'actionability', 'artifact'], `${field}.sections[${index}]`);
|
|
401
|
-
isoTimestamp(section.generatedAt, `${field}.sections[${index}].generatedAt`);
|
|
402
|
-
if (target.kind === 'subscription-detail') {
|
|
403
|
-
assertRequiredKeys(section, ['scope', 'filters', 'summary', 'counts', 'savings', 'highlights'], `${field}.sections[${index}]`);
|
|
404
|
-
validateRecommendationScope(section.scope, scope, `${field}.sections[${index}].scope`);
|
|
405
|
-
jsonArray(section.highlights, `${field}.sections[${index}].highlights`);
|
|
406
|
-
}
|
|
407
|
-
else {
|
|
408
|
-
assertRequiredKeys(section, ['artifact'], `${field}.sections[${index}]`);
|
|
409
|
-
asRecord(section.artifact, `${field}.sections[${index}].artifact`);
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
else if (status === 'not-found') {
|
|
413
|
-
assertExactKeys(section, ['status', 'source', 'targetKey'], `${field}.sections[${index}]`);
|
|
414
|
-
}
|
|
415
|
-
else {
|
|
416
|
-
assertExactKeys(section, ['status', 'source'], `${field}.sections[${index}]`);
|
|
417
|
-
}
|
|
418
|
-
});
|
|
419
|
-
assertValue(summary.availableScopeCount, statusCounts.available, `${field}.summary.availableScopeCount`);
|
|
420
|
-
assertValue(summary.notFoundScopeCount, statusCounts['not-found'], `${field}.summary.notFoundScopeCount`);
|
|
421
|
-
if (summary.unsupportedScopeCount !== undefined) {
|
|
422
|
-
assertValue(summary.unsupportedScopeCount, statusCounts['unsupported-resource-identity'], `${field}.summary.unsupportedScopeCount`);
|
|
423
|
-
}
|
|
424
|
-
else if (statusCounts['unsupported-resource-identity'] > 0) {
|
|
425
|
-
throw new Error(`${field}.summary.unsupportedScopeCount is required.`);
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
function validateRecommendationScope(value, expected, field) {
|
|
429
|
-
const scope = asRecord(value, field);
|
|
430
|
-
assertExactKeys(scope, ['source', 'scope', 'accountId', 'scopeDiscriminator', 'computeOptimizerFamily', 'resourceRegions'], field);
|
|
431
|
-
for (const key of ['source', 'scope', 'accountId', 'scopeDiscriminator', 'computeOptimizerFamily', 'resourceRegions']) {
|
|
432
|
-
assertJsonEqual(scope[key], expected[key], `${field}.${key}`);
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
function jsonArray(value, field) {
|
|
436
|
-
if (!Array.isArray(value))
|
|
437
|
-
throw new Error(`${field} must be an array.`);
|
|
438
|
-
return value;
|
|
439
|
-
}
|
|
440
|
-
function nonNegativeInteger(value, field) {
|
|
441
|
-
if (!Number.isSafeInteger(value) || Number(value) < 0)
|
|
442
|
-
throw new Error(`${field} must be a non-negative safe integer.`);
|
|
443
|
-
}
|
|
444
|
-
const EVIDENCE_SHAPES = {
|
|
445
|
-
'account-summary': { allowed: ['artifact'], required: ['artifact'] },
|
|
446
|
-
resources: { allowed: ['summary', 'coverage', 'highlights'], required: ['summary', 'coverage', 'highlights'] },
|
|
447
|
-
'ai-cost-summary': {
|
|
448
|
-
allowed: ['audience', 'sourceAccountSummaryGeneratedAt', 'artifact'],
|
|
449
|
-
required: ['audience', 'sourceAccountSummaryGeneratedAt', 'artifact'],
|
|
450
|
-
},
|
|
451
|
-
'service-retirement': {
|
|
452
|
-
allowed: ['stats', 'refreshMetadataBySource', 'refreshMetadataByFamily', 'highlights', 'summary', 'entries'],
|
|
453
|
-
required: [],
|
|
454
|
-
},
|
|
455
|
-
recommendations: { allowed: ['summary', 'sections'], required: ['summary', 'sections'] },
|
|
456
|
-
'commitment-analysis': { allowed: ['request', 'billing', 'benefitExpiry', 'evidenceSource'], required: ['billing', 'benefitExpiry'] },
|
|
457
|
-
reliability: { allowed: ['request', 'summary', 'sections'], required: ['request', 'summary', 'sections'] },
|
|
458
|
-
'account-governance': { allowed: ['workflow', 'checklist', 'complianceResults'], required: ['workflow', 'checklist'] },
|
|
459
|
-
resource: { allowed: ['item'], required: ['item'] },
|
|
460
|
-
relationships: {
|
|
461
|
-
allowed: ['anchorNodeId', 'stats', 'nodes', 'edges', 'unresolved'],
|
|
462
|
-
required: ['anchorNodeId', 'stats', 'nodes', 'edges', 'unresolved'],
|
|
463
|
-
},
|
|
464
|
-
};
|