@spottoai/types-package 1.0.2-dev1138.1 → 1.0.2-dev1138.12
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 +9 -0
- package/dist/accounts/accounts.d.ts +84 -5
- package/dist/accounts/accounts.d.ts.map +1 -1
- package/dist/accounts/accounts.js +2 -1
- package/dist/accounts/accounts.js.map +1 -1
- package/dist/accounts/azureManualOnboarding.d.ts +114 -0
- package/dist/accounts/azureManualOnboarding.d.ts.map +1 -0
- package/dist/accounts/azureManualOnboarding.js +12 -0
- package/dist/accounts/azureManualOnboarding.js.map +1 -0
- package/dist/accounts/azureSpSetup.d.ts +142 -31
- package/dist/accounts/azureSpSetup.d.ts.map +1 -1
- package/dist/accounts/azureSpSetup.js +15 -0
- package/dist/accounts/azureSpSetup.js.map +1 -1
- package/dist/accounts/azureSpSetupDurable.d.ts +8 -0
- package/dist/accounts/azureSpSetupDurable.d.ts.map +1 -1
- package/dist/accounts/azureSpSetupDurable.js +28 -0
- package/dist/accounts/azureSpSetupDurable.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/readPermissions.d.ts +1 -1
- package/dist/accounts/readPermissions.d.ts.map +1 -1
- package/dist/accounts/readPermissions.js.map +1 -1
- package/dist/accounts/validation.d.ts +24 -0
- package/dist/accounts/validation.d.ts.map +1 -1
- package/dist/ai/conversationHistory.d.ts +52 -0
- package/dist/ai/conversationHistory.d.ts.map +1 -0
- package/dist/ai/conversationHistory.js +10 -0
- package/dist/ai/conversationHistory.js.map +1 -0
- package/dist/ai/grounding.d.ts +41 -0
- package/dist/ai/grounding.d.ts.map +1 -0
- package/dist/ai/grounding.js +86 -0
- package/dist/ai/grounding.js.map +1 -0
- package/dist/ai/index.d.ts +302 -6
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +25 -0
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/workspaceArtifacts.d.ts +587 -0
- package/dist/ai/workspaceArtifacts.d.ts.map +1 -0
- package/dist/ai/workspaceArtifacts.js +162 -0
- package/dist/ai/workspaceArtifacts.js.map +1 -0
- package/dist/aws/commitments-planning.d.ts +5 -0
- package/dist/aws/commitments-planning.d.ts.map +1 -1
- package/dist/aws/commitments-planning.js +19 -0
- package/dist/aws/commitments-planning.js.map +1 -1
- package/dist/aws/estates.d.ts +1 -1
- package/dist/aws/estates.d.ts.map +1 -1
- package/dist/aws/estates.js +7 -1
- package/dist/aws/estates.js.map +1 -1
- package/dist/aws/index.d.ts +5 -0
- package/dist/aws/index.d.ts.map +1 -1
- package/dist/aws/index.js +5 -0
- package/dist/aws/index.js.map +1 -1
- package/dist/aws/onboarding.d.ts +3 -0
- package/dist/aws/onboarding.d.ts.map +1 -1
- package/dist/aws/organizationCommitments.d.ts +260 -0
- package/dist/aws/organizationCommitments.d.ts.map +1 -0
- package/dist/aws/organizationCommitments.js +53 -0
- package/dist/aws/organizationCommitments.js.map +1 -0
- package/dist/aws/organizationCommitmentsApiValidation.d.ts +21 -0
- package/dist/aws/organizationCommitmentsApiValidation.d.ts.map +1 -0
- package/dist/aws/organizationCommitmentsApiValidation.js +226 -0
- package/dist/aws/organizationCommitmentsApiValidation.js.map +1 -0
- package/dist/aws/organizationCommitmentsValidation.d.ts +12 -0
- package/dist/aws/organizationCommitmentsValidation.d.ts.map +1 -0
- package/dist/aws/organizationCommitmentsValidation.js +228 -0
- package/dist/aws/organizationCommitmentsValidation.js.map +1 -0
- package/dist/aws/portalOrganizationCommitmentsPlanningPublicArtifactValidation.d.ts +9 -0
- package/dist/aws/portalOrganizationCommitmentsPlanningPublicArtifactValidation.d.ts.map +1 -0
- package/dist/aws/portalOrganizationCommitmentsPlanningPublicArtifactValidation.js +407 -0
- package/dist/aws/portalOrganizationCommitmentsPlanningPublicArtifactValidation.js.map +1 -0
- package/dist/aws/portalOrganizationCommitmentsPlanningPublicArtifacts.d.ts +17 -0
- package/dist/aws/portalOrganizationCommitmentsPlanningPublicArtifacts.d.ts.map +1 -0
- package/dist/aws/portalOrganizationCommitmentsPlanningPublicArtifacts.js +6 -0
- package/dist/aws/portalOrganizationCommitmentsPlanningPublicArtifacts.js.map +1 -0
- package/dist/aws/requests.d.ts +13 -2
- package/dist/aws/requests.d.ts.map +1 -1
- package/dist/aws/requests.js +1 -1
- package/dist/aws/requests.js.map +1 -1
- package/dist/azure/activityLogAnalysis.d.ts +320 -0
- package/dist/azure/activityLogAnalysis.d.ts.map +1 -0
- package/dist/azure/activityLogAnalysis.js +70 -0
- package/dist/azure/activityLogAnalysis.js.map +1 -0
- package/dist/azure/activityLogAnalysisPublicValidation.d.ts +8 -0
- package/dist/azure/activityLogAnalysisPublicValidation.d.ts.map +1 -0
- package/dist/azure/activityLogAnalysisPublicValidation.js +368 -0
- package/dist/azure/activityLogAnalysisPublicValidation.js.map +1 -0
- package/dist/azure/activityLogAnalysisPublicValidationHelpers.d.ts +33 -0
- package/dist/azure/activityLogAnalysisPublicValidationHelpers.d.ts.map +1 -0
- package/dist/azure/activityLogAnalysisPublicValidationHelpers.js +197 -0
- package/dist/azure/activityLogAnalysisPublicValidationHelpers.js.map +1 -0
- package/dist/azure/activityLogAnalysisValidation.d.ts +5 -0
- package/dist/azure/activityLogAnalysisValidation.d.ts.map +1 -0
- package/dist/azure/activityLogAnalysisValidation.js +376 -0
- package/dist/azure/activityLogAnalysisValidation.js.map +1 -0
- package/dist/azure/activityLogs.d.ts +8 -0
- package/dist/azure/activityLogs.d.ts.map +1 -1
- package/dist/azure/activityLogs.js.map +1 -1
- package/dist/azure/benefits.d.ts +1 -1
- package/dist/azure/benefits.d.ts.map +1 -1
- package/dist/azure/billingPlots.d.ts +7 -1
- package/dist/azure/billingPlots.d.ts.map +1 -1
- package/dist/azure/billingPlots.js +45 -4
- package/dist/azure/billingPlots.js.map +1 -1
- package/dist/azure/commitmentsPlanning.d.ts +8 -2
- package/dist/azure/commitmentsPlanning.d.ts.map +1 -1
- package/dist/azure/common.d.ts +26 -5
- package/dist/azure/common.d.ts.map +1 -1
- package/dist/azure/common.js +30 -0
- package/dist/azure/common.js.map +1 -1
- package/dist/azure/costComposition.d.ts +11 -1
- package/dist/azure/costComposition.d.ts.map +1 -1
- package/dist/azure/costComposition.js +84 -1
- package/dist/azure/costComposition.js.map +1 -1
- package/dist/azure/dataProtection.d.ts +4 -4
- package/dist/azure/dataProtection.d.ts.map +1 -1
- package/dist/azure/financialAnalytics.d.ts +80 -8
- package/dist/azure/financialAnalytics.d.ts.map +1 -1
- package/dist/azure/financialAnalyticsDelivery.d.ts +72 -3
- package/dist/azure/financialAnalyticsDelivery.d.ts.map +1 -1
- package/dist/azure/financialAnalyticsDelivery.js +7 -1
- package/dist/azure/financialAnalyticsDelivery.js.map +1 -1
- package/dist/azure/financialAnalyticsDeliveryValidation.d.ts +9 -1
- package/dist/azure/financialAnalyticsDeliveryValidation.d.ts.map +1 -1
- package/dist/azure/financialAnalyticsDeliveryValidation.js +190 -10
- package/dist/azure/financialAnalyticsDeliveryValidation.js.map +1 -1
- package/dist/azure/financialAnalyticsDisplayKernel.d.ts +12 -0
- package/dist/azure/financialAnalyticsDisplayKernel.d.ts.map +1 -0
- package/dist/azure/financialAnalyticsDisplayKernel.js +144 -0
- package/dist/azure/financialAnalyticsDisplayKernel.js.map +1 -0
- package/dist/azure/financialAnalyticsValidation.d.ts.map +1 -1
- package/dist/azure/financialAnalyticsValidation.js +101 -19
- package/dist/azure/financialAnalyticsValidation.js.map +1 -1
- package/dist/azure/financialAuthorityProjectionKernel.d.ts +8 -0
- package/dist/azure/financialAuthorityProjectionKernel.d.ts.map +1 -0
- package/dist/azure/financialAuthorityProjectionKernel.js +269 -0
- package/dist/azure/financialAuthorityProjectionKernel.js.map +1 -0
- package/dist/azure/financialAuthorityView.d.ts +13 -0
- package/dist/azure/financialAuthorityView.d.ts.map +1 -1
- package/dist/azure/financialAuthorityView.js.map +1 -1
- package/dist/azure/financialAuthorityViewValidation.d.ts +3 -1
- package/dist/azure/financialAuthorityViewValidation.d.ts.map +1 -1
- package/dist/azure/financialAuthorityViewValidation.js +273 -2
- package/dist/azure/financialAuthorityViewValidation.js.map +1 -1
- package/dist/azure/financialChargeComposition.d.ts +81 -0
- package/dist/azure/financialChargeComposition.d.ts.map +1 -0
- package/dist/azure/financialChargeComposition.js +41 -0
- package/dist/azure/financialChargeComposition.js.map +1 -0
- package/dist/azure/financialChargeCompositionKernel.d.ts +3 -0
- package/dist/azure/financialChargeCompositionKernel.d.ts.map +1 -0
- package/dist/azure/financialChargeCompositionKernel.js +53 -0
- package/dist/azure/financialChargeCompositionKernel.js.map +1 -0
- package/dist/azure/financialChargeCompositionValidation.d.ts +8 -0
- package/dist/azure/financialChargeCompositionValidation.d.ts.map +1 -0
- package/dist/azure/financialChargeCompositionValidation.js +164 -0
- package/dist/azure/financialChargeCompositionValidation.js.map +1 -0
- package/dist/azure/financialChargePolicy.d.ts +215 -0
- package/dist/azure/financialChargePolicy.d.ts.map +1 -0
- package/dist/azure/financialChargePolicy.js +488 -0
- package/dist/azure/financialChargePolicy.js.map +1 -0
- package/dist/azure/financialCurrentSpendSurfaceProjection.d.ts +76 -0
- package/dist/azure/financialCurrentSpendSurfaceProjection.d.ts.map +1 -0
- package/dist/azure/financialCurrentSpendSurfaceProjection.js +6 -0
- package/dist/azure/financialCurrentSpendSurfaceProjection.js.map +1 -0
- package/dist/azure/financialCurrentSpendSurfaceProjectionValidation.d.ts +10 -0
- package/dist/azure/financialCurrentSpendSurfaceProjectionValidation.d.ts.map +1 -0
- package/dist/azure/financialCurrentSpendSurfaceProjectionValidation.js +196 -0
- package/dist/azure/financialCurrentSpendSurfaceProjectionValidation.js.map +1 -0
- package/dist/azure/financialDataflow.d.ts +45 -2
- package/dist/azure/financialDataflow.d.ts.map +1 -1
- package/dist/azure/financialDataflow.js.map +1 -1
- package/dist/azure/financialDataflowKernel.d.ts +31 -0
- package/dist/azure/financialDataflowKernel.d.ts.map +1 -0
- package/dist/azure/financialDataflowKernel.js +170 -0
- package/dist/azure/financialDataflowKernel.js.map +1 -0
- package/dist/azure/financialDataflowValidation.d.ts +5 -2
- package/dist/azure/financialDataflowValidation.d.ts.map +1 -1
- package/dist/azure/financialDataflowValidation.js +203 -30
- package/dist/azure/financialDataflowValidation.js.map +1 -1
- package/dist/azure/financialEvidenceAssessmentValidation.d.ts.map +1 -1
- package/dist/azure/financialEvidenceAssessmentValidation.js +7 -0
- package/dist/azure/financialEvidenceAssessmentValidation.js.map +1 -1
- package/dist/azure/financialEvidenceCoverage.d.ts +36 -0
- package/dist/azure/financialEvidenceCoverage.d.ts.map +1 -0
- package/dist/azure/financialEvidenceCoverage.js +111 -0
- package/dist/azure/financialEvidenceCoverage.js.map +1 -0
- package/dist/azure/financialPolicy.d.ts +19 -3
- package/dist/azure/financialPolicy.d.ts.map +1 -1
- package/dist/azure/financialPolicy.js.map +1 -1
- package/dist/azure/financialPolicyDelivery.d.ts +75 -1
- package/dist/azure/financialPolicyDelivery.d.ts.map +1 -1
- package/dist/azure/financialPolicyDelivery.js +5 -1
- package/dist/azure/financialPolicyDelivery.js.map +1 -1
- package/dist/azure/financialPolicyDeliveryValidation.d.ts +16 -2
- package/dist/azure/financialPolicyDeliveryValidation.d.ts.map +1 -1
- package/dist/azure/financialPolicyDeliveryValidation.js +238 -5
- package/dist/azure/financialPolicyDeliveryValidation.js.map +1 -1
- package/dist/azure/financialPolicyKernel.d.ts +38 -0
- package/dist/azure/financialPolicyKernel.d.ts.map +1 -0
- package/dist/azure/financialPolicyKernel.js +232 -0
- package/dist/azure/financialPolicyKernel.js.map +1 -0
- package/dist/azure/financialPolicyValidation.d.ts +1 -0
- package/dist/azure/financialPolicyValidation.d.ts.map +1 -1
- package/dist/azure/financialPolicyValidation.js +111 -16
- package/dist/azure/financialPolicyValidation.js.map +1 -1
- package/dist/azure/financialProjection.d.ts +11 -1
- package/dist/azure/financialProjection.d.ts.map +1 -1
- package/dist/azure/financialProjection.js.map +1 -1
- package/dist/azure/financialProjectionValidation.d.ts.map +1 -1
- package/dist/azure/financialProjectionValidation.js +43 -3
- package/dist/azure/financialProjectionValidation.js.map +1 -1
- package/dist/azure/financialResourceSurfaceProjection.d.ts +66 -0
- package/dist/azure/financialResourceSurfaceProjection.d.ts.map +1 -0
- package/dist/azure/financialResourceSurfaceProjection.js +6 -0
- package/dist/azure/financialResourceSurfaceProjection.js.map +1 -0
- package/dist/azure/financialResourceSurfaceProjectionValidation.d.ts +16 -0
- package/dist/azure/financialResourceSurfaceProjectionValidation.d.ts.map +1 -0
- package/dist/azure/financialResourceSurfaceProjectionValidation.js +252 -0
- package/dist/azure/financialResourceSurfaceProjectionValidation.js.map +1 -0
- package/dist/azure/financialSavingsAuthority.d.ts +68 -4
- package/dist/azure/financialSavingsAuthority.d.ts.map +1 -1
- package/dist/azure/financialSavingsAuthority.js +2 -1
- package/dist/azure/financialSavingsAuthority.js.map +1 -1
- package/dist/azure/financialSavingsAuthorityValidation.d.ts +6 -2
- package/dist/azure/financialSavingsAuthorityValidation.d.ts.map +1 -1
- package/dist/azure/financialSavingsAuthorityValidation.js +188 -2
- package/dist/azure/financialSavingsAuthorityValidation.js.map +1 -1
- package/dist/azure/financialSavingsChargePolicyKernel.d.ts +12 -0
- package/dist/azure/financialSavingsChargePolicyKernel.d.ts.map +1 -0
- package/dist/azure/financialSavingsChargePolicyKernel.js +34 -0
- package/dist/azure/financialSavingsChargePolicyKernel.js.map +1 -0
- package/dist/azure/financialSavingsCoordinateValidation.d.ts.map +1 -1
- package/dist/azure/financialSavingsCoordinateValidation.js +98 -19
- package/dist/azure/financialSavingsCoordinateValidation.js.map +1 -1
- package/dist/azure/financialSavingsPercentageKernel.d.ts +20 -0
- package/dist/azure/financialSavingsPercentageKernel.d.ts.map +1 -0
- package/dist/azure/financialSavingsPercentageKernel.js +49 -0
- package/dist/azure/financialSavingsPercentageKernel.js.map +1 -0
- package/dist/azure/financialSavingsSurfaceProjection.d.ts +82 -3
- package/dist/azure/financialSavingsSurfaceProjection.d.ts.map +1 -1
- package/dist/azure/financialSavingsSurfaceProjection.js +3 -1
- package/dist/azure/financialSavingsSurfaceProjection.js.map +1 -1
- package/dist/azure/financialSavingsSurfaceProjectionKernel.d.ts +26 -0
- package/dist/azure/financialSavingsSurfaceProjectionKernel.d.ts.map +1 -0
- package/dist/azure/financialSavingsSurfaceProjectionKernel.js +435 -0
- package/dist/azure/financialSavingsSurfaceProjectionKernel.js.map +1 -0
- package/dist/azure/financialSavingsSurfaceProjectionValidation.d.ts.map +1 -1
- package/dist/azure/financialSavingsSurfaceProjectionValidation.js +199 -13
- package/dist/azure/financialSavingsSurfaceProjectionValidation.js.map +1 -1
- package/dist/azure/financialScope.d.ts +14 -0
- package/dist/azure/financialScope.d.ts.map +1 -1
- package/dist/azure/financialScope.js +14 -0
- package/dist/azure/financialScope.js.map +1 -1
- package/dist/azure/financialScopeBaseline.d.ts +11 -3
- package/dist/azure/financialScopeBaseline.d.ts.map +1 -1
- package/dist/azure/financialScopeBaseline.js +14 -1
- package/dist/azure/financialScopeBaseline.js.map +1 -1
- package/dist/azure/financialScopeBaselineIdentity.d.ts.map +1 -1
- package/dist/azure/financialScopeBaselineIdentity.js +24 -4
- package/dist/azure/financialScopeBaselineIdentity.js.map +1 -1
- package/dist/azure/financialScopeBaselineValidation.d.ts.map +1 -1
- package/dist/azure/financialScopeBaselineValidation.js +21 -4
- package/dist/azure/financialScopeBaselineValidation.js.map +1 -1
- package/dist/azure/financialScopeEvidence.d.ts +1 -1
- package/dist/azure/financialScopeEvidence.d.ts.map +1 -1
- package/dist/azure/governance.d.ts +145 -0
- package/dist/azure/governance.d.ts.map +1 -1
- package/dist/azure/governance.js +2 -1
- package/dist/azure/governance.js.map +1 -1
- package/dist/azure/metrics.d.ts +2 -2
- package/dist/azure/metrics.d.ts.map +1 -1
- package/dist/azure/payloads.d.ts +55 -1
- package/dist/azure/payloads.d.ts.map +1 -1
- package/dist/azure/prices.d.ts +41 -12
- package/dist/azure/prices.d.ts.map +1 -1
- package/dist/azure/recommendationLifecycleOverlayValidation.d.ts +5 -0
- package/dist/azure/recommendationLifecycleOverlayValidation.d.ts.map +1 -0
- package/dist/azure/recommendationLifecycleOverlayValidation.js +82 -0
- package/dist/azure/recommendationLifecycleOverlayValidation.js.map +1 -0
- package/dist/azure/recommendationState.d.ts +1 -1
- package/dist/azure/recommendationState.d.ts.map +1 -1
- package/dist/azure/recommendations.d.ts +141 -5
- package/dist/azure/recommendations.d.ts.map +1 -1
- package/dist/azure/recommendations.js +3 -1
- package/dist/azure/recommendations.js.map +1 -1
- package/dist/azure/relationships.d.ts +1 -1
- package/dist/azure/relationships.d.ts.map +1 -1
- package/dist/azure/reportDailySpend.d.ts +48 -0
- package/dist/azure/reportDailySpend.d.ts.map +1 -0
- package/dist/azure/reportDailySpend.js +6 -0
- package/dist/azure/reportDailySpend.js.map +1 -0
- package/dist/azure/reportDailySpendValidation.d.ts +3 -0
- package/dist/azure/reportDailySpendValidation.d.ts.map +1 -0
- package/dist/azure/reportDailySpendValidation.js +72 -0
- package/dist/azure/reportDailySpendValidation.js.map +1 -0
- package/dist/azure/reportEvidence.d.ts +615 -0
- package/dist/azure/reportEvidence.d.ts.map +1 -0
- package/dist/azure/reportEvidence.js +25 -0
- package/dist/azure/reportEvidence.js.map +1 -0
- package/dist/azure/reportEvidenceCatalogueValidation.d.ts +5 -0
- package/dist/azure/reportEvidenceCatalogueValidation.d.ts.map +1 -0
- package/dist/azure/reportEvidenceCatalogueValidation.js +109 -0
- package/dist/azure/reportEvidenceCatalogueValidation.js.map +1 -0
- package/dist/azure/reportEvidenceValidation.d.ts +7 -0
- package/dist/azure/reportEvidenceValidation.d.ts.map +1 -0
- package/dist/azure/reportEvidenceValidation.js +421 -0
- package/dist/azure/reportEvidenceValidation.js.map +1 -0
- package/dist/azure/reportEvidenceValidationHelpers.d.ts +27 -0
- package/dist/azure/reportEvidenceValidationHelpers.d.ts.map +1 -0
- package/dist/azure/reportEvidenceValidationHelpers.js +134 -0
- package/dist/azure/reportEvidenceValidationHelpers.js.map +1 -0
- package/dist/azure/reportSavingsContributionValidation.d.ts +5 -0
- package/dist/azure/reportSavingsContributionValidation.d.ts.map +1 -0
- package/dist/azure/reportSavingsContributionValidation.js +37 -0
- package/dist/azure/reportSavingsContributionValidation.js.map +1 -0
- package/dist/azure/reportSpend.d.ts +87 -0
- package/dist/azure/reportSpend.d.ts.map +1 -0
- package/dist/azure/reportSpend.js +5 -0
- package/dist/azure/reportSpend.js.map +1 -0
- package/dist/azure/reportSpendValidation.d.ts +7 -0
- package/dist/azure/reportSpendValidation.d.ts.map +1 -0
- package/dist/azure/reportSpendValidation.js +197 -0
- package/dist/azure/reportSpendValidation.js.map +1 -0
- package/dist/azure/reportSpendValidationHelpers.d.ts +7 -0
- package/dist/azure/reportSpendValidationHelpers.d.ts.map +1 -0
- package/dist/azure/reportSpendValidationHelpers.js +31 -0
- package/dist/azure/reportSpendValidationHelpers.js.map +1 -0
- package/dist/azure/reports.d.ts +32 -10
- package/dist/azure/reports.d.ts.map +1 -1
- package/dist/azure/reports.js.map +1 -1
- package/dist/azure/resources.d.ts +24 -12
- package/dist/azure/resources.d.ts.map +1 -1
- package/dist/azure/serviceRetirement.d.ts +33 -2
- package/dist/azure/serviceRetirement.d.ts.map +1 -1
- package/dist/azure/storage-inventory.d.ts +44 -0
- package/dist/azure/storage-inventory.d.ts.map +1 -1
- package/dist/azure/subscriptions.d.ts +57 -11
- package/dist/azure/subscriptions.d.ts.map +1 -1
- package/dist/azure/subscriptions.js +35 -0
- package/dist/azure/subscriptions.js.map +1 -1
- package/dist/azure/views.d.ts +86 -22
- package/dist/azure/views.d.ts.map +1 -1
- package/dist/azure/views.js +8 -1
- package/dist/azure/views.js.map +1 -1
- package/dist/azure/vmPatchManagement.d.ts +109 -0
- package/dist/azure/vmPatchManagement.d.ts.map +1 -0
- package/dist/azure/vmPatchManagement.js +7 -0
- package/dist/azure/vmPatchManagement.js.map +1 -0
- package/dist/common/provider.d.ts +53 -0
- package/dist/common/provider.d.ts.map +1 -1
- package/dist/common/provider.js.map +1 -1
- package/dist/company/company.d.ts +1 -0
- package/dist/company/company.d.ts.map +1 -1
- package/dist/environment/canonicalization.d.ts +12 -0
- package/dist/environment/canonicalization.d.ts.map +1 -0
- package/dist/environment/canonicalization.js +40 -0
- package/dist/environment/canonicalization.js.map +1 -0
- package/dist/environment/contracts.d.ts +472 -0
- package/dist/environment/contracts.d.ts.map +1 -0
- package/dist/environment/contracts.js +73 -0
- package/dist/environment/contracts.js.map +1 -0
- package/dist/environment/index.d.ts +6 -0
- package/dist/environment/index.d.ts.map +1 -0
- package/dist/environment/index.js +22 -0
- package/dist/environment/index.js.map +1 -0
- package/dist/environment/internal.d.ts +21 -0
- package/dist/environment/internal.d.ts.map +1 -0
- package/dist/environment/internal.js +113 -0
- package/dist/environment/internal.js.map +1 -0
- package/dist/environment/references.d.ts +24 -0
- package/dist/environment/references.d.ts.map +1 -0
- package/dist/environment/references.js +243 -0
- package/dist/environment/references.js.map +1 -0
- package/dist/environment/tenant.d.ts +128 -0
- package/dist/environment/tenant.d.ts.map +1 -0
- package/dist/environment/tenant.js +203 -0
- package/dist/environment/tenant.js.map +1 -0
- package/dist/environment/validation.d.ts +34 -0
- package/dist/environment/validation.d.ts.map +1 -0
- package/dist/environment/validation.js +655 -0
- package/dist/environment/validation.js.map +1 -0
- package/dist/esm/accounts/accounts.js +1 -0
- package/dist/esm/accounts/azureManualOnboarding.js +8 -0
- package/dist/esm/accounts/azureSpSetup.js +14 -1
- package/dist/esm/accounts/azureSpSetupDurable.js +27 -1
- package/dist/esm/accounts/index.js +1 -0
- package/dist/esm/ai/conversationHistory.js +6 -0
- package/dist/esm/ai/grounding.js +80 -0
- package/dist/esm/ai/index.js +10 -1
- package/dist/esm/ai/workspaceArtifacts.js +158 -0
- package/dist/esm/aws/commitments-planning.js +5 -0
- package/dist/esm/aws/estates.js +7 -1
- package/dist/esm/aws/index.js +5 -0
- package/dist/esm/aws/organizationCommitments.js +48 -0
- package/dist/esm/aws/organizationCommitmentsApiValidation.js +220 -0
- package/dist/esm/aws/organizationCommitmentsValidation.js +224 -0
- package/dist/esm/aws/portalOrganizationCommitmentsPlanningPublicArtifactValidation.js +402 -0
- package/dist/esm/aws/portalOrganizationCommitmentsPlanningPublicArtifacts.js +2 -0
- package/dist/esm/aws/requests.js +1 -1
- package/dist/esm/azure/activityLogAnalysis.js +64 -0
- package/dist/esm/azure/activityLogAnalysisPublicValidation.js +360 -0
- package/dist/esm/azure/activityLogAnalysisPublicValidationHelpers.js +172 -0
- package/dist/esm/azure/activityLogAnalysisValidation.js +365 -0
- package/dist/esm/azure/billingPlots.js +45 -4
- package/dist/esm/azure/common.js +28 -1
- package/dist/esm/azure/costComposition.js +80 -0
- package/dist/esm/azure/financialAnalyticsDelivery.js +5 -0
- package/dist/esm/azure/financialAnalyticsDeliveryValidation.js +184 -11
- package/dist/esm/azure/financialAnalyticsDisplayKernel.js +139 -0
- package/dist/esm/azure/financialAnalyticsValidation.js +101 -19
- package/dist/esm/azure/financialAuthorityProjectionKernel.js +263 -0
- package/dist/esm/azure/financialAuthorityViewValidation.js +271 -1
- package/dist/esm/azure/financialChargeComposition.js +36 -0
- package/dist/esm/azure/financialChargeCompositionKernel.js +48 -0
- package/dist/esm/azure/financialChargeCompositionValidation.js +155 -0
- package/dist/esm/azure/financialChargePolicy.js +473 -0
- package/dist/esm/azure/financialCurrentSpendSurfaceProjection.js +2 -0
- package/dist/esm/azure/financialCurrentSpendSurfaceProjectionValidation.js +184 -0
- package/dist/esm/azure/financialDataflowKernel.js +164 -0
- package/dist/esm/azure/financialDataflowValidation.js +199 -29
- package/dist/esm/azure/financialEvidenceAssessmentValidation.js +7 -0
- package/dist/esm/azure/financialEvidenceCoverage.js +106 -0
- package/dist/esm/azure/financialPolicyDelivery.js +4 -0
- package/dist/esm/azure/financialPolicyDeliveryValidation.js +227 -7
- package/dist/esm/azure/financialPolicyKernel.js +225 -0
- package/dist/esm/azure/financialPolicyValidation.js +110 -16
- package/dist/esm/azure/financialProjectionValidation.js +43 -3
- package/dist/esm/azure/financialResourceSurfaceProjection.js +2 -0
- package/dist/esm/azure/financialResourceSurfaceProjectionValidation.js +243 -0
- package/dist/esm/azure/financialSavingsAuthority.js +1 -0
- package/dist/esm/azure/financialSavingsAuthorityValidation.js +186 -2
- package/dist/esm/azure/financialSavingsChargePolicyKernel.js +29 -0
- package/dist/esm/azure/financialSavingsCoordinateValidation.js +98 -19
- package/dist/esm/azure/financialSavingsPercentageKernel.js +44 -0
- package/dist/esm/azure/financialSavingsSurfaceProjection.js +2 -0
- package/dist/esm/azure/financialSavingsSurfaceProjectionKernel.js +427 -0
- package/dist/esm/azure/financialSavingsSurfaceProjectionValidation.js +199 -13
- package/dist/esm/azure/financialScope.js +14 -0
- package/dist/esm/azure/financialScopeBaseline.js +12 -0
- package/dist/esm/azure/financialScopeBaselineIdentity.js +24 -4
- package/dist/esm/azure/financialScopeBaselineValidation.js +21 -4
- package/dist/esm/azure/governance.js +1 -0
- package/dist/esm/azure/recommendationLifecycleOverlayValidation.js +75 -0
- package/dist/esm/azure/recommendations.js +2 -0
- package/dist/esm/azure/reportDailySpend.js +2 -0
- package/dist/esm/azure/reportDailySpendValidation.js +67 -0
- package/dist/esm/azure/reportEvidence.js +21 -0
- package/dist/esm/azure/reportEvidenceCatalogueValidation.js +103 -0
- package/dist/esm/azure/reportEvidenceValidation.js +413 -0
- package/dist/esm/azure/reportEvidenceValidationHelpers.js +106 -0
- package/dist/esm/azure/reportSavingsContributionValidation.js +30 -0
- package/dist/esm/azure/reportSpend.js +1 -0
- package/dist/esm/azure/reportSpendValidation.js +189 -0
- package/dist/esm/azure/reportSpendValidationHelpers.js +22 -0
- package/dist/esm/azure/subscriptions.js +33 -1
- package/dist/esm/azure/views.js +8 -1
- package/dist/esm/azure/vmPatchManagement.js +3 -0
- package/dist/esm/entries/commitments-planning.js +2 -2
- package/dist/esm/entries/environment.js +3 -0
- package/dist/esm/environment/canonicalization.js +34 -0
- package/dist/esm/environment/contracts.js +69 -0
- package/dist/esm/environment/index.js +5 -0
- package/dist/esm/environment/internal.js +97 -0
- package/dist/esm/environment/references.js +230 -0
- package/dist/esm/environment/tenant.js +190 -0
- package/dist/esm/environment/validation.js +635 -0
- package/dist/esm/identity/index.js +1 -0
- package/dist/esm/identity/microsoftSignInAdminConsent.js +1 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.vite.js +11 -0
- package/dist/esm/scheduler/bastionSchedule.js +1 -0
- package/dist/esm/scheduler/bastionScheduleProfile.js +206 -0
- package/dist/esm/scheduler/bastionScheduleValidation.js +401 -0
- package/dist/esm/scheduler/index.js +3 -0
- package/dist/events/alertDefinitionRun.d.ts +4 -0
- package/dist/events/alertDefinitionRun.d.ts.map +1 -1
- package/dist/events/baseAlert.d.ts +1 -0
- package/dist/events/baseAlert.d.ts.map +1 -1
- package/dist/events/cost.d.ts +4 -0
- package/dist/events/cost.d.ts.map +1 -1
- package/dist/events/quickAlerts.d.ts +13 -4
- package/dist/events/quickAlerts.d.ts.map +1 -1
- package/dist/events/quickAlerts.js.map +1 -1
- package/dist/features-and-permissions/access.d.ts +79 -0
- package/dist/features-and-permissions/access.d.ts.map +1 -1
- package/dist/identity/index.d.ts +1 -0
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +1 -0
- package/dist/identity/index.js.map +1 -1
- package/dist/identity/microsoftSignInAdminConsent.d.ts +59 -0
- package/dist/identity/microsoftSignInAdminConsent.d.ts.map +1 -0
- package/dist/identity/microsoftSignInAdminConsent.js +3 -0
- package/dist/identity/microsoftSignInAdminConsent.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -1
- package/dist/index.vite.d.ts +11 -0
- package/dist/index.vite.d.ts.map +1 -1
- package/dist/index.vite.js +15 -0
- package/dist/index.vite.js.map +1 -1
- package/dist/portfolio/portfolioOperations.d.ts +1 -1
- package/dist/portfolio/portfolioOperations.d.ts.map +1 -1
- package/dist/scheduler/bastionSchedule.d.ts +113 -0
- package/dist/scheduler/bastionSchedule.d.ts.map +1 -0
- package/dist/scheduler/bastionSchedule.js +3 -0
- package/dist/scheduler/bastionSchedule.js.map +1 -0
- package/dist/scheduler/bastionScheduleProfile.d.ts +24 -0
- package/dist/scheduler/bastionScheduleProfile.d.ts.map +1 -0
- package/dist/scheduler/bastionScheduleProfile.js +210 -0
- package/dist/scheduler/bastionScheduleProfile.js.map +1 -0
- package/dist/scheduler/bastionScheduleValidation.d.ts +10 -0
- package/dist/scheduler/bastionScheduleValidation.d.ts.map +1 -0
- package/dist/scheduler/bastionScheduleValidation.js +412 -0
- package/dist/scheduler/bastionScheduleValidation.js.map +1 -0
- package/dist/scheduler/index.d.ts +3 -0
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js +3 -0
- package/dist/scheduler/index.js.map +1 -1
- package/dist/scheduler/scheduler.d.ts +14 -10
- package/dist/scheduler/scheduler.d.ts.map +1 -1
- package/package.json +20 -3
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { REPORT_EVIDENCE_LIMITS } from './reportEvidence.js';
|
|
2
|
+
export const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
3
|
+
export const isString = (value) => typeof value === 'string' && value.trim().length > 0;
|
|
4
|
+
export const isOptionalString = (value) => value === undefined || isString(value);
|
|
5
|
+
export const isFiniteNumber = (value) => typeof value === 'number' && Number.isFinite(value);
|
|
6
|
+
export const isOptionalFiniteNumber = (value) => value === undefined || isFiniteNumber(value);
|
|
7
|
+
export const isOptionalBoolean = (value) => value === undefined || typeof value === 'boolean';
|
|
8
|
+
export const isCount = (value) => isFiniteNumber(value) && Number.isInteger(value) && value >= 0;
|
|
9
|
+
export const isDateTime = (value) => isString(value) && Number.isFinite(Date.parse(value));
|
|
10
|
+
export const isStringArray = (value) => Array.isArray(value) && value.every(isString);
|
|
11
|
+
export const isCountRecord = (value) => isRecord(value) && Object.values(value).every(isCount);
|
|
12
|
+
export const countTotal = (value) => Object.values(value).reduce((total, count) => total + count, 0);
|
|
13
|
+
export const hasOptionalStrings = (value, keys) => keys.every(key => isOptionalString(value[key]));
|
|
14
|
+
export const hasOptionalNumbers = (value, keys) => keys.every(key => isOptionalFiniteNumber(value[key]));
|
|
15
|
+
export const isBoundedRows = (value, limit, isRow) => {
|
|
16
|
+
if (!isRecord(value) || !isCount(value.totalCount) || !isCount(value.omittedCount) || !Array.isArray(value.rows))
|
|
17
|
+
return false;
|
|
18
|
+
return value.rows.length <= limit && value.rows.every(isRow) && value.totalCount === value.rows.length + value.omittedCount;
|
|
19
|
+
};
|
|
20
|
+
export const isProjectionRows = (value, limit = REPORT_EVIDENCE_LIMITS.detailRows) => isBoundedRows(value, limit, isRecord);
|
|
21
|
+
export const hasRequiredRecords = (value, keys) => keys.every(key => isRecord(value[key]));
|
|
22
|
+
export const isSourceFileStatus = (value) => isRecord(value) &&
|
|
23
|
+
isString(value.path) &&
|
|
24
|
+
typeof value.available === 'boolean' &&
|
|
25
|
+
(value.recordCount === undefined || isCount(value.recordCount)) &&
|
|
26
|
+
isOptionalString(value.note);
|
|
27
|
+
export const isTagCoverage = (value) => isRecord(value) &&
|
|
28
|
+
isCount(value.withTags) &&
|
|
29
|
+
isCount(value.withoutTags) &&
|
|
30
|
+
isFiniteNumber(value.coveragePercentage) &&
|
|
31
|
+
Array.isArray(value.topTagKeys) &&
|
|
32
|
+
value.topTagKeys.every(row => isRecord(row) && isString(row.key) && isCount(row.count));
|
|
33
|
+
const isTopSpendResource = (value) => isRecord(value) &&
|
|
34
|
+
isString(value.id) &&
|
|
35
|
+
isString(value.name) &&
|
|
36
|
+
isString(value.type) &&
|
|
37
|
+
isOptionalString(value.location) &&
|
|
38
|
+
isFiniteNumber(value.spend30Days) &&
|
|
39
|
+
isOptionalFiniteNumber(value.spend30DaysAmortized);
|
|
40
|
+
export const isResourceSummary = (value) => isRecord(value) &&
|
|
41
|
+
isCount(value.total) &&
|
|
42
|
+
Array.isArray(value.byType) &&
|
|
43
|
+
value.byType.length <= REPORT_EVIDENCE_LIMITS.summaryDimensions &&
|
|
44
|
+
value.byType.every(row => isRecord(row) && isString(row.type) && isCount(row.count) && isOptionalFiniteNumber(row.spend30Days)) &&
|
|
45
|
+
Array.isArray(value.byLocation) &&
|
|
46
|
+
value.byLocation.length <= REPORT_EVIDENCE_LIMITS.summaryDimensions &&
|
|
47
|
+
value.byLocation.every(row => isRecord(row) && isString(row.location) && isCount(row.count) && isOptionalFiniteNumber(row.spend30Days)) &&
|
|
48
|
+
isRecord(value.tagCoverage) &&
|
|
49
|
+
isTagCoverage(value.tagCoverage) &&
|
|
50
|
+
Array.isArray(value.tagCoverage.topTagKeys) &&
|
|
51
|
+
value.tagCoverage.topTagKeys.length <= REPORT_EVIDENCE_LIMITS.summaryRows &&
|
|
52
|
+
Array.isArray(value.topSpendResources) &&
|
|
53
|
+
value.topSpendResources.length <= REPORT_EVIDENCE_LIMITS.summaryRows &&
|
|
54
|
+
value.topSpendResources.every(isTopSpendResource);
|
|
55
|
+
export const isCostSummary = (value) => {
|
|
56
|
+
if (!isRecord(value) || !isRecord(value.sourceMetadata) || !Array.isArray(value.topSpendResources))
|
|
57
|
+
return false;
|
|
58
|
+
if (!hasOptionalStrings(value, ['currency', 'currencySymbol']) ||
|
|
59
|
+
!hasOptionalNumbers(value, ['spend30Days', 'spend30DaysAmortized', 'totalRetailCost', 'miscCost', 'rollingCostRecordCount']) ||
|
|
60
|
+
(value.budget !== undefined && !isRecord(value.budget)) ||
|
|
61
|
+
!isString(value.sourceMetadata.spend30DaysSource) ||
|
|
62
|
+
!isString(value.sourceMetadata.spend30DaysAmortizedSource) ||
|
|
63
|
+
!isString(value.sourceMetadata.totalRetailCostSource) ||
|
|
64
|
+
!isString(value.sourceMetadata.rollingCostFile) ||
|
|
65
|
+
!isOptionalFiniteNumber(value.sourceMetadata.rollingCostRecordCount) ||
|
|
66
|
+
!value.topSpendResources.every(isTopSpendResource)) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
return (value.period === undefined ||
|
|
70
|
+
(isRecord(value.period) &&
|
|
71
|
+
value.period.type === 'rolling_30_days' &&
|
|
72
|
+
isString(value.period.source) &&
|
|
73
|
+
hasOptionalStrings(value.period, ['startDate', 'endDate'])));
|
|
74
|
+
};
|
|
75
|
+
export const isRecommendationSummary = (value) => isRecord(value) &&
|
|
76
|
+
isCount(value.total) &&
|
|
77
|
+
isCountRecord(value.byPillar) &&
|
|
78
|
+
isCountRecord(value.byImpact) &&
|
|
79
|
+
isCountRecord(value.byEffort) &&
|
|
80
|
+
isStringArray(value.topRecommendationIds) &&
|
|
81
|
+
value.topRecommendationIds.length <= REPORT_EVIDENCE_LIMITS.topRecommendationIds &&
|
|
82
|
+
isRecord(value.topRecommendationIdsByPillar) &&
|
|
83
|
+
Object.values(value.topRecommendationIdsByPillar).every(ids => isStringArray(ids) && ids.length <= REPORT_EVIDENCE_LIMITS.topRecommendationIdsPerPillar);
|
|
84
|
+
export const isRetirementSummary = (value) => isRecord(value) &&
|
|
85
|
+
isCount(value.total) &&
|
|
86
|
+
isCount(value.sourceRecordCount) &&
|
|
87
|
+
isCount(value.excludedUnlinked) &&
|
|
88
|
+
isCount(value.excludedCommitmentExpiries) &&
|
|
89
|
+
isCount(value.within180Days) &&
|
|
90
|
+
isCount(value.expiredOrPastDue) &&
|
|
91
|
+
Array.isArray(value.upcoming) &&
|
|
92
|
+
value.upcoming.length <= REPORT_EVIDENCE_LIMITS.upcomingEvents &&
|
|
93
|
+
value.upcoming.every(row => isRecord(row) && isOptionalString(row.id) && isOptionalString(row.title) && isOptionalString(row.retirementDate) && isCount(row.resourceCount));
|
|
94
|
+
export const isCommitmentExpirySummary = (value) => isRecord(value) &&
|
|
95
|
+
isCount(value.total) &&
|
|
96
|
+
isCount(value.sourceRecordCount) &&
|
|
97
|
+
isCount(value.within180Days) &&
|
|
98
|
+
isCount(value.expiredOrPastDue) &&
|
|
99
|
+
Array.isArray(value.upcoming) &&
|
|
100
|
+
value.upcoming.length <= REPORT_EVIDENCE_LIMITS.upcomingEvents &&
|
|
101
|
+
value.upcoming.every(row => isRecord(row) && isOptionalString(row.id) && isOptionalString(row.title) && isOptionalString(row.expiryDate) && isCount(row.resourceCount));
|
|
102
|
+
export const isEvidenceReference = (value) => isRecord(value) &&
|
|
103
|
+
isString(value.source) &&
|
|
104
|
+
isString(value.summary) &&
|
|
105
|
+
(value.value === undefined || ['string', 'number', 'boolean'].includes(typeof value.value)) &&
|
|
106
|
+
(typeof value.value !== 'number' || Number.isFinite(value.value));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { isRecord } from './reportEvidenceValidationHelpers.js';
|
|
2
|
+
const isMoneyRange = (value) => {
|
|
3
|
+
if (!isRecord(value) || typeof value.currency !== 'string' || !/^[A-Z]{3}$/.test(value.currency))
|
|
4
|
+
return false;
|
|
5
|
+
const fields = ['minorUnitScale', 'currentMonthlyMinorUnits', 'minSavingsMinorUnits', 'maxSavingsMinorUnits'];
|
|
6
|
+
if (!fields.every(key => Number.isSafeInteger(value[key]) && Number(value[key]) >= 0))
|
|
7
|
+
return false;
|
|
8
|
+
return (Number(value.minorUnitScale) <= 6 &&
|
|
9
|
+
Number(value.minSavingsMinorUnits) <= Number(value.maxSavingsMinorUnits) &&
|
|
10
|
+
Number(value.maxSavingsMinorUnits) <= Number(value.currentMonthlyMinorUnits));
|
|
11
|
+
};
|
|
12
|
+
export const isReportPortfolioSavingsContribution = (value) => isRecord(value) &&
|
|
13
|
+
value.semantics === 'portfolio-contribution' &&
|
|
14
|
+
isMoneyRange(value.range) &&
|
|
15
|
+
Array.isArray(value.allocationIds) &&
|
|
16
|
+
value.allocationIds.length <= 10000 &&
|
|
17
|
+
value.allocationIds.every(id => typeof id === 'string' && id.trim().length > 0 && id.length <= 16384) &&
|
|
18
|
+
new Set(value.allocationIds).size === value.allocationIds.length &&
|
|
19
|
+
(value.allocationIds.length > 0 || value.range.maxSavingsMinorUnits === 0);
|
|
20
|
+
export const isReportScenarioSavings = (value) => isRecord(value) &&
|
|
21
|
+
value.semantics === 'standalone-scenario' &&
|
|
22
|
+
isMoneyRange(value.range) &&
|
|
23
|
+
(value.combinationPolicy === 'additive' || value.combinationPolicy === 'exclusive' || value.combinationPolicy === 'conditional') &&
|
|
24
|
+
(value.combinationGroupId === undefined || (typeof value.combinationGroupId === 'string' && value.combinationGroupId.length <= 16384));
|
|
25
|
+
export const hasValidReportSavingsMetadata = (value) => ['savingsOwnerResourceId', 'billableComponentKey'].every(key => value[key] === undefined || (typeof value[key] === 'string' && value[key].trim().length > 0 && value[key].length <= 16384)) &&
|
|
26
|
+
(value.savingsAggregationPolicy === undefined ||
|
|
27
|
+
value.savingsAggregationPolicy === 'owner-component' ||
|
|
28
|
+
value.savingsAggregationPolicy === 'resource') &&
|
|
29
|
+
(value.portfolioContribution === undefined || isReportPortfolioSavingsContribution(value.portfolioContribution)) &&
|
|
30
|
+
(value.scenarioSavings === undefined || isReportScenarioSavings(value.scenarioSavings));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const REPORT_SPEND_LIMITS = { periods: 14, servicesPerPeriod: 100, periodDays: 92, assumptions: 10, textLength: 500 };
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { isPublicCostComposition } from './costComposition.js';
|
|
2
|
+
import { isBoundedRows, isRecord } from './reportEvidenceValidationHelpers.js';
|
|
3
|
+
import { REPORT_SPEND_LIMITS, } from './reportSpend.js';
|
|
4
|
+
import { isReportCalendarDate, isReportCurrency, isReportText, isReportUtcTimestamp, reportMoneyUnits } from './reportSpendValidationHelpers.js';
|
|
5
|
+
const bases = ['billed', 'amortized'];
|
|
6
|
+
const coverageStates = new Set(['complete', 'partial', 'unavailable']);
|
|
7
|
+
const exactFields = (value, required, optional = []) => required.every(key => Object.prototype.hasOwnProperty.call(value, key)) &&
|
|
8
|
+
Object.keys(value).every(key => [...required, ...optional].includes(key));
|
|
9
|
+
export const isReportSavingsBasis = (value) => typeof value === 'string' && ['billed', 'amortized', 'retail', 'mixed', 'unknown'].includes(value);
|
|
10
|
+
const amountOf = (value) => value.status === 'available' ? reportMoneyUnits(value.component.amount) : undefined;
|
|
11
|
+
function isBasisConsistent(basis, coverage, lens) {
|
|
12
|
+
if (!isRecord(coverage) || !exactFields(coverage, ['actual', 'estimated', 'combined']))
|
|
13
|
+
return false;
|
|
14
|
+
const components = { actual: basis.actual.availability, estimated: basis.estimated.availability, combined: basis.combined };
|
|
15
|
+
for (const key of ['actual', 'estimated', 'combined']) {
|
|
16
|
+
if (!coverageStates.has(coverage[key]))
|
|
17
|
+
return false;
|
|
18
|
+
const available = components[key].status === 'available';
|
|
19
|
+
if (available !== (coverage[key] !== 'unavailable'))
|
|
20
|
+
return false;
|
|
21
|
+
if (available && amountOf(components[key]) === undefined)
|
|
22
|
+
return false;
|
|
23
|
+
if (key !== 'combined' && available && basis[key].support !== 'supported')
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
const actual = amountOf(components.actual);
|
|
27
|
+
const estimated = amountOf(components.estimated);
|
|
28
|
+
const expectedStatus = actual !== undefined
|
|
29
|
+
? estimated !== undefined
|
|
30
|
+
? 'actual-plus-estimated'
|
|
31
|
+
: 'actual-only'
|
|
32
|
+
: estimated !== undefined
|
|
33
|
+
? 'estimated-only'
|
|
34
|
+
: 'unavailable';
|
|
35
|
+
if (basis.status !== expectedStatus)
|
|
36
|
+
return false;
|
|
37
|
+
const combined = amountOf(basis.combined);
|
|
38
|
+
// Reconciliation may withhold the combined amount even when individual components are available.
|
|
39
|
+
if (combined === undefined)
|
|
40
|
+
return true;
|
|
41
|
+
if (lens === 'actual-only')
|
|
42
|
+
return actual === combined && coverage.combined === coverage.actual;
|
|
43
|
+
if (lens === 'estimates-only')
|
|
44
|
+
return estimated === combined && coverage.combined === coverage.estimated;
|
|
45
|
+
if (actual === undefined && estimated === undefined)
|
|
46
|
+
return false;
|
|
47
|
+
if (combined !== (actual ?? 0n) + (estimated ?? 0n))
|
|
48
|
+
return false;
|
|
49
|
+
// A single partial component cannot become a complete combined total. Two components require producer coverage proof.
|
|
50
|
+
if (actual === undefined)
|
|
51
|
+
return coverage.combined === coverage.estimated;
|
|
52
|
+
if (estimated === undefined)
|
|
53
|
+
return coverage.combined === coverage.actual;
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
export function isReportSpendAmounts(value, currency, generatedAt) {
|
|
57
|
+
if (!isRecord(value) || !exactFields(value, ['composition', 'coverage', 'retail'], ['estimates']) || !isPublicCostComposition(value.composition))
|
|
58
|
+
return false;
|
|
59
|
+
if (!isRecord(value.coverage) || !exactFields(value.coverage, [...bases]))
|
|
60
|
+
return false;
|
|
61
|
+
if (currency !== undefined && !isReportCurrency(currency))
|
|
62
|
+
return false;
|
|
63
|
+
if (generatedAt !== undefined && !isReportUtcTimestamp(generatedAt))
|
|
64
|
+
return false;
|
|
65
|
+
if (value.estimates !== undefined && (!isRecord(value.estimates) || !exactFields(value.estimates, [], [...bases])))
|
|
66
|
+
return false;
|
|
67
|
+
const currencies = new Set();
|
|
68
|
+
if (currency)
|
|
69
|
+
currencies.add(currency);
|
|
70
|
+
for (const key of bases) {
|
|
71
|
+
const basis = value.composition[key];
|
|
72
|
+
if (!isBasisConsistent(basis, value.coverage[key], value.composition.selectedLens))
|
|
73
|
+
return false;
|
|
74
|
+
for (const item of [basis.actual.availability, basis.estimated.availability, basis.combined]) {
|
|
75
|
+
if (item.status === 'available') {
|
|
76
|
+
if (!isReportCurrency(item.component.currencyCode))
|
|
77
|
+
return false;
|
|
78
|
+
currencies.add(item.component.currencyCode);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const estimate = isRecord(value.estimates) ? value.estimates[key] : undefined;
|
|
82
|
+
if (basis.estimated.availability.status === 'available') {
|
|
83
|
+
if (!isRecord(estimate) ||
|
|
84
|
+
!exactFields(estimate, ['reason', 'method', 'observedAt']) ||
|
|
85
|
+
!['billing-lag', 'billing-unavailable-sponsorship', 'other'].includes(estimate.reason) ||
|
|
86
|
+
!isReportText(estimate.method) ||
|
|
87
|
+
!isReportUtcTimestamp(estimate.observedAt) ||
|
|
88
|
+
(generatedAt !== undefined && Date.parse(estimate.observedAt) > Date.parse(generatedAt)))
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
else if (estimate !== undefined)
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
const retail = value.retail;
|
|
95
|
+
if (!isRecord(retail))
|
|
96
|
+
return false;
|
|
97
|
+
if (retail.status === 'unavailable') {
|
|
98
|
+
if (!exactFields(retail, ['status']))
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
if (retail.status !== 'available' ||
|
|
103
|
+
!exactFields(retail, ['status', 'component', 'coverage', 'scopeDescription', 'pricingSource', 'pricedAt', 'assumptions']) ||
|
|
104
|
+
!isRecord(retail.component) ||
|
|
105
|
+
!exactFields(retail.component, ['amount', 'currencyCode']) ||
|
|
106
|
+
!isReportCurrency(retail.component.currencyCode) ||
|
|
107
|
+
!['complete', 'partial'].includes(retail.coverage) ||
|
|
108
|
+
!isReportText(retail.scopeDescription) ||
|
|
109
|
+
!isReportText(retail.pricingSource) ||
|
|
110
|
+
!isReportUtcTimestamp(retail.pricedAt) ||
|
|
111
|
+
(generatedAt !== undefined && Date.parse(retail.pricedAt) > Date.parse(generatedAt)) ||
|
|
112
|
+
!Array.isArray(retail.assumptions) ||
|
|
113
|
+
retail.assumptions.length > REPORT_SPEND_LIMITS.assumptions ||
|
|
114
|
+
!retail.assumptions.every(isReportText))
|
|
115
|
+
return false;
|
|
116
|
+
const amount = reportMoneyUnits(retail.component.amount);
|
|
117
|
+
if (amount === undefined || amount < 0n)
|
|
118
|
+
return false;
|
|
119
|
+
currencies.add(retail.component.currencyCode);
|
|
120
|
+
}
|
|
121
|
+
return currencies.size <= 1;
|
|
122
|
+
}
|
|
123
|
+
export const hasReportSpendValue = (value) => value.retail.status === 'available' ||
|
|
124
|
+
bases.some(key => value.composition[key].actual.availability.status === 'available' || value.composition[key].estimated.availability.status === 'available');
|
|
125
|
+
/** Dates, population completeness and actual/estimated selection remain independent checks. */
|
|
126
|
+
export const isReportSpendProjection = (value) => {
|
|
127
|
+
if (!isRecord(value) ||
|
|
128
|
+
!exactFields(value, ['currency', 'dateBasis', 'generatedAt', 'freshness', 'periods'], ['sourceObservedAt']) ||
|
|
129
|
+
!isReportCurrency(value.currency) ||
|
|
130
|
+
value.dateBasis !== 'billing-calendar' ||
|
|
131
|
+
!isReportUtcTimestamp(value.generatedAt) ||
|
|
132
|
+
!['current', 'stale', 'unavailable'].includes(value.freshness) ||
|
|
133
|
+
!Array.isArray(value.periods) ||
|
|
134
|
+
value.periods.length > REPORT_SPEND_LIMITS.periods)
|
|
135
|
+
return false;
|
|
136
|
+
if (value.sourceObservedAt !== undefined &&
|
|
137
|
+
(!isReportUtcTimestamp(value.sourceObservedAt) || Date.parse(value.sourceObservedAt) > Date.parse(value.generatedAt)))
|
|
138
|
+
return false;
|
|
139
|
+
const seen = new Set();
|
|
140
|
+
let rollingCount = 0;
|
|
141
|
+
let historicalCount = 0;
|
|
142
|
+
let available = false;
|
|
143
|
+
for (const period of value.periods) {
|
|
144
|
+
if (!isRecord(period) ||
|
|
145
|
+
!exactFields(period, ['kind', 'startDate', 'endDate', 'amounts'], ['services']) ||
|
|
146
|
+
!['calendar-month', 'billing-period', 'rolling-30-days'].includes(period.kind) ||
|
|
147
|
+
!isReportCalendarDate(period.startDate) ||
|
|
148
|
+
!isReportCalendarDate(period.endDate))
|
|
149
|
+
return false;
|
|
150
|
+
const days = (Date.parse(period.endDate) - Date.parse(period.startDate)) / 86400000 + 1;
|
|
151
|
+
if (days < 1 || days > REPORT_SPEND_LIMITS.periodDays)
|
|
152
|
+
return false;
|
|
153
|
+
if (period.kind === 'calendar-month') {
|
|
154
|
+
const following = new Date(Date.parse(period.endDate) + 86400000).toISOString().slice(0, 10);
|
|
155
|
+
if (!period.startDate.endsWith('-01') || period.startDate.slice(0, 7) !== period.endDate.slice(0, 7) || !following.endsWith('-01'))
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
if (period.kind === 'rolling-30-days') {
|
|
159
|
+
if (days !== 30 || ++rollingCount > 1)
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
else if (++historicalCount > 13)
|
|
163
|
+
return false;
|
|
164
|
+
const key = `${period.kind}:${period.startDate}:${period.endDate}`;
|
|
165
|
+
if (seen.has(key))
|
|
166
|
+
return false;
|
|
167
|
+
seen.add(key);
|
|
168
|
+
if (!isReportSpendAmounts(period.amounts, value.currency, value.generatedAt))
|
|
169
|
+
return false;
|
|
170
|
+
available || (available = hasReportSpendValue(period.amounts));
|
|
171
|
+
if (period.services !== undefined) {
|
|
172
|
+
const serviceKeys = new Set();
|
|
173
|
+
if (!isBoundedRows(period.services, REPORT_SPEND_LIMITS.servicesPerPeriod, (row) => {
|
|
174
|
+
if (!isRecord(row) ||
|
|
175
|
+
!exactFields(row, ['serviceKey', 'name', 'amounts']) ||
|
|
176
|
+
!isReportText(row.serviceKey) ||
|
|
177
|
+
!isReportText(row.name) ||
|
|
178
|
+
serviceKeys.has(row.serviceKey) ||
|
|
179
|
+
!isReportSpendAmounts(row.amounts, value.currency, value.generatedAt))
|
|
180
|
+
return false;
|
|
181
|
+
serviceKeys.add(row.serviceKey);
|
|
182
|
+
available || (available = hasReportSpendValue(row.amounts));
|
|
183
|
+
return true;
|
|
184
|
+
}))
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return available ? value.sourceObservedAt !== undefined && value.freshness !== 'unavailable' : value.freshness === 'unavailable';
|
|
189
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { REPORT_SPEND_LIMITS } from './reportSpend.js';
|
|
2
|
+
export const isReportCalendarDate = (value) => {
|
|
3
|
+
if (typeof value !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(value))
|
|
4
|
+
return false;
|
|
5
|
+
const time = Date.parse(`${value}T00:00:00.000Z`);
|
|
6
|
+
return Number.isFinite(time) && new Date(time).toISOString().slice(0, 10) === value;
|
|
7
|
+
};
|
|
8
|
+
export const isReportUtcTimestamp = (value) => typeof value === 'string' &&
|
|
9
|
+
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$/.test(value) &&
|
|
10
|
+
isReportCalendarDate(value.slice(0, 10)) &&
|
|
11
|
+
Number.isFinite(Date.parse(value)) &&
|
|
12
|
+
new Date(value).toISOString() === (value.length === 20 ? value.replace('Z', '.000Z') : value);
|
|
13
|
+
export const isReportCurrency = (value) => typeof value === 'string' && /^[A-Z]{3}$/.test(value);
|
|
14
|
+
export const isReportText = (value) => typeof value === 'string' && value.trim().length > 0 && value.length <= REPORT_SPEND_LIMITS.textLength;
|
|
15
|
+
/** Bounded exact arithmetic avoids binary floating point and pathological decimal-string input. */
|
|
16
|
+
export const reportMoneyUnits = (value) => {
|
|
17
|
+
if (typeof value !== 'string' || value.length > 25 || !/^-?(?:0|[1-9]\d{0,14})(?:\.\d{1,8})?$/.test(value))
|
|
18
|
+
return undefined;
|
|
19
|
+
const [whole, fraction = ''] = value.replace(/^-/, '').split('.');
|
|
20
|
+
const amount = BigInt(whole) * 100000000n + BigInt(fraction.padEnd(8, '0'));
|
|
21
|
+
return value.startsWith('-') ? -amount : amount;
|
|
22
|
+
};
|
|
@@ -1 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
import { isAzureProviderScopeFinancialChargeSpendBreakdownV1, } from './financialChargePolicy.js';
|
|
2
|
+
const AZURE_NATIVE_STATS_OPTIONAL_MONEY_FIELDS = [
|
|
3
|
+
'spend30Days',
|
|
4
|
+
'spend30DaysAmortized',
|
|
5
|
+
'spendPrevious30Days',
|
|
6
|
+
'spendPrevious30DaysAmortized',
|
|
7
|
+
'spend7Days',
|
|
8
|
+
'spend7DaysAmortized',
|
|
9
|
+
'spendPrevious7Days',
|
|
10
|
+
'spendPrevious7DaysAmortized',
|
|
11
|
+
'spend30DaysBillingBacked',
|
|
12
|
+
'spend30DaysAmortizedBillingBacked',
|
|
13
|
+
'spend30DaysEstimated',
|
|
14
|
+
'spend30DaysAmortizedEstimated',
|
|
15
|
+
];
|
|
16
|
+
const isFinancialStatsRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
17
|
+
/** Exact top-level validator for the dashboard Azure-native display projection. */
|
|
18
|
+
export const isAzureNativeSubscriptionFinancialStatsV1 = (value) => {
|
|
19
|
+
if (!isFinancialStatsRecord(value))
|
|
20
|
+
return false;
|
|
21
|
+
const required = ['contractVersion', 'policyRef', 'status', 'resourcesByLocation', 'resourcesByType'];
|
|
22
|
+
const allowed = new Set([...required, 'financialChargeSpend', ...AZURE_NATIVE_STATS_OPTIONAL_MONEY_FIELDS]);
|
|
23
|
+
if (!required.every(field => Object.prototype.hasOwnProperty.call(value, field)) || !Object.keys(value).every(field => allowed.has(field))) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
return (value.contractVersion === 'azure-native-subscription-financial-stats/v1' &&
|
|
27
|
+
value.policyRef === 'azure-cloud-services-excluding-marketplace/v1' &&
|
|
28
|
+
(value.status === 'complete' || value.status === 'partial') &&
|
|
29
|
+
(value.financialChargeSpend === undefined || isAzureProviderScopeFinancialChargeSpendBreakdownV1(value.financialChargeSpend)) &&
|
|
30
|
+
Array.isArray(value.resourcesByLocation) &&
|
|
31
|
+
Array.isArray(value.resourcesByType) &&
|
|
32
|
+
AZURE_NATIVE_STATS_OPTIONAL_MONEY_FIELDS.every(field => value[field] === undefined || (typeof value[field] === 'number' && Number.isFinite(value[field]))));
|
|
33
|
+
};
|
package/dist/esm/azure/views.js
CHANGED
|
@@ -116,6 +116,12 @@ const isViewArtifactDescriptor = (value, runId, runReference = runId) => isRecor
|
|
|
116
116
|
isNonNegativeSafeInteger(value.byteLength) &&
|
|
117
117
|
isSha256(value.sha256);
|
|
118
118
|
const isPublishedViewCoverage = (value) => value === 'complete' || value === 'partial';
|
|
119
|
+
const hasValidPublicProjectionContracts = (value) => value === undefined ||
|
|
120
|
+
(Array.isArray(value) &&
|
|
121
|
+
value.length > 0 &&
|
|
122
|
+
value.length <= 32 &&
|
|
123
|
+
value.every(contract => isStrictNonEmptyString(contract) && contract.length <= 128) &&
|
|
124
|
+
new Set(value).size === value.length);
|
|
119
125
|
const isProjectedSectionPathForArtifact = (value, artifactPath) => {
|
|
120
126
|
if (!isStrictNonEmptyString(value))
|
|
121
127
|
return false;
|
|
@@ -366,7 +372,8 @@ export const isPublishedViewManifestV4 = (value) => {
|
|
|
366
372
|
!isSha256(value.compositeDependencyDigest) ||
|
|
367
373
|
!isStrictCanonicalIsoTimestamp(value.completedAt) ||
|
|
368
374
|
!isArtifactPublicationDecision(value.publicationDecision) ||
|
|
369
|
-
!hasPublishedViewDecisionBounds(value.publicationDecision)
|
|
375
|
+
!hasPublishedViewDecisionBounds(value.publicationDecision) ||
|
|
376
|
+
!hasValidPublicProjectionContracts(value.publicProjectionContracts)) {
|
|
370
377
|
return false;
|
|
371
378
|
}
|
|
372
379
|
return (isPublishedDecisionForCoverage(value.publicationDecision, value.coverage) &&
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from '../aws/
|
|
2
|
-
import * as namespace from '../aws/
|
|
1
|
+
export * from '../aws/commitments-planning.js';
|
|
2
|
+
import * as namespace from '../aws/commitments-planning.js';
|
|
3
3
|
export default namespace;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { isEnvironmentDocumentDescriptorSetV1, isEnvironmentScopeV1 } from './validation.js';
|
|
2
|
+
const compareUnicodeCodePoints = (left, right) => {
|
|
3
|
+
const leftPoints = Array.from(left, character => character.codePointAt(0));
|
|
4
|
+
const rightPoints = Array.from(right, character => character.codePointAt(0));
|
|
5
|
+
const length = Math.min(leftPoints.length, rightPoints.length);
|
|
6
|
+
for (let index = 0; index < length; index += 1) {
|
|
7
|
+
const difference = leftPoints[index] - rightPoints[index];
|
|
8
|
+
if (difference !== 0)
|
|
9
|
+
return difference;
|
|
10
|
+
}
|
|
11
|
+
return leftPoints.length - rightPoints.length;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Builds the canonical scope-qualified artifact subject used inside opaque
|
|
15
|
+
* logical references. The JSON tuple is an identifier, never a storage path.
|
|
16
|
+
*/
|
|
17
|
+
export const buildEnvironmentScopeQualifiedSubjectV1 = (scope) => {
|
|
18
|
+
if (!isEnvironmentScopeV1(scope))
|
|
19
|
+
throw new TypeError('Invalid V1 environment scope.');
|
|
20
|
+
return JSON.stringify([scope.kind, scope.tenantId, scope.companyId, scope.subscriptionId]);
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Produces the exact compact UTF-8 tree-digest preimage. Hashing remains the
|
|
24
|
+
* caller's responsibility so this helper stays browser-safe.
|
|
25
|
+
*/
|
|
26
|
+
export const buildEnvironmentTreeDigestPreimageV1 = (descriptors) => {
|
|
27
|
+
if (!isEnvironmentDocumentDescriptorSetV1(descriptors)) {
|
|
28
|
+
throw new TypeError('V1 environment tree digests require each allowlisted document exactly once.');
|
|
29
|
+
}
|
|
30
|
+
const pairs = descriptors
|
|
31
|
+
.map(descriptor => [descriptor.name, descriptor.contentSha256])
|
|
32
|
+
.sort((left, right) => compareUnicodeCodePoints(left[0], right[0]));
|
|
33
|
+
return JSON.stringify(pairs);
|
|
34
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/** Single pre-release multi-pillar environment contract shared by producers and consumers. */
|
|
2
|
+
export const ENVIRONMENT_CONTRACT_LIMITS_V1 = Object.freeze({
|
|
3
|
+
completedPointerBytes: 16 * 1024,
|
|
4
|
+
projectionBytes: 256 * 1024,
|
|
5
|
+
environmentIndexBytes: 8 * 1024,
|
|
6
|
+
pillarDocumentBytes: 8 * 1024,
|
|
7
|
+
boundedListItems: 50,
|
|
8
|
+
/**
|
|
9
|
+
* Row cap for the optional structured detail sections. Deliberately far below
|
|
10
|
+
* `boundedListItems`: the core lists already consume most of the projection byte budget,
|
|
11
|
+
* and a detail section is a summary, not an inventory.
|
|
12
|
+
*/
|
|
13
|
+
sectionListItems: 10,
|
|
14
|
+
customerStringScalars: 4096,
|
|
15
|
+
safeLabelScalars: 512,
|
|
16
|
+
scopeIdentifierScalars: 2048,
|
|
17
|
+
environmentRunIdAsciiCharacters: 128,
|
|
18
|
+
sourceIdentityScalars: 256,
|
|
19
|
+
logicalReferencePayloadBytes: 4 * 1024,
|
|
20
|
+
validatedContainerDepth: 10,
|
|
21
|
+
});
|
|
22
|
+
export const ENVIRONMENT_PILLARS_V1 = ['cost', 'security', 'governance', 'reliability', 'performance', 'operations'];
|
|
23
|
+
export const ENVIRONMENT_DOCUMENT_NAMES_V1 = [
|
|
24
|
+
'projection.json',
|
|
25
|
+
'environment-index.md',
|
|
26
|
+
'pillars/cost.md',
|
|
27
|
+
'pillars/security.md',
|
|
28
|
+
'pillars/governance.md',
|
|
29
|
+
'pillars/reliability.md',
|
|
30
|
+
'pillars/performance.md',
|
|
31
|
+
'pillars/operations.md',
|
|
32
|
+
];
|
|
33
|
+
export const ENVIRONMENT_ARTIFACT_KINDS_V1 = [
|
|
34
|
+
'subscription-summary',
|
|
35
|
+
'subscription-resources',
|
|
36
|
+
'subscription-recommendations',
|
|
37
|
+
'subscription-service-retirements',
|
|
38
|
+
'subscription-monitor-alerts',
|
|
39
|
+
'subscription-data-protection',
|
|
40
|
+
'subscription-system-tracks',
|
|
41
|
+
'subscription-metrics',
|
|
42
|
+
// API-issued evidence kind: a bounded projection of one compiled `projection.json` detail section
|
|
43
|
+
// (commitments, budgets, idle resources, ...). Never emitted by the compiler as a source reference.
|
|
44
|
+
'subscription-projection',
|
|
45
|
+
'tenant-governance',
|
|
46
|
+
'tenant-governance-access',
|
|
47
|
+
'tenant-reservations',
|
|
48
|
+
'tenant-savings-plans',
|
|
49
|
+
'tenant-applications',
|
|
50
|
+
'tenant-service-principals',
|
|
51
|
+
];
|
|
52
|
+
export const ENVIRONMENT_FINDING_KINDS_V1 = [
|
|
53
|
+
'recommendation',
|
|
54
|
+
'security-posture',
|
|
55
|
+
'public-exposure',
|
|
56
|
+
'governance',
|
|
57
|
+
'compliance',
|
|
58
|
+
'service-retirement',
|
|
59
|
+
'data-protection',
|
|
60
|
+
'health',
|
|
61
|
+
'performance',
|
|
62
|
+
'scaling',
|
|
63
|
+
'operations',
|
|
64
|
+
'monitoring',
|
|
65
|
+
'topology',
|
|
66
|
+
];
|
|
67
|
+
export const ENVIRONMENT_SEVERITIES_V1 = ['critical', 'high', 'medium', 'low', 'informational', 'unknown'];
|
|
68
|
+
export const ENVIRONMENT_IMPACTS_V1 = ['high', 'medium', 'low', 'unknown'];
|
|
69
|
+
export const ENVIRONMENT_EFFORTS_V1 = ['high', 'medium', 'low', 'unknown'];
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { ENVIRONMENT_CONTRACT_LIMITS_V1 } from './contracts.js';
|
|
2
|
+
export const SHA256_PATTERN = /^[a-f0-9]{64}$/u;
|
|
3
|
+
export const ENVIRONMENT_RUN_ID_PATTERN = /^[A-Za-z0-9._-]+$/u;
|
|
4
|
+
export const DECIMAL_PATTERN = /^(?:0|[1-9]\d*)(?:\.\d+)?$/u;
|
|
5
|
+
export const CURRENCY_PATTERN = /^[A-Z]{3}$/u;
|
|
6
|
+
export const PROTOTYPE_KEYS = new Set(['__proto__', 'prototype', 'constructor']);
|
|
7
|
+
export const hasControlCharacter = (value) => {
|
|
8
|
+
for (const character of value) {
|
|
9
|
+
const codePoint = character.codePointAt(0);
|
|
10
|
+
if (codePoint <= 0x1f || (codePoint >= 0x7f && codePoint <= 0x9f))
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
return false;
|
|
14
|
+
};
|
|
15
|
+
export const isRecord = (value) => {
|
|
16
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
17
|
+
return false;
|
|
18
|
+
const prototype = Object.getPrototypeOf(value);
|
|
19
|
+
return prototype === Object.prototype || prototype === null;
|
|
20
|
+
};
|
|
21
|
+
export const hasExactKeys = (value, required, optional = []) => {
|
|
22
|
+
const allowed = new Set([...required, ...optional]);
|
|
23
|
+
const keys = Object.keys(value);
|
|
24
|
+
return required.every(key => Object.prototype.hasOwnProperty.call(value, key)) && keys.every(key => allowed.has(key) && !PROTOTYPE_KEYS.has(key));
|
|
25
|
+
};
|
|
26
|
+
const scalarLength = (value) => {
|
|
27
|
+
let count = 0;
|
|
28
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
29
|
+
const codeUnit = value.charCodeAt(index);
|
|
30
|
+
if (codeUnit >= 0xd800 && codeUnit <= 0xdbff) {
|
|
31
|
+
const trailing = value.charCodeAt(index + 1);
|
|
32
|
+
if (!(trailing >= 0xdc00 && trailing <= 0xdfff))
|
|
33
|
+
return null;
|
|
34
|
+
index += 1;
|
|
35
|
+
}
|
|
36
|
+
else if (codeUnit >= 0xdc00 && codeUnit <= 0xdfff) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
count += 1;
|
|
40
|
+
}
|
|
41
|
+
return count;
|
|
42
|
+
};
|
|
43
|
+
export const isBoundedString = (value, maximumScalars, options = {}) => {
|
|
44
|
+
if (typeof value !== 'string')
|
|
45
|
+
return false;
|
|
46
|
+
if (options.trimmed && (value.length === 0 || value.trim() !== value))
|
|
47
|
+
return false;
|
|
48
|
+
if (options.controls && hasControlCharacter(value))
|
|
49
|
+
return false;
|
|
50
|
+
const length = scalarLength(value);
|
|
51
|
+
return length !== null && length <= maximumScalars;
|
|
52
|
+
};
|
|
53
|
+
export const isCustomerString = (value) => isBoundedString(value, ENVIRONMENT_CONTRACT_LIMITS_V1.customerStringScalars, { controls: true });
|
|
54
|
+
export const isSafeLabel = (value) => isBoundedString(value, ENVIRONMENT_CONTRACT_LIMITS_V1.safeLabelScalars, { trimmed: true, controls: true });
|
|
55
|
+
export const isScopeIdentifier = (value) => isBoundedString(value, ENVIRONMENT_CONTRACT_LIMITS_V1.scopeIdentifierScalars, { trimmed: true, controls: true });
|
|
56
|
+
export const isSourceIdentity = (value) => isBoundedString(value, ENVIRONMENT_CONTRACT_LIMITS_V1.sourceIdentityScalars, { trimmed: true, controls: true });
|
|
57
|
+
export const isNonNegativeInteger = (value) => Number.isSafeInteger(value) && value >= 0;
|
|
58
|
+
export const isCanonicalUtcTimestamp = (value) => {
|
|
59
|
+
if (typeof value !== 'string' || !/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/u.test(value))
|
|
60
|
+
return false;
|
|
61
|
+
const milliseconds = Date.parse(value);
|
|
62
|
+
return Number.isFinite(milliseconds) && new Date(milliseconds).toISOString() === value;
|
|
63
|
+
};
|
|
64
|
+
export const utf8ByteLength = (value) => {
|
|
65
|
+
let bytes = 0;
|
|
66
|
+
for (const character of value) {
|
|
67
|
+
const codePoint = character.codePointAt(0);
|
|
68
|
+
if (codePoint <= 0x7f)
|
|
69
|
+
bytes += 1;
|
|
70
|
+
else if (codePoint <= 0x7ff)
|
|
71
|
+
bytes += 2;
|
|
72
|
+
else if (codePoint <= 0xffff)
|
|
73
|
+
bytes += 3;
|
|
74
|
+
else
|
|
75
|
+
bytes += 4;
|
|
76
|
+
}
|
|
77
|
+
return bytes;
|
|
78
|
+
};
|
|
79
|
+
export const hasSafeContainerShape = (value, depth = 0, seen = new Set()) => {
|
|
80
|
+
if (depth > ENVIRONMENT_CONTRACT_LIMITS_V1.validatedContainerDepth)
|
|
81
|
+
return false;
|
|
82
|
+
if (typeof value !== 'object' || value === null)
|
|
83
|
+
return true;
|
|
84
|
+
if (seen.has(value))
|
|
85
|
+
return false;
|
|
86
|
+
seen.add(value);
|
|
87
|
+
if (Array.isArray(value)) {
|
|
88
|
+
const valid = value.length <= ENVIRONMENT_CONTRACT_LIMITS_V1.boundedListItems && value.every(item => hasSafeContainerShape(item, depth + 1, seen));
|
|
89
|
+
seen.delete(value);
|
|
90
|
+
return valid;
|
|
91
|
+
}
|
|
92
|
+
if (!isRecord(value))
|
|
93
|
+
return false;
|
|
94
|
+
const valid = Object.keys(value).every(key => !PROTOTYPE_KEYS.has(key) && hasSafeContainerShape(value[key], depth + 1, seen));
|
|
95
|
+
seen.delete(value);
|
|
96
|
+
return valid;
|
|
97
|
+
};
|