@camunda/ccma-shared-types 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/misc.const.d.ts +75 -0
- package/dist/constants/misc.const.js +12 -0
- package/dist/constants/misc.const.js.map +2 -2
- package/dist/dtos/CommonCluster.dto.d.ts +13 -1
- package/dist/dtos/ControlV2.dto.d.ts +17 -3
- package/dist/enums/AuditEntity.enum.d.ts +2 -0
- package/dist/enums/AuditEntity.enum.js +2 -0
- package/dist/enums/AuditEntity.enum.js.map +2 -2
- package/dist/enums/ConsoleApiClientPermission.enum.d.ts +6 -1
- package/dist/enums/ConsoleApiClientPermission.enum.js +4 -0
- package/dist/enums/ConsoleApiClientPermission.enum.js.map +2 -2
- package/dist/enums/ErrorType.enum.d.ts +1 -0
- package/dist/enums/ErrorType.enum.js +1 -0
- package/dist/enums/ErrorType.enum.js.map +2 -2
- package/dist/index.d.ts +9 -5
- package/dist/index.js +31 -1
- package/dist/index.js.map +2 -2
- package/dist/types/HdpTenantUsage.type.d.ts +32 -0
- package/dist/types/TrialManagement.types.d.ts +63 -0
- package/dist/types/TrialManagement.types.js +1 -0
- package/dist/types/TrialManagement.types.js.map +7 -0
- package/dist/utils/cloudProvider.utils.d.ts +18 -0
- package/dist/utils/cloudProvider.utils.js +23 -0
- package/dist/utils/cloudProvider.utils.js.map +7 -0
- package/dist/utils/cronSchedule.utils.d.ts +42 -0
- package/dist/utils/cronSchedule.utils.js +161 -0
- package/dist/utils/cronSchedule.utils.js.map +7 -0
- package/dist/utils/cronSchedule.utils.spec.d.ts +1 -0
- package/dist/utils/string-validation.utils.d.ts +17 -0
- package/dist/utils/string-validation.utils.js +8 -1
- package/dist/utils/string-validation.utils.js.map +2 -2
- package/dist/utils/versionCheck.utils.d.ts +12 -0
- package/dist/utils/versionCheck.utils.js +37 -1
- package/dist/utils/versionCheck.utils.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\n// ============================================================================\n// Constants (runtime values)\n// ============================================================================\n\nexport { DAY, HOUR, MINUTE, SECOND, WEEK } from './constants/duration.const.js'\nexport {\n isSupportedFailoverRegionPair,\n SUPPORTED_FAILOVER_REGION_PAIRS,\n} from './constants/failoverRegionPairs.const.js'\nexport type { Stage } from './constants/misc.const.js'\nexport {\n CONSOLE_API_USER_ID,\n FIRSTNAME_LASTNAME_MAX_LENGTH,\n HOTBACKUP_MIN_CREATE_PERIOD,\n MAX_HARDWARE_PACKAGE_COUNT,\n MAX_LENGTH_CLUSTER_NAME,\n MINIMUM_EYEPAIRS,\n NAMES_OF_ENTERPRISE_SALESPLANS_WITH_SLEEPING_CLUSTERS,\n OPTIMIZE_FILTERING_MIN_VERSION,\n SECRETS_MAX_LENGTH,\n STARTING_PRICE_PER_MONTH_IN_EURO,\n TEMPORARY_CLUSTER_NAME,\n} from './constants/misc.const.js'\nexport {\n getGatewayPropertyHint,\n getGatewayPropertyPath,\n isAffectedByStreamlinedDeployment,\n isPre89AffectedPath,\n PRE89_AFFECTED_PATHS,\n PRE89_AFFECTED_PROPERTY_PREFIXES,\n PRE89_GATEWAY_PROPERTY_PATHS,\n PRE89_GATEWAY_RESOURCE_PREFIXES,\n} from './constants/pre89EnvVarMapping.const.js'\nexport { PRIVATE_LINK_REGIONS } from './constants/privateLinkRegions.const.js'\nexport { SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT } from './constants/secureConnectivity.const.js'\nexport type {\n TrialExtensionSurveyAnswer,\n TrialExtensionSurveyQuestion,\n} from './constants/trialExtensionSurvey.const.js'\nexport { TRIAL_EXTENSION_SURVEY_QUESTIONS } from './constants/trialExtensionSurvey.const.js'\n\n// ============================================================================\n// DTOs - Types (interfaces and type aliases)\n// ============================================================================\n\nexport type {\n ALERT_SUBSCRIPTION_REPORT_TYPES,\n ALERT_SUBSCRIPTION_TYPES,\n AlertSubscriptionDto,\n AlertSubscriptionEntryDto,\n AlertSubscriptionWebhookAuth,\n CheckFailedReason,\n} from './dtos/AlertSubscription.dto.js'\n\n// DTOs - Values (constants)\nexport {\n FORBIDDEN_HOSTNAMES_FOR_WEBHOOK_ALERTS,\n HMAC_HEADER_POSITION,\n HMAC_SUPPORTED_ALGORITHM,\n} from './dtos/AlertSubscription.dto.js'\n\nexport type { AuditDto } from './dtos/Audit.dto.js'\nexport type { Auth0ResourceServerDto } from './dtos/Auth0ResourceServer.dto.js'\nexport type { BackupDto } from './dtos/Backup.dto.js'\nexport type { BackupScheduleDto } from './dtos/BackupSchedule.dto.js'\nexport type { ByomClientDto, ByomStatus } from './dtos/ByomClient.dto.js'\nexport type { ClusterIpWhitelistDto } from './dtos/ClusterIpWhitelist.dto.js'\nexport type { ClusterPlanDto } from './dtos/ClusterPlan.dto.js'\nexport type { ClusterPlanTypeDto } from './dtos/ClusterPlanType.dto.js'\nexport type {\n ClusterSpecChange,\n ClusterSpecChangeActor,\n ClusterSpecHistory,\n} from './dtos/ClusterSpecHistory.dto.js'\nexport type {\n CommonClusterDto,\n ExternalIdpConfig,\n OptimizeFilteringConfig,\n OptimizeFilteringIncludeExclude,\n OptimizeFilteringPatch,\n} from './dtos/CommonCluster.dto.js'\nexport type { ConsoleClusterDto } from './dtos/ConsoleCluster.dto.js'\nexport type {\n ClusterByClientV2Dto,\n ClusterDetailV2Dto,\n ClusterFacetsV2Dto,\n ClusterListItemV2Dto,\n ClusterParameterOptionV2Dto,\n ClusterParametersV2Dto,\n ControlResolvedPermissions,\n ControlSessionDto,\n ControlSessionUser,\n CursorPage,\n CursorParams,\n ListClustersV2Params,\n ListOrganizationsV2Params,\n ListOrgMembersV2Params,\n OrgDetailV2Dto,\n OrgListItemV2Dto,\n OrgMemberV2Dto,\n OrgSummaryV2Dto,\n} from './dtos/ControlV2.dto.js'\nexport type { EarlyAccessFeatureDto } from './dtos/EarlyAccessFeature.dto.js'\nexport type {\n CamundaWebApp,\n CamundaWebAppWithZeebe,\n ExternalClusterDto,\n ExternalOrganizationDto,\n} from './dtos/ExternalWebapp.dto.js'\n// Functions\nexport {\n type GenerationDto,\n type GenerationWithClusterCountDto,\n sortGenerationBySemverOfZeebe,\n type UpgradableGenerationsDto,\n} from './dtos/Generations.dto.js'\n// Namespace (type-only - contains only interfaces)\nexport type { Hdp } from './dtos/Hdp.dto.js'\nexport type {\n K8sConfig,\n K8sConfigLegacyFormat,\n K8sContext,\n K8sContextDto,\n} from './dtos/K8sContext.dto.js'\nexport type { MetaDto } from './dtos/Meta.dto.js'\nexport type {\n AutoJoinAssignment,\n LicensingModelType,\n OrganizationDto,\n OrganizationMetadata,\n OrgOwner,\n OrgWithNameAndSalesPlan,\n} from './dtos/Organization.dto.js'\nexport {\n LICENSING_MODEL_DISPLAY_NAMES,\n VALID_LICENSING_MODELS,\n} from './dtos/Organization.dto.js'\nexport type { OrganizationMemberDto } from './dtos/OrganizationMember.dto.js'\nexport type { OrganizationToSalesPlanDto } from './dtos/OrganizationToSalesPlan.dto.js'\nexport type {\n ReleaseTrainSanityReport,\n SanityFix,\n SanityRuleInfo,\n SanitySeverity,\n SanityViolation,\n} from './dtos/ReleaseTrainSanity.dto.js'\nexport type { RestoreDto, RestoreState } from './dtos/Restore.dto.js'\n// SalesPlan.dto - Types\nexport type {\n ClusterLimits,\n ConsumptionDataItem,\n Limits,\n SalesPlanDto,\n SalesPlanMetadata,\n} from './dtos/SalesPlan.dto.js'\n// SalesPlan.dto - Values (constants and functions)\nexport {\n allClusterBasedLimits,\n allSalesPlanLimits,\n deprecatedLimit,\n MAX_CLUSTER_CLIENTS_DEFAULT,\n MAX_CLUSTER_CLIENTS_DEV,\n RETENTION_LIMIT_DEFAULT,\n RETENTION_LIMIT_MAXIMUM,\n RETENTION_LIMIT_MINIMUM,\n unusedClusterBasedLimits,\n unusedSalesPlanLimits,\n} from './dtos/SalesPlan.dto.js'\nexport type { SecureConnectivityDto } from './dtos/SecureConnectivity.dto.js'\nexport type { SignupDto } from './dtos/Signup.dto.js'\nexport type {\n StorybookConfig,\n StorybookConfigBackup,\n StorybookConfigChannel,\n StorybookConfigDatacenter,\n StorybookConfigGeneration,\n} from './dtos/StorybookConfig.dto.js'\nexport type { SystemAuditDto } from './dtos/SystemAudit.dto.js'\n// UsageAlert.dto - Types\nexport type { UsageAlertDto } from './dtos/UsageAlert.dto.js'\n// UsageAlert.dto - Values (enum and constants)\nexport {\n UsageAlertInitValues,\n UsageAlertMetric,\n UsageAlertThresholdLimits,\n} from './dtos/UsageAlert.dto.js'\nexport type { UserMetaDataDto } from './dtos/UserMetaData.dto.js'\n// Lucene-style table search (parser + AST \u2192 SQL compiler + field registries).\nexport {\n type AndNode,\n CLUSTER_DEFAULT_SEARCH_FIELDS,\n CLUSTER_SEARCH_FIELDS,\n type CompileContext,\n type CompiledQuery,\n compileQuery,\n type FieldBinding,\n findSearchField,\n isLuceneQueryError,\n LuceneQueryError,\n likeArgument,\n type NotNode,\n ORG_DEFAULT_SEARCH_FIELDS,\n ORGANIZATION_SEARCH_FIELDS,\n type OrNode,\n parseLuceneQuery,\n type QueryNode,\n type RangeNode,\n type SearchFieldCapability,\n type SearchFieldSpec,\n type SearchFieldType,\n type SearchTermOperator,\n type TermNode,\n} from './search/index.js'\n\n// ============================================================================\n// Enums (runtime values)\n// ============================================================================\n\nexport {\n AlertSubscriptionReportType,\n AlertSubscriptionType,\n} from './enums/AlertSubscription.enum.js'\nexport { AuditEntity, AuditEntityAttribute } from './enums/AuditEntity.enum.js'\nexport { AuditService } from './enums/AuditService.enum.js'\nexport { BackupStatus } from './enums/BackupStatus.enum.js'\nexport {\n ClusterBulkOperationStatus,\n ClusterBulkOperationType,\n} from './enums/ClusterBulkOperation.enum.js'\nexport { ClusterClientPermission } from './enums/ClusterClientPermissions.enum.js'\nexport { ClusterEncryptionKey } from './enums/ClusterEncryptionKey.enum.js'\nexport { ClusterStatus } from './enums/ClusterStatus.enum.js'\nexport { ConsoleAPIClientPermission } from './enums/ConsoleApiClientPermission.enum.js'\nexport { ErrorType } from './enums/ErrorType.enum.js'\nexport type {\n AssignableOrganizationRoleType,\n OrganizationRoleType,\n UnassignableOrganizationRoleType,\n} from './enums/OrganizationRole.enum.js'\nexport {\n AssignableOrganizationRole,\n LegacyHeldOrganizationRole,\n OrganizationRole,\n UnassignableOrganizationRole,\n} from './enums/OrganizationRole.enum.js'\nexport { SseEntity, SseType } from './enums/Sse.enum.js'\nexport {\n SystemAuditEntity,\n SystemAuditEntityAttribute,\n} from './enums/SystemAuditEntity.enum.js'\n\n// ============================================================================\n// Permissions - Namespaces (runtime values)\n// ============================================================================\n\nexport { AccountsPermissions } from './permissions/accounts.permissions.js'\nexport { AlertDistributorPermissions } from './permissions/alert-distributor.permissions.js'\nexport { AuditLoggerPermissions } from './permissions/auditlogger.permissions.js'\nexport {\n accountsUserFeaturesFromPermissions,\n consoleUserFeaturesFromPermissions,\n} from './permissions/combo.js'\nexport { ConsolePermissions } from './permissions/console.permissions.js'\nexport { NotificationPermissions } from './permissions/notification.permissions.js'\n// profile.permissions - Types\nexport type { OnboardConfig } from './permissions/profile.permissions.js'\n// profile.permissions - Values (constants)\n// NOTE: the `allowed` email lists (CLOUD_TEAM_EMAILS, SRE_TEAM_EMAILS, etc.)\n// intentionally live in the private `@camunda-cloud/shared-backend` package\n// instead of here, since this package is published publicly to npm.\nexport { PROFILES } from './permissions/profile.permissions.js'\nexport { expandRolesToPermissions } from './permissions/roleExpansion.utils.js'\n\n// ============================================================================\n// Types - Type-only exports (interfaces and type aliases)\n// ============================================================================\n\nexport type { AuditData } from './types/AuditData.type.js'\n// AutoSleep.type - Types\nexport type {\n ActivitySleepEligibilityOptions,\n SleepCronEligibilityOptions,\n} from './types/AutoSleep.type.js'\n// AutoSleep.type - Values (constants and functions)\nexport {\n INTERNAL_LOW_HARDWARE_PLAN_NAME,\n isActivitySleepEligible,\n isClusterTagEligibleForSleepCron,\n isSalesPlanEligibleForSleepCron,\n isSleepCronEligible,\n SLEEP_CRON_ELIGIBLE_TAGS,\n} from './types/AutoSleep.type.js'\nexport type {\n BotContext,\n BotOptions,\n BotRequest,\n GetUserDetailsResponse,\n ListRolesForUserResponse,\n UpdateUserRolesRequest,\n UpdateUserRolesResponse,\n UserContext,\n UserDetails,\n} from './types/Bot.types.js'\n// BulkOperation.type - Types\nexport type {\n BulkClusterDeletionContent,\n BulkClusterDeletionItem,\n BulkClusterGenerationUpdateItem,\n BulkClusterPlanTypeUpdateContent,\n BulkClusterPlanTypeUpdateItem,\n BulkClusterPlanUpdateContent,\n BulkClusterPlanUpdateItem,\n BulkGenerationUpdateContent,\n GenericBulkClusterOperationContent,\n GenericBulkOperationContent,\n GenericClusterBulkOperationItem,\n} from './types/BulkOperation.type.js'\n// BulkOperation.type - Functions (type guards)\nexport {\n isBulkClusterDeletionItem,\n isBulkClusterPlanTypeUpdateItem,\n isBulkClusterPlanUpdateItem,\n isIsBulkClusterGenerationUpdateIten,\n} from './types/BulkOperation.type.js'\n// C8ClusterComponentVersions.type - Types\nexport type {\n ImmutableZeebeClusterVersionsDto,\n MutableZeebeClusterVersionsDto,\n ZeebeClusterVersionsDto,\n} from './types/C8ClusterComponentVersions.type.js'\n// C8ClusterComponentVersions.type - Values (constants)\nexport {\n AllThings,\n ImmutableThings,\n MutableThings,\n} from './types/C8ClusterComponentVersions.type.js'\n// CamundaClusterLabels.type - Types\nexport type {\n CamundaClusterStage,\n CamundaClusterStageLabel,\n ClusterLabels,\n} from './types/CamundaClusterLabels.type.js'\n// CamundaClusterLabels.type - Values (constants)\nexport {\n ALLOWED_CAMUNDA_LABELS,\n StageClusterLabels,\n} from './types/CamundaClusterLabels.type.js'\n// Chargebee.type - Types\nexport type { SubscriptionItem } from './types/Chargebee.type.js'\n// Chargebee.type - Values (enums)\nexport { ConsumptionData, ConsumptionDataType } from './types/Chargebee.type.js'\n// ClusterBulkOperation.type - Types\nexport type {\n ClusterBulkOperationAck,\n ClusterBulkOperationClusterDto,\n ClusterBulkOperationContent,\n ClusterBulkOperationDto,\n ClusterBulkOperationGenerationUpdateParameter,\n ClusterBulkOperationParameter,\n ClusterBulkOperationPlanTypeUpdateParameter,\n ClusterBulkOperationPlanUpdateParameter,\n ClusterBulkOperationPostContent,\n ClusterSleepWakeupParameter,\n} from './types/ClusterBulkOperation.type.js'\nexport type {\n ClusterModificationConfigDto,\n ClusterModificationDto,\n} from './types/ClusterModification.type.js'\n// ClusterPlanFields.type - Values (field spec and type guard)\nexport {\n CLUSTER_PLAN_FIELDS,\n type ClusterPlanFieldSpec,\n type ClusterPlanFieldTree,\n isClusterPlanFieldSpec,\n} from './types/ClusterPlanFields.type.js'\nexport type {\n ClusterPlanModificationAck,\n ClusterPlanModificationConfig,\n ClusterPlanModificationDto,\n} from './types/ClusterPlanModification.type.js'\n// ClusterPlanTypeAvailabilityClass.type - Values (enum and function)\nexport {\n ClusterPlanTypeAvailabilityClass,\n sortByAvailabilityClasses,\n} from './types/ClusterPlanTypeAvailabilityClass.type.js'\n// ClusterPlanTypeCategory.type - Values (enum and functions)\nexport {\n ClusterPlanTypeCategory,\n hasAvailabilityClass,\n sortByClusterPlanTypeCategory,\n} from './types/ClusterPlanTypeCategory.type.js'\nexport type { ClusterPlanTypesToConfig } from './types/ClusterPlanTypesToConfig.type.js'\nexport type { ClusterPlanTypesToReserved } from './types/ClusterPlanTypesToReserved.type.js'\nexport type {\n ClusterUsageDataRequest,\n ClusterUsageMetricsAddRequestByMetricHeap,\n ClusterUsageMetricsData,\n ClusterUsageMetricsFilter,\n ClusterUsageOrgStartDate,\n} from './types/ClusterUsageMetrics.type.js'\n// Namespace with runtime values (consts, functions, enums)\nexport { ConsoleSM } from './types/ConsoleSelfManaged.type.js'\n// Namespace (type-only - contains only interfaces)\nexport type { ConsoleSMAdminApi } from './types/ConsoleSelfManagedAdminApi.type.js'\n// Dashboard.types - Types\nexport type {\n DashboardConfig,\n DashboardMappingItem,\n DashboardMappingTarget,\n DashboardResultPrimitive,\n DashboardResultRow,\n EngineeringOperationsDashboardResponse,\n} from './types/Dashboard.types.js'\nexport type { EnterpriseIncludingValueMetrics } from './types/EnterpriseIncludingValueMetrics.type.js'\nexport type { HdpTenantUsagePoint } from './types/HdpTenantUsage.type.js'\n// hdp.types - Types (interfaces)\nexport type {\n AlertSubscription as HdpAlertSubscription,\n Audit as HdpAudit,\n ByomClient as HdpByomClient,\n Channel as HdpChannel,\n Cluster as HdpCluster,\n ClusterBackup as HdpClusterBackup,\n ClusterBackupSchedule as HdpClusterBackupSchedule,\n ClusterBulkOperation as HdpClusterBulkOperation,\n ClusterClient as HdpClusterClient,\n ClusterModification as HdpClusterModification,\n ClusterPlan as HdpClusterPlan,\n ClusterPlanType as HdpClusterPlanType,\n ConnectorSecret as HdpConnectorSecret,\n ConsoleApiClient as HdpConsoleApiClient,\n Datacenter as HdpDatacenter,\n Generation as HdpGeneration,\n HdpBackendChangeEvent,\n HdpClusterModificationConfig,\n HdpEntity,\n HdpPrometheusDataCapacityDataPoint,\n Invite as HdpInvite,\n LlmSpend as HdpLlmSpend,\n Organization as HdpOrganization,\n SecureConnectivity as HdpSecureConnectivity,\n SystemAudit as HdpSystemAudit,\n TelemetryData as HdpTelemetryData,\n UsageAlert as HdpUsageAlert,\n User as HdpUser,\n UserLogin as HdpUserLogin,\n} from './types/hdp.types.js'\n// hdp.types - Values (enums)\nexport {\n AlertSubscriptionReportType as HdpAlertSubscriptionReportType,\n AlertSubscriptionType as HdpAlertSubscriptionType,\n} from './types/hdp.types.js'\n// notification.type - Types\nexport type {\n GlobalNotification,\n NotificationDto,\n NotificationMeta,\n NotificationOptions,\n NotificationPermission,\n NotificationSource,\n NotificationState,\n NotificationType,\n OrgNotification,\n UserNotification,\n UserOrgNotification,\n} from './types/notification.type.js'\n// notification.type - Values (enums and constants)\nexport {\n NotificationPermissionValues,\n NotificationSourceEnum,\n NotificationStateEnum,\n NotificationTypeEnum,\n} from './types/notification.type.js'\n// OrganizationPermission.type - Types\nexport type {\n CreateReadUpdateDelete,\n OrganizationPermissions,\n} from './types/OrganizationPermission.type.js'\n// OrganizationPermission.type - Values (constants)\nexport {\n OrganizationPermissionsDescriptions,\n PermissionsForOrganizationRole,\n} from './types/OrganizationPermission.type.js'\n// Roles.js - Types\nexport type {\n AccountRoles,\n ConsoleRoles,\n ModelerRoles,\n Roles,\n} from './types/Roles.js'\n// Roles.js - Values (constants)\nexport { SAFE_ROLES } from './types/Roles.js'\n// SalesPlanType.type - Types\nexport type {\n DisplayedSalesPlan,\n RevisitedSalesPlanName,\n} from './types/SalesPlanType.type.js'\n// SalesPlanType.type - Values (enums and functions)\nexport {\n AnalyticsSalesPlanType,\n getAnalyticsSalesPlanFromOrgSalesPlan,\n getDisplayedSalesPlan,\n getRevisitedSalesPlanName,\n OPTIMIZE_DISABLED_PLAN_TYPES,\n SalesPlanType,\n} from './types/SalesPlanType.type.js'\n// SpamDetection.type - Types\nexport type { SpamDetectionPatterns } from './types/SpamDetection.type.js'\n// SpamDetection.type - Values (constants)\nexport { TEERGRUBE_PATTERNS } from './types/SpamDetection.type.js'\nexport type {\n AlertSubscriptionSseEvent,\n BackupSseEvent,\n ClusterClientSseEvent,\n ClusterSseEvent,\n ConnectorSecretsSseEvent,\n ConsoleApiClientSseEvent,\n ConsoleSseEvent,\n MonitoringSseEvent,\n SecureConnectivitySseEvent,\n SseClusterPayload,\n SseMonitoringPayload,\n SseSecureConnectivityPayload,\n} from './types/SseEvent.type.js'\n// Namespace (type-only - contains only interfaces)\nexport type { AccountsStats } from './types/Stats.types.js'\n// Survey.type - Types\nexport type { Persona, SurveyDto } from './types/Survey.type.js'\n// Survey.type - Values (enum)\nexport { FeedbackType } from './types/Survey.type.js'\n// SuspendStrategy.type - Types\nexport type {\n GetSuspendStrategyOptions,\n SuspendStrategy,\n} from './types/SuspendStrategy.type.js'\n// SuspendStrategy.type - Values (function)\nexport { getSuspendStrategy } from './types/SuspendStrategy.type.js'\nexport type { SystemAuditData } from './types/SystemAuditData.type.js'\n\n// Namespace (runtime value)\nexport { Telemetry } from './types/Telemetry.type.js'\n\n// User.type - Types\nexport type {\n AccountsData,\n AppMetadata,\n BasicUser,\n BlockedFor,\n Identity,\n OrgMembership,\n User,\n UserMetadata,\n UserRequest,\n} from './types/User.type.js'\n\n// User.type - Values (enum)\nexport { UserMetadataEvent } from './types/User.type.js'\n\nexport type {\n UniqueTaskUser,\n ValueMetrics,\n ValueMetricsPerYearMonth,\n} from './types/ValueMetrics.type.js'\n\n// ============================================================================\n// Utils - Classes (runtime values)\n// ============================================================================\n\nexport { ConsoleSelfManagedUtils } from './utils/console-sm.utils.js'\nexport {\n deriveEncryptionStatus,\n type EncryptionStatus,\n isEncryptionStatus,\n} from './utils/encryptionStatus.utils.js'\n// enterprise-connection.utils - Types\nexport type { EnterpriseConnectionOrganizationAssignment } from './utils/enterprise-connection.utils.js'\n// enterprise-connection.utils - Values (functions)\nexport {\n enterpriseConnectionMetadataToOrganizationAssignments,\n organizationAssignmentsToEnterpriseConnectionMetadata,\n} from './utils/enterprise-connection.utils.js'\nexport {\n addMonthsClamped,\n DEFAULT_ENTERPRISE_DURATION_IN_MONTHS,\n diffInWholeMonths,\n type EnterpriseTermWindow,\n getCurrentEnterpriseTerm,\n peakWithinTerm,\n toUtcDayStartMs,\n} from './utils/enterpriseTerm.utils.js'\nexport type { EnvVarEntry } from './utils/envVars.js'\nexport { parseEnvVars, serializeEnvVars } from './utils/envVars.js'\nexport {\n deriveFailoverKeyPolicyPrincipals,\n type FailoverKeyPolicyPrincipals,\n} from './utils/failoverKeyPolicy.utils.js'\nexport {\n KMS_ARN,\n KMS_MRK_ARN,\n type KmsArnValidationError,\n type ParsedKmsArn,\n parseKmsArn,\n validateKmsArnForRegion,\n} from './utils/kmsArn.utils.js'\nexport { validateLabels } from './utils/labelValidator.utils.js'\nexport { ObjectMergeUtils } from './utils/objectMerge.utils.js'\nexport {\n getPermissionsByRoles,\n getUserPermissionsForOrg,\n} from './utils/orgs/OrgHelper.js'\n\n// PasswordPolicy - Types\nexport type {\n PasswordPolicyRequest,\n PasswordPolicyResult,\n} from './utils/PasswordPolicy.js'\n\n// PasswordPolicy - Values (constants and function)\nexport {\n MAXLENGTH as PASSWORD_POLICY_MAXLENGTH,\n MINLENGTH as PASSWORD_POLICY_MINLENGTH,\n passwordPolicyCheck,\n} from './utils/PasswordPolicy.js'\n\nexport {\n allSettledResultsCounts,\n getFulfilledPromises,\n getRejectedPromises,\n getSettledSummary,\n} from './utils/settledPromises.util.js'\n\nexport {\n isValidAwsArn,\n isValidCIDR,\n isValidCIDRList,\n isValidClientName,\n isValidHostname,\n isValidPrivateLinkRegion,\n} from './utils/string-validation.utils.js'\nexport {\n extractCamundaUserEmail,\n guessName,\n isCamundaUserId,\n} from './utils/user.utils.js'\n\n// versionCheck.utils - Values (enum and function)\nexport {\n checkVersion,\n VersionCheckOperator,\n} from './utils/versionCheck.utils.js'\n\n// ============================================================================\n// Config - Configuration files and types\n// ============================================================================\n\nexport { default as CAMUNDI_PERMISSION_RULES } from './config/camundi-permission-rules.js'\nexport type { CamundiPermissionRules } from './config/camundi-permission-rules.types.js'\n\nexport {\n augmentCamundiPermissions,\n getApplicableRolesForEmployee,\n isManager,\n} from './utils/camundiPermissionAugmenter.utils.js'\n"],
|
|
5
|
-
"mappings": "AAUA,SAAS,KAAK,MAAM,QAAQ,QAAQ,YAAY;AAChD;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AACrC,SAAS,iDAAiD;AAK1D,SAAS,wCAAwC;AAgBjD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;
|
|
4
|
+
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\n// ============================================================================\n// Constants (runtime values)\n// ============================================================================\n\nexport { DAY, HOUR, MINUTE, SECOND, WEEK } from './constants/duration.const.js'\nexport {\n isSupportedFailoverRegionPair,\n SUPPORTED_FAILOVER_REGION_PAIRS,\n} from './constants/failoverRegionPairs.const.js'\nexport type { Stage } from './constants/misc.const.js'\nexport {\n APP_INTEGRATIONS_89_STREAM_CONNECTOR_BRIDGE_MIN_VERSION,\n APP_INTEGRATIONS_89_STREAM_ZEEBE_MIN_VERSION,\n APP_INTEGRATIONS_MIN_VERSION,\n BYOIDP_MIN_VERSION,\n CONNECTOR_SECRET_SYNC_MIN_VERSION,\n CONSOLE_API_USER_ID,\n FIRSTNAME_LASTNAME_MAX_LENGTH,\n HOTBACKUP_MIN_CREATE_PERIOD,\n MAX_HARDWARE_PACKAGE_COUNT,\n MAX_LENGTH_CLUSTER_NAME,\n MINIMUM_EYEPAIRS,\n NAMES_OF_ENTERPRISE_SALESPLANS_WITH_SLEEPING_CLUSTERS,\n OPTIMIZE_FILTERING_MIN_VERSION,\n SECRET_SOURCE_MIN_VERSION,\n SECRETS_MAX_LENGTH,\n STARTING_PRICE_PER_MONTH_IN_EURO,\n TEMPORARY_CLUSTER_NAME,\n} from './constants/misc.const.js'\nexport {\n getGatewayPropertyHint,\n getGatewayPropertyPath,\n isAffectedByStreamlinedDeployment,\n isPre89AffectedPath,\n PRE89_AFFECTED_PATHS,\n PRE89_AFFECTED_PROPERTY_PREFIXES,\n PRE89_GATEWAY_PROPERTY_PATHS,\n PRE89_GATEWAY_RESOURCE_PREFIXES,\n} from './constants/pre89EnvVarMapping.const.js'\nexport { PRIVATE_LINK_REGIONS } from './constants/privateLinkRegions.const.js'\nexport { SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT } from './constants/secureConnectivity.const.js'\nexport type {\n TrialExtensionSurveyAnswer,\n TrialExtensionSurveyQuestion,\n} from './constants/trialExtensionSurvey.const.js'\nexport { TRIAL_EXTENSION_SURVEY_QUESTIONS } from './constants/trialExtensionSurvey.const.js'\n\n// ============================================================================\n// DTOs - Types (interfaces and type aliases)\n// ============================================================================\n\nexport type {\n ALERT_SUBSCRIPTION_REPORT_TYPES,\n ALERT_SUBSCRIPTION_TYPES,\n AlertSubscriptionDto,\n AlertSubscriptionEntryDto,\n AlertSubscriptionWebhookAuth,\n CheckFailedReason,\n} from './dtos/AlertSubscription.dto.js'\n\n// DTOs - Values (constants)\nexport {\n FORBIDDEN_HOSTNAMES_FOR_WEBHOOK_ALERTS,\n HMAC_HEADER_POSITION,\n HMAC_SUPPORTED_ALGORITHM,\n} from './dtos/AlertSubscription.dto.js'\n\nexport type { AuditDto } from './dtos/Audit.dto.js'\nexport type { Auth0ResourceServerDto } from './dtos/Auth0ResourceServer.dto.js'\nexport type { BackupDto } from './dtos/Backup.dto.js'\nexport type { BackupScheduleDto } from './dtos/BackupSchedule.dto.js'\nexport type { ByomClientDto, ByomStatus } from './dtos/ByomClient.dto.js'\nexport type { ClusterIpWhitelistDto } from './dtos/ClusterIpWhitelist.dto.js'\nexport type { ClusterPlanDto } from './dtos/ClusterPlan.dto.js'\nexport type { ClusterPlanTypeDto } from './dtos/ClusterPlanType.dto.js'\nexport type {\n ClusterSpecChange,\n ClusterSpecChangeActor,\n ClusterSpecHistory,\n} from './dtos/ClusterSpecHistory.dto.js'\nexport type {\n CommonClusterDto,\n ExternalIdpConfig,\n OptimizeFilteringConfig,\n OptimizeFilteringIncludeExclude,\n OptimizeFilteringPatch,\n} from './dtos/CommonCluster.dto.js'\nexport type { ConsoleClusterDto } from './dtos/ConsoleCluster.dto.js'\nexport type {\n ClusterByClientV2Dto,\n ClusterDatacenterOptionV2Dto,\n ClusterDetailV2Dto,\n ClusterFacetsV2Dto,\n ClusterListItemV2Dto,\n ClusterParameterOptionV2Dto,\n ClusterParametersV2Dto,\n ControlResolvedPermissions,\n ControlSessionDto,\n ControlSessionUser,\n CursorPage,\n CursorParams,\n ListClustersV2Params,\n ListOrganizationsV2Params,\n ListOrgMembersV2Params,\n OrgDetailV2Dto,\n OrgListItemV2Dto,\n OrgMemberV2Dto,\n OrgSummaryV2Dto,\n} from './dtos/ControlV2.dto.js'\nexport type { EarlyAccessFeatureDto } from './dtos/EarlyAccessFeature.dto.js'\nexport type {\n CamundaWebApp,\n CamundaWebAppWithZeebe,\n ExternalClusterDto,\n ExternalOrganizationDto,\n} from './dtos/ExternalWebapp.dto.js'\n// Functions\nexport {\n type GenerationDto,\n type GenerationWithClusterCountDto,\n sortGenerationBySemverOfZeebe,\n type UpgradableGenerationsDto,\n} from './dtos/Generations.dto.js'\n// Namespace (type-only - contains only interfaces)\nexport type { Hdp } from './dtos/Hdp.dto.js'\nexport type {\n K8sConfig,\n K8sConfigLegacyFormat,\n K8sContext,\n K8sContextDto,\n} from './dtos/K8sContext.dto.js'\nexport type { MetaDto } from './dtos/Meta.dto.js'\nexport type {\n AutoJoinAssignment,\n LicensingModelType,\n OrganizationDto,\n OrganizationMetadata,\n OrgOwner,\n OrgWithNameAndSalesPlan,\n} from './dtos/Organization.dto.js'\nexport {\n LICENSING_MODEL_DISPLAY_NAMES,\n VALID_LICENSING_MODELS,\n} from './dtos/Organization.dto.js'\nexport type { OrganizationMemberDto } from './dtos/OrganizationMember.dto.js'\nexport type { OrganizationToSalesPlanDto } from './dtos/OrganizationToSalesPlan.dto.js'\nexport type {\n ReleaseTrainSanityReport,\n SanityFix,\n SanityRuleInfo,\n SanitySeverity,\n SanityViolation,\n} from './dtos/ReleaseTrainSanity.dto.js'\nexport type { RestoreDto, RestoreState } from './dtos/Restore.dto.js'\n// SalesPlan.dto - Types\nexport type {\n ClusterLimits,\n ConsumptionDataItem,\n Limits,\n SalesPlanDto,\n SalesPlanMetadata,\n} from './dtos/SalesPlan.dto.js'\n// SalesPlan.dto - Values (constants and functions)\nexport {\n allClusterBasedLimits,\n allSalesPlanLimits,\n deprecatedLimit,\n MAX_CLUSTER_CLIENTS_DEFAULT,\n MAX_CLUSTER_CLIENTS_DEV,\n RETENTION_LIMIT_DEFAULT,\n RETENTION_LIMIT_MAXIMUM,\n RETENTION_LIMIT_MINIMUM,\n unusedClusterBasedLimits,\n unusedSalesPlanLimits,\n} from './dtos/SalesPlan.dto.js'\nexport type { SecureConnectivityDto } from './dtos/SecureConnectivity.dto.js'\nexport type { SignupDto } from './dtos/Signup.dto.js'\nexport type {\n StorybookConfig,\n StorybookConfigBackup,\n StorybookConfigChannel,\n StorybookConfigDatacenter,\n StorybookConfigGeneration,\n} from './dtos/StorybookConfig.dto.js'\nexport type { SystemAuditDto } from './dtos/SystemAudit.dto.js'\n// UsageAlert.dto - Types\nexport type { UsageAlertDto } from './dtos/UsageAlert.dto.js'\n// UsageAlert.dto - Values (enum and constants)\nexport {\n UsageAlertInitValues,\n UsageAlertMetric,\n UsageAlertThresholdLimits,\n} from './dtos/UsageAlert.dto.js'\nexport type { UserMetaDataDto } from './dtos/UserMetaData.dto.js'\n// Lucene-style table search (parser + AST \u2192 SQL compiler + field registries).\nexport {\n type AndNode,\n CLUSTER_DEFAULT_SEARCH_FIELDS,\n CLUSTER_SEARCH_FIELDS,\n type CompileContext,\n type CompiledQuery,\n compileQuery,\n type FieldBinding,\n findSearchField,\n isLuceneQueryError,\n LuceneQueryError,\n likeArgument,\n type NotNode,\n ORG_DEFAULT_SEARCH_FIELDS,\n ORGANIZATION_SEARCH_FIELDS,\n type OrNode,\n parseLuceneQuery,\n type QueryNode,\n type RangeNode,\n type SearchFieldCapability,\n type SearchFieldSpec,\n type SearchFieldType,\n type SearchTermOperator,\n type TermNode,\n} from './search/index.js'\n\n// ============================================================================\n// Enums (runtime values)\n// ============================================================================\n\nexport {\n AlertSubscriptionReportType,\n AlertSubscriptionType,\n} from './enums/AlertSubscription.enum.js'\nexport { AuditEntity, AuditEntityAttribute } from './enums/AuditEntity.enum.js'\nexport { AuditService } from './enums/AuditService.enum.js'\nexport { BackupStatus } from './enums/BackupStatus.enum.js'\nexport {\n ClusterBulkOperationStatus,\n ClusterBulkOperationType,\n} from './enums/ClusterBulkOperation.enum.js'\nexport { ClusterClientPermission } from './enums/ClusterClientPermissions.enum.js'\nexport { ClusterEncryptionKey } from './enums/ClusterEncryptionKey.enum.js'\nexport { ClusterStatus } from './enums/ClusterStatus.enum.js'\nexport { ConsoleAPIClientPermission } from './enums/ConsoleApiClientPermission.enum.js'\nexport { ErrorType } from './enums/ErrorType.enum.js'\nexport type {\n AssignableOrganizationRoleType,\n OrganizationRoleType,\n UnassignableOrganizationRoleType,\n} from './enums/OrganizationRole.enum.js'\nexport {\n AssignableOrganizationRole,\n LegacyHeldOrganizationRole,\n OrganizationRole,\n UnassignableOrganizationRole,\n} from './enums/OrganizationRole.enum.js'\nexport { SseEntity, SseType } from './enums/Sse.enum.js'\nexport {\n SystemAuditEntity,\n SystemAuditEntityAttribute,\n} from './enums/SystemAuditEntity.enum.js'\n\n// ============================================================================\n// Permissions - Namespaces (runtime values)\n// ============================================================================\n\nexport { AccountsPermissions } from './permissions/accounts.permissions.js'\nexport { AlertDistributorPermissions } from './permissions/alert-distributor.permissions.js'\nexport { AuditLoggerPermissions } from './permissions/auditlogger.permissions.js'\nexport {\n accountsUserFeaturesFromPermissions,\n consoleUserFeaturesFromPermissions,\n} from './permissions/combo.js'\nexport { ConsolePermissions } from './permissions/console.permissions.js'\nexport { NotificationPermissions } from './permissions/notification.permissions.js'\n// profile.permissions - Types\nexport type { OnboardConfig } from './permissions/profile.permissions.js'\n// profile.permissions - Values (constants)\n// NOTE: the `allowed` email lists (CLOUD_TEAM_EMAILS, SRE_TEAM_EMAILS, etc.)\n// intentionally live in the private `@camunda-cloud/shared-backend` package\n// instead of here, since this package is published publicly to npm.\nexport { PROFILES } from './permissions/profile.permissions.js'\nexport { expandRolesToPermissions } from './permissions/roleExpansion.utils.js'\n\n// ============================================================================\n// Types - Type-only exports (interfaces and type aliases)\n// ============================================================================\n\nexport type { AuditData } from './types/AuditData.type.js'\n// AutoSleep.type - Types\nexport type {\n ActivitySleepEligibilityOptions,\n SleepCronEligibilityOptions,\n} from './types/AutoSleep.type.js'\n// AutoSleep.type - Values (constants and functions)\nexport {\n INTERNAL_LOW_HARDWARE_PLAN_NAME,\n isActivitySleepEligible,\n isClusterTagEligibleForSleepCron,\n isSalesPlanEligibleForSleepCron,\n isSleepCronEligible,\n SLEEP_CRON_ELIGIBLE_TAGS,\n} from './types/AutoSleep.type.js'\nexport type {\n BotContext,\n BotOptions,\n BotRequest,\n GetUserDetailsResponse,\n ListRolesForUserResponse,\n UpdateUserRolesRequest,\n UpdateUserRolesResponse,\n UserContext,\n UserDetails,\n} from './types/Bot.types.js'\n// BulkOperation.type - Types\nexport type {\n BulkClusterDeletionContent,\n BulkClusterDeletionItem,\n BulkClusterGenerationUpdateItem,\n BulkClusterPlanTypeUpdateContent,\n BulkClusterPlanTypeUpdateItem,\n BulkClusterPlanUpdateContent,\n BulkClusterPlanUpdateItem,\n BulkGenerationUpdateContent,\n GenericBulkClusterOperationContent,\n GenericBulkOperationContent,\n GenericClusterBulkOperationItem,\n} from './types/BulkOperation.type.js'\n// BulkOperation.type - Functions (type guards)\nexport {\n isBulkClusterDeletionItem,\n isBulkClusterPlanTypeUpdateItem,\n isBulkClusterPlanUpdateItem,\n isIsBulkClusterGenerationUpdateIten,\n} from './types/BulkOperation.type.js'\n// C8ClusterComponentVersions.type - Types\nexport type {\n ImmutableZeebeClusterVersionsDto,\n MutableZeebeClusterVersionsDto,\n ZeebeClusterVersionsDto,\n} from './types/C8ClusterComponentVersions.type.js'\n// C8ClusterComponentVersions.type - Values (constants)\nexport {\n AllThings,\n ImmutableThings,\n MutableThings,\n} from './types/C8ClusterComponentVersions.type.js'\n// CamundaClusterLabels.type - Types\nexport type {\n CamundaClusterStage,\n CamundaClusterStageLabel,\n ClusterLabels,\n} from './types/CamundaClusterLabels.type.js'\n// CamundaClusterLabels.type - Values (constants)\nexport {\n ALLOWED_CAMUNDA_LABELS,\n StageClusterLabels,\n} from './types/CamundaClusterLabels.type.js'\n// Chargebee.type - Types\nexport type { SubscriptionItem } from './types/Chargebee.type.js'\n// Chargebee.type - Values (enums)\nexport { ConsumptionData, ConsumptionDataType } from './types/Chargebee.type.js'\n// ClusterBulkOperation.type - Types\nexport type {\n ClusterBulkOperationAck,\n ClusterBulkOperationClusterDto,\n ClusterBulkOperationContent,\n ClusterBulkOperationDto,\n ClusterBulkOperationGenerationUpdateParameter,\n ClusterBulkOperationParameter,\n ClusterBulkOperationPlanTypeUpdateParameter,\n ClusterBulkOperationPlanUpdateParameter,\n ClusterBulkOperationPostContent,\n ClusterSleepWakeupParameter,\n} from './types/ClusterBulkOperation.type.js'\nexport type {\n ClusterModificationConfigDto,\n ClusterModificationDto,\n} from './types/ClusterModification.type.js'\n// ClusterPlanFields.type - Values (field spec and type guard)\nexport {\n CLUSTER_PLAN_FIELDS,\n type ClusterPlanFieldSpec,\n type ClusterPlanFieldTree,\n isClusterPlanFieldSpec,\n} from './types/ClusterPlanFields.type.js'\nexport type {\n ClusterPlanModificationAck,\n ClusterPlanModificationConfig,\n ClusterPlanModificationDto,\n} from './types/ClusterPlanModification.type.js'\n// ClusterPlanTypeAvailabilityClass.type - Values (enum and function)\nexport {\n ClusterPlanTypeAvailabilityClass,\n sortByAvailabilityClasses,\n} from './types/ClusterPlanTypeAvailabilityClass.type.js'\n// ClusterPlanTypeCategory.type - Values (enum and functions)\nexport {\n ClusterPlanTypeCategory,\n hasAvailabilityClass,\n sortByClusterPlanTypeCategory,\n} from './types/ClusterPlanTypeCategory.type.js'\nexport type { ClusterPlanTypesToConfig } from './types/ClusterPlanTypesToConfig.type.js'\nexport type { ClusterPlanTypesToReserved } from './types/ClusterPlanTypesToReserved.type.js'\nexport type {\n ClusterUsageDataRequest,\n ClusterUsageMetricsAddRequestByMetricHeap,\n ClusterUsageMetricsData,\n ClusterUsageMetricsFilter,\n ClusterUsageOrgStartDate,\n} from './types/ClusterUsageMetrics.type.js'\n// Namespace with runtime values (consts, functions, enums)\nexport { ConsoleSM } from './types/ConsoleSelfManaged.type.js'\n// Namespace (type-only - contains only interfaces)\nexport type { ConsoleSMAdminApi } from './types/ConsoleSelfManagedAdminApi.type.js'\n// Dashboard.types - Types\nexport type {\n DashboardConfig,\n DashboardMappingItem,\n DashboardMappingTarget,\n DashboardResultPrimitive,\n DashboardResultRow,\n EngineeringOperationsDashboardResponse,\n} from './types/Dashboard.types.js'\nexport type { EnterpriseIncludingValueMetrics } from './types/EnterpriseIncludingValueMetrics.type.js'\nexport type {\n HdpTenantUsageBreakdown,\n HdpTenantUsagePerClusterPoint,\n HdpTenantUsagePoint,\n} from './types/HdpTenantUsage.type.js'\n// hdp.types - Types (interfaces)\nexport type {\n AlertSubscription as HdpAlertSubscription,\n Audit as HdpAudit,\n ByomClient as HdpByomClient,\n Channel as HdpChannel,\n Cluster as HdpCluster,\n ClusterBackup as HdpClusterBackup,\n ClusterBackupSchedule as HdpClusterBackupSchedule,\n ClusterBulkOperation as HdpClusterBulkOperation,\n ClusterClient as HdpClusterClient,\n ClusterModification as HdpClusterModification,\n ClusterPlan as HdpClusterPlan,\n ClusterPlanType as HdpClusterPlanType,\n ConnectorSecret as HdpConnectorSecret,\n ConsoleApiClient as HdpConsoleApiClient,\n Datacenter as HdpDatacenter,\n Generation as HdpGeneration,\n HdpBackendChangeEvent,\n HdpClusterModificationConfig,\n HdpEntity,\n HdpPrometheusDataCapacityDataPoint,\n Invite as HdpInvite,\n LlmSpend as HdpLlmSpend,\n Organization as HdpOrganization,\n SecureConnectivity as HdpSecureConnectivity,\n SystemAudit as HdpSystemAudit,\n TelemetryData as HdpTelemetryData,\n UsageAlert as HdpUsageAlert,\n User as HdpUser,\n UserLogin as HdpUserLogin,\n} from './types/hdp.types.js'\n// hdp.types - Values (enums)\nexport {\n AlertSubscriptionReportType as HdpAlertSubscriptionReportType,\n AlertSubscriptionType as HdpAlertSubscriptionType,\n} from './types/hdp.types.js'\n// notification.type - Types\nexport type {\n GlobalNotification,\n NotificationDto,\n NotificationMeta,\n NotificationOptions,\n NotificationPermission,\n NotificationSource,\n NotificationState,\n NotificationType,\n OrgNotification,\n UserNotification,\n UserOrgNotification,\n} from './types/notification.type.js'\n// notification.type - Values (enums and constants)\nexport {\n NotificationPermissionValues,\n NotificationSourceEnum,\n NotificationStateEnum,\n NotificationTypeEnum,\n} from './types/notification.type.js'\n// OrganizationPermission.type - Types\nexport type {\n CreateReadUpdateDelete,\n OrganizationPermissions,\n} from './types/OrganizationPermission.type.js'\n// OrganizationPermission.type - Values (constants)\nexport {\n OrganizationPermissionsDescriptions,\n PermissionsForOrganizationRole,\n} from './types/OrganizationPermission.type.js'\n// Roles.js - Types\nexport type {\n AccountRoles,\n ConsoleRoles,\n ModelerRoles,\n Roles,\n} from './types/Roles.js'\n// Roles.js - Values (constants)\nexport { SAFE_ROLES } from './types/Roles.js'\n// SalesPlanType.type - Types\nexport type {\n DisplayedSalesPlan,\n RevisitedSalesPlanName,\n} from './types/SalesPlanType.type.js'\n// SalesPlanType.type - Values (enums and functions)\nexport {\n AnalyticsSalesPlanType,\n getAnalyticsSalesPlanFromOrgSalesPlan,\n getDisplayedSalesPlan,\n getRevisitedSalesPlanName,\n OPTIMIZE_DISABLED_PLAN_TYPES,\n SalesPlanType,\n} from './types/SalesPlanType.type.js'\n// SpamDetection.type - Types\nexport type { SpamDetectionPatterns } from './types/SpamDetection.type.js'\n// SpamDetection.type - Values (constants)\nexport { TEERGRUBE_PATTERNS } from './types/SpamDetection.type.js'\nexport type {\n AlertSubscriptionSseEvent,\n BackupSseEvent,\n ClusterClientSseEvent,\n ClusterSseEvent,\n ConnectorSecretsSseEvent,\n ConsoleApiClientSseEvent,\n ConsoleSseEvent,\n MonitoringSseEvent,\n SecureConnectivitySseEvent,\n SseClusterPayload,\n SseMonitoringPayload,\n SseSecureConnectivityPayload,\n} from './types/SseEvent.type.js'\n// Namespace (type-only - contains only interfaces)\nexport type { AccountsStats } from './types/Stats.types.js'\n// Survey.type - Types\nexport type { Persona, SurveyDto } from './types/Survey.type.js'\n// Survey.type - Values (enum)\nexport { FeedbackType } from './types/Survey.type.js'\n// SuspendStrategy.type - Types\nexport type {\n GetSuspendStrategyOptions,\n SuspendStrategy,\n} from './types/SuspendStrategy.type.js'\n// SuspendStrategy.type - Values (function)\nexport { getSuspendStrategy } from './types/SuspendStrategy.type.js'\nexport type { SystemAuditData } from './types/SystemAuditData.type.js'\n\n// Namespace (runtime value)\nexport { Telemetry } from './types/Telemetry.type.js'\n\n// TrialManagement.types - Types\nexport type {\n ExtensionListItem,\n ExtensionListResponse,\n OrgTrialDetail,\n TrialExtensionSource,\n TrialManagementStats,\n} from './types/TrialManagement.types.js'\n\n// User.type - Types\nexport type {\n AccountsData,\n AppMetadata,\n BasicUser,\n BlockedFor,\n Identity,\n OrgMembership,\n User,\n UserMetadata,\n UserRequest,\n} from './types/User.type.js'\n\n// User.type - Values (enum)\nexport { UserMetadataEvent } from './types/User.type.js'\n\nexport type {\n UniqueTaskUser,\n ValueMetrics,\n ValueMetricsPerYearMonth,\n} from './types/ValueMetrics.type.js'\n\n// ============================================================================\n// Utils - Classes (runtime values)\n// ============================================================================\n\nexport {\n CLOUD_PROVIDER_ORDER,\n getCloudProviderLabel,\n getCloudProviderRank,\n} from './utils/cloudProvider.utils.js'\nexport { ConsoleSelfManagedUtils } from './utils/console-sm.utils.js'\nexport type {\n CronScheduleValidationFailure,\n CronScheduleValidationResult,\n CronScheduleValidationSuccess,\n} from './utils/cronSchedule.utils.js'\nexport {\n BACKUP_SCHEDULE_MIN_INTERVAL_MINUTES,\n validateCronSchedule,\n} from './utils/cronSchedule.utils.js'\nexport {\n deriveEncryptionStatus,\n type EncryptionStatus,\n isEncryptionStatus,\n} from './utils/encryptionStatus.utils.js'\n// enterprise-connection.utils - Types\nexport type { EnterpriseConnectionOrganizationAssignment } from './utils/enterprise-connection.utils.js'\n// enterprise-connection.utils - Values (functions)\nexport {\n enterpriseConnectionMetadataToOrganizationAssignments,\n organizationAssignmentsToEnterpriseConnectionMetadata,\n} from './utils/enterprise-connection.utils.js'\nexport {\n addMonthsClamped,\n DEFAULT_ENTERPRISE_DURATION_IN_MONTHS,\n diffInWholeMonths,\n type EnterpriseTermWindow,\n getCurrentEnterpriseTerm,\n peakWithinTerm,\n toUtcDayStartMs,\n} from './utils/enterpriseTerm.utils.js'\nexport type { EnvVarEntry } from './utils/envVars.js'\nexport { parseEnvVars, serializeEnvVars } from './utils/envVars.js'\nexport {\n deriveFailoverKeyPolicyPrincipals,\n type FailoverKeyPolicyPrincipals,\n} from './utils/failoverKeyPolicy.utils.js'\nexport {\n KMS_ARN,\n KMS_MRK_ARN,\n type KmsArnValidationError,\n type ParsedKmsArn,\n parseKmsArn,\n validateKmsArnForRegion,\n} from './utils/kmsArn.utils.js'\nexport { validateLabels } from './utils/labelValidator.utils.js'\nexport { ObjectMergeUtils } from './utils/objectMerge.utils.js'\nexport {\n getPermissionsByRoles,\n getUserPermissionsForOrg,\n} from './utils/orgs/OrgHelper.js'\n\n// PasswordPolicy - Types\nexport type {\n PasswordPolicyRequest,\n PasswordPolicyResult,\n} from './utils/PasswordPolicy.js'\n\n// PasswordPolicy - Values (constants and function)\nexport {\n MAXLENGTH as PASSWORD_POLICY_MAXLENGTH,\n MINLENGTH as PASSWORD_POLICY_MINLENGTH,\n passwordPolicyCheck,\n} from './utils/PasswordPolicy.js'\n\nexport {\n allSettledResultsCounts,\n getFulfilledPromises,\n getRejectedPromises,\n getSettledSummary,\n} from './utils/settledPromises.util.js'\n\nexport {\n isValidAwsArn,\n isValidCIDR,\n isValidCIDRList,\n isValidClientName,\n isValidHostname,\n isValidPrivateLinkRegion,\n normalizeCIDRList,\n} from './utils/string-validation.utils.js'\nexport {\n extractCamundaUserEmail,\n guessName,\n isCamundaUserId,\n} from './utils/user.utils.js'\n\n// versionCheck.utils - Values (enum and function)\nexport {\n checkVersion,\n isAppIntegrationsVersionSupported,\n VersionCheckOperator,\n} from './utils/versionCheck.utils.js'\n\n// ============================================================================\n// Config - Configuration files and types\n// ============================================================================\n\nexport { default as CAMUNDI_PERMISSION_RULES } from './config/camundi-permission-rules.js'\nexport type { CamundiPermissionRules } from './config/camundi-permission-rules.types.js'\n\nexport {\n augmentCamundiPermissions,\n getApplicableRolesForEmployee,\n isManager,\n} from './utils/camundiPermissionAugmenter.utils.js'\n"],
|
|
5
|
+
"mappings": "AAUA,SAAS,KAAK,MAAM,QAAQ,QAAQ,YAAY;AAChD;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AACrC,SAAS,iDAAiD;AAK1D,SAAS,wCAAwC;AAgBjD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAoDP;AAAA,EAGE;AAAA,OAEK;AAkBP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAoBP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAcP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EAEE;AAAA,EACA;AAAA,EAGA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EAEA;AAAA,OAQK;AAMP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa,4BAA4B;AAClD,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,+BAA+B;AACxC,SAAS,4BAA4B;AACrC,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAC3C,SAAS,iBAAiB;AAM1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,WAAW,eAAe;AACnC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAMP,SAAS,2BAA2B;AACpC,SAAS,mCAAmC;AAC5C,SAAS,8BAA8B;AACvC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;AACnC,SAAS,+BAA+B;AAOxC,SAAS,gBAAgB;AACzB,SAAS,gCAAgC;AAazC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA2BP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAIP,SAAS,iBAAiB,2BAA2B;AAmBrD;AAAA,EACE;AAAA,EAGA;AAAA,OACK;AAOP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAWP,SAAS,iBAAiB;AAmD1B;AAAA,EACiC,+BAA/BA;AAAA,EACyB,yBAAzBC;AAAA,OACK;AAgBP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AASP,SAAS,kBAAkB;AAO3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIP,SAAS,0BAA0B;AAoBnC,SAAS,oBAAoB;AAO7B,SAAS,0BAA0B;AAInC,SAAS,iBAAiB;AAyB1B,SAAS,yBAAyB;AAYlC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,+BAA+B;AAMxC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EAEA;AAAA,OACK;AAIP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,cAAc,wBAAwB;AAC/C;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AASP;AAAA,EACe;AAAA,EACA;AAAA,EACb;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP,SAAoB,WAAXC,gBAA2C;AAGpD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;",
|
|
6
6
|
"names": ["AlertSubscriptionReportType", "AlertSubscriptionType", "default"]
|
|
7
7
|
}
|
|
@@ -2,3 +2,35 @@ export interface HdpTenantUsagePoint {
|
|
|
2
2
|
ts: number;
|
|
3
3
|
value: number;
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* One cluster's peak active tenants on one UTC day.
|
|
7
|
+
*
|
|
8
|
+
* `ActiveTenants` is reported per cluster, so this is the granularity HDP
|
|
9
|
+
* actually stores; `HdpTenantUsagePoint` is the org roll-up of it (the sum of
|
|
10
|
+
* a day's per-cluster peaks).
|
|
11
|
+
*/
|
|
12
|
+
export interface HdpTenantUsagePerClusterPoint extends HdpTenantUsagePoint {
|
|
13
|
+
clusterId: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Tenant usage at both granularities.
|
|
17
|
+
*
|
|
18
|
+
* `orgTotals` is what a billing figure is derived from, and is the same data
|
|
19
|
+
* the org-total endpoint serves for the same window — it carries no row cap.
|
|
20
|
+
* `perCluster` is the per-cluster detail behind it and is the only half that
|
|
21
|
+
* can be truncated for an org with very many clusters, so a capped response
|
|
22
|
+
* can never move the org's number.
|
|
23
|
+
*
|
|
24
|
+
* The two do not necessarily reconcile, for two reasons worth knowing before
|
|
25
|
+
* reading a discrepancy as a bug:
|
|
26
|
+
* - a peak is not additive across days, so an org's peak for a period is not
|
|
27
|
+
* the sum of its clusters' peaks for that period (they can fall on
|
|
28
|
+
* different days);
|
|
29
|
+
* - rows HDP holds without a cluster id count toward `orgTotals` (matching
|
|
30
|
+
* the org-total query) but cannot be attributed to a cluster, so they are
|
|
31
|
+
* absent from `perCluster`.
|
|
32
|
+
*/
|
|
33
|
+
export interface HdpTenantUsageBreakdown {
|
|
34
|
+
orgTotals: HdpTenantUsagePoint[];
|
|
35
|
+
perCluster: HdpTenantUsagePerClusterPoint[];
|
|
36
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { TrialExtensionSurveyAnswer } from '../constants/trialExtensionSurvey.const.js';
|
|
2
|
+
export type TrialExtensionSource = 'self-service' | 'admin' | 'external';
|
|
3
|
+
export interface TrialManagementStats {
|
|
4
|
+
updatedAt: number;
|
|
5
|
+
overview: {
|
|
6
|
+
activeTrials: number;
|
|
7
|
+
expiredTrials: number;
|
|
8
|
+
withClusterCreated: number;
|
|
9
|
+
expiringIn7Days: number;
|
|
10
|
+
expiringIn30Days: number;
|
|
11
|
+
avgTrialDaysUsed: number;
|
|
12
|
+
};
|
|
13
|
+
signupTrend: Array<{
|
|
14
|
+
weekStart: number;
|
|
15
|
+
newTrialOrgs: number;
|
|
16
|
+
}>;
|
|
17
|
+
extensionTrend: Array<{
|
|
18
|
+
weekStart: number;
|
|
19
|
+
extensions: number;
|
|
20
|
+
}>;
|
|
21
|
+
piTrend: {
|
|
22
|
+
monthlyTrend: Array<{
|
|
23
|
+
year: number;
|
|
24
|
+
month: number;
|
|
25
|
+
processInstances: number;
|
|
26
|
+
}>;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface ExtensionListItem {
|
|
30
|
+
id: number;
|
|
31
|
+
orgId: string;
|
|
32
|
+
orgName: string;
|
|
33
|
+
ownerName: string;
|
|
34
|
+
ownerEmail: string;
|
|
35
|
+
createdAt: number;
|
|
36
|
+
previousExpirationDate: number | undefined;
|
|
37
|
+
newExpirationDate: number;
|
|
38
|
+
source: TrialExtensionSource;
|
|
39
|
+
actorUserId: string | undefined;
|
|
40
|
+
extensionsUsedAfter: number;
|
|
41
|
+
surveyAnswers: TrialExtensionSurveyAnswer[] | undefined;
|
|
42
|
+
}
|
|
43
|
+
export interface ExtensionListResponse {
|
|
44
|
+
items: ExtensionListItem[];
|
|
45
|
+
total: number;
|
|
46
|
+
page: number;
|
|
47
|
+
pageSize: number;
|
|
48
|
+
}
|
|
49
|
+
export interface OrgTrialDetail {
|
|
50
|
+
orgId: string;
|
|
51
|
+
orgName: string;
|
|
52
|
+
metadata: Record<string, unknown>;
|
|
53
|
+
trialExpirationDate: number | undefined;
|
|
54
|
+
trialStateExpired: boolean;
|
|
55
|
+
trialExtensionsUsed: number;
|
|
56
|
+
owner: {
|
|
57
|
+
owner: string;
|
|
58
|
+
email: string;
|
|
59
|
+
first: string;
|
|
60
|
+
last: string;
|
|
61
|
+
};
|
|
62
|
+
extensionHistory: ExtensionListItem[];
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=TrialManagement.types.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cloud providers in their canonical display order. Values match the lowercase
|
|
3
|
+
* `provider` strings returned by the cluster APIs.
|
|
4
|
+
*/
|
|
5
|
+
export declare const CLOUD_PROVIDER_ORDER: readonly string[];
|
|
6
|
+
/**
|
|
7
|
+
* Proper-case display label for a cloud `provider` string (e.g. `aws` -> `AWS`,
|
|
8
|
+
* `azure` -> `Azure`). Unknown providers are capitalized (first letter upper,
|
|
9
|
+
* rest lower) so they still render tidily.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getCloudProviderLabel(provider: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Sort rank for a cloud `provider` following {@link CLOUD_PROVIDER_ORDER}. Known
|
|
14
|
+
* providers rank by their position; unknown or `undefined` providers rank last
|
|
15
|
+
* (and keep their relative order via a stable sort). Accepts either the raw
|
|
16
|
+
* lowercase provider string or a proper-case label (e.g. `AWS`, `Azure`).
|
|
17
|
+
*/
|
|
18
|
+
export declare function getCloudProviderRank(provider: string | undefined): number;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const CLOUD_PROVIDER_ORDER = ["aws", "gcp", "azure"];
|
|
2
|
+
const CLOUD_PROVIDER_LABELS = {
|
|
3
|
+
aws: "AWS",
|
|
4
|
+
gcp: "GCP",
|
|
5
|
+
azure: "Azure"
|
|
6
|
+
};
|
|
7
|
+
function getCloudProviderLabel(provider) {
|
|
8
|
+
const key = provider.toLowerCase();
|
|
9
|
+
return CLOUD_PROVIDER_LABELS[key] ?? provider.charAt(0).toUpperCase() + provider.slice(1).toLowerCase();
|
|
10
|
+
}
|
|
11
|
+
function getCloudProviderRank(provider) {
|
|
12
|
+
if (provider === void 0) {
|
|
13
|
+
return CLOUD_PROVIDER_ORDER.length;
|
|
14
|
+
}
|
|
15
|
+
const index = CLOUD_PROVIDER_ORDER.indexOf(provider.toLowerCase());
|
|
16
|
+
return index === -1 ? CLOUD_PROVIDER_ORDER.length : index;
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
CLOUD_PROVIDER_ORDER,
|
|
20
|
+
getCloudProviderLabel,
|
|
21
|
+
getCloudProviderRank
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=cloudProvider.utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/cloudProvider.utils.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\n// Single source of truth for how cloud providers are ordered and labeled in the\n// UI. Datacenter/provider dropdowns group and sort by this canonical order\n// (AWS, then GCP, then Azure) rather than alphabetically, and render\n// proper-case labels rather than the raw lowercase `provider` strings the\n// cluster APIs return.\n\n/**\n * Cloud providers in their canonical display order. Values match the lowercase\n * `provider` strings returned by the cluster APIs.\n */\nexport const CLOUD_PROVIDER_ORDER: readonly string[] = ['aws', 'gcp', 'azure']\n\nconst CLOUD_PROVIDER_LABELS: Record<string, string> = {\n aws: 'AWS',\n gcp: 'GCP',\n azure: 'Azure',\n}\n\n/**\n * Proper-case display label for a cloud `provider` string (e.g. `aws` -> `AWS`,\n * `azure` -> `Azure`). Unknown providers are capitalized (first letter upper,\n * rest lower) so they still render tidily.\n */\nexport function getCloudProviderLabel(provider: string): string {\n const key = provider.toLowerCase()\n return (\n CLOUD_PROVIDER_LABELS[key] ??\n provider.charAt(0).toUpperCase() + provider.slice(1).toLowerCase()\n )\n}\n\n/**\n * Sort rank for a cloud `provider` following {@link CLOUD_PROVIDER_ORDER}. Known\n * providers rank by their position; unknown or `undefined` providers rank last\n * (and keep their relative order via a stable sort). Accepts either the raw\n * lowercase provider string or a proper-case label (e.g. `AWS`, `Azure`).\n */\nexport function getCloudProviderRank(provider: string | undefined): number {\n if (provider === undefined) {\n return CLOUD_PROVIDER_ORDER.length\n }\n const index = CLOUD_PROVIDER_ORDER.indexOf(provider.toLowerCase())\n return index === -1 ? CLOUD_PROVIDER_ORDER.length : index\n}\n"],
|
|
5
|
+
"mappings": "AAgBO,MAAM,uBAA0C,CAAC,OAAO,OAAO,OAAO;AAE7E,MAAM,wBAAgD;AAAA,EACpD,KAAK;AAAA,EACL,KAAK;AAAA,EACL,OAAO;AACT;AAOO,SAAS,sBAAsB,UAA0B;AAC9D,QAAM,MAAM,SAAS,YAAY;AACjC,SACE,sBAAsB,GAAG,KACzB,SAAS,OAAO,CAAC,EAAE,YAAY,IAAI,SAAS,MAAM,CAAC,EAAE,YAAY;AAErE;AAQO,SAAS,qBAAqB,UAAsC;AACzE,MAAI,aAAa,QAAW;AAC1B,WAAO,qBAAqB;AAAA,EAC9B;AACA,QAAM,QAAQ,qBAAqB,QAAQ,SAAS,YAAY,CAAC;AACjE,SAAO,UAAU,KAAK,qBAAqB,SAAS;AACtD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Smallest gap we allow between two runs of a backup schedule, in minutes.
|
|
3
|
+
* Same 15-minute floor the manual (on-demand) create throttle uses — a
|
|
4
|
+
* schedule must not be able to produce backups faster than a customer could
|
|
5
|
+
* trigger them by hand.
|
|
6
|
+
*/
|
|
7
|
+
export declare const BACKUP_SCHEDULE_MIN_INTERVAL_MINUTES: number;
|
|
8
|
+
export interface CronScheduleValidationSuccess {
|
|
9
|
+
valid: true;
|
|
10
|
+
/**
|
|
11
|
+
* Smallest gap between two consecutive runs, in minutes. Capped at one day:
|
|
12
|
+
* day-of-month / day-of-week restrictions only ever push runs further apart,
|
|
13
|
+
* so they are deliberately not taken into account.
|
|
14
|
+
*/
|
|
15
|
+
minIntervalMinutes: number;
|
|
16
|
+
}
|
|
17
|
+
export interface CronScheduleValidationFailure {
|
|
18
|
+
valid: false;
|
|
19
|
+
/** Human-readable, safe to hand straight back to an API caller. */
|
|
20
|
+
reason: string;
|
|
21
|
+
}
|
|
22
|
+
export type CronScheduleValidationResult = CronScheduleValidationSuccess | CronScheduleValidationFailure;
|
|
23
|
+
/**
|
|
24
|
+
* Validates a standard five-field cron expression (`minute hour day-of-month
|
|
25
|
+
* month day-of-week`) — the syntax the operator's `BackupSchedule` CR expects —
|
|
26
|
+
* and computes how often it fires.
|
|
27
|
+
*
|
|
28
|
+
* Kept dependency-free on purpose: console-backend has no cron library, and the
|
|
29
|
+
* K8s API would otherwise be the first thing to see (and reject) a malformed
|
|
30
|
+
* expression, turning a customer typo into a 500.
|
|
31
|
+
*
|
|
32
|
+
* Supported per field: `*`, single values, lists (`0,30`), ranges (`1-5`) and
|
|
33
|
+
* steps — `0-30/10`, `5/30`, or `*` followed by `/15`. No whitespace is allowed
|
|
34
|
+
* around the `/` (fields are split on whitespace first, so a spaced-out step
|
|
35
|
+
* reads as extra fields). Month and day-of-week additionally accept their
|
|
36
|
+
* three-letter names. Seconds (a sixth field) and non-standard macros
|
|
37
|
+
* (`@daily`, `L`, `W`, `#`) are rejected — the operator does not support them
|
|
38
|
+
* either.
|
|
39
|
+
*/
|
|
40
|
+
export declare function validateCronSchedule(schedule: string, options?: {
|
|
41
|
+
minIntervalMinutes?: number;
|
|
42
|
+
}): CronScheduleValidationResult;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { HOTBACKUP_MIN_CREATE_PERIOD } from "../constants/misc.const.js";
|
|
2
|
+
const BACKUP_SCHEDULE_MIN_INTERVAL_MINUTES = HOTBACKUP_MIN_CREATE_PERIOD / (60 * 1e3);
|
|
3
|
+
const MINUTES_PER_DAY = 24 * 60;
|
|
4
|
+
const MONTH_NAMES = [
|
|
5
|
+
"JAN",
|
|
6
|
+
"FEB",
|
|
7
|
+
"MAR",
|
|
8
|
+
"APR",
|
|
9
|
+
"MAY",
|
|
10
|
+
"JUN",
|
|
11
|
+
"JUL",
|
|
12
|
+
"AUG",
|
|
13
|
+
"SEP",
|
|
14
|
+
"OCT",
|
|
15
|
+
"NOV",
|
|
16
|
+
"DEC"
|
|
17
|
+
];
|
|
18
|
+
const DAY_NAMES = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];
|
|
19
|
+
const CRON_FIELDS = [
|
|
20
|
+
{ name: "minute", min: 0, max: 59 },
|
|
21
|
+
{ name: "hour", min: 0, max: 23 },
|
|
22
|
+
{ name: "day of month", min: 1, max: 31 },
|
|
23
|
+
{ name: "month", min: 1, max: 12, names: MONTH_NAMES },
|
|
24
|
+
{ name: "day of week", min: 0, max: 6, maxInput: 7, names: DAY_NAMES }
|
|
25
|
+
];
|
|
26
|
+
function validateCronSchedule(schedule, options = {}) {
|
|
27
|
+
const minIntervalMinutes = options.minIntervalMinutes ?? BACKUP_SCHEDULE_MIN_INTERVAL_MINUTES;
|
|
28
|
+
if (typeof schedule !== "string" || schedule.trim().length === 0) {
|
|
29
|
+
return { valid: false, reason: "Schedule must be a non-empty cron string" };
|
|
30
|
+
}
|
|
31
|
+
const fields = schedule.trim().split(/\s+/u);
|
|
32
|
+
if (fields.length !== CRON_FIELDS.length) {
|
|
33
|
+
return {
|
|
34
|
+
valid: false,
|
|
35
|
+
reason: `Schedule must be a cron expression with ${CRON_FIELDS.length} fields (minute hour day-of-month month day-of-week), got ${fields.length}`
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const values = [];
|
|
39
|
+
for (const [index, spec] of CRON_FIELDS.entries()) {
|
|
40
|
+
const parsed = parseField(fields[index], spec);
|
|
41
|
+
if ("reason" in parsed) {
|
|
42
|
+
return { valid: false, reason: parsed.reason };
|
|
43
|
+
}
|
|
44
|
+
values.push(parsed.values);
|
|
45
|
+
}
|
|
46
|
+
const [minutes, hours] = values;
|
|
47
|
+
const gap = smallestIntervalMinutes(minutes, hours);
|
|
48
|
+
if (gap < minIntervalMinutes) {
|
|
49
|
+
return {
|
|
50
|
+
valid: false,
|
|
51
|
+
reason: `Schedule runs every ${gap} minute(s); backups can be scheduled at most once every ${minIntervalMinutes} minutes`
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return { valid: true, minIntervalMinutes: gap };
|
|
55
|
+
}
|
|
56
|
+
function smallestIntervalMinutes(minutes, hours) {
|
|
57
|
+
let smallest = MINUTES_PER_DAY;
|
|
58
|
+
for (let index = 1; index < minutes.length; index++) {
|
|
59
|
+
smallest = Math.min(smallest, minutes[index] - minutes[index - 1]);
|
|
60
|
+
}
|
|
61
|
+
const firstMinute = minutes[0];
|
|
62
|
+
const lastMinute = minutes[minutes.length - 1];
|
|
63
|
+
let smallestHourGap = 24;
|
|
64
|
+
for (let index = 1; index < hours.length; index++) {
|
|
65
|
+
smallestHourGap = Math.min(smallestHourGap, hours[index] - hours[index - 1]);
|
|
66
|
+
}
|
|
67
|
+
if (hours.length > 1) {
|
|
68
|
+
smallestHourGap = Math.min(
|
|
69
|
+
smallestHourGap,
|
|
70
|
+
24 - hours[hours.length - 1] + hours[0]
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
return Math.min(
|
|
74
|
+
smallest,
|
|
75
|
+
smallestHourGap * 60 - lastMinute + firstMinute,
|
|
76
|
+
MINUTES_PER_DAY
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
function parseField(field, spec) {
|
|
80
|
+
const collected = /* @__PURE__ */ new Set();
|
|
81
|
+
for (const part of field.split(",")) {
|
|
82
|
+
const parsed = parsePart(part, spec);
|
|
83
|
+
if ("reason" in parsed) {
|
|
84
|
+
return parsed;
|
|
85
|
+
}
|
|
86
|
+
for (const value of parsed.values) {
|
|
87
|
+
collected.add(value);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (collected.size === 0) {
|
|
91
|
+
return { reason: `Invalid ${spec.name} field: "${field}"` };
|
|
92
|
+
}
|
|
93
|
+
return { values: Array.from(collected).sort((a, b) => a - b) };
|
|
94
|
+
}
|
|
95
|
+
function parsePart(part, spec) {
|
|
96
|
+
const invalid = { reason: `Invalid ${spec.name} field: "${part}"` };
|
|
97
|
+
const [rangePart, stepPart, ...rest] = part.split("/");
|
|
98
|
+
if (rest.length > 0 || rangePart === void 0) {
|
|
99
|
+
return invalid;
|
|
100
|
+
}
|
|
101
|
+
const maxInput = spec.maxInput ?? spec.max;
|
|
102
|
+
let step = 1;
|
|
103
|
+
if (stepPart !== void 0) {
|
|
104
|
+
if (!/^\d+$/u.test(stepPart)) {
|
|
105
|
+
return invalid;
|
|
106
|
+
}
|
|
107
|
+
step = Number(stepPart);
|
|
108
|
+
if (step < 1) {
|
|
109
|
+
return invalid;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
let from;
|
|
113
|
+
let to;
|
|
114
|
+
if (rangePart === "*") {
|
|
115
|
+
from = spec.min;
|
|
116
|
+
to = spec.max;
|
|
117
|
+
} else if (rangePart.includes("-")) {
|
|
118
|
+
const bounds = rangePart.split("-");
|
|
119
|
+
if (bounds.length !== 2) {
|
|
120
|
+
return invalid;
|
|
121
|
+
}
|
|
122
|
+
const start = toValue(bounds[0], spec);
|
|
123
|
+
const end = toValue(bounds[1], spec);
|
|
124
|
+
if (start === void 0 || end === void 0 || start > end) {
|
|
125
|
+
return invalid;
|
|
126
|
+
}
|
|
127
|
+
from = start;
|
|
128
|
+
to = end;
|
|
129
|
+
} else {
|
|
130
|
+
const single = toValue(rangePart, spec);
|
|
131
|
+
if (single === void 0) {
|
|
132
|
+
return invalid;
|
|
133
|
+
}
|
|
134
|
+
from = single;
|
|
135
|
+
to = stepPart === void 0 ? single : maxInput;
|
|
136
|
+
}
|
|
137
|
+
const values = [];
|
|
138
|
+
for (let value = from; value <= to; value += step) {
|
|
139
|
+
values.push(value > spec.max ? spec.min : value);
|
|
140
|
+
}
|
|
141
|
+
return { values };
|
|
142
|
+
}
|
|
143
|
+
function toValue(raw, spec) {
|
|
144
|
+
const trimmed = raw.trim();
|
|
145
|
+
let value;
|
|
146
|
+
if (/^\d+$/u.test(trimmed)) {
|
|
147
|
+
value = Number(trimmed);
|
|
148
|
+
} else {
|
|
149
|
+
const nameIndex = spec.names?.indexOf(trimmed.toUpperCase()) ?? -1;
|
|
150
|
+
if (nameIndex < 0) {
|
|
151
|
+
return void 0;
|
|
152
|
+
}
|
|
153
|
+
value = nameIndex + spec.min;
|
|
154
|
+
}
|
|
155
|
+
return value >= spec.min && value <= (spec.maxInput ?? spec.max) ? value : void 0;
|
|
156
|
+
}
|
|
157
|
+
export {
|
|
158
|
+
BACKUP_SCHEDULE_MIN_INTERVAL_MINUTES,
|
|
159
|
+
validateCronSchedule
|
|
160
|
+
};
|
|
161
|
+
//# sourceMappingURL=cronSchedule.utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/cronSchedule.utils.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport { HOTBACKUP_MIN_CREATE_PERIOD } from '../constants/misc.const.js'\n\n/**\n * Smallest gap we allow between two runs of a backup schedule, in minutes.\n * Same 15-minute floor the manual (on-demand) create throttle uses \u2014 a\n * schedule must not be able to produce backups faster than a customer could\n * trigger them by hand.\n */\nexport const BACKUP_SCHEDULE_MIN_INTERVAL_MINUTES =\n HOTBACKUP_MIN_CREATE_PERIOD / (60 * 1000)\n\n/**\n * Gap reported for a schedule that fires at most once per day \u2014 used as the\n * \"no further constraint\" ceiling so callers never see `Infinity`.\n */\nconst MINUTES_PER_DAY = 24 * 60\n\nconst MONTH_NAMES = [\n 'JAN',\n 'FEB',\n 'MAR',\n 'APR',\n 'MAY',\n 'JUN',\n 'JUL',\n 'AUG',\n 'SEP',\n 'OCT',\n 'NOV',\n 'DEC',\n]\n\nconst DAY_NAMES = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']\n\ninterface CronFieldSpec {\n name: string\n min: number\n /** Largest value the field can produce, after alias normalization. */\n max: number\n /**\n * Largest value accepted on input, when the field has an out-of-range alias:\n * cron's `7` for Sunday, which is normalized to `0`. Defaults to `max`.\n */\n maxInput?: number\n names?: string[]\n}\n\nconst CRON_FIELDS: CronFieldSpec[] = [\n { name: 'minute', min: 0, max: 59 },\n { name: 'hour', min: 0, max: 23 },\n { name: 'day of month', min: 1, max: 31 },\n { name: 'month', min: 1, max: 12, names: MONTH_NAMES },\n { name: 'day of week', min: 0, max: 6, maxInput: 7, names: DAY_NAMES },\n]\n\nexport interface CronScheduleValidationSuccess {\n valid: true\n /**\n * Smallest gap between two consecutive runs, in minutes. Capped at one day:\n * day-of-month / day-of-week restrictions only ever push runs further apart,\n * so they are deliberately not taken into account.\n */\n minIntervalMinutes: number\n}\n\nexport interface CronScheduleValidationFailure {\n valid: false\n /** Human-readable, safe to hand straight back to an API caller. */\n reason: string\n}\n\nexport type CronScheduleValidationResult =\n | CronScheduleValidationSuccess\n | CronScheduleValidationFailure\n\n/**\n * Validates a standard five-field cron expression (`minute hour day-of-month\n * month day-of-week`) \u2014 the syntax the operator's `BackupSchedule` CR expects \u2014\n * and computes how often it fires.\n *\n * Kept dependency-free on purpose: console-backend has no cron library, and the\n * K8s API would otherwise be the first thing to see (and reject) a malformed\n * expression, turning a customer typo into a 500.\n *\n * Supported per field: `*`, single values, lists (`0,30`), ranges (`1-5`) and\n * steps \u2014 `0-30/10`, `5/30`, or `*` followed by `/15`. No whitespace is allowed\n * around the `/` (fields are split on whitespace first, so a spaced-out step\n * reads as extra fields). Month and day-of-week additionally accept their\n * three-letter names. Seconds (a sixth field) and non-standard macros\n * (`@daily`, `L`, `W`, `#`) are rejected \u2014 the operator does not support them\n * either.\n */\nexport function validateCronSchedule(\n schedule: string,\n options: { minIntervalMinutes?: number } = {},\n): CronScheduleValidationResult {\n const minIntervalMinutes =\n options.minIntervalMinutes ?? BACKUP_SCHEDULE_MIN_INTERVAL_MINUTES\n\n if (typeof schedule !== 'string' || schedule.trim().length === 0) {\n return { valid: false, reason: 'Schedule must be a non-empty cron string' }\n }\n\n const fields = schedule.trim().split(/\\s+/u)\n if (fields.length !== CRON_FIELDS.length) {\n return {\n valid: false,\n reason: `Schedule must be a cron expression with ${CRON_FIELDS.length} fields (minute hour day-of-month month day-of-week), got ${fields.length}`,\n }\n }\n\n const values: number[][] = []\n for (const [index, spec] of CRON_FIELDS.entries()) {\n const parsed = parseField(fields[index], spec)\n if ('reason' in parsed) {\n return { valid: false, reason: parsed.reason }\n }\n values.push(parsed.values)\n }\n\n const [minutes, hours] = values\n const gap = smallestIntervalMinutes(minutes, hours)\n\n if (gap < minIntervalMinutes) {\n return {\n valid: false,\n reason: `Schedule runs every ${gap} minute(s); backups can be scheduled at most once every ${minIntervalMinutes} minutes`,\n }\n }\n\n return { valid: true, minIntervalMinutes: gap }\n}\n\n/**\n * Smallest gap between two runs, derived from the minute and hour fields only.\n * Ignoring the day fields under-estimates the gap for schedules that skip days,\n * which keeps the check conservative: it can never wave through a schedule that\n * fires more often than the computed value.\n */\nfunction smallestIntervalMinutes(minutes: number[], hours: number[]): number {\n let smallest = MINUTES_PER_DAY\n\n for (let index = 1; index < minutes.length; index++) {\n smallest = Math.min(smallest, minutes[index] - minutes[index - 1])\n }\n\n const firstMinute = minutes[0]\n const lastMinute = minutes[minutes.length - 1]\n\n // Gap from the last run of one active hour to the first run of the next one.\n // With a single active hour the next run is a day later.\n let smallestHourGap = 24\n for (let index = 1; index < hours.length; index++) {\n smallestHourGap = Math.min(smallestHourGap, hours[index] - hours[index - 1])\n }\n if (hours.length > 1) {\n // Wrap-around: last active hour of the day to the first one of the next.\n smallestHourGap = Math.min(\n smallestHourGap,\n 24 - hours[hours.length - 1] + hours[0],\n )\n }\n\n return Math.min(\n smallest,\n smallestHourGap * 60 - lastMinute + firstMinute,\n MINUTES_PER_DAY,\n )\n}\n\nfunction parseField(\n field: string,\n spec: CronFieldSpec,\n): { values: number[] } | { reason: string } {\n const collected = new Set<number>()\n\n for (const part of field.split(',')) {\n const parsed = parsePart(part, spec)\n if ('reason' in parsed) {\n return parsed\n }\n for (const value of parsed.values) {\n collected.add(value)\n }\n }\n\n if (collected.size === 0) {\n return { reason: `Invalid ${spec.name} field: \"${field}\"` }\n }\n\n return { values: Array.from(collected).sort((a, b) => a - b) }\n}\n\nfunction parsePart(\n part: string,\n spec: CronFieldSpec,\n): { values: number[] } | { reason: string } {\n const invalid = { reason: `Invalid ${spec.name} field: \"${part}\"` }\n const [rangePart, stepPart, ...rest] = part.split('/')\n if (rest.length > 0 || rangePart === undefined) {\n return invalid\n }\n\n const maxInput = spec.maxInput ?? spec.max\n\n let step = 1\n if (stepPart !== undefined) {\n if (!/^\\d+$/u.test(stepPart)) {\n return invalid\n }\n step = Number(stepPart)\n if (step < 1) {\n return invalid\n }\n }\n\n let from: number\n let to: number\n if (rangePart === '*') {\n from = spec.min\n to = spec.max\n } else if (rangePart.includes('-')) {\n const bounds = rangePart.split('-')\n if (bounds.length !== 2) {\n return invalid\n }\n const start = toValue(bounds[0], spec)\n const end = toValue(bounds[1], spec)\n if (start === undefined || end === undefined || start > end) {\n return invalid\n }\n from = start\n to = end\n } else {\n const single = toValue(rangePart, spec)\n if (single === undefined) {\n return invalid\n }\n // `5/15` means \"from 5 to the field maximum, every 15\" \u2014 a bare value\n // without a step is just itself.\n from = single\n to = stepPart === undefined ? single : maxInput\n }\n\n const values: number[] = []\n for (let value = from; value <= to; value += step) {\n // Normalize the alias (day-of-week `7` -> `0`) only here, so a range like\n // `5-7` (Fri\u2013Sun) still parses as an ascending range.\n values.push(value > spec.max ? spec.min : value)\n }\n return { values }\n}\n\nfunction toValue(raw: string, spec: CronFieldSpec): number | undefined {\n const trimmed = raw.trim()\n let value: number\n\n if (/^\\d+$/u.test(trimmed)) {\n value = Number(trimmed)\n } else {\n const nameIndex = spec.names?.indexOf(trimmed.toUpperCase()) ?? -1\n if (nameIndex < 0) {\n return undefined\n }\n value = nameIndex + spec.min\n }\n\n return value >= spec.min && value <= (spec.maxInput ?? spec.max)\n ? value\n : undefined\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -28,6 +28,23 @@ export declare function isValidClientName(name: string): boolean;
|
|
|
28
28
|
* @returns true if the CIDR is valid, false otherwise
|
|
29
29
|
*/
|
|
30
30
|
export declare function isValidCIDR(cidr: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Normalizes a comma-separated list of IPv4 addresses and/or CIDR notations by
|
|
33
|
+
* stripping every whitespace character.
|
|
34
|
+
*
|
|
35
|
+
* Whitespace is never meaningful inside a CIDR list, but `isValidCIDR` trims
|
|
36
|
+
* before validating, so a value such as `"10.0.0.1 "` passes validation and is
|
|
37
|
+
* then persisted verbatim — where the trailing space later breaks the cluster
|
|
38
|
+
* controller. Normalizing on the way in keeps the stored value clean.
|
|
39
|
+
*
|
|
40
|
+
* Examples:
|
|
41
|
+
* - "10.0.0.1 " -> "10.0.0.1"
|
|
42
|
+
* - "192.168.1.1, 10.0.0.0/8" -> "192.168.1.1,10.0.0.0/8"
|
|
43
|
+
*
|
|
44
|
+
* @param cidrList - A comma-separated list of IPv4 addresses or CIDR notations
|
|
45
|
+
* @returns The list with all whitespace removed
|
|
46
|
+
*/
|
|
47
|
+
export declare function normalizeCIDRList(cidrList: string): string;
|
|
31
48
|
/**
|
|
32
49
|
* Validates a comma-separated list of IPv4 addresses and/or CIDR notations.
|
|
33
50
|
*
|
|
@@ -128,6 +128,12 @@ function isValidCIDR(cidr) {
|
|
|
128
128
|
}
|
|
129
129
|
return true;
|
|
130
130
|
}
|
|
131
|
+
function normalizeCIDRList(cidrList) {
|
|
132
|
+
if (typeof cidrList !== "string") {
|
|
133
|
+
return "";
|
|
134
|
+
}
|
|
135
|
+
return cidrList.replace(/\s/gu, "");
|
|
136
|
+
}
|
|
131
137
|
function isValidCIDRList(cidrList) {
|
|
132
138
|
if (typeof cidrList !== "string") {
|
|
133
139
|
return false;
|
|
@@ -148,6 +154,7 @@ export {
|
|
|
148
154
|
isValidCIDRList,
|
|
149
155
|
isValidClientName,
|
|
150
156
|
isValidHostname,
|
|
151
|
-
isValidPrivateLinkRegion
|
|
157
|
+
isValidPrivateLinkRegion,
|
|
158
|
+
normalizeCIDRList
|
|
152
159
|
};
|
|
153
160
|
//# sourceMappingURL=string-validation.utils.js.map
|