@spottoai/types-package 1.0.2-dev1138.13 → 1.0.2-dev1138.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/dist/accounts/accounts.d.ts +97 -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 +147 -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 +2 -0
- package/dist/accounts/index.d.ts.map +1 -1
- package/dist/accounts/index.js +2 -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/subscriptionWriteAccess.d.ts +76 -0
- package/dist/accounts/subscriptionWriteAccess.d.ts.map +1 -0
- package/dist/accounts/subscriptionWriteAccess.js +119 -0
- package/dist/accounts/subscriptionWriteAccess.js.map +1 -0
- package/dist/accounts/validation.d.ts +24 -0
- package/dist/accounts/validation.d.ts.map +1 -1
- package/dist/accounts/writePermissions.d.ts +17 -1
- package/dist/accounts/writePermissions.d.ts.map +1 -1
- package/dist/accounts/writePermissions.js +47 -1
- package/dist/accounts/writePermissions.js.map +1 -1
- package/dist/ai/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/followUps.d.ts +16 -0
- package/dist/ai/followUps.d.ts.map +1 -0
- package/dist/ai/followUps.js +21 -0
- package/dist/ai/followUps.js.map +1 -0
- package/dist/ai/grounding.d.ts +78 -0
- package/dist/ai/grounding.d.ts.map +1 -0
- package/dist/ai/grounding.js +154 -0
- package/dist/ai/grounding.js.map +1 -0
- package/dist/ai/index.d.ts +306 -6
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +26 -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 +6 -1
- package/dist/aws/commitments-planning.d.ts.map +1 -1
- package/dist/aws/commitments-planning.js +20 -0
- package/dist/aws/commitments-planning.js.map +1 -1
- package/dist/aws/commitmentsPlanningValidation.d.ts +1 -1
- package/dist/aws/commitmentsPlanningValidation.d.ts.map +1 -1
- package/dist/aws/commitmentsPlanningValidation.js +26 -25
- package/dist/aws/commitmentsPlanningValidation.js.map +1 -1
- package/dist/aws/commitmentsPlanningView.d.ts +49 -0
- package/dist/aws/commitmentsPlanningView.d.ts.map +1 -0
- package/dist/aws/{pluginPublicArtifactEvidence.js → commitmentsPlanningView.js} +1 -1
- package/dist/aws/commitmentsPlanningView.js.map +1 -0
- package/dist/aws/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 +7 -14
- package/dist/aws/index.d.ts.map +1 -1
- package/dist/aws/index.js +7 -13
- 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 +261 -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 +229 -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 +410 -0
- package/dist/aws/portalOrganizationCommitmentsPlanningPublicArtifactValidation.js.map +1 -0
- package/dist/aws/portalOrganizationCommitmentsPlanningPublicArtifacts.d.ts +16 -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/publicArtifacts.d.ts +2 -37
- package/dist/aws/publicArtifacts.d.ts.map +1 -1
- package/dist/aws/publicArtifacts.js +3 -1
- package/dist/aws/publicArtifacts.js.map +1 -1
- package/dist/aws/relationships.d.ts +5 -3
- package/dist/aws/relationships.d.ts.map +1 -1
- package/dist/aws/relationships.js +18 -3
- package/dist/aws/relationships.js.map +1 -1
- package/dist/aws/requests.d.ts +46 -3
- package/dist/aws/requests.d.ts.map +1 -1
- package/dist/aws/requests.js +5 -3
- package/dist/aws/requests.js.map +1 -1
- package/dist/aws/resourceGraph.d.ts +14 -0
- package/dist/aws/resourceGraph.d.ts.map +1 -0
- package/dist/aws/resourceGraph.js +68 -0
- package/dist/aws/resourceGraph.js.map +1 -0
- package/dist/aws/validationHelpers.d.ts +8 -0
- package/dist/aws/validationHelpers.d.ts.map +1 -0
- package/dist/aws/validationHelpers.js +54 -0
- package/dist/aws/validationHelpers.js.map +1 -0
- package/dist/azure/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 +23 -48
- package/dist/azure/commitmentsPlanning.d.ts.map +1 -1
- package/dist/azure/commitmentsPlanning.js +9 -0
- package/dist/azure/commitmentsPlanning.js.map +1 -1
- package/dist/azure/commitmentsPlanningValidation.d.ts +18 -0
- package/dist/azure/commitmentsPlanningValidation.d.ts.map +1 -0
- package/dist/azure/commitmentsPlanningValidation.js +50 -0
- package/dist/azure/commitmentsPlanningValidation.js.map +1 -0
- package/dist/azure/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 +44 -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 +150 -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 +4 -29
- package/dist/azure/metrics.d.ts.map +1 -1
- package/dist/azure/payloads.d.ts +79 -1
- package/dist/azure/payloads.d.ts.map +1 -1
- package/dist/azure/payloads.js +87 -0
- package/dist/azure/payloads.js.map +1 -1
- package/dist/azure/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/recommendationTracks.d.ts +1 -1
- package/dist/azure/recommendationTracks.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 +796 -0
- package/dist/azure/reportEvidence.d.ts.map +1 -0
- package/dist/azure/reportEvidence.js +33 -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 +617 -0
- package/dist/azure/reportEvidenceValidation.js.map +1 -0
- package/dist/azure/reportEvidenceValidationHelpers.d.ts +14 -0
- package/dist/azure/reportEvidenceValidationHelpers.d.ts.map +1 -0
- package/dist/azure/reportEvidenceValidationHelpers.js +122 -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/resilienceFacts.d.ts +100 -0
- package/dist/azure/resilienceFacts.d.ts.map +1 -0
- package/dist/azure/resilienceFacts.js +20 -0
- package/dist/azure/resilienceFacts.js.map +1 -0
- package/dist/azure/resilienceFactsValidation.d.ts +4 -0
- package/dist/azure/resilienceFactsValidation.d.ts.map +1 -0
- package/dist/azure/resilienceFactsValidation.js +70 -0
- package/dist/azure/resilienceFactsValidation.js.map +1 -0
- package/dist/azure/resources.d.ts +24 -12
- package/dist/azure/resources.d.ts.map +1 -1
- package/dist/azure/savings.d.ts +4 -2
- package/dist/azure/savings.d.ts.map +1 -1
- package/dist/azure/serviceRetirement.d.ts +52 -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 +110 -23
- 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/boundedRows.d.ts +7 -0
- package/dist/common/boundedRows.d.ts.map +1 -0
- package/dist/{scheduler/scheduler.js → common/boundedRows.js} +1 -1
- package/dist/common/boundedRows.js.map +1 -0
- package/dist/common/index.d.ts +3 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +3 -0
- package/dist/common/index.js.map +1 -1
- package/dist/common/metricStats.d.ts +29 -0
- package/dist/common/metricStats.d.ts.map +1 -0
- package/dist/{aws/portalPublicArtifactNestedEvidence.js → common/metricStats.js} +1 -1
- package/dist/common/metricStats.js.map +1 -0
- package/dist/common/provider.d.ts +55 -0
- package/dist/common/provider.d.ts.map +1 -1
- package/dist/common/provider.js.map +1 -1
- package/dist/common/relationships.d.ts +3 -3
- package/dist/common/relationships.d.ts.map +1 -1
- package/dist/common/resourceGraph.d.ts +137 -0
- package/dist/common/resourceGraph.d.ts.map +1 -0
- package/dist/common/resourceGraph.js +17 -0
- package/dist/common/resourceGraph.js.map +1 -0
- package/dist/common/resourceGraphValidation.d.ts +30 -0
- package/dist/common/resourceGraphValidation.d.ts.map +1 -0
- package/dist/common/resourceGraphValidation.js +369 -0
- package/dist/common/resourceGraphValidation.js.map +1 -0
- package/dist/common/resourceIdentity.d.ts +28 -0
- package/dist/common/resourceIdentity.d.ts.map +1 -0
- package/dist/common/resourceIdentity.js +35 -0
- package/dist/common/resourceIdentity.js.map +1 -0
- package/dist/common/sha256.d.ts +2 -0
- package/dist/common/sha256.d.ts.map +1 -1
- package/dist/common/sha256.js +3 -0
- package/dist/common/sha256.js.map +1 -1
- package/dist/common/utilizationStories.d.ts +695 -0
- package/dist/common/utilizationStories.d.ts.map +1 -0
- package/dist/common/utilizationStories.js +21 -0
- package/dist/common/utilizationStories.js.map +1 -0
- package/dist/common/utilizationStoriesValidation.d.ts +60 -0
- package/dist/common/utilizationStoriesValidation.d.ts.map +1 -0
- package/dist/common/utilizationStoriesValidation.js +762 -0
- package/dist/common/utilizationStoriesValidation.js.map +1 -0
- package/dist/common/validationHelpers.d.ts +37 -0
- package/dist/common/validationHelpers.d.ts.map +1 -0
- package/dist/common/validationHelpers.js +147 -0
- package/dist/common/validationHelpers.js.map +1 -0
- package/dist/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 +2 -0
- package/dist/esm/accounts/subscriptionWriteAccess.js +112 -0
- package/dist/esm/accounts/writePermissions.js +46 -0
- package/dist/esm/ai/conversationHistory.js +6 -0
- package/dist/esm/ai/followUps.js +16 -0
- package/dist/esm/ai/grounding.js +147 -0
- package/dist/esm/ai/index.js +11 -1
- package/dist/esm/ai/workspaceArtifacts.js +158 -0
- package/dist/esm/aws/commitments-planning.js +6 -0
- package/dist/esm/aws/commitmentsPlanningValidation.js +2 -1
- package/dist/esm/aws/estates.js +7 -1
- package/dist/esm/aws/index.js +7 -13
- package/dist/esm/aws/organizationCommitments.js +48 -0
- package/dist/esm/aws/organizationCommitmentsApiValidation.js +220 -0
- package/dist/esm/aws/organizationCommitmentsValidation.js +225 -0
- package/dist/esm/aws/portalOrganizationCommitmentsPlanningPublicArtifactValidation.js +405 -0
- package/dist/esm/aws/portalOrganizationCommitmentsPlanningPublicArtifacts.js +2 -0
- package/dist/esm/aws/publicArtifacts.js +2 -0
- package/dist/esm/aws/relationships.js +4 -1
- package/dist/esm/aws/requests.js +4 -2
- package/dist/esm/aws/resourceGraph.js +63 -0
- package/dist/esm/aws/validationHelpers.js +46 -0
- package/dist/esm/azure/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/commitmentsPlanning.js +8 -1
- package/dist/esm/azure/commitmentsPlanningValidation.js +39 -0
- 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/payloads.js +84 -1
- 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 +29 -0
- package/dist/esm/azure/reportEvidenceCatalogueValidation.js +103 -0
- package/dist/esm/azure/reportEvidenceValidation.js +609 -0
- package/dist/esm/azure/reportEvidenceValidationHelpers.js +94 -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/resilienceFacts.js +16 -0
- package/dist/esm/azure/resilienceFactsValidation.js +64 -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/common/index.js +3 -0
- package/dist/esm/common/resourceGraph.js +13 -0
- package/dist/esm/common/resourceGraphValidation.js +365 -0
- package/dist/esm/common/resourceIdentity.js +24 -0
- package/dist/esm/common/sha256.js +2 -0
- package/dist/esm/common/utilizationStories.js +17 -0
- package/dist/esm/common/utilizationStoriesValidation.js +718 -0
- package/dist/esm/common/validationHelpers.js +115 -0
- package/dist/esm/entries/commitments-planning.js +2 -2
- package/dist/esm/entries/environment.js +3 -0
- package/dist/esm/entries/relationships.js +2 -2
- 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/index.js +18 -0
- package/dist/esm/index.vite.js +12 -0
- package/dist/esm/reporting/jobs/index.js +13 -0
- package/dist/esm/reporting/jobs/reportJobIdentity.js +76 -0
- package/dist/esm/reporting/jobs/reportJobMessages.js +47 -0
- package/dist/esm/reporting/jobs/reportJobRow.js +264 -0
- package/dist/esm/reporting/jobs/reportJobSpec.js +295 -0
- package/dist/esm/reporting/jobs/reportJobStatus.js +87 -0
- package/dist/esm/reporting/shared/reportTableEntities.js +41 -0
- package/dist/esm/reporting/shared/reportingDigest.js +57 -0
- package/dist/esm/reporting/shared/reportingIds.js +88 -0
- package/dist/esm/reporting/shared/reportingPaths.js +23 -0
- package/dist/esm/scheduler/index.js +4 -1
- package/dist/esm/scheduler/resourceStrategy.js +2 -0
- package/dist/esm/scheduler/resourceStrategyCapabilityValidation.js +265 -0
- package/dist/esm/scheduler/resourceStrategyContracts.js +20 -0
- package/dist/esm/scheduler/resourceStrategyFinancialValidation.js +145 -0
- package/dist/esm/scheduler/resourceStrategyPermissionValidation.js +190 -0
- package/dist/esm/scheduler/resourceStrategyScheduleValidation.js +506 -0
- package/dist/esm/scheduler/resourceStrategyValidation.js +4 -0
- package/dist/esm/scheduler/resourceStrategyValidationShared.js +261 -0
- package/dist/esm/scheduler/schedulerContracts.js +1 -0
- package/dist/esm/scheduler/schedulerValidation.js +372 -0
- package/dist/esm/scheduler/weeklyAvailabilityFixtures.js +140 -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/{aws/portalRelationshipResourceNodeTypes.js → identity/microsoftSignInAdminConsent.js} +1 -1
- package/dist/identity/microsoftSignInAdminConsent.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -1
- package/dist/index.vite.d.ts +12 -0
- package/dist/index.vite.d.ts.map +1 -1
- package/dist/index.vite.js +16 -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/reporting/jobs/index.d.ts +14 -0
- package/dist/reporting/jobs/index.d.ts.map +1 -0
- package/dist/reporting/jobs/index.js +45 -0
- package/dist/reporting/jobs/index.js.map +1 -0
- package/dist/reporting/jobs/reportJobIdentity.d.ts +44 -0
- package/dist/reporting/jobs/reportJobIdentity.d.ts.map +1 -0
- package/dist/reporting/jobs/reportJobIdentity.js +88 -0
- package/dist/reporting/jobs/reportJobIdentity.js.map +1 -0
- package/dist/reporting/jobs/reportJobMessages.d.ts +30 -0
- package/dist/reporting/jobs/reportJobMessages.d.ts.map +1 -0
- package/dist/reporting/jobs/reportJobMessages.js +54 -0
- package/dist/reporting/jobs/reportJobMessages.js.map +1 -0
- package/dist/reporting/jobs/reportJobRow.d.ts +98 -0
- package/dist/reporting/jobs/reportJobRow.d.ts.map +1 -0
- package/dist/reporting/jobs/reportJobRow.js +270 -0
- package/dist/reporting/jobs/reportJobRow.js.map +1 -0
- package/dist/reporting/jobs/reportJobSpec.d.ts +92 -0
- package/dist/reporting/jobs/reportJobSpec.d.ts.map +1 -0
- package/dist/reporting/jobs/reportJobSpec.js +304 -0
- package/dist/reporting/jobs/reportJobSpec.js.map +1 -0
- package/dist/reporting/jobs/reportJobStatus.d.ts +60 -0
- package/dist/reporting/jobs/reportJobStatus.d.ts.map +1 -0
- package/dist/reporting/jobs/reportJobStatus.js +98 -0
- package/dist/reporting/jobs/reportJobStatus.js.map +1 -0
- package/dist/reporting/shared/reportTableEntities.d.ts +23 -0
- package/dist/reporting/shared/reportTableEntities.d.ts.map +1 -0
- package/dist/reporting/shared/reportTableEntities.js +47 -0
- package/dist/reporting/shared/reportTableEntities.js.map +1 -0
- package/dist/reporting/shared/reportingDigest.d.ts +6 -0
- package/dist/reporting/shared/reportingDigest.d.ts.map +1 -0
- package/dist/reporting/shared/reportingDigest.js +63 -0
- package/dist/reporting/shared/reportingDigest.js.map +1 -0
- package/dist/reporting/shared/reportingIds.d.ts +34 -0
- package/dist/reporting/shared/reportingIds.d.ts.map +1 -0
- package/dist/reporting/shared/reportingIds.js +102 -0
- package/dist/reporting/shared/reportingIds.js.map +1 -0
- package/dist/reporting/shared/reportingPaths.d.ts +14 -0
- package/dist/reporting/shared/reportingPaths.d.ts.map +1 -0
- package/dist/reporting/shared/reportingPaths.js +29 -0
- package/dist/reporting/shared/reportingPaths.js.map +1 -0
- package/dist/scheduler/index.d.ts +4 -1
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js +4 -1
- package/dist/scheduler/index.js.map +1 -1
- package/dist/scheduler/resourceStrategy.d.ts +3 -0
- package/dist/scheduler/resourceStrategy.d.ts.map +1 -0
- package/dist/scheduler/resourceStrategy.js +19 -0
- package/dist/scheduler/resourceStrategy.js.map +1 -0
- package/dist/scheduler/resourceStrategyCapabilityValidation.d.ts +4 -0
- package/dist/scheduler/resourceStrategyCapabilityValidation.d.ts.map +1 -0
- package/dist/scheduler/resourceStrategyCapabilityValidation.js +270 -0
- package/dist/scheduler/resourceStrategyCapabilityValidation.js.map +1 -0
- package/dist/scheduler/resourceStrategyContracts.d.ts +466 -0
- package/dist/scheduler/resourceStrategyContracts.d.ts.map +1 -0
- package/dist/scheduler/resourceStrategyContracts.js +24 -0
- package/dist/scheduler/resourceStrategyContracts.js.map +1 -0
- package/dist/scheduler/resourceStrategyFinancialValidation.d.ts +5 -0
- package/dist/scheduler/resourceStrategyFinancialValidation.d.ts.map +1 -0
- package/dist/scheduler/resourceStrategyFinancialValidation.js +151 -0
- package/dist/scheduler/resourceStrategyFinancialValidation.js.map +1 -0
- package/dist/scheduler/resourceStrategyPermissionValidation.d.ts +4 -0
- package/dist/scheduler/resourceStrategyPermissionValidation.d.ts.map +1 -0
- package/dist/scheduler/resourceStrategyPermissionValidation.js +195 -0
- package/dist/scheduler/resourceStrategyPermissionValidation.js.map +1 -0
- package/dist/scheduler/resourceStrategyScheduleValidation.d.ts +14 -0
- package/dist/scheduler/resourceStrategyScheduleValidation.d.ts.map +1 -0
- package/dist/scheduler/resourceStrategyScheduleValidation.js +519 -0
- package/dist/scheduler/resourceStrategyScheduleValidation.js.map +1 -0
- package/dist/scheduler/resourceStrategyValidation.d.ts +5 -0
- package/dist/scheduler/resourceStrategyValidation.d.ts.map +1 -0
- package/dist/scheduler/resourceStrategyValidation.js +21 -0
- package/dist/scheduler/resourceStrategyValidation.js.map +1 -0
- package/dist/scheduler/resourceStrategyValidationShared.d.ts +19 -0
- package/dist/scheduler/resourceStrategyValidationShared.d.ts.map +1 -0
- package/dist/scheduler/resourceStrategyValidationShared.js +281 -0
- package/dist/scheduler/resourceStrategyValidationShared.js.map +1 -0
- package/dist/scheduler/schedulerContracts.d.ts +184 -0
- package/dist/scheduler/schedulerContracts.d.ts.map +1 -0
- package/dist/scheduler/schedulerContracts.js +3 -0
- package/dist/scheduler/schedulerContracts.js.map +1 -0
- package/dist/scheduler/schedulerValidation.d.ts +15 -0
- package/dist/scheduler/schedulerValidation.d.ts.map +1 -0
- package/dist/scheduler/schedulerValidation.js +388 -0
- package/dist/scheduler/schedulerValidation.js.map +1 -0
- package/dist/scheduler/weeklyAvailabilityFixtures.d.ts +26 -0
- package/dist/scheduler/weeklyAvailabilityFixtures.d.ts.map +1 -0
- package/dist/scheduler/weeklyAvailabilityFixtures.js +144 -0
- package/dist/scheduler/weeklyAvailabilityFixtures.js.map +1 -0
- package/package.json +43 -7
- package/dist/aws/pluginPublicArtifactBodyValidation.d.ts +0 -10
- package/dist/aws/pluginPublicArtifactBodyValidation.d.ts.map +0 -1
- package/dist/aws/pluginPublicArtifactBodyValidation.js +0 -225
- package/dist/aws/pluginPublicArtifactBodyValidation.js.map +0 -1
- package/dist/aws/pluginPublicArtifactEvidence.d.ts +0 -161
- package/dist/aws/pluginPublicArtifactEvidence.d.ts.map +0 -1
- package/dist/aws/pluginPublicArtifactEvidence.js.map +0 -1
- package/dist/aws/pluginPublicArtifactManifestValidation.d.ts +0 -4
- package/dist/aws/pluginPublicArtifactManifestValidation.d.ts.map +0 -1
- package/dist/aws/pluginPublicArtifactManifestValidation.js +0 -259
- package/dist/aws/pluginPublicArtifactManifestValidation.js.map +0 -1
- package/dist/aws/pluginPublicArtifactSectionValidation.d.ts +0 -6
- package/dist/aws/pluginPublicArtifactSectionValidation.d.ts.map +0 -1
- package/dist/aws/pluginPublicArtifactSectionValidation.js +0 -471
- package/dist/aws/pluginPublicArtifactSectionValidation.js.map +0 -1
- package/dist/aws/pluginPublicArtifactValidation.d.ts +0 -3
- package/dist/aws/pluginPublicArtifactValidation.d.ts.map +0 -1
- package/dist/aws/pluginPublicArtifactValidation.js +0 -9
- package/dist/aws/pluginPublicArtifactValidation.js.map +0 -1
- package/dist/aws/pluginPublicArtifactValidationHelpers.d.ts +0 -23
- package/dist/aws/pluginPublicArtifactValidationHelpers.d.ts.map +0 -1
- package/dist/aws/pluginPublicArtifactValidationHelpers.js +0 -240
- package/dist/aws/pluginPublicArtifactValidationHelpers.js.map +0 -1
- package/dist/aws/pluginPublicArtifacts.d.ts +0 -253
- package/dist/aws/pluginPublicArtifacts.d.ts.map +0 -1
- package/dist/aws/pluginPublicArtifacts.js +0 -51
- package/dist/aws/pluginPublicArtifacts.js.map +0 -1
- package/dist/aws/portalCommitmentsPlanningPublicArtifactValidation.d.ts +0 -4
- package/dist/aws/portalCommitmentsPlanningPublicArtifactValidation.d.ts.map +0 -1
- package/dist/aws/portalCommitmentsPlanningPublicArtifactValidation.js +0 -513
- package/dist/aws/portalCommitmentsPlanningPublicArtifactValidation.js.map +0 -1
- package/dist/aws/portalCommitmentsPlanningPublicArtifacts.d.ts +0 -13
- package/dist/aws/portalCommitmentsPlanningPublicArtifacts.d.ts.map +0 -1
- package/dist/aws/portalCommitmentsPlanningPublicArtifacts.js +0 -5
- package/dist/aws/portalCommitmentsPlanningPublicArtifacts.js.map +0 -1
- package/dist/aws/portalPublicArtifactCurrentValidation.d.ts +0 -4
- package/dist/aws/portalPublicArtifactCurrentValidation.d.ts.map +0 -1
- package/dist/aws/portalPublicArtifactCurrentValidation.js +0 -333
- package/dist/aws/portalPublicArtifactCurrentValidation.js.map +0 -1
- package/dist/aws/portalPublicArtifactEvidenceValidation.d.ts +0 -6
- package/dist/aws/portalPublicArtifactEvidenceValidation.d.ts.map +0 -1
- package/dist/aws/portalPublicArtifactEvidenceValidation.js +0 -301
- package/dist/aws/portalPublicArtifactEvidenceValidation.js.map +0 -1
- package/dist/aws/portalPublicArtifactHistoryAiValidation.d.ts +0 -8
- package/dist/aws/portalPublicArtifactHistoryAiValidation.d.ts.map +0 -1
- package/dist/aws/portalPublicArtifactHistoryAiValidation.js +0 -377
- package/dist/aws/portalPublicArtifactHistoryAiValidation.js.map +0 -1
- package/dist/aws/portalPublicArtifactHistoryTypes.d.ts +0 -178
- package/dist/aws/portalPublicArtifactHistoryTypes.d.ts.map +0 -1
- package/dist/aws/portalPublicArtifactHistoryTypes.js +0 -44
- package/dist/aws/portalPublicArtifactHistoryTypes.js.map +0 -1
- package/dist/aws/portalPublicArtifactNestedEvidence.d.ts +0 -127
- package/dist/aws/portalPublicArtifactNestedEvidence.d.ts.map +0 -1
- package/dist/aws/portalPublicArtifactNestedEvidence.js.map +0 -1
- package/dist/aws/portalPublicArtifactNestedEvidenceValidation.d.ts +0 -6
- package/dist/aws/portalPublicArtifactNestedEvidenceValidation.d.ts.map +0 -1
- package/dist/aws/portalPublicArtifactNestedEvidenceValidation.js +0 -405
- package/dist/aws/portalPublicArtifactNestedEvidenceValidation.js.map +0 -1
- package/dist/aws/portalPublicArtifactValidation.d.ts +0 -3
- package/dist/aws/portalPublicArtifactValidation.d.ts.map +0 -1
- package/dist/aws/portalPublicArtifactValidation.js +0 -14
- package/dist/aws/portalPublicArtifactValidation.js.map +0 -1
- package/dist/aws/portalPublicArtifactValidationCommon.d.ts +0 -30
- package/dist/aws/portalPublicArtifactValidationCommon.d.ts.map +0 -1
- package/dist/aws/portalPublicArtifactValidationCommon.js +0 -167
- package/dist/aws/portalPublicArtifactValidationCommon.js.map +0 -1
- package/dist/aws/portalPublicArtifacts.d.ts +0 -400
- package/dist/aws/portalPublicArtifacts.d.ts.map +0 -1
- package/dist/aws/portalPublicArtifacts.js +0 -85
- package/dist/aws/portalPublicArtifacts.js.map +0 -1
- package/dist/aws/portalRelationshipPublicArtifactValidation.d.ts +0 -4
- package/dist/aws/portalRelationshipPublicArtifactValidation.d.ts.map +0 -1
- package/dist/aws/portalRelationshipPublicArtifactValidation.js +0 -338
- package/dist/aws/portalRelationshipPublicArtifactValidation.js.map +0 -1
- package/dist/aws/portalRelationshipPublicArtifacts.d.ts +0 -196
- package/dist/aws/portalRelationshipPublicArtifacts.d.ts.map +0 -1
- package/dist/aws/portalRelationshipPublicArtifacts.js +0 -63
- package/dist/aws/portalRelationshipPublicArtifacts.js.map +0 -1
- package/dist/aws/portalRelationshipResourceNodeTypes.d.ts +0 -269
- package/dist/aws/portalRelationshipResourceNodeTypes.d.ts.map +0 -1
- package/dist/aws/portalRelationshipResourceNodeTypes.js.map +0 -1
- package/dist/aws/portalRelationshipResourceNodeValidation.d.ts +0 -2
- package/dist/aws/portalRelationshipResourceNodeValidation.d.ts.map +0 -1
- package/dist/aws/portalRelationshipResourceNodeValidation.js +0 -372
- package/dist/aws/portalRelationshipResourceNodeValidation.js.map +0 -1
- package/dist/esm/aws/pluginPublicArtifactBodyValidation.js +0 -217
- package/dist/esm/aws/pluginPublicArtifactManifestValidation.js +0 -255
- package/dist/esm/aws/pluginPublicArtifactSectionValidation.js +0 -464
- package/dist/esm/aws/pluginPublicArtifactValidation.js +0 -2
- package/dist/esm/aws/pluginPublicArtifactValidationHelpers.js +0 -216
- package/dist/esm/aws/pluginPublicArtifacts.js +0 -44
- package/dist/esm/aws/portalCommitmentsPlanningPublicArtifactValidation.js +0 -509
- package/dist/esm/aws/portalCommitmentsPlanningPublicArtifacts.js +0 -1
- package/dist/esm/aws/portalPublicArtifactCurrentValidation.js +0 -328
- package/dist/esm/aws/portalPublicArtifactEvidenceValidation.js +0 -294
- package/dist/esm/aws/portalPublicArtifactHistoryAiValidation.js +0 -368
- package/dist/esm/aws/portalPublicArtifactHistoryTypes.js +0 -40
- package/dist/esm/aws/portalPublicArtifactNestedEvidenceValidation.js +0 -397
- package/dist/esm/aws/portalPublicArtifactValidation.js +0 -2
- package/dist/esm/aws/portalPublicArtifactValidationCommon.js +0 -139
- package/dist/esm/aws/portalPublicArtifacts.js +0 -73
- package/dist/esm/aws/portalRelationshipPublicArtifactValidation.js +0 -334
- package/dist/esm/aws/portalRelationshipPublicArtifacts.js +0 -59
- package/dist/esm/aws/portalRelationshipResourceNodeValidation.js +0 -368
- package/dist/scheduler/scheduler.d.ts +0 -263
- package/dist/scheduler/scheduler.d.ts.map +0 -1
- package/dist/scheduler/scheduler.js.map +0 -1
- /package/dist/esm/aws/{pluginPublicArtifactEvidence.js → commitmentsPlanningView.js} +0 -0
- /package/dist/esm/{aws/portalPublicArtifactNestedEvidence.js → common/boundedRows.js} +0 -0
- /package/dist/esm/{aws/portalRelationshipResourceNodeTypes.js → common/metricStats.js} +0 -0
- /package/dist/esm/{scheduler/scheduler.js → identity/microsoftSignInAdminConsent.js} +0 -0
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The background report request (`ReportJobSpecV1`), stored as `requestJson` on the `reportjobs` row
|
|
3
|
+
* (core/specs/reporting/reporting-scheduler.md, "Request spec"; types-package/specs/reporting/reporting-scheduler-types.md).
|
|
4
|
+
*
|
|
5
|
+
* Parsing is strict (unknown fields fail) and normalising: subscription IDs are lower-cased, de-duplicated and
|
|
6
|
+
* sorted, so equal requests serialise to the same canonical JSON.
|
|
7
|
+
*/
|
|
8
|
+
import { hasExactlyKeys, isBoundedPlainText, isCalendarDate, isPlainRecord, isReportEntityId, isReportGuid, utf8ByteLength, } from '../shared/reportingIds.js';
|
|
9
|
+
export const REPORT_JOB_SPEC_SCHEMA_VERSION = 1;
|
|
10
|
+
export const REPORT_JOB_REPORT_TYPES = ['sdm', 'architecture-assessment'];
|
|
11
|
+
export const REPORT_JOB_MAX_SUBSCRIPTIONS = 200;
|
|
12
|
+
export const REPORT_JOB_MAX_CLOUD_ACCOUNTS = 20;
|
|
13
|
+
export const REPORT_JOB_MAX_SERVICE_IDS = 20;
|
|
14
|
+
export const REPORT_JOB_MAX_EXPLICIT_PERIOD_DAYS = 366;
|
|
15
|
+
/** Maximum UTF-8 size of the canonical `requestJson`. */
|
|
16
|
+
export const REPORT_JOB_SPEC_MAX_BYTES = 32 * 1024;
|
|
17
|
+
export const SDM_BACKGROUND_LAYOUTS = ['spotto-layout', 'monthly-insights'];
|
|
18
|
+
export const SDM_BACKGROUND_DETAIL_ROW_LIMITS = [10, 25, 50, 'all'];
|
|
19
|
+
export const CURRENT_STATE_AUDIENCES = ['customer', 'internal'];
|
|
20
|
+
export const CURRENT_STATE_SECTION_KEYS = ['costOpportunities', 'securityPosture', 'reliabilityAvailability', 'quickWins', 'roadmap'];
|
|
21
|
+
const SERVICE_ID_PATTERN = /^[a-z][a-z0-9_]{0,63}$/;
|
|
22
|
+
const CURRENCY_PATTERN = /^[A-Z]{3}$/;
|
|
23
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
24
|
+
export const isReportJobReportType = (value) => typeof value === 'string' && REPORT_JOB_REPORT_TYPES.includes(value);
|
|
25
|
+
/**
|
|
26
|
+
* Lower-cases, de-duplicates and sorts subscription IDs. Lower case is Spotto's canonical subscription ID form: the
|
|
27
|
+
* request and the scope hash use it, and so do the storage keys and paths reportworker builds from it.
|
|
28
|
+
*/
|
|
29
|
+
export const normalizeReportSubscriptionIds = (subscriptionIds) => Array.from(new Set(subscriptionIds.map(id => id.trim().toLowerCase()))).sort();
|
|
30
|
+
const parseScope = (value, errors) => {
|
|
31
|
+
if (!isPlainRecord(value) || !hasExactlyKeys(value, ['cloudAccountIds', 'subscriptionIds'])) {
|
|
32
|
+
errors.push('scope: must contain exactly cloudAccountIds and subscriptionIds');
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
const { cloudAccountIds, subscriptionIds } = value;
|
|
36
|
+
let valid = true;
|
|
37
|
+
if (!Array.isArray(cloudAccountIds) || cloudAccountIds.length === 0) {
|
|
38
|
+
errors.push('scope.cloudAccountIds: at least one cloud account is required');
|
|
39
|
+
valid = false;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
cloudAccountIds.forEach((id, index) => {
|
|
43
|
+
if (!isReportEntityId(id)) {
|
|
44
|
+
errors.push(`scope.cloudAccountIds[${index}]: invalid cloud account ID`);
|
|
45
|
+
valid = false;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
if (!Array.isArray(subscriptionIds) || subscriptionIds.length === 0) {
|
|
50
|
+
errors.push('scope.subscriptionIds: at least one subscription is required');
|
|
51
|
+
valid = false;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
subscriptionIds.forEach((id, index) => {
|
|
55
|
+
if (typeof id !== 'string' || !isReportGuid(id.trim())) {
|
|
56
|
+
errors.push(`scope.subscriptionIds[${index}]: invalid subscription ID`);
|
|
57
|
+
valid = false;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
if (!valid)
|
|
62
|
+
return undefined;
|
|
63
|
+
const normalizedAccounts = Array.from(new Set(cloudAccountIds)).sort();
|
|
64
|
+
const normalizedSubscriptions = normalizeReportSubscriptionIds(subscriptionIds);
|
|
65
|
+
if (normalizedAccounts.length > REPORT_JOB_MAX_CLOUD_ACCOUNTS) {
|
|
66
|
+
errors.push(`scope.cloudAccountIds: at most ${REPORT_JOB_MAX_CLOUD_ACCOUNTS} cloud accounts`);
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
if (normalizedSubscriptions.length > REPORT_JOB_MAX_SUBSCRIPTIONS) {
|
|
70
|
+
errors.push(`scope.subscriptionIds: at most ${REPORT_JOB_MAX_SUBSCRIPTIONS} subscriptions`);
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
return { cloudAccountIds: normalizedAccounts, subscriptionIds: normalizedSubscriptions };
|
|
74
|
+
};
|
|
75
|
+
const parsePeriod = (value, errors) => {
|
|
76
|
+
if (!isPlainRecord(value)) {
|
|
77
|
+
errors.push('period: must be an object');
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
if (value.kind === 'previous-calendar-month' || value.kind === 'previous-calendar-quarter') {
|
|
81
|
+
if (!hasExactlyKeys(value, ['kind'])) {
|
|
82
|
+
errors.push('period: a period rule has no other fields');
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
return { kind: value.kind };
|
|
86
|
+
}
|
|
87
|
+
if (value.kind === 'explicit') {
|
|
88
|
+
if (!hasExactlyKeys(value, ['kind', 'startDate', 'endDate']) || !isCalendarDate(value.startDate) || !isCalendarDate(value.endDate)) {
|
|
89
|
+
errors.push('period: explicit periods need startDate and endDate as YYYY-MM-DD');
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
const days = (Date.parse(`${value.endDate}T00:00:00.000Z`) - Date.parse(`${value.startDate}T00:00:00.000Z`)) / DAY_MS + 1;
|
|
93
|
+
if (days < 1 || days > REPORT_JOB_MAX_EXPLICIT_PERIOD_DAYS) {
|
|
94
|
+
errors.push(`period: startDate must not be after endDate and the period must be at most ${REPORT_JOB_MAX_EXPLICIT_PERIOD_DAYS} days`);
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
return { kind: 'explicit', startDate: value.startDate, endDate: value.endDate };
|
|
98
|
+
}
|
|
99
|
+
errors.push('period.kind: must be previous-calendar-month, previous-calendar-quarter or explicit');
|
|
100
|
+
return undefined;
|
|
101
|
+
};
|
|
102
|
+
const parseSdmConfiguration = (value, errors) => {
|
|
103
|
+
if (!isPlainRecord(value) || !hasExactlyKeys(value, ['layout', 'cloudIqServiceProfile'])) {
|
|
104
|
+
errors.push('configuration: SDM needs exactly layout and cloudIqServiceProfile');
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
const { layout, cloudIqServiceProfile: profile } = value;
|
|
108
|
+
let valid = true;
|
|
109
|
+
if (typeof layout !== 'string' || !SDM_BACKGROUND_LAYOUTS.includes(layout)) {
|
|
110
|
+
errors.push('configuration.layout: must be spotto-layout or monthly-insights');
|
|
111
|
+
valid = false;
|
|
112
|
+
}
|
|
113
|
+
if (!isPlainRecord(profile) || !hasExactlyKeys(profile, ['selectedServiceIds'], ['detailRowLimit'])) {
|
|
114
|
+
errors.push('configuration.cloudIqServiceProfile: needs selectedServiceIds and optionally detailRowLimit');
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
const { selectedServiceIds, detailRowLimit } = profile;
|
|
118
|
+
if (!Array.isArray(selectedServiceIds) ||
|
|
119
|
+
selectedServiceIds.length > REPORT_JOB_MAX_SERVICE_IDS ||
|
|
120
|
+
!selectedServiceIds.every(id => typeof id === 'string' && SERVICE_ID_PATTERN.test(id)) ||
|
|
121
|
+
new Set(selectedServiceIds).size !== selectedServiceIds.length) {
|
|
122
|
+
errors.push(`configuration.cloudIqServiceProfile.selectedServiceIds: up to ${REPORT_JOB_MAX_SERVICE_IDS} unique service IDs`);
|
|
123
|
+
valid = false;
|
|
124
|
+
}
|
|
125
|
+
if (detailRowLimit !== undefined && !SDM_BACKGROUND_DETAIL_ROW_LIMITS.includes(detailRowLimit)) {
|
|
126
|
+
errors.push('configuration.cloudIqServiceProfile.detailRowLimit: must be 10, 25, 50 or all');
|
|
127
|
+
valid = false;
|
|
128
|
+
}
|
|
129
|
+
if (!valid)
|
|
130
|
+
return undefined;
|
|
131
|
+
return {
|
|
132
|
+
layout: layout,
|
|
133
|
+
cloudIqServiceProfile: {
|
|
134
|
+
selectedServiceIds: [...selectedServiceIds],
|
|
135
|
+
...(detailRowLimit === undefined ? {} : { detailRowLimit: detailRowLimit }),
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
const parseCurrentStateConfiguration = (value, errors) => {
|
|
140
|
+
if (!isPlainRecord(value) || !hasExactlyKeys(value, ['audience', 'sections', 'scopeCurrencyCode'], ['preparedBy'])) {
|
|
141
|
+
errors.push('configuration: Current State needs audience, sections, scopeCurrencyCode and optionally preparedBy');
|
|
142
|
+
return undefined;
|
|
143
|
+
}
|
|
144
|
+
const { audience, sections, scopeCurrencyCode, preparedBy } = value;
|
|
145
|
+
let valid = true;
|
|
146
|
+
if (typeof audience !== 'string' || !CURRENT_STATE_AUDIENCES.includes(audience)) {
|
|
147
|
+
errors.push('configuration.audience: must be customer or internal');
|
|
148
|
+
valid = false;
|
|
149
|
+
}
|
|
150
|
+
if (!isPlainRecord(sections) ||
|
|
151
|
+
!hasExactlyKeys(sections, CURRENT_STATE_SECTION_KEYS) ||
|
|
152
|
+
!CURRENT_STATE_SECTION_KEYS.every(key => typeof sections[key] === 'boolean')) {
|
|
153
|
+
errors.push(`configuration.sections: needs exactly ${CURRENT_STATE_SECTION_KEYS.join(', ')} as booleans`);
|
|
154
|
+
valid = false;
|
|
155
|
+
}
|
|
156
|
+
const currency = typeof scopeCurrencyCode === 'string' ? scopeCurrencyCode.trim().toUpperCase() : '';
|
|
157
|
+
if (!CURRENCY_PATTERN.test(currency)) {
|
|
158
|
+
errors.push('configuration.scopeCurrencyCode: must be a three-letter ISO 4217 code');
|
|
159
|
+
valid = false;
|
|
160
|
+
}
|
|
161
|
+
const preparedByText = typeof preparedBy === 'string' ? preparedBy.trim() : preparedBy;
|
|
162
|
+
if (preparedByText !== undefined && (!isBoundedPlainText(preparedByText, 120) || preparedByText.includes('://'))) {
|
|
163
|
+
errors.push('configuration.preparedBy: 1..120 characters of plain text, no URLs');
|
|
164
|
+
valid = false;
|
|
165
|
+
}
|
|
166
|
+
if (!valid)
|
|
167
|
+
return undefined;
|
|
168
|
+
const sectionRecord = sections;
|
|
169
|
+
return {
|
|
170
|
+
audience: audience,
|
|
171
|
+
sections: {
|
|
172
|
+
costOpportunities: sectionRecord.costOpportunities,
|
|
173
|
+
securityPosture: sectionRecord.securityPosture,
|
|
174
|
+
reliabilityAvailability: sectionRecord.reliabilityAvailability,
|
|
175
|
+
quickWins: sectionRecord.quickWins,
|
|
176
|
+
roadmap: sectionRecord.roadmap,
|
|
177
|
+
},
|
|
178
|
+
scopeCurrencyCode: currency,
|
|
179
|
+
...(preparedByText === undefined ? {} : { preparedBy: preparedByText }),
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
const parseSpecUnsafe = (input) => {
|
|
183
|
+
const errors = [];
|
|
184
|
+
if (!isPlainRecord(input))
|
|
185
|
+
return { ok: false, errors: ['spec: must be an object'] };
|
|
186
|
+
if (input.schemaVersion !== REPORT_JOB_SPEC_SCHEMA_VERSION)
|
|
187
|
+
return { ok: false, errors: ['schemaVersion: must be 1'] };
|
|
188
|
+
if (input.reportType === 'sdm') {
|
|
189
|
+
if (!hasExactlyKeys(input, ['schemaVersion', 'reportType', 'scope', 'period', 'configuration'])) {
|
|
190
|
+
return { ok: false, errors: ['spec: SDM needs exactly schemaVersion, reportType, scope, period and configuration'] };
|
|
191
|
+
}
|
|
192
|
+
const scope = parseScope(input.scope, errors);
|
|
193
|
+
const period = parsePeriod(input.period, errors);
|
|
194
|
+
const configuration = parseSdmConfiguration(input.configuration, errors);
|
|
195
|
+
if (!scope || !period || !configuration || errors.length > 0)
|
|
196
|
+
return { ok: false, errors };
|
|
197
|
+
return { ok: true, value: { schemaVersion: 1, reportType: 'sdm', scope, period, configuration } };
|
|
198
|
+
}
|
|
199
|
+
if (input.reportType === 'architecture-assessment') {
|
|
200
|
+
if (!hasExactlyKeys(input, ['schemaVersion', 'reportType', 'scope', 'configuration'])) {
|
|
201
|
+
return { ok: false, errors: ['spec: Current State needs exactly schemaVersion, reportType, scope and configuration (no period)'] };
|
|
202
|
+
}
|
|
203
|
+
const scope = parseScope(input.scope, errors);
|
|
204
|
+
const configuration = parseCurrentStateConfiguration(input.configuration, errors);
|
|
205
|
+
if (!scope || !configuration || errors.length > 0)
|
|
206
|
+
return { ok: false, errors };
|
|
207
|
+
return { ok: true, value: { schemaVersion: 1, reportType: 'architecture-assessment', scope, configuration } };
|
|
208
|
+
}
|
|
209
|
+
return { ok: false, errors: ['reportType: must be sdm or architecture-assessment'] };
|
|
210
|
+
};
|
|
211
|
+
/** Strict, normalising parser. Never throws (hostile getters are reported as an invalid spec). */
|
|
212
|
+
export const parseReportJobSpecV1 = (input) => {
|
|
213
|
+
try {
|
|
214
|
+
return parseSpecUnsafe(input);
|
|
215
|
+
}
|
|
216
|
+
catch {
|
|
217
|
+
return { ok: false, errors: ['spec: unreadable'] };
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
const canonicalSpecObject = (spec) => {
|
|
221
|
+
const scope = { cloudAccountIds: spec.scope.cloudAccountIds, subscriptionIds: spec.scope.subscriptionIds };
|
|
222
|
+
if (spec.reportType === 'sdm') {
|
|
223
|
+
const period = spec.period.kind === 'explicit'
|
|
224
|
+
? { kind: 'explicit', startDate: spec.period.startDate, endDate: spec.period.endDate }
|
|
225
|
+
: { kind: spec.period.kind };
|
|
226
|
+
const profile = spec.configuration.cloudIqServiceProfile;
|
|
227
|
+
return {
|
|
228
|
+
schemaVersion: 1,
|
|
229
|
+
reportType: 'sdm',
|
|
230
|
+
scope,
|
|
231
|
+
period,
|
|
232
|
+
configuration: {
|
|
233
|
+
layout: spec.configuration.layout,
|
|
234
|
+
cloudIqServiceProfile: {
|
|
235
|
+
selectedServiceIds: profile.selectedServiceIds,
|
|
236
|
+
...(profile.detailRowLimit === undefined ? {} : { detailRowLimit: profile.detailRowLimit }),
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
const configuration = spec.configuration;
|
|
242
|
+
return {
|
|
243
|
+
schemaVersion: 1,
|
|
244
|
+
reportType: 'architecture-assessment',
|
|
245
|
+
scope,
|
|
246
|
+
configuration: {
|
|
247
|
+
audience: configuration.audience,
|
|
248
|
+
sections: {
|
|
249
|
+
costOpportunities: configuration.sections.costOpportunities,
|
|
250
|
+
securityPosture: configuration.sections.securityPosture,
|
|
251
|
+
reliabilityAvailability: configuration.sections.reliabilityAvailability,
|
|
252
|
+
quickWins: configuration.sections.quickWins,
|
|
253
|
+
roadmap: configuration.sections.roadmap,
|
|
254
|
+
},
|
|
255
|
+
scopeCurrencyCode: configuration.scopeCurrencyCode,
|
|
256
|
+
...(configuration.preparedBy === undefined ? {} : { preparedBy: configuration.preparedBy }),
|
|
257
|
+
},
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* The canonical `requestJson`: validated, normalised, fixed key order. Producers store exactly this string, and
|
|
262
|
+
* `requestSha256` is the SHA-256 of its UTF-8 bytes. Throws on an invalid spec or one above 32 KiB.
|
|
263
|
+
*/
|
|
264
|
+
export const serializeReportJobSpecV1 = (spec) => {
|
|
265
|
+
const parsed = parseReportJobSpecV1(spec);
|
|
266
|
+
if (!parsed.ok)
|
|
267
|
+
throw new Error(`Invalid report job spec: ${parsed.errors.join('; ')}`);
|
|
268
|
+
const json = JSON.stringify(canonicalSpecObject(parsed.value));
|
|
269
|
+
if (utf8ByteLength(json) > REPORT_JOB_SPEC_MAX_BYTES)
|
|
270
|
+
throw new RangeError(`Report job spec exceeds ${REPORT_JOB_SPEC_MAX_BYTES} bytes.`);
|
|
271
|
+
return json;
|
|
272
|
+
};
|
|
273
|
+
/**
|
|
274
|
+
* Parses stored `requestJson`. It must be valid JSON, a valid spec and already canonical (byte-equal to
|
|
275
|
+
* `serializeReportJobSpecV1` of itself), so a hash over the stored string identifies the request exactly.
|
|
276
|
+
*/
|
|
277
|
+
export const parseReportJobRequestJson = (requestJson) => {
|
|
278
|
+
if (typeof requestJson !== 'string' || requestJson.length === 0)
|
|
279
|
+
return { ok: false, errors: ['requestJson: must be a non-empty string'] };
|
|
280
|
+
if (utf8ByteLength(requestJson) > REPORT_JOB_SPEC_MAX_BYTES)
|
|
281
|
+
return { ok: false, errors: ['requestJson: exceeds 32 KiB'] };
|
|
282
|
+
let raw;
|
|
283
|
+
try {
|
|
284
|
+
raw = JSON.parse(requestJson);
|
|
285
|
+
}
|
|
286
|
+
catch {
|
|
287
|
+
return { ok: false, errors: ['requestJson: not valid JSON'] };
|
|
288
|
+
}
|
|
289
|
+
const parsed = parseReportJobSpecV1(raw);
|
|
290
|
+
if (!parsed.ok)
|
|
291
|
+
return parsed;
|
|
292
|
+
if (JSON.stringify(canonicalSpecObject(parsed.value)) !== requestJson)
|
|
293
|
+
return { ok: false, errors: ['requestJson: not in canonical form'] };
|
|
294
|
+
return parsed;
|
|
295
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Background report job status, failure stage and failure code vocabularies
|
|
3
|
+
* (core/specs/reporting/reporting-scheduler.md, "Report job table").
|
|
4
|
+
*
|
|
5
|
+
* Status is a monotonic milestone: retries change `attemptCount` and the lease, never move status backwards.
|
|
6
|
+
*/
|
|
7
|
+
export const REPORT_JOB_STATUSES = [
|
|
8
|
+
'accepted',
|
|
9
|
+
'running',
|
|
10
|
+
'source-ready',
|
|
11
|
+
'generated',
|
|
12
|
+
'completed',
|
|
13
|
+
'completed-with-notification-errors',
|
|
14
|
+
'failed',
|
|
15
|
+
];
|
|
16
|
+
export const REPORT_JOB_TERMINAL_STATUSES = ['completed', 'completed-with-notification-errors', 'failed'];
|
|
17
|
+
/** Allowed status changes. Every non-terminal status may also move to `failed`. */
|
|
18
|
+
export const REPORT_JOB_STATUS_TRANSITIONS = {
|
|
19
|
+
accepted: ['running', 'failed'],
|
|
20
|
+
running: ['source-ready', 'failed'],
|
|
21
|
+
'source-ready': ['generated', 'failed'],
|
|
22
|
+
generated: ['completed', 'completed-with-notification-errors', 'failed'],
|
|
23
|
+
completed: [],
|
|
24
|
+
'completed-with-notification-errors': [],
|
|
25
|
+
failed: [],
|
|
26
|
+
};
|
|
27
|
+
export const isReportJobStatus = (value) => typeof value === 'string' && REPORT_JOB_STATUSES.includes(value);
|
|
28
|
+
export const isTerminalReportJobStatus = (status) => REPORT_JOB_TERMINAL_STATUSES.includes(status);
|
|
29
|
+
export const canTransitionReportJobStatus = (from, to) => REPORT_JOB_STATUS_TRANSITIONS[from].includes(to);
|
|
30
|
+
export const REPORT_JOB_NOTIFICATION_STATUSES = ['none', 'pending', 'delivered', 'partially-delivered', 'attachment-too-large', 'failed'];
|
|
31
|
+
export const isReportJobNotificationStatus = (value) => typeof value === 'string' && REPORT_JOB_NOTIFICATION_STATUSES.includes(value);
|
|
32
|
+
export const REPORT_JOB_FAILURE_STAGES = [
|
|
33
|
+
'request',
|
|
34
|
+
'authorization-or-entitlement',
|
|
35
|
+
'scope-resolution',
|
|
36
|
+
'source-load',
|
|
37
|
+
'report-model',
|
|
38
|
+
'document-render',
|
|
39
|
+
'artifact-persist',
|
|
40
|
+
'notification',
|
|
41
|
+
];
|
|
42
|
+
export const isReportJobFailureStage = (value) => typeof value === 'string' && REPORT_JOB_FAILURE_STAGES.includes(value);
|
|
43
|
+
/**
|
|
44
|
+
* Each failure code and the stage it belongs to. `retries-exhausted` has no fixed stage: the writer records the
|
|
45
|
+
* stage the last attempt was in.
|
|
46
|
+
*/
|
|
47
|
+
export const REPORT_JOB_FAILURE_STAGE_BY_CODE = {
|
|
48
|
+
'request-invalid': 'request',
|
|
49
|
+
'request-hash-mismatch': 'request',
|
|
50
|
+
'message-row-mismatch': 'request',
|
|
51
|
+
'region-mismatch': 'request',
|
|
52
|
+
'unsupported-schema-version': 'request',
|
|
53
|
+
'notifications-not-enabled': 'request',
|
|
54
|
+
'report-type-disabled': 'request',
|
|
55
|
+
'company-not-found': 'authorization-or-entitlement',
|
|
56
|
+
'entitlement-missing': 'authorization-or-entitlement',
|
|
57
|
+
'scope-not-owned': 'scope-resolution',
|
|
58
|
+
'scope-load-failed': 'scope-resolution',
|
|
59
|
+
'no-ready-subscriptions': 'scope-resolution',
|
|
60
|
+
'source-not-ready': 'source-load',
|
|
61
|
+
'source-invalid': 'source-load',
|
|
62
|
+
'snapshot-too-large': 'source-load',
|
|
63
|
+
'snapshot-invalid': 'source-load',
|
|
64
|
+
'invalid-rate': 'report-model',
|
|
65
|
+
'invalid-currency': 'report-model',
|
|
66
|
+
'no-prepared-by': 'report-model',
|
|
67
|
+
'model-error': 'report-model',
|
|
68
|
+
'render-error': 'document-render',
|
|
69
|
+
'docx-invalid': 'document-render',
|
|
70
|
+
'artifact-too-large': 'document-render',
|
|
71
|
+
'artifact-conflict': 'artifact-persist',
|
|
72
|
+
'artifact-integrity': 'artifact-persist',
|
|
73
|
+
'retries-exhausted': null,
|
|
74
|
+
};
|
|
75
|
+
export const REPORT_JOB_FAILURE_CODES = Object.keys(REPORT_JOB_FAILURE_STAGE_BY_CODE);
|
|
76
|
+
export const isReportJobFailureCode = (value) => typeof value === 'string' && Object.prototype.hasOwnProperty.call(REPORT_JOB_FAILURE_STAGE_BY_CODE, value);
|
|
77
|
+
/**
|
|
78
|
+
* The stage to record for a failure code. `retries-exhausted` requires the caller's current stage.
|
|
79
|
+
*/
|
|
80
|
+
export const resolveReportJobFailureStage = (code, currentStage) => {
|
|
81
|
+
const stage = REPORT_JOB_FAILURE_STAGE_BY_CODE[code];
|
|
82
|
+
if (stage)
|
|
83
|
+
return stage;
|
|
84
|
+
if (!currentStage)
|
|
85
|
+
throw new Error(`Failure code ${code} needs the stage the attempt was in.`);
|
|
86
|
+
return currentStage;
|
|
87
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Azure Table entities arrive in two key casings: the REST API with `odata=nometadata` (the API's TableStore)
|
|
3
|
+
* returns `PartitionKey`/`RowKey`/`Timestamp`, while `@azure/data-tables` (reportworker, cloud-engine's
|
|
4
|
+
* `schedules` table) returns `partitionKey`/`rowKey`/`timestamp`/`etag`. The contracts use the REST casing;
|
|
5
|
+
* these helpers convert either shape and drop system properties.
|
|
6
|
+
*/
|
|
7
|
+
/** System and metadata properties a Table read may add; never part of a contract row. */
|
|
8
|
+
export const REPORT_TABLE_SYSTEM_FIELDS = [
|
|
9
|
+
'Timestamp',
|
|
10
|
+
'timestamp',
|
|
11
|
+
'etag',
|
|
12
|
+
'odata.etag',
|
|
13
|
+
'odata.metadata',
|
|
14
|
+
'odata.type',
|
|
15
|
+
'odata.id',
|
|
16
|
+
'odata.editLink',
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* Returns a copy with `PartitionKey`/`RowKey` (from either casing), without system properties and without
|
|
20
|
+
* `null`/`undefined` values (some SDKs return absent properties as `null`). Conflicting casings are kept as-is so
|
|
21
|
+
* the caller's validation rejects them.
|
|
22
|
+
*/
|
|
23
|
+
export const normalizeReportTableEntity = (entity) => {
|
|
24
|
+
const result = {};
|
|
25
|
+
for (const [key, value] of Object.entries(entity)) {
|
|
26
|
+
if (value === null || value === undefined || REPORT_TABLE_SYSTEM_FIELDS.includes(key))
|
|
27
|
+
continue;
|
|
28
|
+
if (key === 'partitionKey' && !('PartitionKey' in entity))
|
|
29
|
+
result.PartitionKey = value;
|
|
30
|
+
else if (key === 'rowKey' && !('RowKey' in entity))
|
|
31
|
+
result.RowKey = value;
|
|
32
|
+
else
|
|
33
|
+
result[key] = value;
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
/** The `@azure/data-tables` shape of a contract row: `partitionKey`/`rowKey` instead of `PartitionKey`/`RowKey`. */
|
|
38
|
+
export const toReportTableSdkEntity = (row) => {
|
|
39
|
+
const { PartitionKey, RowKey, ...rest } = row;
|
|
40
|
+
return { partitionKey: PartitionKey, rowKey: RowKey, ...rest };
|
|
41
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SHA-256 through Web Crypto, which the API (Cloudflare Workers), cloud-engine and reportworker (Node 24) all
|
|
3
|
+
* provide as `globalThis.crypto.subtle`. The package has no Node or DOM typings, so the shapes are declared here.
|
|
4
|
+
*/
|
|
5
|
+
import { utf8ByteLength } from './reportingIds.js';
|
|
6
|
+
const getSubtle = () => {
|
|
7
|
+
const subtle = globalThis.crypto?.subtle;
|
|
8
|
+
if (!subtle || typeof subtle.digest !== 'function') {
|
|
9
|
+
throw new Error('Web Crypto (globalThis.crypto.subtle) is required for report job hashing.');
|
|
10
|
+
}
|
|
11
|
+
return subtle;
|
|
12
|
+
};
|
|
13
|
+
/** UTF-8 encodes a string without relying on `TextEncoder` typings. */
|
|
14
|
+
export const encodeUtf8 = (value) => {
|
|
15
|
+
const bytes = new Uint8Array(utf8ByteLength(value));
|
|
16
|
+
let offset = 0;
|
|
17
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
18
|
+
let code = value.charCodeAt(index);
|
|
19
|
+
if (code >= 0xd800 && code <= 0xdbff && index + 1 < value.length) {
|
|
20
|
+
const next = value.charCodeAt(index + 1);
|
|
21
|
+
if (next >= 0xdc00 && next <= 0xdfff) {
|
|
22
|
+
code = 0x10000 + ((code - 0xd800) << 10) + (next - 0xdc00);
|
|
23
|
+
index += 1;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (code >= 0xd800 && code <= 0xdfff)
|
|
27
|
+
code = 0xfffd; // lone surrogate, as TextEncoder does
|
|
28
|
+
if (code < 0x80)
|
|
29
|
+
bytes[offset++] = code;
|
|
30
|
+
else if (code < 0x800) {
|
|
31
|
+
bytes[offset++] = 0xc0 | (code >> 6);
|
|
32
|
+
bytes[offset++] = 0x80 | (code & 0x3f);
|
|
33
|
+
}
|
|
34
|
+
else if (code < 0x10000) {
|
|
35
|
+
bytes[offset++] = 0xe0 | (code >> 12);
|
|
36
|
+
bytes[offset++] = 0x80 | ((code >> 6) & 0x3f);
|
|
37
|
+
bytes[offset++] = 0x80 | (code & 0x3f);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
bytes[offset++] = 0xf0 | (code >> 18);
|
|
41
|
+
bytes[offset++] = 0x80 | ((code >> 12) & 0x3f);
|
|
42
|
+
bytes[offset++] = 0x80 | ((code >> 6) & 0x3f);
|
|
43
|
+
bytes[offset++] = 0x80 | (code & 0x3f);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return bytes;
|
|
47
|
+
};
|
|
48
|
+
/** Lower-case hex SHA-256 of a UTF-8 string or of raw bytes. */
|
|
49
|
+
export const sha256Hex = async (input) => {
|
|
50
|
+
const data = typeof input === 'string' ? encodeUtf8(input) : input;
|
|
51
|
+
const digest = new Uint8Array(await getSubtle().digest('SHA-256', data));
|
|
52
|
+
let hex = '';
|
|
53
|
+
for (const byte of digest)
|
|
54
|
+
hex += byte.toString(16).padStart(2, '0');
|
|
55
|
+
return hex;
|
|
56
|
+
};
|
|
57
|
+
export const SHA256_HEX_PATTERN = /^[0-9a-f]{64}$/;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identifier rules shared by the background report job contracts and the report storage contracts.
|
|
3
|
+
*
|
|
4
|
+
* Every identifier that ends up in a Table key, a Blob path, a Service Bus MessageId (`:` separated) or a
|
|
5
|
+
* file name is validated here first. The rules are deliberately narrower than what storage accepts, so an
|
|
6
|
+
* accepted value is always safe in every one of those places.
|
|
7
|
+
*/
|
|
8
|
+
/** Company, cloud-account, schedule and action-group IDs: alphanumeric ends, `._-` inside, at most 80 characters. */
|
|
9
|
+
export const REPORT_ENTITY_ID_PATTERN = /^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,78}[A-Za-z0-9])?$/;
|
|
10
|
+
/** Azure subscription and tenant IDs (GUIDs, any case). */
|
|
11
|
+
export const REPORT_GUID_PATTERN = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
|
|
12
|
+
/** Calendar dates as `YYYY-MM-DD`. */
|
|
13
|
+
export const REPORT_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
14
|
+
const hasControlCharacter = (value) => {
|
|
15
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
16
|
+
const code = value.charCodeAt(index);
|
|
17
|
+
if (code < 0x20 || code === 0x7f)
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
return false;
|
|
21
|
+
};
|
|
22
|
+
export const isReportEntityId = (value) => typeof value === 'string' && REPORT_ENTITY_ID_PATTERN.test(value);
|
|
23
|
+
/**
|
|
24
|
+
* Company IDs on jobs, rows and messages: an entity ID of at most 56 characters, so the Service Bus MessageId
|
|
25
|
+
* `report-job:{companyId}:{jobId}` stays within its 128-character limit. Real IDs are `comp-` plus 15 characters.
|
|
26
|
+
*/
|
|
27
|
+
export const REPORT_JOB_COMPANY_ID_MAX_LENGTH = 56;
|
|
28
|
+
export const isReportJobCompanyId = (value) => isReportEntityId(value) && value.length <= REPORT_JOB_COMPANY_ID_MAX_LENGTH;
|
|
29
|
+
export const isReportGuid = (value) => typeof value === 'string' && REPORT_GUID_PATTERN.test(value);
|
|
30
|
+
/** A plain-text value with no control characters, trimmed, within the length bounds. */
|
|
31
|
+
export const isBoundedPlainText = (value, maxLength) => typeof value === 'string' && value.length > 0 && value.length <= maxLength && value === value.trim() && !hasControlCharacter(value);
|
|
32
|
+
/** An exact ISO-8601 UTC timestamp as produced by `Date.prototype.toISOString`. */
|
|
33
|
+
export const isIsoUtcTimestamp = (value) => {
|
|
34
|
+
if (typeof value !== 'string' || value.length !== 24)
|
|
35
|
+
return false;
|
|
36
|
+
const time = Date.parse(value);
|
|
37
|
+
return Number.isFinite(time) && new Date(time).toISOString() === value;
|
|
38
|
+
};
|
|
39
|
+
/** A real calendar date in `YYYY-MM-DD` form. */
|
|
40
|
+
export const isCalendarDate = (value) => {
|
|
41
|
+
if (typeof value !== 'string' || !REPORT_DATE_PATTERN.test(value))
|
|
42
|
+
return false;
|
|
43
|
+
const time = Date.parse(`${value}T00:00:00.000Z`);
|
|
44
|
+
return Number.isFinite(time) && new Date(time).toISOString().slice(0, 10) === value;
|
|
45
|
+
};
|
|
46
|
+
/** An IANA time zone name the runtime's `Intl` recognises. */
|
|
47
|
+
export const isIanaTimeZone = (value) => {
|
|
48
|
+
if (typeof value !== 'string' || value.length === 0 || value.length > 64)
|
|
49
|
+
return false;
|
|
50
|
+
if (!/^(?:UTC|[A-Za-z][A-Za-z0-9_+-]*(?:\/[A-Za-z0-9_+-]+){1,2})$/.test(value))
|
|
51
|
+
return false;
|
|
52
|
+
try {
|
|
53
|
+
new Intl.DateTimeFormat('en-US', { timeZone: value });
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
/** Number of bytes `value` occupies as UTF-8 (no dependency on `TextEncoder`). */
|
|
61
|
+
export const utf8ByteLength = (value) => {
|
|
62
|
+
let bytes = 0;
|
|
63
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
64
|
+
const code = value.charCodeAt(index);
|
|
65
|
+
if (code < 0x80)
|
|
66
|
+
bytes += 1;
|
|
67
|
+
else if (code < 0x800)
|
|
68
|
+
bytes += 2;
|
|
69
|
+
else if (code >= 0xd800 && code <= 0xdbff && index + 1 < value.length) {
|
|
70
|
+
const next = value.charCodeAt(index + 1);
|
|
71
|
+
if (next >= 0xdc00 && next <= 0xdfff) {
|
|
72
|
+
bytes += 4;
|
|
73
|
+
index += 1;
|
|
74
|
+
}
|
|
75
|
+
else
|
|
76
|
+
bytes += 3;
|
|
77
|
+
}
|
|
78
|
+
else
|
|
79
|
+
bytes += 3;
|
|
80
|
+
}
|
|
81
|
+
return bytes;
|
|
82
|
+
};
|
|
83
|
+
export const hasExactlyKeys = (value, required, optional = []) => {
|
|
84
|
+
const keys = Object.keys(value);
|
|
85
|
+
const allowed = new Set([...required, ...optional]);
|
|
86
|
+
return required.every(key => Object.prototype.hasOwnProperty.call(value, key)) && keys.every(key => allowed.has(key));
|
|
87
|
+
};
|
|
88
|
+
export const isPlainRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The API's reporting path-segment rule (`sanitizePathSegment` in api/services/ReportingTemplates/ReportingTemplateService.ts
|
|
3
|
+
* and api/services/ReportingSettings/ReportingSettingsService.ts): trim, replace runs of characters outside
|
|
4
|
+
* `[A-Za-z0-9._-]` with `-`, trim leading and trailing `-`, and use the fallback when nothing is left.
|
|
5
|
+
*/
|
|
6
|
+
export const sanitizeReportingPathSegment = (value, fallback) => {
|
|
7
|
+
const normalized = value
|
|
8
|
+
.trim()
|
|
9
|
+
.replace(/[^A-Za-z0-9._-]+/g, '-')
|
|
10
|
+
.replace(/^-+|-+$/g, '');
|
|
11
|
+
return normalized || fallback;
|
|
12
|
+
};
|
|
13
|
+
export const REPORTING_DOCX_EXTENSION = '.docx';
|
|
14
|
+
export const REPORT_FILE_NAME_MAX_LENGTH = 120;
|
|
15
|
+
/**
|
|
16
|
+
* A generated-report file name as the API accepts it: unchanged by the sanitiser, ends with `.docx`,
|
|
17
|
+
* at most 120 characters, and not just the extension.
|
|
18
|
+
*/
|
|
19
|
+
export const isReportFileName = (value) => typeof value === 'string' &&
|
|
20
|
+
value.length > REPORTING_DOCX_EXTENSION.length &&
|
|
21
|
+
value.length <= REPORT_FILE_NAME_MAX_LENGTH &&
|
|
22
|
+
value.endsWith(REPORTING_DOCX_EXTENSION) &&
|
|
23
|
+
sanitizeReportingPathSegment(value, '') === value;
|