@spottoai/types-package 1.0.2-beta.36 → 1.0.2-beta.360
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/LICENSE +18 -40
- package/README.md +98 -18
- package/dist/accounts/accounts.d.ts +545 -3
- package/dist/accounts/accounts.d.ts.map +1 -1
- package/dist/accounts/accounts.js +122 -0
- package/dist/accounts/accounts.js.map +1 -1
- package/dist/accounts/azureSpSetup.d.ts +401 -0
- package/dist/accounts/azureSpSetup.d.ts.map +1 -0
- package/dist/accounts/azureSpSetup.js +3 -0
- package/dist/accounts/azureSpSetup.js.map +1 -0
- package/dist/accounts/azureSpSetupDurable.d.ts +118 -0
- package/dist/accounts/azureSpSetupDurable.d.ts.map +1 -0
- package/dist/accounts/azureSpSetupDurable.js +3 -0
- package/dist/accounts/azureSpSetupDurable.js.map +1 -0
- package/dist/accounts/index.d.ts +4 -0
- package/dist/accounts/index.d.ts.map +1 -1
- package/dist/accounts/index.js +4 -0
- package/dist/accounts/index.js.map +1 -1
- package/dist/accounts/readPermissions.d.ts +76 -0
- package/dist/accounts/readPermissions.d.ts.map +1 -0
- package/dist/accounts/readPermissions.js +202 -0
- package/dist/accounts/readPermissions.js.map +1 -0
- package/dist/accounts/validation.d.ts +91 -0
- package/dist/accounts/validation.d.ts.map +1 -0
- package/dist/accounts/validation.js +3 -0
- package/dist/accounts/validation.js.map +1 -0
- package/dist/accounts/writePermissions.d.ts +36 -0
- package/dist/accounts/writePermissions.d.ts.map +1 -0
- package/dist/accounts/writePermissions.js +47 -0
- package/dist/accounts/writePermissions.js.map +1 -0
- package/dist/ai/index.d.ts +1019 -9
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +1 -1
- package/dist/ai/index.js.map +1 -1
- package/dist/assessments/artifact.d.ts +84 -0
- package/dist/assessments/artifact.d.ts.map +1 -0
- package/dist/assessments/artifact.js +3 -0
- package/dist/assessments/artifact.js.map +1 -0
- package/dist/assessments/catalogue.d.ts +53 -0
- package/dist/assessments/catalogue.d.ts.map +1 -0
- package/dist/assessments/catalogue.js +16 -0
- package/dist/assessments/catalogue.js.map +1 -0
- package/dist/assessments/common.d.ts +27 -0
- package/dist/assessments/common.d.ts.map +1 -0
- package/dist/assessments/common.js +3 -0
- package/dist/assessments/common.js.map +1 -0
- package/dist/assessments/evidence.d.ts +78 -0
- package/dist/assessments/evidence.d.ts.map +1 -0
- package/dist/assessments/evidence.js +3 -0
- package/dist/assessments/evidence.js.map +1 -0
- package/dist/assessments/export.d.ts +27 -0
- package/dist/assessments/export.d.ts.map +1 -0
- package/dist/assessments/export.js +3 -0
- package/dist/assessments/export.js.map +1 -0
- package/dist/assessments/index.d.ts +11 -0
- package/dist/assessments/index.d.ts.map +1 -0
- package/dist/assessments/index.js +27 -0
- package/dist/assessments/index.js.map +1 -0
- package/dist/assessments/queue.d.ts +20 -0
- package/dist/assessments/queue.d.ts.map +1 -0
- package/dist/assessments/queue.js +6 -0
- package/dist/assessments/queue.js.map +1 -0
- package/dist/assessments/review.d.ts +36 -0
- package/dist/assessments/review.d.ts.map +1 -0
- package/dist/assessments/review.js +3 -0
- package/dist/assessments/review.js.map +1 -0
- package/dist/assessments/run.d.ts +62 -0
- package/dist/assessments/run.d.ts.map +1 -0
- package/dist/assessments/run.js +3 -0
- package/dist/assessments/run.js.map +1 -0
- package/dist/assessments/sow.d.ts +30 -0
- package/dist/assessments/sow.d.ts.map +1 -0
- package/dist/assessments/sow.js +3 -0
- package/dist/assessments/sow.js.map +1 -0
- package/dist/assessments/status.d.ts +27 -0
- package/dist/assessments/status.d.ts.map +1 -0
- package/dist/assessments/status.js +27 -0
- package/dist/assessments/status.js.map +1 -0
- package/dist/aws/commitments-planning.d.ts +3 -0
- package/dist/aws/commitments-planning.d.ts.map +1 -0
- package/dist/aws/commitments-planning.js +6 -0
- package/dist/aws/commitments-planning.js.map +1 -0
- package/dist/aws/commitmentsPlanningValidation.d.ts +7 -0
- package/dist/aws/commitmentsPlanningValidation.d.ts.map +1 -0
- package/dist/aws/commitmentsPlanningValidation.js +125 -0
- package/dist/aws/commitmentsPlanningValidation.js.map +1 -0
- package/dist/aws/estates.d.ts +153 -0
- package/dist/aws/estates.d.ts.map +1 -0
- package/dist/aws/estates.js +25 -0
- package/dist/aws/estates.js.map +1 -0
- package/dist/aws/index.d.ts +20 -0
- package/dist/aws/index.d.ts.map +1 -0
- package/dist/aws/index.js +35 -0
- package/dist/aws/index.js.map +1 -0
- package/dist/aws/onboarding.d.ts +54 -0
- package/dist/aws/onboarding.d.ts.map +1 -0
- package/dist/aws/onboarding.js +3 -0
- package/dist/aws/onboarding.js.map +1 -0
- package/dist/aws/pluginPublicArtifactBodyValidation.d.ts +10 -0
- package/dist/aws/pluginPublicArtifactBodyValidation.d.ts.map +1 -0
- package/dist/aws/pluginPublicArtifactBodyValidation.js +225 -0
- package/dist/aws/pluginPublicArtifactBodyValidation.js.map +1 -0
- package/dist/aws/pluginPublicArtifactEvidence.d.ts +161 -0
- package/dist/aws/pluginPublicArtifactEvidence.d.ts.map +1 -0
- package/dist/aws/pluginPublicArtifactEvidence.js +3 -0
- package/dist/aws/pluginPublicArtifactEvidence.js.map +1 -0
- package/dist/aws/pluginPublicArtifactManifestValidation.d.ts +4 -0
- package/dist/aws/pluginPublicArtifactManifestValidation.d.ts.map +1 -0
- package/dist/aws/pluginPublicArtifactManifestValidation.js +259 -0
- package/dist/aws/pluginPublicArtifactManifestValidation.js.map +1 -0
- package/dist/aws/pluginPublicArtifactSectionValidation.d.ts +6 -0
- package/dist/aws/pluginPublicArtifactSectionValidation.d.ts.map +1 -0
- package/dist/aws/pluginPublicArtifactSectionValidation.js +471 -0
- package/dist/aws/pluginPublicArtifactSectionValidation.js.map +1 -0
- package/dist/aws/pluginPublicArtifactValidation.d.ts +3 -0
- package/dist/aws/pluginPublicArtifactValidation.d.ts.map +1 -0
- package/dist/aws/pluginPublicArtifactValidation.js +9 -0
- package/dist/aws/pluginPublicArtifactValidation.js.map +1 -0
- package/dist/aws/pluginPublicArtifactValidationHelpers.d.ts +23 -0
- package/dist/aws/pluginPublicArtifactValidationHelpers.d.ts.map +1 -0
- package/dist/aws/pluginPublicArtifactValidationHelpers.js +240 -0
- package/dist/aws/pluginPublicArtifactValidationHelpers.js.map +1 -0
- package/dist/aws/pluginPublicArtifacts.d.ts +253 -0
- package/dist/aws/pluginPublicArtifacts.d.ts.map +1 -0
- package/dist/aws/pluginPublicArtifacts.js +116 -0
- package/dist/aws/pluginPublicArtifacts.js.map +1 -0
- package/dist/aws/portalCommitmentsPlanningPublicArtifactValidation.d.ts +4 -0
- package/dist/aws/portalCommitmentsPlanningPublicArtifactValidation.d.ts.map +1 -0
- package/dist/aws/portalCommitmentsPlanningPublicArtifactValidation.js +513 -0
- package/dist/aws/portalCommitmentsPlanningPublicArtifactValidation.js.map +1 -0
- package/dist/aws/portalCommitmentsPlanningPublicArtifacts.d.ts +13 -0
- package/dist/aws/portalCommitmentsPlanningPublicArtifacts.d.ts.map +1 -0
- package/dist/aws/portalCommitmentsPlanningPublicArtifacts.js +5 -0
- package/dist/aws/portalCommitmentsPlanningPublicArtifacts.js.map +1 -0
- package/dist/aws/portalPublicArtifactCurrentValidation.d.ts +4 -0
- package/dist/aws/portalPublicArtifactCurrentValidation.d.ts.map +1 -0
- package/dist/aws/portalPublicArtifactCurrentValidation.js +333 -0
- package/dist/aws/portalPublicArtifactCurrentValidation.js.map +1 -0
- package/dist/aws/portalPublicArtifactEvidenceValidation.d.ts +6 -0
- package/dist/aws/portalPublicArtifactEvidenceValidation.d.ts.map +1 -0
- package/dist/aws/portalPublicArtifactEvidenceValidation.js +301 -0
- package/dist/aws/portalPublicArtifactEvidenceValidation.js.map +1 -0
- package/dist/aws/portalPublicArtifactHistoryAiValidation.d.ts +8 -0
- package/dist/aws/portalPublicArtifactHistoryAiValidation.d.ts.map +1 -0
- package/dist/aws/portalPublicArtifactHistoryAiValidation.js +377 -0
- package/dist/aws/portalPublicArtifactHistoryAiValidation.js.map +1 -0
- package/dist/aws/portalPublicArtifactHistoryTypes.d.ts +178 -0
- package/dist/aws/portalPublicArtifactHistoryTypes.d.ts.map +1 -0
- package/dist/aws/portalPublicArtifactHistoryTypes.js +44 -0
- package/dist/aws/portalPublicArtifactHistoryTypes.js.map +1 -0
- package/dist/aws/portalPublicArtifactNestedEvidence.d.ts +127 -0
- package/dist/aws/portalPublicArtifactNestedEvidence.d.ts.map +1 -0
- package/dist/aws/portalPublicArtifactNestedEvidence.js +3 -0
- package/dist/aws/portalPublicArtifactNestedEvidence.js.map +1 -0
- package/dist/aws/portalPublicArtifactNestedEvidenceValidation.d.ts +6 -0
- package/dist/aws/portalPublicArtifactNestedEvidenceValidation.d.ts.map +1 -0
- package/dist/aws/portalPublicArtifactNestedEvidenceValidation.js +405 -0
- package/dist/aws/portalPublicArtifactNestedEvidenceValidation.js.map +1 -0
- package/dist/aws/portalPublicArtifactValidation.d.ts +3 -0
- package/dist/aws/portalPublicArtifactValidation.d.ts.map +1 -0
- package/dist/aws/portalPublicArtifactValidation.js +14 -0
- package/dist/aws/portalPublicArtifactValidation.js.map +1 -0
- package/dist/aws/portalPublicArtifactValidationCommon.d.ts +30 -0
- package/dist/aws/portalPublicArtifactValidationCommon.d.ts.map +1 -0
- package/dist/aws/portalPublicArtifactValidationCommon.js +167 -0
- package/dist/aws/portalPublicArtifactValidationCommon.js.map +1 -0
- package/dist/aws/portalPublicArtifacts.d.ts +400 -0
- package/dist/aws/portalPublicArtifacts.d.ts.map +1 -0
- package/dist/aws/portalPublicArtifacts.js +85 -0
- package/dist/aws/portalPublicArtifacts.js.map +1 -0
- package/dist/aws/portalRelationshipPublicArtifactValidation.d.ts +4 -0
- package/dist/aws/portalRelationshipPublicArtifactValidation.d.ts.map +1 -0
- package/dist/aws/portalRelationshipPublicArtifactValidation.js +338 -0
- package/dist/aws/portalRelationshipPublicArtifactValidation.js.map +1 -0
- package/dist/aws/portalRelationshipPublicArtifacts.d.ts +196 -0
- package/dist/aws/portalRelationshipPublicArtifacts.d.ts.map +1 -0
- package/dist/aws/portalRelationshipPublicArtifacts.js +63 -0
- package/dist/aws/portalRelationshipPublicArtifacts.js.map +1 -0
- package/dist/aws/portalRelationshipResourceNodeTypes.d.ts +269 -0
- package/dist/aws/portalRelationshipResourceNodeTypes.d.ts.map +1 -0
- package/dist/aws/portalRelationshipResourceNodeTypes.js +3 -0
- package/dist/aws/portalRelationshipResourceNodeTypes.js.map +1 -0
- package/dist/aws/portalRelationshipResourceNodeValidation.d.ts +2 -0
- package/dist/aws/portalRelationshipResourceNodeValidation.d.ts.map +1 -0
- package/dist/aws/portalRelationshipResourceNodeValidation.js +372 -0
- package/dist/aws/portalRelationshipResourceNodeValidation.js.map +1 -0
- package/dist/aws/publicArtifacts.d.ts +76 -0
- package/dist/aws/publicArtifacts.d.ts.map +1 -0
- package/dist/aws/publicArtifacts.js +17 -0
- package/dist/aws/publicArtifacts.js.map +1 -0
- package/dist/aws/relationships.d.ts +4 -0
- package/dist/aws/relationships.d.ts.map +1 -0
- package/dist/aws/relationships.js +6 -0
- package/dist/aws/relationships.js.map +1 -0
- package/dist/aws/requests.d.ts +84 -0
- package/dist/aws/requests.d.ts.map +1 -0
- package/dist/aws/requests.js +23 -0
- package/dist/aws/requests.js.map +1 -0
- package/dist/azure/activityLogs.d.ts +71 -0
- package/dist/azure/activityLogs.d.ts.map +1 -0
- package/dist/azure/activityLogs.js +6 -0
- package/dist/azure/activityLogs.js.map +1 -0
- package/dist/azure/advisorScore.d.ts +39 -0
- package/dist/azure/advisorScore.d.ts.map +1 -0
- package/dist/azure/advisorScore.js +3 -0
- package/dist/azure/advisorScore.js.map +1 -0
- package/dist/azure/benefits.d.ts +161 -0
- package/dist/azure/benefits.d.ts.map +1 -0
- package/dist/azure/benefits.js +3 -0
- package/dist/azure/benefits.js.map +1 -0
- package/dist/azure/billingArtifactCanonicalization.d.ts +28 -0
- package/dist/azure/billingArtifactCanonicalization.d.ts.map +1 -0
- package/dist/azure/billingArtifactCanonicalization.js +291 -0
- package/dist/azure/billingArtifactCanonicalization.js.map +1 -0
- package/dist/azure/billingArtifactEvidence.d.ts +39 -0
- package/dist/azure/billingArtifactEvidence.d.ts.map +1 -0
- package/dist/azure/billingArtifactEvidence.js +29 -0
- package/dist/azure/billingArtifactEvidence.js.map +1 -0
- package/dist/azure/billingArtifactGeneration.d.ts +114 -0
- package/dist/azure/billingArtifactGeneration.d.ts.map +1 -0
- package/dist/azure/billingArtifactGeneration.js +238 -0
- package/dist/azure/billingArtifactGeneration.js.map +1 -0
- package/dist/azure/billingGeneration.d.ts +50 -0
- package/dist/azure/billingGeneration.d.ts.map +1 -0
- package/dist/azure/billingGeneration.js +3 -0
- package/dist/azure/billingGeneration.js.map +1 -0
- package/dist/azure/billingPlots.d.ts +273 -0
- package/dist/azure/billingPlots.d.ts.map +1 -0
- package/dist/azure/billingPlots.js +192 -0
- package/dist/azure/billingPlots.js.map +1 -0
- package/dist/azure/budgets.d.ts +4 -0
- package/dist/azure/budgets.d.ts.map +1 -1
- package/dist/azure/commitmentsPlanning.d.ts +731 -0
- package/dist/azure/commitmentsPlanning.d.ts.map +1 -0
- package/dist/azure/commitmentsPlanning.js +3 -0
- package/dist/azure/commitmentsPlanning.js.map +1 -0
- package/dist/azure/common.d.ts +48 -1
- package/dist/azure/common.d.ts.map +1 -1
- package/dist/azure/configs.d.ts +75 -2
- package/dist/azure/configs.d.ts.map +1 -1
- package/dist/azure/costComposition.d.ts +74 -0
- package/dist/azure/costComposition.d.ts.map +1 -0
- package/dist/azure/costComposition.js +3 -0
- package/dist/azure/costComposition.js.map +1 -0
- package/dist/azure/dataProtection.d.ts +229 -0
- package/dist/azure/dataProtection.d.ts.map +1 -0
- package/dist/azure/dataProtection.js +9 -0
- package/dist/azure/dataProtection.js.map +1 -0
- package/dist/azure/governance.d.ts +942 -0
- package/dist/azure/governance.d.ts.map +1 -0
- package/dist/azure/governance.js +18 -0
- package/dist/azure/governance.js.map +1 -0
- package/dist/azure/licensing.d.ts +386 -0
- package/dist/azure/licensing.d.ts.map +1 -0
- package/dist/azure/licensing.js +3 -0
- package/dist/azure/licensing.js.map +1 -0
- package/dist/azure/metrics.d.ts +99 -4
- package/dist/azure/metrics.d.ts.map +1 -1
- package/dist/azure/payloads.d.ts +376 -1
- package/dist/azure/payloads.d.ts.map +1 -1
- package/dist/azure/portalArtifacts.d.ts +14 -0
- package/dist/azure/portalArtifacts.d.ts.map +1 -0
- package/dist/azure/portalArtifacts.js +5 -0
- package/dist/azure/portalArtifacts.js.map +1 -0
- package/dist/azure/prices.d.ts +250 -0
- package/dist/azure/prices.d.ts.map +1 -1
- package/dist/azure/publicIpAddresses.d.ts +171 -0
- package/dist/azure/publicIpAddresses.d.ts.map +1 -0
- package/dist/azure/publicIpAddresses.js +6 -0
- package/dist/azure/publicIpAddresses.js.map +1 -0
- package/dist/azure/recommendationAudit.d.ts +167 -0
- package/dist/azure/recommendationAudit.d.ts.map +1 -0
- package/dist/azure/recommendationAudit.js +20 -0
- package/dist/azure/recommendationAudit.js.map +1 -0
- package/dist/azure/recommendationState.d.ts +93 -4
- package/dist/azure/recommendationState.d.ts.map +1 -1
- package/dist/azure/recommendationTracks.d.ts +214 -0
- package/dist/azure/recommendationTracks.d.ts.map +1 -0
- package/dist/azure/recommendationTracks.js +44 -0
- package/dist/azure/recommendationTracks.js.map +1 -0
- package/dist/azure/recommendationWorkflow.d.ts +304 -0
- package/dist/azure/recommendationWorkflow.d.ts.map +1 -0
- package/dist/azure/recommendationWorkflow.js +17 -0
- package/dist/azure/recommendationWorkflow.js.map +1 -0
- package/dist/azure/recommendations.d.ts +582 -12
- package/dist/azure/recommendations.d.ts.map +1 -1
- package/dist/azure/recommendations.js.map +1 -1
- package/dist/azure/regulatoryCompliance.d.ts +301 -0
- package/dist/azure/regulatoryCompliance.d.ts.map +1 -0
- package/dist/azure/regulatoryCompliance.js +10 -0
- package/dist/azure/regulatoryCompliance.js.map +1 -0
- package/dist/azure/relationships.d.ts +193 -0
- package/dist/azure/relationships.d.ts.map +1 -0
- package/dist/azure/relationships.js +6 -0
- package/dist/azure/relationships.js.map +1 -0
- package/dist/azure/reportingTemplates.d.ts +70 -0
- package/dist/azure/reportingTemplates.d.ts.map +1 -0
- package/dist/azure/reportingTemplates.js +5 -0
- package/dist/azure/reportingTemplates.js.map +1 -0
- package/dist/azure/reports.d.ts +260 -2
- package/dist/azure/reports.d.ts.map +1 -1
- package/dist/azure/reports.js +1 -1
- package/dist/azure/reports.js.map +1 -1
- package/dist/azure/resourceHealth.d.ts +264 -0
- package/dist/azure/resourceHealth.d.ts.map +1 -0
- package/dist/azure/resourceHealth.js +16 -0
- package/dist/azure/resourceHealth.js.map +1 -0
- package/dist/azure/resourceOptimization.d.ts +79 -0
- package/dist/azure/resourceOptimization.d.ts.map +1 -0
- package/dist/azure/resourceOptimization.js +3 -0
- package/dist/azure/resourceOptimization.js.map +1 -0
- package/dist/azure/resources.d.ts +80 -0
- package/dist/azure/resources.d.ts.map +1 -1
- package/dist/azure/reviewChecklist.d.ts +147 -0
- package/dist/azure/reviewChecklist.d.ts.map +1 -0
- package/dist/azure/reviewChecklist.js +3 -0
- package/dist/azure/reviewChecklist.js.map +1 -0
- package/dist/azure/secureScore.d.ts +23 -0
- package/dist/azure/secureScore.d.ts.map +1 -0
- package/dist/azure/secureScore.js +3 -0
- package/dist/azure/secureScore.js.map +1 -0
- package/dist/azure/security.d.ts +10 -0
- package/dist/azure/security.d.ts.map +1 -1
- package/dist/azure/serviceRetirement.d.ts +59 -0
- package/dist/azure/serviceRetirement.d.ts.map +1 -0
- package/dist/azure/serviceRetirement.js +3 -0
- package/dist/azure/serviceRetirement.js.map +1 -0
- package/dist/azure/serviceRetirementState.d.ts +22 -0
- package/dist/azure/serviceRetirementState.d.ts.map +1 -0
- package/dist/azure/serviceRetirementState.js +3 -0
- package/dist/azure/serviceRetirementState.js.map +1 -0
- package/dist/azure/serviceRetirementWorkManagement.d.ts +7 -0
- package/dist/azure/serviceRetirementWorkManagement.d.ts.map +1 -0
- package/dist/azure/serviceRetirementWorkManagement.js +3 -0
- package/dist/azure/serviceRetirementWorkManagement.js.map +1 -0
- package/dist/azure/storage-inventory.d.ts +241 -0
- package/dist/azure/storage-inventory.d.ts.map +1 -0
- package/dist/azure/storage-inventory.js +3 -0
- package/dist/azure/storage-inventory.js.map +1 -0
- package/dist/azure/subscriptions.d.ts +89 -8
- package/dist/azure/subscriptions.d.ts.map +1 -1
- package/dist/azure/views.d.ts +815 -7
- package/dist/azure/views.d.ts.map +1 -1
- package/dist/azure/views.js +185 -0
- package/dist/azure/views.js.map +1 -1
- package/dist/azure/workManagement.d.ts +154 -0
- package/dist/azure/workManagement.d.ts.map +1 -0
- package/dist/azure/workManagement.js +8 -0
- package/dist/azure/workManagement.js.map +1 -0
- package/dist/common/artifactControlData.d.ts +12 -0
- package/dist/common/artifactControlData.d.ts.map +1 -0
- package/dist/common/artifactControlData.js +102 -0
- package/dist/common/artifactControlData.js.map +1 -0
- package/dist/common/artifactEvidence.d.ts +144 -0
- package/dist/common/artifactEvidence.d.ts.map +1 -0
- package/dist/common/artifactEvidence.js +181 -0
- package/dist/common/artifactEvidence.js.map +1 -0
- package/dist/common/artifactEvidenceValidation.d.ts +16 -0
- package/dist/common/artifactEvidenceValidation.d.ts.map +1 -0
- package/dist/common/artifactEvidenceValidation.js +31 -0
- package/dist/common/artifactEvidenceValidation.js.map +1 -0
- package/dist/common/artifactGeneration.d.ts +93 -0
- package/dist/common/artifactGeneration.d.ts.map +1 -0
- package/dist/common/artifactGeneration.js +5 -0
- package/dist/common/artifactGeneration.js.map +1 -0
- package/dist/common/capabilityPassport.d.ts +114 -0
- package/dist/common/capabilityPassport.d.ts.map +1 -0
- package/dist/common/capabilityPassport.js +211 -0
- package/dist/common/capabilityPassport.js.map +1 -0
- package/dist/common/index.d.ts +6 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +6 -0
- package/dist/common/index.js.map +1 -1
- package/dist/common/pagination.d.ts +3 -0
- package/dist/common/pagination.d.ts.map +1 -1
- package/dist/common/provider.d.ts +33 -0
- package/dist/common/provider.d.ts.map +1 -0
- package/dist/common/provider.js +15 -0
- package/dist/common/provider.js.map +1 -0
- package/dist/common/providerSyncProgress.d.ts +91 -0
- package/dist/common/providerSyncProgress.d.ts.map +1 -0
- package/dist/common/providerSyncProgress.js +3 -0
- package/dist/common/providerSyncProgress.js.map +1 -0
- package/dist/common/relationships.d.ts +8 -0
- package/dist/common/relationships.d.ts.map +1 -0
- package/dist/common/relationships.js +3 -0
- package/dist/common/relationships.js.map +1 -0
- package/dist/common/syncProgress.d.ts +27 -0
- package/dist/common/syncProgress.d.ts.map +1 -0
- package/dist/common/syncProgress.js +3 -0
- package/dist/common/syncProgress.js.map +1 -0
- package/dist/company/billingAccount.d.ts +30 -0
- package/dist/company/billingAccount.d.ts.map +1 -0
- package/dist/company/billingAccount.js +3 -0
- package/dist/company/billingAccount.js.map +1 -0
- package/dist/company/company.d.ts +91 -1
- package/dist/company/company.d.ts.map +1 -1
- package/dist/company/companyHierarchy.d.ts +53 -0
- package/dist/company/companyHierarchy.d.ts.map +1 -0
- package/dist/company/companyHierarchy.js +3 -0
- package/dist/company/companyHierarchy.js.map +1 -0
- package/dist/company/companyNotes.d.ts +288 -0
- package/dist/company/companyNotes.d.ts.map +1 -0
- package/dist/company/companyNotes.js +42 -0
- package/dist/company/companyNotes.js.map +1 -0
- package/dist/company/customProperties.d.ts +2 -0
- package/dist/company/customProperties.d.ts.map +1 -0
- package/dist/company/customProperties.js +18 -0
- package/dist/company/customProperties.js.map +1 -0
- package/dist/company/index.d.ts +3 -0
- package/dist/company/index.d.ts.map +1 -1
- package/dist/company/index.js +3 -0
- package/dist/company/index.js.map +1 -1
- package/dist/company/notification.d.ts +35 -1
- package/dist/company/notification.d.ts.map +1 -1
- package/dist/company/notification.js +27 -12
- package/dist/company/notification.js.map +1 -1
- package/dist/company/survey.d.ts +3 -0
- package/dist/company/survey.d.ts.map +1 -1
- package/dist/customProperties/customProperties.d.ts +87 -0
- package/dist/customProperties/customProperties.d.ts.map +1 -0
- package/dist/customProperties/customProperties.js +3 -0
- package/dist/customProperties/customProperties.js.map +1 -0
- package/dist/customProperties/index.d.ts +2 -0
- package/dist/customProperties/index.d.ts.map +1 -0
- package/dist/customProperties/index.js +18 -0
- package/dist/customProperties/index.js.map +1 -0
- package/dist/esm/accounts/accounts.js +115 -0
- package/dist/esm/accounts/azureSpSetup.js +1 -0
- package/dist/esm/accounts/azureSpSetupDurable.js +1 -0
- package/dist/esm/accounts/index.js +5 -0
- package/dist/esm/accounts/readPermissions.js +198 -0
- package/dist/esm/accounts/validation.js +1 -0
- package/dist/esm/accounts/writePermissions.js +43 -0
- package/dist/esm/ai/index.js +2 -0
- package/dist/esm/assessments/artifact.js +1 -0
- package/dist/esm/assessments/catalogue.js +12 -0
- package/dist/esm/assessments/common.js +1 -0
- package/dist/esm/assessments/evidence.js +1 -0
- package/dist/esm/assessments/export.js +1 -0
- package/dist/esm/assessments/index.js +10 -0
- package/dist/esm/assessments/queue.js +2 -0
- package/dist/esm/assessments/review.js +1 -0
- package/dist/esm/assessments/run.js +1 -0
- package/dist/esm/assessments/sow.js +1 -0
- package/dist/esm/assessments/status.js +23 -0
- package/dist/esm/aws/commitments-planning.js +1 -0
- package/dist/esm/aws/commitmentsPlanningValidation.js +121 -0
- package/dist/esm/aws/estates.js +21 -0
- package/dist/esm/aws/index.js +18 -0
- package/dist/esm/aws/onboarding.js +1 -0
- package/dist/esm/aws/pluginPublicArtifactBodyValidation.js +217 -0
- package/dist/esm/aws/pluginPublicArtifactEvidence.js +1 -0
- package/dist/esm/aws/pluginPublicArtifactManifestValidation.js +255 -0
- package/dist/esm/aws/pluginPublicArtifactSectionValidation.js +464 -0
- package/dist/esm/aws/pluginPublicArtifactValidation.js +2 -0
- package/dist/esm/aws/pluginPublicArtifactValidationHelpers.js +216 -0
- package/dist/esm/aws/pluginPublicArtifacts.js +109 -0
- package/dist/esm/aws/portalCommitmentsPlanningPublicArtifactValidation.js +509 -0
- package/dist/esm/aws/portalCommitmentsPlanningPublicArtifacts.js +1 -0
- package/dist/esm/aws/portalPublicArtifactCurrentValidation.js +328 -0
- package/dist/esm/aws/portalPublicArtifactEvidenceValidation.js +294 -0
- package/dist/esm/aws/portalPublicArtifactHistoryAiValidation.js +368 -0
- package/dist/esm/aws/portalPublicArtifactHistoryTypes.js +40 -0
- package/dist/esm/aws/portalPublicArtifactNestedEvidence.js +1 -0
- package/dist/esm/aws/portalPublicArtifactNestedEvidenceValidation.js +397 -0
- package/dist/esm/aws/portalPublicArtifactValidation.js +2 -0
- package/dist/esm/aws/portalPublicArtifactValidationCommon.js +139 -0
- package/dist/esm/aws/portalPublicArtifacts.js +73 -0
- package/dist/esm/aws/portalRelationshipPublicArtifactValidation.js +334 -0
- package/dist/esm/aws/portalRelationshipPublicArtifacts.js +59 -0
- package/dist/esm/aws/portalRelationshipResourceNodeTypes.js +1 -0
- package/dist/esm/aws/portalRelationshipResourceNodeValidation.js +368 -0
- package/dist/esm/aws/publicArtifacts.js +13 -0
- package/dist/esm/aws/relationships.js +1 -0
- package/dist/esm/aws/requests.js +19 -0
- package/dist/esm/azure/activityLogs.js +2 -0
- package/dist/esm/azure/advisorScore.js +1 -0
- package/dist/esm/azure/benefits.js +1 -0
- package/dist/esm/azure/billingArtifactCanonicalization.js +281 -0
- package/dist/esm/azure/billingArtifactEvidence.js +23 -0
- package/dist/esm/azure/billingArtifactGeneration.js +229 -0
- package/dist/esm/azure/billingGeneration.js +1 -0
- package/dist/esm/azure/billingPlots.js +187 -0
- package/dist/esm/azure/budgets.js +1 -0
- package/dist/esm/azure/commitmentsPlanning.js +1 -0
- package/dist/esm/azure/common.js +1 -0
- package/dist/esm/azure/configs.js +1 -0
- package/dist/esm/azure/costComposition.js +1 -0
- package/dist/esm/azure/dataProtection.js +5 -0
- package/dist/esm/azure/governance.js +14 -0
- package/dist/esm/azure/licensing.js +1 -0
- package/dist/esm/azure/metrics.js +1 -0
- package/dist/esm/azure/payloads.js +1 -0
- package/dist/esm/azure/portalArtifacts.js +1 -0
- package/dist/esm/azure/prices.js +1 -0
- package/dist/esm/azure/publicIpAddresses.js +2 -0
- package/dist/esm/azure/recommendationAudit.js +16 -0
- package/dist/esm/azure/recommendationState.js +1 -0
- package/dist/esm/azure/recommendationTracks.js +40 -0
- package/dist/esm/azure/recommendationWorkflow.js +13 -0
- package/dist/esm/azure/recommendations.js +10 -0
- package/dist/esm/azure/regulatoryCompliance.js +6 -0
- package/dist/esm/azure/relationships.js +2 -0
- package/dist/esm/azure/reportingTemplates.js +1 -0
- package/dist/esm/azure/reports.js +12 -0
- package/dist/esm/azure/resourceHealth.js +12 -0
- package/dist/esm/azure/resourceOptimization.js +1 -0
- package/dist/esm/azure/resources.js +1 -0
- package/dist/esm/azure/reviewChecklist.js +1 -0
- package/dist/esm/azure/secureScore.js +1 -0
- package/dist/esm/azure/security.js +1 -0
- package/dist/esm/azure/serviceRetirement.js +1 -0
- package/dist/esm/azure/serviceRetirementState.js +1 -0
- package/dist/esm/azure/serviceRetirementWorkManagement.js +1 -0
- package/dist/esm/azure/storage-inventory.js +1 -0
- package/dist/esm/azure/subscriptions.js +1 -0
- package/dist/esm/azure/views.js +181 -0
- package/dist/esm/azure/workManagement.js +4 -0
- package/dist/esm/common/artifactControlData.js +95 -0
- package/dist/esm/common/artifactEvidence.js +173 -0
- package/dist/esm/common/artifactEvidenceValidation.js +24 -0
- package/dist/esm/common/artifactGeneration.js +1 -0
- package/dist/esm/common/capabilityPassport.js +206 -0
- package/dist/esm/common/index.js +7 -0
- package/dist/esm/common/pagination.js +1 -0
- package/dist/esm/common/provider.js +11 -0
- package/dist/esm/common/providerSyncProgress.js +1 -0
- package/dist/esm/common/relationships.js +1 -0
- package/dist/esm/common/syncProgress.js +1 -0
- package/dist/esm/company/billingAccount.js +1 -0
- package/dist/esm/company/company.js +1 -0
- package/dist/esm/company/companyHierarchy.js +1 -0
- package/dist/esm/company/companyNotes.js +38 -0
- package/dist/esm/company/customProperties.js +1 -0
- package/dist/esm/company/index.js +6 -0
- package/dist/esm/company/notification.js +43 -0
- package/dist/esm/company/survey.js +1 -0
- package/dist/esm/customProperties/customProperties.js +1 -0
- package/dist/esm/customProperties/index.js +1 -0
- package/dist/esm/entries/aws.js +3 -0
- package/dist/esm/entries/commitments-planning.js +3 -0
- package/dist/esm/entries/provider.js +3 -0
- package/dist/esm/entries/recommendations.js +3 -0
- package/dist/esm/entries/relationships.js +3 -0
- package/dist/esm/entries/root.js +3 -0
- package/dist/esm/events/actionGroups.js +1 -0
- package/dist/esm/events/alertDefinitionRun.js +1 -0
- package/dist/esm/events/baseAlert.js +1 -0
- package/dist/esm/events/cost.js +1 -0
- package/dist/esm/events/costAnomalies.js +1 -0
- package/dist/esm/events/costViews.js +1 -0
- package/dist/esm/events/eventStatus.js +1 -0
- package/dist/esm/events/index.js +8 -0
- package/dist/esm/events/quickAlerts.js +2 -0
- package/dist/esm/features-and-permissions/access.js +1 -0
- package/dist/esm/features-and-permissions/index.js +1 -0
- package/dist/esm/feedbacks/feedback.js +1 -0
- package/dist/esm/identity/apikey.js +1 -0
- package/dist/esm/identity/index.js +1 -0
- package/dist/esm/index.js +58 -0
- package/dist/esm/index.vite.js +48 -0
- package/dist/esm/integrations/autotask.js +1 -0
- package/dist/esm/integrations/azureDevOps.js +1 -0
- package/dist/esm/integrations/github.js +1 -0
- package/dist/esm/integrations/halo.js +1 -0
- package/dist/esm/integrations/index.js +5 -0
- package/dist/esm/integrations/integrationTickets.js +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/portfolio/index.js +2 -0
- package/dist/esm/portfolio/portfolioOperations.js +1 -0
- package/dist/esm/portfolio/portfolioProjections.js +17 -0
- package/dist/esm/scheduler/index.js +1 -0
- package/dist/esm/scheduler/scheduler.js +1 -0
- package/dist/esm/tags/index.js +1 -0
- package/dist/esm/tags/tags.js +6 -0
- package/dist/esm/unknown/services.js +1 -0
- package/dist/esm/users/companyUser.js +2 -0
- package/dist/esm/users/index.js +2 -0
- package/dist/esm/users/user.js +1 -0
- package/dist/events/actionGroups.d.ts +85 -0
- package/dist/events/actionGroups.d.ts.map +1 -0
- package/dist/events/actionGroups.js +3 -0
- package/dist/events/actionGroups.js.map +1 -0
- package/dist/events/alertDefinitionRun.d.ts +23 -0
- package/dist/events/alertDefinitionRun.d.ts.map +1 -0
- package/dist/events/alertDefinitionRun.js +3 -0
- package/dist/events/alertDefinitionRun.js.map +1 -0
- package/dist/events/baseAlert.d.ts +140 -0
- package/dist/events/baseAlert.d.ts.map +1 -0
- package/dist/events/baseAlert.js +3 -0
- package/dist/events/baseAlert.js.map +1 -0
- package/dist/events/cost.d.ts +371 -0
- package/dist/events/cost.d.ts.map +1 -0
- package/dist/events/cost.js +3 -0
- package/dist/events/cost.js.map +1 -0
- package/dist/events/costAnomalies.d.ts +47 -0
- package/dist/events/costAnomalies.d.ts.map +1 -0
- package/dist/events/costAnomalies.js +3 -0
- package/dist/events/costAnomalies.js.map +1 -0
- package/dist/events/costViews.d.ts +25 -0
- package/dist/events/costViews.d.ts.map +1 -0
- package/dist/events/costViews.js +3 -0
- package/dist/events/costViews.js.map +1 -0
- package/dist/events/eventStatus.d.ts +67 -0
- package/dist/events/eventStatus.d.ts.map +1 -0
- package/dist/events/eventStatus.js +3 -0
- package/dist/events/eventStatus.js.map +1 -0
- package/dist/events/index.d.ts +9 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +25 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/quickAlerts.d.ts +67 -0
- package/dist/events/quickAlerts.d.ts.map +1 -0
- package/dist/events/quickAlerts.js +7 -0
- package/dist/events/quickAlerts.js.map +1 -0
- package/dist/features-and-permissions/access.d.ts +139 -0
- package/dist/features-and-permissions/access.d.ts.map +1 -0
- package/dist/features-and-permissions/access.js +3 -0
- package/dist/features-and-permissions/access.js.map +1 -0
- package/dist/features-and-permissions/index.d.ts +2 -0
- package/dist/features-and-permissions/index.d.ts.map +1 -0
- package/dist/features-and-permissions/index.js +18 -0
- package/dist/features-and-permissions/index.js.map +1 -0
- package/dist/feedbacks/feedback.d.ts +9 -0
- package/dist/feedbacks/feedback.d.ts.map +1 -1
- package/dist/identity/apikey.d.ts +84 -0
- package/dist/identity/apikey.d.ts.map +1 -0
- package/dist/identity/apikey.js +3 -0
- package/dist/identity/apikey.js.map +1 -0
- package/dist/identity/index.d.ts +2 -0
- package/dist/identity/index.d.ts.map +1 -0
- package/dist/identity/index.js +18 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -1
- package/dist/index.js.map +1 -1
- package/dist/index.vite.d.ts +49 -0
- package/dist/index.vite.d.ts.map +1 -0
- package/dist/index.vite.js +65 -0
- package/dist/index.vite.js.map +1 -0
- package/dist/integrations/autotask.d.ts +108 -0
- package/dist/integrations/autotask.d.ts.map +1 -0
- package/dist/integrations/autotask.js +3 -0
- package/dist/integrations/autotask.js.map +1 -0
- package/dist/integrations/azureDevOps.d.ts +130 -0
- package/dist/integrations/azureDevOps.d.ts.map +1 -0
- package/dist/integrations/azureDevOps.js +3 -0
- package/dist/integrations/azureDevOps.js.map +1 -0
- package/dist/integrations/github.d.ts +96 -0
- package/dist/integrations/github.d.ts.map +1 -0
- package/dist/integrations/github.js +3 -0
- package/dist/integrations/github.js.map +1 -0
- package/dist/integrations/halo.d.ts +76 -0
- package/dist/integrations/halo.d.ts.map +1 -0
- package/dist/integrations/halo.js +3 -0
- package/dist/integrations/halo.js.map +1 -0
- package/dist/integrations/index.d.ts +6 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +22 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/integrations/integrationTickets.d.ts +77 -0
- package/dist/integrations/integrationTickets.d.ts.map +1 -0
- package/dist/integrations/integrationTickets.js +3 -0
- package/dist/integrations/integrationTickets.js.map +1 -0
- package/dist/portfolio/index.d.ts +3 -0
- package/dist/portfolio/index.d.ts.map +1 -0
- package/dist/portfolio/index.js +19 -0
- package/dist/portfolio/index.js.map +1 -0
- package/dist/portfolio/portfolioOperations.d.ts +174 -0
- package/dist/portfolio/portfolioOperations.d.ts.map +1 -0
- package/dist/portfolio/portfolioOperations.js +3 -0
- package/dist/portfolio/portfolioOperations.js.map +1 -0
- package/dist/portfolio/portfolioProjections.d.ts +460 -0
- package/dist/portfolio/portfolioProjections.d.ts.map +1 -0
- package/dist/portfolio/portfolioProjections.js +21 -0
- package/dist/portfolio/portfolioProjections.js.map +1 -0
- package/dist/scheduler/index.d.ts +2 -0
- package/dist/scheduler/index.d.ts.map +1 -0
- package/dist/scheduler/index.js +18 -0
- package/dist/scheduler/index.js.map +1 -0
- package/dist/scheduler/scheduler.d.ts +263 -0
- package/dist/scheduler/scheduler.d.ts.map +1 -0
- package/dist/scheduler/scheduler.js +3 -0
- package/dist/scheduler/scheduler.js.map +1 -0
- package/dist/tags/index.d.ts +2 -0
- package/dist/tags/index.d.ts.map +1 -0
- package/dist/tags/index.js +18 -0
- package/dist/tags/index.js.map +1 -0
- package/dist/tags/tags.d.ts +37 -0
- package/dist/tags/tags.d.ts.map +1 -0
- package/dist/tags/tags.js +10 -0
- package/dist/tags/tags.js.map +1 -0
- package/dist/unknown/services.d.ts +12 -0
- package/dist/unknown/services.d.ts.map +1 -0
- package/dist/unknown/services.js +3 -0
- package/dist/unknown/services.js.map +1 -0
- package/dist/users/companyUser.d.ts +14 -0
- package/dist/users/companyUser.d.ts.map +1 -1
- package/dist/users/companyUser.js.map +1 -1
- package/dist/users/user.d.ts +20 -1
- package/dist/users/user.d.ts.map +1 -1
- package/package.json +68 -5
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import { AWS_PORTAL_ACCOUNT_SUMMARY_LOGICAL_NAME, AWS_PORTAL_RESOURCE_COLLECTION_LOGICAL_NAME, } from './portalPublicArtifacts.js';
|
|
2
|
+
import { asRecord, assertExactKeys, assertPublicJson, assertUnique, assertValue, isoTimestamp, nonNegativeInteger, requiredBoolean, requiredEnum, requiredString, stringArray, validateAccountScope, validateFreshness, validateJsonObject, validatePortalEnvelope, validateResourceScope, } from './portalPublicArtifactValidationCommon.js';
|
|
3
|
+
import { validateAwsPortalBillingBlock, validateAwsPortalRecommendationCoverage } from './portalPublicArtifactEvidenceValidation.js';
|
|
4
|
+
import { validateRecommendationActionability, validateResourceBillingEvidence, validateTemplateProvenanceSources, } from './portalPublicArtifactNestedEvidenceValidation.js';
|
|
5
|
+
const DISCOVERY_FAMILIES = [
|
|
6
|
+
'ec2-instance',
|
|
7
|
+
'ebs-volume',
|
|
8
|
+
'efs-file-system',
|
|
9
|
+
'lambda-function',
|
|
10
|
+
'elasticache-cache-cluster',
|
|
11
|
+
'elasticache-serverless-cache',
|
|
12
|
+
'vpc',
|
|
13
|
+
'subnet',
|
|
14
|
+
'route-table',
|
|
15
|
+
'internet-gateway',
|
|
16
|
+
'nat-gateway',
|
|
17
|
+
'network-interface',
|
|
18
|
+
'virtual-private-gateway',
|
|
19
|
+
'load-balancer-v2',
|
|
20
|
+
'classic-load-balancer',
|
|
21
|
+
'security-group',
|
|
22
|
+
'rds-db-cluster',
|
|
23
|
+
'rds-db-instance',
|
|
24
|
+
];
|
|
25
|
+
const METRIC_FAMILIES = [
|
|
26
|
+
'ec2-core-utilization',
|
|
27
|
+
'ebs-volume-performance',
|
|
28
|
+
'lambda-function-performance',
|
|
29
|
+
'load-balancer-v2-network-traffic',
|
|
30
|
+
'load-balancer-v2-application-traffic',
|
|
31
|
+
'rds-db-instance-utilization',
|
|
32
|
+
];
|
|
33
|
+
const RECOMMENDATION_SOURCES = [
|
|
34
|
+
'custom',
|
|
35
|
+
'compute-optimizer',
|
|
36
|
+
'cost-optimization-hub',
|
|
37
|
+
'resilience-hub',
|
|
38
|
+
'security-hub',
|
|
39
|
+
'trusted-advisor',
|
|
40
|
+
'well-architected',
|
|
41
|
+
];
|
|
42
|
+
const CURRENT_KEYS = [
|
|
43
|
+
'schemaVersion',
|
|
44
|
+
'portalSchemaVersion',
|
|
45
|
+
'provider',
|
|
46
|
+
'accountId',
|
|
47
|
+
'artifactType',
|
|
48
|
+
'artifactGeneration',
|
|
49
|
+
'generatedAt',
|
|
50
|
+
'logicalName',
|
|
51
|
+
'scope',
|
|
52
|
+
];
|
|
53
|
+
export function validateAwsPortalResourceCollectionDetailArtifact(value) {
|
|
54
|
+
const artifact = asRecord(value, 'artifact');
|
|
55
|
+
const { accountId } = validatePortalEnvelope(artifact, 'resource-collection', [...CURRENT_KEYS, 'summary', 'coverage', 'resources']);
|
|
56
|
+
assertValue(artifact.logicalName, AWS_PORTAL_RESOURCE_COLLECTION_LOGICAL_NAME, 'artifact.logicalName');
|
|
57
|
+
const scope = validateResourceScope(artifact.scope, accountId, 'artifact.scope');
|
|
58
|
+
validateResourceSummary(artifact.summary, 'artifact.summary');
|
|
59
|
+
validateResourceCoverage(artifact.coverage, accountId, scope);
|
|
60
|
+
if (!Array.isArray(artifact.resources))
|
|
61
|
+
throw new Error('artifact.resources must be an array.');
|
|
62
|
+
validateResources(artifact.resources, scope.resourceRegions);
|
|
63
|
+
const summary = asRecord(artifact.summary, 'artifact.summary');
|
|
64
|
+
if (summary.returnedResourceCount !== artifact.resources.length)
|
|
65
|
+
throw new Error('artifact.summary.returnedResourceCount must equal artifact.resources length.');
|
|
66
|
+
if (Number(summary.totalDiscoveredResourceCount) < Number(summary.returnedResourceCount))
|
|
67
|
+
throw new Error('artifact.summary.totalDiscoveredResourceCount must not be less than returnedResourceCount.');
|
|
68
|
+
assertPublicJson(artifact, 'artifact');
|
|
69
|
+
return value;
|
|
70
|
+
}
|
|
71
|
+
export function validateAwsPortalAccountSummaryDetailArtifact(value) {
|
|
72
|
+
const artifact = asRecord(value, 'artifact');
|
|
73
|
+
const { accountId } = validatePortalEnvelope(artifact, 'account-summary', [
|
|
74
|
+
...CURRENT_KEYS,
|
|
75
|
+
'account',
|
|
76
|
+
'billing',
|
|
77
|
+
'discovery',
|
|
78
|
+
'metrics',
|
|
79
|
+
'recommendations',
|
|
80
|
+
]);
|
|
81
|
+
assertValue(artifact.logicalName, AWS_PORTAL_ACCOUNT_SUMMARY_LOGICAL_NAME, 'artifact.logicalName');
|
|
82
|
+
const scope = validateAccountScope(artifact.scope, accountId, 'artifact.scope');
|
|
83
|
+
validateAccount(artifact.account, accountId);
|
|
84
|
+
validateAwsPortalBillingBlock(artifact.billing, 'artifact.billing', scope.billing, accountId, true);
|
|
85
|
+
validateDiscovery(artifact.discovery, scope.resourceRegions, 'artifact.discovery');
|
|
86
|
+
validateMetrics(artifact.metrics, scope.resourceRegions, 'artifact.metrics', 'account');
|
|
87
|
+
validateAwsPortalRecommendationCoverage(artifact.recommendations, accountId, scope.resourceRegions, 'artifact.recommendations', RECOMMENDATION_SOURCES, true);
|
|
88
|
+
assertPublicJson(artifact, 'artifact');
|
|
89
|
+
return value;
|
|
90
|
+
}
|
|
91
|
+
function validateResourceSummary(value, field) {
|
|
92
|
+
const summary = asRecord(value, field);
|
|
93
|
+
const keys = [
|
|
94
|
+
'totalDiscoveredResourceCount',
|
|
95
|
+
'returnedResourceCount',
|
|
96
|
+
'emptyCollection',
|
|
97
|
+
'truncated',
|
|
98
|
+
'unmatchedRecommendationResourceCount',
|
|
99
|
+
'unmatchedBillingExpenseCount',
|
|
100
|
+
];
|
|
101
|
+
assertExactKeys(summary, keys, field);
|
|
102
|
+
keys.filter(key => !['emptyCollection', 'truncated'].includes(key)).forEach(key => nonNegativeInteger(summary[key], `${field}.${key}`));
|
|
103
|
+
requiredBoolean(summary.emptyCollection, `${field}.emptyCollection`);
|
|
104
|
+
requiredBoolean(summary.truncated, `${field}.truncated`);
|
|
105
|
+
if (summary.emptyCollection === true && Number(summary.returnedResourceCount) !== 0)
|
|
106
|
+
throw new Error(`${field}.emptyCollection requires zero returned resources.`);
|
|
107
|
+
}
|
|
108
|
+
function validateResourceCoverage(value, accountId, scope) {
|
|
109
|
+
const coverage = asRecord(value, 'artifact.coverage');
|
|
110
|
+
assertExactKeys(coverage, ['billing', 'discovery', 'metrics', 'recommendations', 'virtualTags'], 'artifact.coverage');
|
|
111
|
+
validateAwsPortalBillingBlock(coverage.billing, 'artifact.coverage.billing', scope.billing, accountId, false);
|
|
112
|
+
validateDiscovery(coverage.discovery, scope.resourceRegions, 'artifact.coverage.discovery');
|
|
113
|
+
validateMetrics(coverage.metrics, scope.resourceRegions, 'artifact.coverage.metrics', 'resource');
|
|
114
|
+
validateAwsPortalRecommendationCoverage(coverage.recommendations, accountId, scope.resourceRegions, 'artifact.coverage.recommendations', RECOMMENDATION_SOURCES, false);
|
|
115
|
+
if (coverage.virtualTags !== undefined)
|
|
116
|
+
validateVirtualTags(coverage.virtualTags);
|
|
117
|
+
}
|
|
118
|
+
function validateDiscovery(value, regions, field) {
|
|
119
|
+
const discovery = asRecord(value, field);
|
|
120
|
+
assertExactKeys(discovery, ['families'], field);
|
|
121
|
+
if (!Array.isArray(discovery.families))
|
|
122
|
+
throw new Error(`${field}.families must be an array.`);
|
|
123
|
+
const identities = [];
|
|
124
|
+
discovery.families.forEach((entry, index) => {
|
|
125
|
+
const itemField = `${field}.families[${index}]`;
|
|
126
|
+
const family = asRecord(entry, itemField);
|
|
127
|
+
assertExactKeys(family, ['family', 'resourceRegion', 'freshness', 'summary', 'groupedTotals'], itemField);
|
|
128
|
+
const familyName = requiredEnum(family.family, DISCOVERY_FAMILIES, `${itemField}.family`);
|
|
129
|
+
const region = requiredString(family.resourceRegion, `${itemField}.resourceRegion`);
|
|
130
|
+
if (!regions.includes(region))
|
|
131
|
+
throw new Error(`${itemField}.resourceRegion is outside artifact scope.`);
|
|
132
|
+
identities.push(`${familyName}|${region}`);
|
|
133
|
+
validateFreshness(family.freshness, `${itemField}.freshness`, 'lastSuccessfulRefreshAt');
|
|
134
|
+
validateJsonObject(family.summary, `${itemField}.summary`);
|
|
135
|
+
validateJsonObject(family.groupedTotals, `${itemField}.groupedTotals`);
|
|
136
|
+
});
|
|
137
|
+
assertUnique(identities, `${field}.families`);
|
|
138
|
+
}
|
|
139
|
+
function validateMetrics(value, regions, field, kind) {
|
|
140
|
+
const metrics = asRecord(value, field);
|
|
141
|
+
assertExactKeys(metrics, ['families'], field);
|
|
142
|
+
if (!Array.isArray(metrics.families))
|
|
143
|
+
throw new Error(`${field}.families must be an array.`);
|
|
144
|
+
const identities = [];
|
|
145
|
+
metrics.families.forEach((entry, index) => {
|
|
146
|
+
const itemField = `${field}.families[${index}]`;
|
|
147
|
+
const family = asRecord(entry, itemField);
|
|
148
|
+
const keys = kind === 'resource'
|
|
149
|
+
? ['metricFamily', 'resourceRegion', 'requestedMonths', 'availableMonths', 'missingMonths', 'coverage', 'summary']
|
|
150
|
+
: ['metricFamily', 'resourceRegion', 'status', 'requestedMonths', 'availableMonths', 'missingMonths', 'freshness', 'readiness', 'summary'];
|
|
151
|
+
assertExactKeys(family, keys, itemField);
|
|
152
|
+
const metricFamily = requiredEnum(family.metricFamily, METRIC_FAMILIES, `${itemField}.metricFamily`);
|
|
153
|
+
const region = requiredString(family.resourceRegion, `${itemField}.resourceRegion`);
|
|
154
|
+
if (!regions.includes(region))
|
|
155
|
+
throw new Error(`${itemField}.resourceRegion is outside artifact scope.`);
|
|
156
|
+
identities.push(`${metricFamily}|${region}`);
|
|
157
|
+
if (family.status !== undefined)
|
|
158
|
+
requiredEnum(family.status, ['available', 'not-found'], `${itemField}.status`);
|
|
159
|
+
const requestedMonths = stringArray(family.requestedMonths, `${itemField}.requestedMonths`);
|
|
160
|
+
const availableMonths = stringArray(family.availableMonths, `${itemField}.availableMonths`);
|
|
161
|
+
const missingMonths = stringArray(family.missingMonths, `${itemField}.missingMonths`);
|
|
162
|
+
[...requestedMonths, ...availableMonths, ...missingMonths].forEach(month => {
|
|
163
|
+
if (!/^\d{4}-(0[1-9]|1[0-2])$/.test(month))
|
|
164
|
+
throw new Error(`${itemField} contains a non-canonical billing month: ${month}.`);
|
|
165
|
+
});
|
|
166
|
+
const classifiedMonths = [...availableMonths, ...missingMonths].sort();
|
|
167
|
+
assertUnique(classifiedMonths, `${itemField} classified months`);
|
|
168
|
+
if (JSON.stringify(requestedMonths) !== JSON.stringify(classifiedMonths))
|
|
169
|
+
throw new Error(`${itemField} requestedMonths must equal availableMonths plus missingMonths.`);
|
|
170
|
+
if (family.freshness !== undefined)
|
|
171
|
+
validateFreshness(family.freshness, `${itemField}.freshness`, 'lastSuccessfulRefreshAt');
|
|
172
|
+
if (family.readiness !== undefined)
|
|
173
|
+
validateJsonObject(family.readiness, `${itemField}.readiness`);
|
|
174
|
+
if (family.coverage !== undefined)
|
|
175
|
+
validateJsonObject(family.coverage, `${itemField}.coverage`);
|
|
176
|
+
if (family.summary !== undefined)
|
|
177
|
+
validateJsonObject(family.summary, `${itemField}.summary`);
|
|
178
|
+
});
|
|
179
|
+
assertUnique(identities, `${field}.families`);
|
|
180
|
+
}
|
|
181
|
+
function validateVirtualTags(value) {
|
|
182
|
+
const tags = asRecord(value, 'artifact.coverage.virtualTags');
|
|
183
|
+
assertExactKeys(tags, ['status', 'source', 'generatedAt', 'rulesHash', 'enabledRuleCount', 'appliedRuleCount', 'taggedResourceCount', 'unsupportedRuleCount', 'reason'], 'artifact.coverage.virtualTags');
|
|
184
|
+
requiredEnum(tags.status, ['available', 'missing', 'malformed', 'unsupported'], 'artifact.coverage.virtualTags.status');
|
|
185
|
+
assertValue(tags.source, 'spotto-tags', 'artifact.coverage.virtualTags.source');
|
|
186
|
+
isoTimestamp(tags.generatedAt, 'artifact.coverage.virtualTags.generatedAt');
|
|
187
|
+
if (tags.rulesHash !== undefined && !/^[a-f0-9]{64}$/.test(String(tags.rulesHash)))
|
|
188
|
+
throw new Error('artifact.coverage.virtualTags.rulesHash must be a SHA-256.');
|
|
189
|
+
['enabledRuleCount', 'appliedRuleCount', 'taggedResourceCount', 'unsupportedRuleCount'].forEach(key => nonNegativeInteger(tags[key], `artifact.coverage.virtualTags.${key}`));
|
|
190
|
+
if (tags.reason !== undefined)
|
|
191
|
+
requiredString(tags.reason, 'artifact.coverage.virtualTags.reason');
|
|
192
|
+
}
|
|
193
|
+
function validateResources(value, regions) {
|
|
194
|
+
if (!Array.isArray(value))
|
|
195
|
+
throw new Error('artifact.resources must be an array.');
|
|
196
|
+
const stableKeys = [];
|
|
197
|
+
value.forEach((entry, index) => {
|
|
198
|
+
const field = `artifact.resources[${index}]`;
|
|
199
|
+
const resource = asRecord(entry, field);
|
|
200
|
+
assertExactKeys(resource, [
|
|
201
|
+
'stableKey',
|
|
202
|
+
'family',
|
|
203
|
+
'resourceRegion',
|
|
204
|
+
'resourceType',
|
|
205
|
+
'resourceArn',
|
|
206
|
+
'resourceId',
|
|
207
|
+
'resourceName',
|
|
208
|
+
'tags',
|
|
209
|
+
'spottoTags',
|
|
210
|
+
'discovery',
|
|
211
|
+
'billing',
|
|
212
|
+
'metrics',
|
|
213
|
+
'recommendations',
|
|
214
|
+
], field);
|
|
215
|
+
stableKeys.push(requiredString(resource.stableKey, `${field}.stableKey`));
|
|
216
|
+
requiredEnum(resource.family, DISCOVERY_FAMILIES, `${field}.family`);
|
|
217
|
+
const region = requiredString(resource.resourceRegion, `${field}.resourceRegion`);
|
|
218
|
+
if (!regions.includes(region))
|
|
219
|
+
throw new Error(`${field}.resourceRegion is outside artifact scope.`);
|
|
220
|
+
requiredString(resource.resourceType, `${field}.resourceType`);
|
|
221
|
+
['resourceArn', 'resourceId', 'resourceName'].forEach(key => {
|
|
222
|
+
if (resource[key] !== undefined)
|
|
223
|
+
requiredString(resource[key], `${field}.${key}`);
|
|
224
|
+
});
|
|
225
|
+
if (resource.tags !== undefined)
|
|
226
|
+
validateStringMap(resource.tags, `${field}.tags`);
|
|
227
|
+
if (resource.spottoTags !== undefined)
|
|
228
|
+
validateJsonObject(resource.spottoTags, `${field}.spottoTags`);
|
|
229
|
+
const discovery = asRecord(resource.discovery, `${field}.discovery`);
|
|
230
|
+
assertExactKeys(discovery, ['freshness', 'summary'], `${field}.discovery`);
|
|
231
|
+
validateFreshness(discovery.freshness, `${field}.discovery.freshness`, 'lastSuccessfulRefreshAt');
|
|
232
|
+
validateJsonObject(discovery.summary, `${field}.discovery.summary`);
|
|
233
|
+
if (resource.billing !== undefined)
|
|
234
|
+
validateResourceBillingEvidence(resource.billing, `${field}.billing`);
|
|
235
|
+
if (resource.metrics !== undefined)
|
|
236
|
+
validateResourceMetrics(resource.metrics, `${field}.metrics`);
|
|
237
|
+
if (resource.recommendations !== undefined)
|
|
238
|
+
validateResourceRecommendations(resource.recommendations, `${field}.recommendations`);
|
|
239
|
+
});
|
|
240
|
+
assertUnique(stableKeys, 'artifact.resources');
|
|
241
|
+
}
|
|
242
|
+
function validateResourceMetrics(value, field) {
|
|
243
|
+
const metrics = asRecord(value, field);
|
|
244
|
+
assertExactKeys(metrics, ['supported', 'families'], field);
|
|
245
|
+
requiredBoolean(metrics.supported, `${field}.supported`);
|
|
246
|
+
if (!Array.isArray(metrics.families))
|
|
247
|
+
throw new Error(`${field}.families must be an array.`);
|
|
248
|
+
metrics.families.forEach((entry, index) => {
|
|
249
|
+
const family = asRecord(entry, `${field}.families[${index}]`);
|
|
250
|
+
assertExactKeys(family, ['metricFamily', 'summary', 'coverage'], `${field}.families[${index}]`);
|
|
251
|
+
requiredEnum(family.metricFamily, METRIC_FAMILIES, `${field}.families[${index}].metricFamily`);
|
|
252
|
+
validateJsonObject(family.summary, `${field}.families[${index}].summary`);
|
|
253
|
+
validateJsonObject(family.coverage, `${field}.families[${index}].coverage`);
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
function validateResourceRecommendations(value, field) {
|
|
257
|
+
const recommendations = asRecord(value, field);
|
|
258
|
+
assertExactKeys(recommendations, ['matchedRecommendationCount', 'sources', 'actionability', 'templateProvenance', 'counts', 'savings'], field);
|
|
259
|
+
nonNegativeInteger(recommendations.matchedRecommendationCount, `${field}.matchedRecommendationCount`);
|
|
260
|
+
stringArray(recommendations.sources, `${field}.sources`).forEach(source => requiredEnum(source, RECOMMENDATION_SOURCES, `${field}.sources`));
|
|
261
|
+
if (recommendations.actionability !== undefined) {
|
|
262
|
+
validateRecommendationActionability(recommendations.actionability, `${field}.actionability`);
|
|
263
|
+
}
|
|
264
|
+
if (recommendations.templateProvenance !== undefined)
|
|
265
|
+
validateTemplateProvenance(recommendations.templateProvenance, `${field}.templateProvenance`);
|
|
266
|
+
validateJsonObject(recommendations.counts, `${field}.counts`);
|
|
267
|
+
validateJsonObject(recommendations.savings, `${field}.savings`);
|
|
268
|
+
}
|
|
269
|
+
function validateTemplateProvenance(value, field) {
|
|
270
|
+
const provenance = asRecord(value, field);
|
|
271
|
+
assertExactKeys(provenance, [
|
|
272
|
+
'status',
|
|
273
|
+
'templateBackedRecommendationCount',
|
|
274
|
+
'missingTemplateRecommendationCount',
|
|
275
|
+
'internalTemplateCount',
|
|
276
|
+
'externalTemplateCount',
|
|
277
|
+
'confidenceBackedRecommendationCount',
|
|
278
|
+
'templateRecommendationWithoutConfidenceCount',
|
|
279
|
+
'lowestConfidenceSources',
|
|
280
|
+
'minimumConfidencePercentage',
|
|
281
|
+
'maximumConfidencePercentage',
|
|
282
|
+
'averageConfidencePercentage',
|
|
283
|
+
], field);
|
|
284
|
+
requiredEnum(provenance.status, ['available-no-template-items', 'missing-template-evidence', 'missing-confidence-evidence', 'available-with-confidence'], `${field}.status`);
|
|
285
|
+
[
|
|
286
|
+
'templateBackedRecommendationCount',
|
|
287
|
+
'missingTemplateRecommendationCount',
|
|
288
|
+
'internalTemplateCount',
|
|
289
|
+
'externalTemplateCount',
|
|
290
|
+
'confidenceBackedRecommendationCount',
|
|
291
|
+
'templateRecommendationWithoutConfidenceCount',
|
|
292
|
+
].forEach(key => nonNegativeInteger(provenance[key], `${field}.${key}`));
|
|
293
|
+
validateTemplateProvenanceSources(provenance.lowestConfidenceSources, `${field}.lowestConfidenceSources`);
|
|
294
|
+
['minimumConfidencePercentage', 'maximumConfidencePercentage', 'averageConfidencePercentage'].forEach(key => {
|
|
295
|
+
if (provenance[key] !== undefined && (typeof provenance[key] !== 'number' || !Number.isFinite(provenance[key])))
|
|
296
|
+
throw new Error(`${field}.${key} must be finite.`);
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
function validateAccount(value, accountId) {
|
|
300
|
+
const account = asRecord(value, 'artifact.account');
|
|
301
|
+
assertExactKeys(account, [
|
|
302
|
+
'metadataFound',
|
|
303
|
+
'providerAccountId',
|
|
304
|
+
'cloudAccountId',
|
|
305
|
+
'accountName',
|
|
306
|
+
'validatedAt',
|
|
307
|
+
'providerPartition',
|
|
308
|
+
'summary',
|
|
309
|
+
'firstUsefulRecommendationReadiness',
|
|
310
|
+
], 'artifact.account');
|
|
311
|
+
requiredBoolean(account.metadataFound, 'artifact.account.metadataFound');
|
|
312
|
+
assertValue(account.providerAccountId, accountId, 'artifact.account.providerAccountId');
|
|
313
|
+
['cloudAccountId', 'accountName', 'providerPartition'].forEach(key => {
|
|
314
|
+
if (account[key] !== undefined)
|
|
315
|
+
requiredString(account[key], `artifact.account.${key}`);
|
|
316
|
+
});
|
|
317
|
+
isoTimestamp(account.validatedAt, 'artifact.account.validatedAt');
|
|
318
|
+
validateJsonObject(account.summary, 'artifact.account.summary');
|
|
319
|
+
if (account.firstUsefulRecommendationReadiness !== undefined)
|
|
320
|
+
validateJsonObject(account.firstUsefulRecommendationReadiness, 'artifact.account.firstUsefulRecommendationReadiness');
|
|
321
|
+
}
|
|
322
|
+
function validateStringMap(value, field) {
|
|
323
|
+
const map = asRecord(value, field);
|
|
324
|
+
Object.entries(map).forEach(([key, item]) => {
|
|
325
|
+
requiredString(key, `${field} key`);
|
|
326
|
+
requiredString(item, `${field}.${key}`);
|
|
327
|
+
});
|
|
328
|
+
}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { asRecord, assertExactKeys, assertUnique, assertValue, finiteNumber, isoTimestamp, nonNegativeInteger, requiredBoolean, requiredString, stringArray, validateFreshness, validateJsonArray, validateJsonObject, } from './portalPublicArtifactValidationCommon.js';
|
|
2
|
+
export function validateAwsPortalBillingBlock(value, field, outerBilling, accountId, accountBody) {
|
|
3
|
+
const billing = asRecord(value, field);
|
|
4
|
+
const accountFields = [
|
|
5
|
+
'costViewByCurrency',
|
|
6
|
+
'groupedCosts',
|
|
7
|
+
'commitmentSpend',
|
|
8
|
+
'resourceAttribution',
|
|
9
|
+
'calendarSummary',
|
|
10
|
+
'periodSummary',
|
|
11
|
+
'spendTrend',
|
|
12
|
+
'comparison',
|
|
13
|
+
];
|
|
14
|
+
const resourceFields = ['pricingReferenceEstimation', 'estimatedBillingAuthority'];
|
|
15
|
+
// AWS-only window evidence. Optional so artifacts published before the
|
|
16
|
+
// rolling resource window stay valid, but validated whenever present: a block
|
|
17
|
+
// that names one anchor period while its totals span three has to say so.
|
|
18
|
+
const windowFields = ['window', 'contributingBillingPeriods', 'windowCoverage'];
|
|
19
|
+
assertExactKeys(billing, ['scope', 'freshness', 'summary', 'totalsByCurrency', ...windowFields, ...(accountBody ? accountFields : resourceFields)], field);
|
|
20
|
+
validateBillingEvidenceScope(billing.scope, outerBilling, accountId, `${field}.scope`);
|
|
21
|
+
validateBillingEvidenceWindow(billing, outerBilling, field);
|
|
22
|
+
validateFreshness(billing.freshness, `${field}.freshness`, 'lastSuccessfulImportAt');
|
|
23
|
+
validateBillingSummary(billing.summary, `${field}.summary`);
|
|
24
|
+
validateBillingGroupedResult(billing.totalsByCurrency, `${field}.totalsByCurrency`);
|
|
25
|
+
if (!accountBody) {
|
|
26
|
+
if (billing.pricingReferenceEstimation !== undefined)
|
|
27
|
+
validateJsonObject(billing.pricingReferenceEstimation, `${field}.pricingReferenceEstimation`);
|
|
28
|
+
if (billing.estimatedBillingAuthority !== undefined)
|
|
29
|
+
validateJsonObject(billing.estimatedBillingAuthority, `${field}.estimatedBillingAuthority`);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
validateJsonArray(billing.costViewByCurrency, `${field}.costViewByCurrency`);
|
|
33
|
+
const grouped = asRecord(billing.groupedCosts, `${field}.groupedCosts`);
|
|
34
|
+
assertExactKeys(grouped, ['byChargeCategory', 'byServiceCode', 'byServiceCategory'], `${field}.groupedCosts`);
|
|
35
|
+
validateBillingGroupedResult(grouped.byChargeCategory, `${field}.groupedCosts.byChargeCategory`, 'chargeCategory');
|
|
36
|
+
validateBillingGroupedResult(grouped.byServiceCode, `${field}.groupedCosts.byServiceCode`, 'serviceCode');
|
|
37
|
+
if (grouped.byServiceCategory !== undefined)
|
|
38
|
+
validateBillingGroupedResult(grouped.byServiceCategory, `${field}.groupedCosts.byServiceCategory`, 'serviceCategory');
|
|
39
|
+
['commitmentSpend', 'resourceAttribution', 'calendarSummary', 'periodSummary', 'spendTrend', 'comparison'].forEach(key => {
|
|
40
|
+
if (billing[key] !== undefined)
|
|
41
|
+
validateJsonObject(billing[key], `${field}.${key}`);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
export function validateAwsPortalRecommendationCoverage(value, accountId, regions, field, sources, includeTrust) {
|
|
45
|
+
const recommendations = asRecord(value, field);
|
|
46
|
+
assertExactKeys(recommendations, ['sources'], field);
|
|
47
|
+
if (!Array.isArray(recommendations.sources))
|
|
48
|
+
throw new Error(`${field}.sources must be an array.`);
|
|
49
|
+
const seenSources = [];
|
|
50
|
+
recommendations.sources.forEach((entry, index) => {
|
|
51
|
+
const itemField = `${field}.sources[${index}]`;
|
|
52
|
+
const source = asRecord(entry, itemField);
|
|
53
|
+
assertExactKeys(source, includeTrust
|
|
54
|
+
? ['source', 'scope', 'summary', 'counts', 'savings', 'sourceEvidence', 'actionHealth']
|
|
55
|
+
: ['source', 'scope', 'summary', 'counts', 'savings'], itemField);
|
|
56
|
+
const sourceName = requiredString(source.source, `${itemField}.source`);
|
|
57
|
+
if (!sources.includes(sourceName))
|
|
58
|
+
throw new Error(`${itemField}.source is not declared.`);
|
|
59
|
+
seenSources.push(sourceName);
|
|
60
|
+
const scope = asRecord(source.scope, `${itemField}.scope`);
|
|
61
|
+
assertExactKeys(scope, ['provider', 'source', 'scope', 'accountId', 'resourceRegions'], `${itemField}.scope`);
|
|
62
|
+
assertValue(scope.provider, 'aws', `${itemField}.scope.provider`);
|
|
63
|
+
assertValue(scope.source, sourceName, `${itemField}.scope.source`);
|
|
64
|
+
assertValue(scope.scope, 'account', `${itemField}.scope.scope`);
|
|
65
|
+
assertValue(scope.accountId, accountId, `${itemField}.scope.accountId`);
|
|
66
|
+
const nestedRegions = stringArray(scope.resourceRegions, `${itemField}.scope.resourceRegions`);
|
|
67
|
+
if (JSON.stringify(nestedRegions) !== JSON.stringify(regions))
|
|
68
|
+
throw new Error(`${itemField}.scope.resourceRegions must match artifact scope exactly.`);
|
|
69
|
+
validateRecommendationSummary(source.summary, `${itemField}.summary`);
|
|
70
|
+
validateRecommendationCounts(source.counts, `${itemField}.counts`);
|
|
71
|
+
validateRecommendationSavings(source.savings, `${itemField}.savings`);
|
|
72
|
+
if (source.sourceEvidence !== undefined)
|
|
73
|
+
validateRecommendationSourceEvidence(source.sourceEvidence, `${itemField}.sourceEvidence`);
|
|
74
|
+
if (source.actionHealth !== undefined)
|
|
75
|
+
validateRecommendationActionHealth(source.actionHealth, `${itemField}.actionHealth`);
|
|
76
|
+
});
|
|
77
|
+
assertUnique(seenSources, `${field}.sources`);
|
|
78
|
+
}
|
|
79
|
+
function validateBillingEvidenceScope(value, outerBilling, accountId, field) {
|
|
80
|
+
const scope = asRecord(value, field);
|
|
81
|
+
assertExactKeys(scope, ['provider', 'source', 'scope', 'accountId', 'reportName', 'billingPeriod'], field);
|
|
82
|
+
assertValue(scope.provider, 'aws', `${field}.provider`);
|
|
83
|
+
assertValue(scope.source, outerBilling.source, `${field}.source`);
|
|
84
|
+
assertValue(scope.scope, 'account', `${field}.scope`);
|
|
85
|
+
assertValue(scope.accountId, accountId, `${field}.accountId`);
|
|
86
|
+
assertValue(scope.reportName, outerBilling.source === 'cur' ? outerBilling.reportName : outerBilling.exportName, `${field}.reportName`);
|
|
87
|
+
if (JSON.stringify(scope.billingPeriod) !== JSON.stringify(outerBilling.billingPeriod))
|
|
88
|
+
throw new Error(`${field}.billingPeriod must match artifact scope exactly.`);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Validates the rolling window a billing block measures, and binds it to the
|
|
92
|
+
* anchor period the artifact scope names.
|
|
93
|
+
*
|
|
94
|
+
* The window may start inside the preceding billing period — that is the whole
|
|
95
|
+
* point of a run-anchored rolling 30 days — but it must end no later than the
|
|
96
|
+
* day after the anchor period ends, and every period it claims contributed must
|
|
97
|
+
* form an adjacent chain that covers it, or the block must admit
|
|
98
|
+
* `partial-billing-period-coverage`.
|
|
99
|
+
*/
|
|
100
|
+
function validateBillingEvidenceWindow(billing, outerBilling, field) {
|
|
101
|
+
const hasWindow = billing.window !== undefined;
|
|
102
|
+
if (billing.contributingBillingPeriods !== undefined && !hasWindow)
|
|
103
|
+
throw new Error(`${field}.contributingBillingPeriods requires ${field}.window.`);
|
|
104
|
+
if (billing.windowCoverage !== undefined && !hasWindow)
|
|
105
|
+
throw new Error(`${field}.windowCoverage requires ${field}.window.`);
|
|
106
|
+
if (!hasWindow)
|
|
107
|
+
return;
|
|
108
|
+
const window = asRecord(billing.window, `${field}.window`);
|
|
109
|
+
assertExactKeys(window, ['kind', 'dayCount', 'startDateInclusive', 'endDateExclusive'], `${field}.window`);
|
|
110
|
+
assertValue(window.kind, 'last-30-days', `${field}.window.kind`);
|
|
111
|
+
assertValue(window.dayCount, 30, `${field}.window.dayCount`);
|
|
112
|
+
const startDateInclusive = utcDate(window.startDateInclusive, `${field}.window.startDateInclusive`);
|
|
113
|
+
const endDateExclusive = utcDate(window.endDateExclusive, `${field}.window.endDateExclusive`);
|
|
114
|
+
if (shiftUtcDate(endDateExclusive, -30) !== startDateInclusive)
|
|
115
|
+
throw new Error(`${field}.window must cover exactly 30 UTC days.`);
|
|
116
|
+
if (endDateExclusive > shiftUtcDate(outerBilling.billingPeriod.end, 1))
|
|
117
|
+
throw new Error(`${field}.window.endDateExclusive must not run past the day after the artifact billing period.`);
|
|
118
|
+
if (billing.contributingBillingPeriods === undefined)
|
|
119
|
+
return;
|
|
120
|
+
if (!Array.isArray(billing.contributingBillingPeriods))
|
|
121
|
+
throw new Error(`${field}.contributingBillingPeriods must be an array.`);
|
|
122
|
+
const periods = billing.contributingBillingPeriods.map((entry, index) => {
|
|
123
|
+
const itemField = `${field}.contributingBillingPeriods[${index}]`;
|
|
124
|
+
const period = asRecord(entry, itemField);
|
|
125
|
+
assertExactKeys(period, ['start', 'end'], itemField);
|
|
126
|
+
const start = utcDate(period.start, `${itemField}.start`);
|
|
127
|
+
const end = utcDate(period.end, `${itemField}.end`);
|
|
128
|
+
if (end < start)
|
|
129
|
+
throw new Error(`${itemField}.end must not precede ${itemField}.start.`);
|
|
130
|
+
return { start, end };
|
|
131
|
+
});
|
|
132
|
+
assertUnique(periods.map(period => `${period.start}|${period.end}`), `${field}.contributingBillingPeriods`);
|
|
133
|
+
if (periods.some((period, index) => index > 0 && period.start <= periods[index - 1].start))
|
|
134
|
+
throw new Error(`${field}.contributingBillingPeriods must be ordered by start date.`);
|
|
135
|
+
const anchor = `${outerBilling.billingPeriod.start}|${outerBilling.billingPeriod.end}`;
|
|
136
|
+
if (periods.length > 0 && !periods.some(period => `${period.start}|${period.end}` === anchor))
|
|
137
|
+
throw new Error(`${field}.contributingBillingPeriods must include the artifact billing period.`);
|
|
138
|
+
const complete = periods.length > 0 &&
|
|
139
|
+
periods[0].start <= startDateInclusive &&
|
|
140
|
+
periods[periods.length - 1].end >= shiftUtcDate(endDateExclusive, -1) &&
|
|
141
|
+
periods.every((period, index) => index === 0 || shiftUtcDate(periods[index - 1].end, 1) === period.start);
|
|
142
|
+
const coverage = billing.windowCoverage;
|
|
143
|
+
if (coverage !== undefined && coverage !== 'complete' && coverage !== 'partial-billing-period-coverage')
|
|
144
|
+
throw new Error(`${field}.windowCoverage must be complete or partial-billing-period-coverage.`);
|
|
145
|
+
if (coverage === 'complete' && !complete)
|
|
146
|
+
throw new Error(`${field}.windowCoverage claims complete coverage its contributingBillingPeriods do not provide.`);
|
|
147
|
+
}
|
|
148
|
+
function utcDate(value, field) {
|
|
149
|
+
const date = requiredString(value, field);
|
|
150
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(date) || new Date(`${date}T00:00:00.000Z`).toISOString().slice(0, 10) !== date)
|
|
151
|
+
throw new Error(`${field} must be a YYYY-MM-DD UTC date.`);
|
|
152
|
+
return date;
|
|
153
|
+
}
|
|
154
|
+
function shiftUtcDate(date, days) {
|
|
155
|
+
const parsed = new Date(`${date}T00:00:00.000Z`);
|
|
156
|
+
parsed.setUTCDate(parsed.getUTCDate() + days);
|
|
157
|
+
return parsed.toISOString().slice(0, 10);
|
|
158
|
+
}
|
|
159
|
+
function validateBillingSummary(value, field) {
|
|
160
|
+
const summary = asRecord(value, field);
|
|
161
|
+
assertExactKeys(summary, ['totalPersistedExpenseCount', 'emptyScope', 'metadataFound', 'metadataMatchesRequestedBillingPeriod'], field);
|
|
162
|
+
nonNegativeInteger(summary.totalPersistedExpenseCount, `${field}.totalPersistedExpenseCount`);
|
|
163
|
+
requiredBoolean(summary.emptyScope, `${field}.emptyScope`);
|
|
164
|
+
requiredBoolean(summary.metadataFound, `${field}.metadataFound`);
|
|
165
|
+
requiredBoolean(summary.metadataMatchesRequestedBillingPeriod, `${field}.metadataMatchesRequestedBillingPeriod`);
|
|
166
|
+
}
|
|
167
|
+
function validateBillingGroupedResult(value, field, label) {
|
|
168
|
+
const result = asRecord(value, field);
|
|
169
|
+
assertExactKeys(result, ['totalGroupCount', 'returnedGroupCount', 'truncated', 'items'], field);
|
|
170
|
+
const total = nonNegativeInteger(result.totalGroupCount, `${field}.totalGroupCount`);
|
|
171
|
+
const returned = nonNegativeInteger(result.returnedGroupCount, `${field}.returnedGroupCount`);
|
|
172
|
+
requiredBoolean(result.truncated, `${field}.truncated`);
|
|
173
|
+
if (returned > total)
|
|
174
|
+
throw new Error(`${field}.returnedGroupCount must not exceed totalGroupCount.`);
|
|
175
|
+
if (!Array.isArray(result.items) || result.items.length !== returned)
|
|
176
|
+
throw new Error(`${field}.items length must equal returnedGroupCount.`);
|
|
177
|
+
const identities = [];
|
|
178
|
+
result.items.forEach((entry, index) => {
|
|
179
|
+
const itemField = `${field}.items[${index}]`;
|
|
180
|
+
const item = asRecord(entry, itemField);
|
|
181
|
+
assertExactKeys(item, [...(label ? [label] : []), 'currency', 'expenseCount', 'baseCostAmount', 'amortizedCostAmount', 'amortizedExpenseCount'], itemField);
|
|
182
|
+
if (label)
|
|
183
|
+
requiredString(item[label], `${itemField}.${label}`);
|
|
184
|
+
const currency = requiredString(item.currency, `${itemField}.currency`);
|
|
185
|
+
nonNegativeInteger(item.expenseCount, `${itemField}.expenseCount`);
|
|
186
|
+
finiteNumber(item.baseCostAmount, `${itemField}.baseCostAmount`);
|
|
187
|
+
if (item.amortizedCostAmount !== undefined)
|
|
188
|
+
finiteNumber(item.amortizedCostAmount, `${itemField}.amortizedCostAmount`);
|
|
189
|
+
if (item.amortizedExpenseCount !== undefined)
|
|
190
|
+
nonNegativeInteger(item.amortizedExpenseCount, `${itemField}.amortizedExpenseCount`);
|
|
191
|
+
identities.push(`${label ? String(item[label]) : ''}|${currency}`);
|
|
192
|
+
});
|
|
193
|
+
assertUnique(identities, `${field}.items`);
|
|
194
|
+
}
|
|
195
|
+
function validateRecommendationSummary(value, field) {
|
|
196
|
+
const summary = asRecord(value, field);
|
|
197
|
+
const counts = [
|
|
198
|
+
'totalStateCount',
|
|
199
|
+
'currentStateCount',
|
|
200
|
+
'missingStateCount',
|
|
201
|
+
'snapshotBackedCount',
|
|
202
|
+
'orphanSnapshotCount',
|
|
203
|
+
'matchedStateCount',
|
|
204
|
+
'filteredOutStateCount',
|
|
205
|
+
];
|
|
206
|
+
assertExactKeys(summary, [...counts, 'emptyScope', 'emptyResult'], field);
|
|
207
|
+
counts.forEach(key => nonNegativeInteger(summary[key], `${field}.${key}`));
|
|
208
|
+
requiredBoolean(summary.emptyScope, `${field}.emptyScope`);
|
|
209
|
+
requiredBoolean(summary.emptyResult, `${field}.emptyResult`);
|
|
210
|
+
}
|
|
211
|
+
function validateRecommendationCounts(value, field) {
|
|
212
|
+
const counts = asRecord(value, field);
|
|
213
|
+
const groups = [
|
|
214
|
+
['byLifecycleStatus', 'lifecycleStatus'],
|
|
215
|
+
['bySourcePresence', 'sourcePresence'],
|
|
216
|
+
['byCategory', 'category'],
|
|
217
|
+
['byRegion', 'region'],
|
|
218
|
+
['bySourceService', 'sourceService'],
|
|
219
|
+
['byResourceType', 'resourceType'],
|
|
220
|
+
['byActionType', 'actionType'],
|
|
221
|
+
['byImplementationEffort', 'implementationEffort'],
|
|
222
|
+
];
|
|
223
|
+
assertExactKeys(counts, groups.map(([group]) => group), field);
|
|
224
|
+
groups.forEach(([group, label]) => validateCountGroup(counts[group], `${field}.${group}`, label));
|
|
225
|
+
}
|
|
226
|
+
function validateCountGroup(value, field, label) {
|
|
227
|
+
if (!Array.isArray(value))
|
|
228
|
+
throw new Error(`${field} must be an array.`);
|
|
229
|
+
const identities = [];
|
|
230
|
+
value.forEach((entry, index) => {
|
|
231
|
+
const item = asRecord(entry, `${field}[${index}]`);
|
|
232
|
+
assertExactKeys(item, [label, 'count'], `${field}[${index}]`);
|
|
233
|
+
identities.push(requiredString(item[label], `${field}[${index}].${label}`));
|
|
234
|
+
nonNegativeInteger(item.count, `${field}[${index}].count`);
|
|
235
|
+
});
|
|
236
|
+
assertUnique(identities, field);
|
|
237
|
+
}
|
|
238
|
+
function validateRecommendationSavings(value, field) {
|
|
239
|
+
const savings = asRecord(value, field);
|
|
240
|
+
const counts = [
|
|
241
|
+
'snapshotBackedMatchedCount',
|
|
242
|
+
'positiveEstimatedSavingsRecommendationCount',
|
|
243
|
+
'nonPositiveEstimatedSavingsCount',
|
|
244
|
+
'missingEstimatedSavingsCount',
|
|
245
|
+
'missingCurrencyCodeCount',
|
|
246
|
+
];
|
|
247
|
+
assertExactKeys(savings, [...counts, 'emptySavings', 'mixedCurrencies', 'byCurrency'], field);
|
|
248
|
+
counts.forEach(key => nonNegativeInteger(savings[key], `${field}.${key}`));
|
|
249
|
+
requiredBoolean(savings.emptySavings, `${field}.emptySavings`);
|
|
250
|
+
requiredBoolean(savings.mixedCurrencies, `${field}.mixedCurrencies`);
|
|
251
|
+
if (!Array.isArray(savings.byCurrency))
|
|
252
|
+
throw new Error(`${field}.byCurrency must be an array.`);
|
|
253
|
+
const currencies = [];
|
|
254
|
+
savings.byCurrency.forEach((entry, index) => {
|
|
255
|
+
const itemField = `${field}.byCurrency[${index}]`;
|
|
256
|
+
const item = asRecord(entry, itemField);
|
|
257
|
+
assertExactKeys(item, ['currencyCode', 'recommendationCount', 'totalEstimatedMonthlySavings'], itemField);
|
|
258
|
+
currencies.push(requiredString(item.currencyCode, `${itemField}.currencyCode`));
|
|
259
|
+
nonNegativeInteger(item.recommendationCount, `${itemField}.recommendationCount`);
|
|
260
|
+
finiteNumber(item.totalEstimatedMonthlySavings, `${itemField}.totalEstimatedMonthlySavings`);
|
|
261
|
+
});
|
|
262
|
+
assertUnique(currencies, `${field}.byCurrency`);
|
|
263
|
+
}
|
|
264
|
+
export function validateRecommendationSourceEvidence(value, field) {
|
|
265
|
+
const evidence = asRecord(value, field);
|
|
266
|
+
const baseKeys = [
|
|
267
|
+
'totalStateCount',
|
|
268
|
+
'currentStateCount',
|
|
269
|
+
'missingStateCount',
|
|
270
|
+
'snapshotBackedCount',
|
|
271
|
+
'orphanSnapshotCount',
|
|
272
|
+
'matchedStateCount',
|
|
273
|
+
'filteredOutStateCount',
|
|
274
|
+
'emptyScope',
|
|
275
|
+
'emptyResult',
|
|
276
|
+
];
|
|
277
|
+
assertExactKeys(evidence, [...baseKeys, 'partialSourceEvidence', 'oldestRecommendationSynchronizedAt', 'latestRecommendationSynchronizedAt', 'exactScopeCoverage'], field);
|
|
278
|
+
baseKeys.filter(key => !['emptyScope', 'emptyResult'].includes(key)).forEach(key => nonNegativeInteger(evidence[key], `${field}.${key}`));
|
|
279
|
+
requiredBoolean(evidence.emptyScope, `${field}.emptyScope`);
|
|
280
|
+
requiredBoolean(evidence.emptyResult, `${field}.emptyResult`);
|
|
281
|
+
requiredBoolean(evidence.partialSourceEvidence, `${field}.partialSourceEvidence`);
|
|
282
|
+
if (evidence.oldestRecommendationSynchronizedAt !== undefined)
|
|
283
|
+
isoTimestamp(evidence.oldestRecommendationSynchronizedAt, `${field}.oldestRecommendationSynchronizedAt`);
|
|
284
|
+
if (evidence.latestRecommendationSynchronizedAt !== undefined)
|
|
285
|
+
isoTimestamp(evidence.latestRecommendationSynchronizedAt, `${field}.latestRecommendationSynchronizedAt`);
|
|
286
|
+
if (evidence.exactScopeCoverage !== undefined)
|
|
287
|
+
validateJsonObject(evidence.exactScopeCoverage, `${field}.exactScopeCoverage`);
|
|
288
|
+
}
|
|
289
|
+
export function validateRecommendationActionHealth(value, field) {
|
|
290
|
+
const health = asRecord(value, field);
|
|
291
|
+
assertExactKeys(health, ['latestActionCount', 'byLatestActionStatus'], field);
|
|
292
|
+
nonNegativeInteger(health.latestActionCount, `${field}.latestActionCount`);
|
|
293
|
+
validateCountGroup(health.byLatestActionStatus, `${field}.byLatestActionStatus`, 'status');
|
|
294
|
+
}
|