:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(batch-exports): authenticate S3 batch exports via integrations (#65855)
Rossd9eac2a3224c
diff --git a/posthog/models/integration.py b/posthog/models/integration.pyindex 2d7762e3ccea..2ba3c10003de 100644--- a/posthog/models/integration.py+++ b/posthog/models/integration.py@@ -3588,7 +3588,7 @@ class AwsS3Integration:aws_secret_access_key: strdef __init__(self, integration: Integration) -> None:- if integration.kind != Integration.IntegrationKind.AWS_S3.value:+ if integration.kind != Integration.IntegrationKind.AWS_S3:raise S3CredentialIntegrationError(f"Integration provided is not an AWS S3 integration (got kind='{integration.kind}')")@@ -3651,7 +3651,7 @@ class AwsS3Integration:# treated as a secret. The account id is non-sensitive and kept for display/debugging.return _create_unique_s3_integration(team_id=team_id,- kind=Integration.IntegrationKind.AWS_S3.value,+ kind=Integration.IntegrationKind.AWS_S3,name=name,config={"name": name, "aws_account_id": account_id},sensitive_config=_build_s3_sensitive_config(aws_access_key_id, aws_secret_access_key),@@ -3680,7 +3680,7 @@ class S3CompatibleIntegration:endpoint_url: strdef __init__(self, integration: Integration) -> None:- if integration.kind != Integration.IntegrationKind.S3_COMPATIBLE.value:+ if integration.kind != Integration.IntegrationKind.S3_COMPATIBLE:raise S3CredentialIntegrationError(f"Integration provided is not an S3-compatible integration (got kind='{integration.kind}')")@@ -3713,7 +3713,7 @@ class S3CompatibleIntegration:return _create_unique_s3_integration(team_id=team_id,- kind=Integration.IntegrationKind.S3_COMPATIBLE.value,+ kind=Integration.IntegrationKind.S3_COMPATIBLE,name=name,config={"name": name, "endpoint_url": endpoint_url},sensitive_config=_build_s3_sensitive_config(aws_access_key_id, aws_secret_access_key),diff --git a/products/batch_exports/backend/api/batch_export.py b/products/batch_exports/backend/api/batch_export.pyindex cec15c660449..d5d153b8b10e 100644--- a/products/batch_exports/backend/api/batch_export.py+++ b/products/batch_exports/backend/api/batch_export.py@@ -38,11 +38,14 @@ from posthog.api.utils import actionfrom posthog.event_usage import groupsfrom posthog.models import Team, Userfrom posthog.models.integration import (+ AwsS3Integration,AzureBlobIntegration,AzureBlobIntegrationError,DatabricksIntegration,DatabricksIntegrationError,Integration,+ S3CompatibleIntegration,+ S3CredentialIntegrationError,)from posthog.temporal.common.client import sync_connectfrom posthog.utils import relative_date_parse, str_to_bool@@ -347,6 +350,75 @@ class AzureBlobDestinationConfigSerializer(serializers.Serializer):)+class S3FamilyDestinationConfigSerializer(serializers.Serializer):+ """Shared non-credential configuration for S3-family batch-export destinations.++ Credentials (and, for S3-compatible providers, the `endpoint_url`) live in the linked+ Integration, not in this config. Mirrors the non-credential fields of `S3FamilyBaseInputs` in+ `products/batch_exports/backend/service.py`.+ """++ bucket_name = serializers.CharField(help_text="Name of the destination bucket.")+ region = serializers.CharField(help_text="Region the bucket is in (e.g. 'us-east-1').")+ prefix = serializers.CharField(help_text="Object key prefix applied to every exported file.")+ compression = serializers.ChoiceField(+ choices=sorted({codec for codecs in S3_SUPPORTED_COMPRESSIONS.values() for codec in codecs}),+ required=False,+ allow_null=True,+ default=None,+ help_text="Optional compression codec applied to exported files. Valid codecs depend on file_format.",+ )+ file_format = serializers.ChoiceField(+ choices=list(S3_SUPPORTED_COMPRESSIONS.keys()),+ required=False,+ default="JSONLines",+ help_text="File format used for exported objects.",+ )+ max_file_size_mb = serializers.IntegerField(+ required=False,+ allow_null=True,+ default=None,+ help_text="If set, rolls to a new file once the current file exceeds this size in MB.",+ )+++class AwsS3DestinationConfigSerializer(S3FamilyDestinationConfigSerializer):+ """Typed configuration for an AWS S3 batch-export destination.++ AWS credentials live in the linked aws-s3 Integration. Mirrors the non-credential fields of+ `AwsS3BatchExportInputs` in `products/batch_exports/backend/service.py`.+ """++ encryption = serializers.CharField(+ required=False,+ allow_null=True,+ default=None,+ help_text="Optional S3 server-side encryption algorithm (e.g. 'AES256' or 'aws:kms').",+ )+ kms_key_id = serializers.CharField(+ required=False,+ allow_null=True,+ default=None,+ help_text="KMS key ID to use when encryption is 'aws:kms'.",+ )+++class S3CompatibleDestinationConfigSerializer(S3FamilyDestinationConfigSerializer):+ """Typed configuration for an S3-compatible batch-export destination (Cloudflare R2,+ DigitalOcean Spaces, etc.).++ Credentials and the provider `endpoint_url` live in the linked s3-compatible Integration.+ Mirrors the non-credential fields of `S3CompatibleBatchExportInputs` in+ `products/batch_exports/backend/service.py`.+ """++ use_virtual_style_addressing = serializers.BooleanField(+ required=False,+ default=False,+ help_text="Use virtual-hosted-style addressing rather than path-style.",+ )++@extend_schema_field(PolymorphicProxySerializer(component_name="BatchExportDestinationConfig",@@ -355,6 +427,8 @@ class AzureBlobDestinationConfigSerializer(serializers.Serializer):"AzureBlob": AzureBlobDestinationConfigSerializer,"BigQuery": BigQueryDestinationConfigSerializer,"Postgres": PostgresDestinationConfigSerializer,+ "AwsS3": AwsS3DestinationConfigSerializer,+ "S3Compatible": S3CompatibleDestinationConfigSerializer,},resource_type_field_name="type",)@@ -420,6 +494,34 @@ class PostgresDestinationRequestSerializer(serializers.Serializer):config = PostgresDestinationConfigSerializer()+class AwsS3DestinationRequestSerializer(serializers.Serializer):+ """Request shape for creating or updating an AWS S3 batch-export destination."""++ type = serializers.ChoiceField(choices=["AwsS3"])+ integration_id = serializers.IntegerField(+ required=False,+ help_text=(+ "ID of an aws-s3-kind Integration providing AWS credentials. Preferred over inline credentials. "+ "Use the integrations-list MCP tool to find one."+ ),+ )+ config = AwsS3DestinationConfigSerializer()+++class S3CompatibleDestinationRequestSerializer(serializers.Serializer):+ """Request shape for creating or updating an S3-compatible batch-export destination."""++ type = serializers.ChoiceField(choices=["S3Compatible"])+ integration_id = serializers.IntegerField(+ required=False,+ help_text=(+ "ID of an s3-compatible-kind Integration providing credentials and the provider endpoint URL. "+ "Preferred over inline credentials. Use the integrations-list MCP tool to find one."+ ),+ )+ config = S3CompatibleDestinationConfigSerializer()++BatchExportDestinationRequest = PolymorphicProxySerializer(component_name="BatchExportDestinationRequest",serializers={@@ -427,6 +529,8 @@ BatchExportDestinationRequest = PolymorphicProxySerializer("AzureBlob": AzureBlobDestinationRequestSerializer,"BigQuery": BigQueryDestinationRequestSerializer,"Postgres": PostgresDestinationRequestSerializer,+ "AwsS3": AwsS3DestinationRequestSerializer,+ "S3Compatible": S3CompatibleDestinationRequestSerializer,},resource_type_field_name="type",)@@ -436,10 +540,11 @@ BatchExportDestinationRequest = PolymorphicProxySerializer(class BatchExportDestinationRequestField(serializers.JSONField):"""JSONField annotated with a polymorphic OpenAPI request schema.- Only integration-backed destinations (Databricks, AzureBlob, BigQuery, Postgres) are- exposed in the schema. integration_id is required when creating any of these. Existing- Postgres exports created before integrations keep their inline credentials. Runtime- validation remains `BatchExportDestinationSerializer.validate_destination`.+ Only integration-backed destinations (Databricks, AzureBlob, BigQuery, Postgres, AwsS3,+ S3Compatible) are exposed in the schema. integration_id is required for Databricks, AzureBlob+ and BigQuery, and optional for the S3 family (inline credentials remain supported for the time+ being). Existing Postgres and S3 exports created before integrations keep their inline+ credentials. Runtime validation remains `BatchExportDestinationSerializer.validate_destination`."""pass@@ -493,20 +598,29 @@ class BatchExportRequestSerializer(serializers.Serializer):)+# S3-family destinations that may authenticate via an Integration, mapped to the handler that+# validates the linked integration's kind and credentials. Adding a future S3-family destination+# (e.g. a first-class GCS-via-S3 type) is a one-line addition here.+S3_INTEGRATION_HANDLERS: dict[str, type[AwsS3Integration] | type[S3CompatibleIntegration]] = {+ BatchExportDestination.Destination.AWS_S3: AwsS3Integration,+ BatchExportDestination.Destination.S3_COMPATIBLE: S3CompatibleIntegration,+}++class BatchExportDestinationSerializer(serializers.ModelSerializer):"""Serializer for an BatchExportDestination model.The `config` field is polymorphic and typed only for destinations that keep- credentials in the linked Integration (currently Databricks, AzureBlob, BigQuery, Postgres).- Other destination types accept the same JSON shape but without a typed+ credentials in the linked Integration (currently Databricks, AzureBlob, BigQuery, Postgres,+ AwsS3, S3Compatible). Other destination types accept the same JSON shape but without a typedOpenAPI schema. Secret fields are stripped from `config` on read."""config = TypedBatchExportDestinationConfigField(help_text=("Destination-specific configuration. Fields depend on `type`. Credentials for "- "integration-backed destinations (Databricks, AzureBlob, BigQuery, Postgres) are NOT stored here — "- "they live in the linked Integration. Secret fields are stripped from responses."+ "integration-backed destinations (Databricks, AzureBlob, BigQuery, Postgres, AwsS3, S3Compatible) "+ "are NOT stored here — they live in the linked Integration. Secret fields are stripped from responses."),)integration = TeamScopedPrimaryKeyRelatedField(@@ -523,7 +637,8 @@ class BatchExportDestinationSerializer(serializers.ModelSerializer):allow_null=True,help_text=("ID of a team-scoped Integration providing credentials. Required when creating Databricks, "- "AzureBlob, BigQuery, and Postgres destinations; unused for other types."+ "AzureBlob, and BigQuery destinations; optional for AwsS3 and S3Compatible (inline credentials "+ "remain supported); unused for other types."),)@@ -561,11 +676,20 @@ class BatchExportDestinationSerializer(serializers.ModelSerializer):str_fields = ", ".join(f"'{extra_field}'" for extra_field in sorted(extra_fields))raise serializers.ValidationError(f"Configuration has unknown field/s: {str_fields}")+ # S3-family credential fields are optional on the dataclass (integration-backed exports+ # resolve them at run time), so they must be required here only when no Integration is linked.+ # TODO: remove this code once integrations for S3 are enforced+ conditionally_required: set[str] = set()+ if export_type in S3_FAMILY_TYPES and attrs.get("integration") is None:+ conditionally_required = {"aws_access_key_id", "aws_secret_access_key"}+ if export_type == BatchExportDestination.Destination.S3_COMPATIBLE:+ conditionally_required.add("endpoint_url")+for destination_field in destination_fields:is_required = (destination_field.default == dataclasses.MISSINGand destination_field.default_factory == dataclasses.MISSING- )+ ) or destination_field.name in conditionally_requiredif destination_field.name not in config:if is_required and not is_patch:# When patching we expect a partial configuration. So, we don't@@ -1007,15 +1131,21 @@ class BatchExportSerializer(serializers.ModelSerializer):raise serializers.ValidationError("Private key is required if authentication type is key pair")if destination_type in S3_FAMILY_TYPES:+ integration: Integration | None = destination_attrs.get("integration")++ # TODO: remove this guard once integrations are mandatory for S3 and inline credentials are gone.+ if instance is not None and instance.destination.integration is not None and integration is None:+ raise serializers.ValidationError(+ "Cannot remove the integration from an S3 batch export that uses one. "+ "Re-send its `integration` to keep it (or a different one to swap)."+ )+# we already validate the required inputs in BatchExportDestinationSerializer::validate# so here we just ensure that the inputs are not empty- required_non_empty_inputs = (- "bucket_name",- "region",- "prefix",- "aws_access_key_id",- "aws_secret_access_key",- )+ required_non_empty_inputs = ["bucket_name", "region", "prefix"]+ # Credentials are only required inline when no Integration provides them.+ if integration is None:+ required_non_empty_inputs += ["aws_access_key_id", "aws_secret_access_key"]empty_inputs = []for required_input in required_non_empty_inputs:value = config.get(required_input)@@ -1024,6 +1154,22 @@ class BatchExportSerializer(serializers.ModelSerializer):if empty_inputs:raise serializers.ValidationError(f"The following inputs are empty: {empty_inputs}")+ # When an Integration is supplied it must match the destination kind. (Team ownership is+ # already enforced by the team-scoped `integration` field, which can only resolve+ # integrations belonging to the request's team.)+ if integration is not None:+ # An Integration only makes sense for the integration-backed S3 types. Reject it on the+ # legacy "S3" type+ # TODO: remove this branch once the legacy "S3" destination type is fully removed.+ if destination_type not in S3_INTEGRATION_HANDLERS:+ raise serializers.ValidationError(+ f"{destination_type} destinations do not support integration-based credentials."+ )+ try:+ S3_INTEGRATION_HANDLERS[destination_type](integration)+ except S3CredentialIntegrationError as e:+ raise serializers.ValidationError(str(e))+# JSONLines is the default file format for S3 exports for legacy reasonsfile_format = merged_config.get("file_format", "JSONLines")supported_file_formats = S3_SUPPORTED_COMPRESSIONS.keys()@@ -1048,14 +1194,10 @@ class BatchExportSerializer(serializers.ModelSerializer):raise serializers.ValidationError(f"Invalid endpoint_url: '{merged_config['endpoint_url']}'")if destination_type == BatchExportDestination.Destination.DATABRICKS:- team_id = self.context["team_id"]-# validate the Integration is valid (this is mandatory for Databricks batch exports)- integration: Integration | None = destination_attrs.get("integration")+ integration = destination_attrs.get("integration")if integration is None:raise serializers.ValidationError("Integration is required for Databricks batch exports")- if integration.team_id != team_id:- raise serializers.ValidationError("Integration does not belong to this team.")if integration.kind != Integration.IntegrationKind.DATABRICKS:raise serializers.ValidationError("Integration is not a Databricks integration.")# try instantiate the integration to check if it's valid@@ -1065,39 +1207,27 @@ class BatchExportSerializer(serializers.ModelSerializer):raise serializers.ValidationError(str(e))if destination_type == BatchExportDestination.Destination.POSTGRES:- team_id = self.context["team_id"]integration = destination_attrs.get("integration")# New Postgres exports must use an Integration for credentials. Exports created before# integrations existed keep their inline credentials, so only require it on create# (`instance is None`); existing inline-credential exports stay valid when edited.if integration is None and instance is None:raise serializers.ValidationError("Integration is required for Postgres batch exports")- if integration is not None:- if integration.team_id != team_id:- raise serializers.ValidationError("Integration does not belong to this team.")- if integration.kind != Integration.IntegrationKind.POSTGRESQL:- raise serializers.ValidationError("Integration is not a PostgreSQL integration.")+ if integration is not None and integration.kind != Integration.IntegrationKind.POSTGRESQL:+ raise serializers.ValidationError("Integration is not a PostgreSQL integration.")if destination_type == BatchExportDestination.Destination.BIGQUERY:- team_id = self.context["team_id"]-integration = destination_attrs.get("integration")if integration is None:raise serializers.ValidationError("Integration is required for BigQuery batch exports")- if integration.team_id != team_id:- raise serializers.ValidationError("Integration does not belong to this team.")if integration.kind != Integration.IntegrationKind.GOOGLE_CLOUD_SERVICE_ACCOUNT:raise serializers.ValidationError("Integration is not a Google Cloud service account integration.")if destination_type == BatchExportDestination.Destination.AZURE_BLOB:- team_id = self.context["team_id"]-# validate the Integration is valid (this is mandatory for Azure Blob batch exports)integration = destination_attrs.get("integration")if integration is None:raise serializers.ValidationError("Integration is required for Azure Blob batch exports")- if integration.team_id != team_id:- raise serializers.ValidationError("Integration does not belong to this team.")if integration.kind != Integration.IntegrationKind.AZURE_BLOB:raise serializers.ValidationError("Integration is not an Azure Blob integration.")# try instantiate the integration to check if it's valid@@ -1365,8 +1495,8 @@ def recursive_dict_merge(@extend_schema(tags=["batch_exports"])@extend_schema_view(# Request bodies use a polymorphic destination schema so that integration-backed types- # (Databricks, AzureBlob, BigQuery, Postgres) advertise integration_id up front — required- # for all of them except Postgres, where it is optional.+ # (Databricks, AzureBlob, BigQuery, Postgres, AwsS3, S3Compatible) advertise integration_id up+ # front — required for Databricks, AzureBlob and BigQuery, optional for Postgres and the S3 family.# Responses continue to use BatchExportSerializer.create=extend_schema(request=BatchExportRequestSerializer),update=extend_schema(request=BatchExportRequestSerializer),diff --git a/products/batch_exports/backend/service.py b/products/batch_exports/backend/service.pyindex 12096f2a58e7..cf2b21f81afa 100644--- a/products/batch_exports/backend/service.py+++ b/products/batch_exports/backend/service.py@@ -264,8 +264,10 @@ class S3BatchExportInputs(BaseBatchExportInputs):bucket_name: The S3 bucket we are exporting to.region: The AWS region where the bucket is located.prefix: A prefix for the file name to be created in S3.- aws_access_key_id: Access key id used to authenticate with S3.- aws_secret_access_key: Secret access key used to authenticate with S3.+ aws_access_key_id: Access key id used to authenticate with S3. Optional; integration-backed+ exports resolve credentials from the linked Integration at run time (see `integration_id`),+ while legacy exports carry them inline.+ aws_secret_access_key: Secret access key used to authenticate with S3. See `aws_access_key_id`.compression: Compression algorithm to apply to exported files (e.g. "gzip", "brotli"), or None.file_format: File format of exported objects (e.g. "JSONLines", "Parquet"). Defaults to JSONLines.max_file_size_mb: The maximum file size in MB for each file to be uploaded.@@ -279,8 +281,8 @@ class S3BatchExportInputs(BaseBatchExportInputs):bucket_name: strregion: strprefix: str- aws_access_key_id: str- aws_secret_access_key: str+ aws_access_key_id: str | None = None+ aws_secret_access_key: str | None = Nonecompression: str | None = Nonefile_format: str = "JSONLines"max_file_size_mb: int | None = None@@ -294,14 +296,16 @@ class S3BatchExportInputs(BaseBatchExportInputs):class S3FamilyBaseInputs(BaseBatchExportInputs):"""Shared fields for every S3-family destination.- Per-destination dataclasses extend this with provider-specific fields.+ Per-destination dataclasses extend this with provider-specific fields. Credentials are optional:+ integration-backed exports resolve them from the linked Integration at run time (see+ `integration_id`), while legacy exports carry them inline."""bucket_name: strregion: strprefix: str- aws_access_key_id: str- aws_secret_access_key: str+ aws_access_key_id: str | None = None+ aws_secret_access_key: str | None = Nonecompression: str | None = Nonefile_format: str = "JSONLines"max_file_size_mb: int | None = None@@ -319,11 +323,12 @@ class AwsS3BatchExportInputs(S3FamilyBaseInputs):class S3CompatibleBatchExportInputs(S3FamilyBaseInputs):"""Inputs for a non-AWS S3-compatible batch export.- Covers providers like MinIO, DigitalOcean Spaces, Cloudflare R2, Hetzner, OVH,- Backblaze, etc. `endpoint_url` is required.+ Covers providers like DigitalOcean Spaces, Cloudflare R2, Hetzner, OVH, Backblaze, etc.+ `endpoint_url` is resolved from the linked Integration at run time when `integration_id` is set,+ otherwise carried inline (legacy)."""- endpoint_url: str+ endpoint_url: str | None = Noneuse_virtual_style_addressing: bool = Falsediff --git a/products/batch_exports/backend/temporal/destinations/s3_batch_export.py b/products/batch_exports/backend/temporal/destinations/s3_batch_export.pyindex 2784c08351d9..021b1556dbae 100644--- a/products/batch_exports/backend/temporal/destinations/s3_batch_export.py+++ b/products/batch_exports/backend/temporal/destinations/s3_batch_export.py@@ -20,6 +20,12 @@ from structlog.contextvars import bind_contextvarsfrom temporalio import activity, workflowfrom temporalio.common import RetryPolicy+from posthog.models.integration import (+ AwsS3Integration,+ Integration,+ S3CompatibleIntegration,+ S3CredentialIntegrationError,+)from posthog.temporal.common.base import PostHogWorkflowfrom posthog.temporal.common.heartbeat import Heartbeaterfrom posthog.temporal.common.logger import get_logger, get_write_only_logger@@ -72,6 +78,10 @@ NON_RETRYABLE_ERROR_TYPES = ("UnsupportedCompressionError",# Invalid S3 credentials"InvalidCredentialsError",+ # The linked Integration was deleted or doesn't belong to the team+ "S3IntegrationNotFoundError",+ # The linked Integration is the wrong kind or has invalid/missing credentials+ "S3CredentialIntegrationError",)FILE_FORMAT_EXTENSIONS = {@@ -105,6 +115,36 @@ class UnsupportedCompressionError(Exception):super().__init__(f"'{compression}' is not a supported compression for S3 batch exports.")+class S3IntegrationNotFoundError(Exception):+ """Raised when an S3-family export references an Integration that can't be resolved."""++ def __init__(self, integration_id: int, team_id: int):+ super().__init__(f"S3 integration with ID '{integration_id}' not found for team '{team_id}'")+++async def _get_s3_integration(integration_id: int, team_id: int) -> AwsS3Integration | S3CompatibleIntegration:+ """Fetch an S3-family integration from the database.++ The kind is validated on create by the batch export serializer, so the wrong-kind branch is+ purely defensive against an integration whose kind was changed out from under the export.+ `AwsS3Integration`/`S3CompatibleIntegration` themselves raise `S3CredentialIntegrationError` if+ the credentials are malformed.+ """+ try:+ integration = await Integration.objects.aget(id=integration_id, team_id=team_id)+ except Integration.DoesNotExist:+ raise S3IntegrationNotFoundError(integration_id, team_id)++ if integration.kind == Integration.IntegrationKind.AWS_S3:+ return AwsS3Integration(integration)+ if integration.kind == Integration.IntegrationKind.S3_COMPATIBLE:+ return S3CompatibleIntegration(integration)+ raise S3CredentialIntegrationError(+ f"Integration with ID '{integration_id}' for team '{team_id}' is not an S3 integration "+ f"(kind='{integration.kind}')"+ )++@dataclasses.dataclass(kw_only=True)class S3InsertInputs(BatchExportInsertInputs):"""Inputs for S3 exports."""@@ -116,6 +156,9 @@ class S3InsertInputs(BatchExportInsertInputs):bucket_name: strregion: strprefix: str+ # When set, credentials (and endpoint_url for S3-compatible) are resolved from this Integration+ # at run time; otherwise the inline credentials below are used (legacy path).+ integration_id: int | None = Noneaws_access_key_id: str | None = Noneaws_secret_access_key: str | None = Noneaws_session_token: str | None = None@@ -266,6 +309,7 @@ class S3BatchExportWorkflow(PostHogWorkflow):region=inputs.region,prefix=inputs.prefix,team_id=inputs.team_id,+ integration_id=inputs.integration_id,aws_access_key_id=inputs.aws_access_key_id,aws_secret_access_key=inputs.aws_secret_access_key,endpoint_url=inputs.endpoint_url or None,@@ -305,18 +349,18 @@ class S3BatchExportResult(BatchExportResult):@activity.defn@handle_non_retryable_errors(NON_RETRYABLE_ERROR_TYPES)async def insert_into_s3_activity_from_stage(inputs: S3InsertInputs) -> S3BatchExportResult:- """Activity to batch export data to a customer's S3.+ """Activity to batch export data from our internal S3 stage to a customer's S3.- This is a new version of the `insert_into_s3_activity` activity that reads data from our internal S3 stage- instead of ClickHouse.+ We support both AWS S3 and S3-compatible destinations (eg Cloudflare R2, DigitalOcean Spaces, etc).- It will upload multiple files if the max_file_size_mb is set, otherwise it will upload a single file. File uploads- are done using multipart upload.+ It will upload multiple files if the max_file_size_mb is set, otherwise it will upload a single+ file. File uploads are done using multipart upload.- We could maybe optimize this by simply copying the data from the internal S3 stage to the customer's S3 bucket,- however, we've tried to keep the activity that writes the data to the internal S3 stage as generic as possible, as- it will be used by other destinations, not just S3. Our S3 batch exports also support customising the max S3 file- size, different file formats, compression, etc, which ClickHouse's S3 functions may not support.+ We could maybe optimize this by simply copying the data from the internal S3 stage to the+ customer's S3 bucket, however, we've tried to keep the activity that writes the data to the+ internal S3 stage as generic as possible, as it will be used by other destinations, not just S3.+ Our S3 batch exports also support customising the max S3 file size, different file formats,+ compression, etc, which ClickHouse's S3 functions may not support."""bind_contextvars(team_id=inputs.team_id,@@ -325,6 +369,15 @@ async def insert_into_s3_activity_from_stage(inputs: S3InsertInputs) -> S3BatchEdata_interval_end=inputs.data_interval_end,)+ # Integration-backed exports resolve credentials at run time; legacy exports carry them inline.+ # TODO: require integration+ if inputs.integration_id is not None:+ integration = await _get_s3_integration(inputs.integration_id, inputs.team_id)+ inputs.aws_access_key_id = integration.aws_access_key_id+ inputs.aws_secret_access_key = integration.aws_secret_access_key+ if isinstance(integration, S3CompatibleIntegration):+ inputs.endpoint_url = integration.endpoint_url+if inputs.file_format not in FILE_FORMAT_EXTENSIONS:raise UnsupportedFileFormatError(inputs.file_format)if inputs.compression is not None and inputs.compression not in SUPPORTED_COMPRESSIONS[inputs.file_format]:diff --git a/products/batch_exports/backend/tests/api/test_create.py b/products/batch_exports/backend/tests/api/test_create.pyindex 22f916842910..722ac478b424 100644--- a/products/batch_exports/backend/tests/api/test_create.py+++ b/products/batch_exports/backend/tests/api/test_create.py@@ -14,6 +14,7 @@ from rest_framework import statusfrom posthog.api.test.test_team import create_teamfrom posthog.api.test.test_user import create_user+from posthog.models.integration import Integrationfrom products.batch_exports.backend.models.batch_export import BatchExportfrom products.batch_exports.backend.tests.api.conftest import (@@ -357,6 +358,50 @@ def test_cannot_create_a_batch_export_for_another_organization(client: HttpClienassert response.status_code == status.HTTP_403_FORBIDDEN, response.json()+ "destination_type,integration_kind,config",+ [+ ("AwsS3", Integration.IntegrationKind.AWS_S3, {"bucket_name": "b", "region": "us-east-1", "prefix": "p/"}),+ (+ "Databricks",+ Integration.IntegrationKind.DATABRICKS,+ {"http_path": "p", "catalog": "c", "schema": "s", "table_name": "t"},+ ),+ ],+)+def test_cannot_create_batch_export_with_integration_from_another_team(+ client: HttpClient, temporal, organization, team, user, destination_type, integration_kind, config+):+ """The team-scoped `integration` field rejects an integration owned by another team (IDOR).++ This is common to every integration-backed destination — a foreign id reads as "does not exist"+ at field resolution, before any destination-specific validation runs.+ """+ other_team = create_team(organization)+ foreign_integration = Integration.objects.create(+ team=other_team,+ kind=integration_kind,+ integration_id="foreign",+ config={},+ sensitive_config={},+ created_by=user,+ )++ client.force_login(user)+ response = create_batch_export(+ client,+ team.pk,+ {+ "name": "my-export",+ "interval": "hour",+ "destination": {"type": destination_type, "config": config, "integration": foreign_integration.id},+ },+ )+ assert response.status_code == status.HTTP_400_BAD_REQUEST, response.json()+ assert response.json()["attr"] == "destination__integration"+ assert response.json()["code"] == "does_not_exist"++def test_cannot_create_a_batch_export_with_higher_frequencies_if_not_enabled(client: HttpClient, temporal, organization, team, user):diff --git a/products/batch_exports/backend/tests/api/test_create_s3.py b/products/batch_exports/backend/tests/api/test_create_s3.pyindex 250f979203fa..31414b9806ed 100644--- a/products/batch_exports/backend/tests/api/test_create_s3.py+++ b/products/batch_exports/backend/tests/api/test_create_s3.py@@ -6,8 +6,12 @@ from django.test import override_settingsfrom django.test.client import Client as HttpClientfrom rest_framework import status+from temporalio.client import ScheduleActionStartWorkflow++from posthog.models.integration import Integrationfrom products.batch_exports.backend.models.batch_export import S3_CREATABLE_TYPES+from products.batch_exports.backend.tests.api.conftest import describe_schedulefrom products.batch_exports.backend.tests.api.operations import create_batch_exportpytestmark = [@@ -301,3 +305,94 @@ def test_creating_s3_family_batch_export_fails_if_using_invalid_endpoint_url(assert response.status_code == status.HTTP_400_BAD_REQUEST, response.json()assert f"Invalid endpoint_url: '{endpoint_url}'" in response.json()["detail"]+++def aws_s3_integration(team, user):+ return Integration.objects.create(+ team=team,+ kind=Integration.IntegrationKind.AWS_S3,+ integration_id="prod-aws",+ config={"name": "prod-aws", "aws_account_id": "123456789012"},+ sensitive_config={"aws_access_key_id": "key", "aws_secret_access_key": "secret"},+ created_by=user,+ )+++def s3_compatible_integration(team, user):+ return Integration.objects.create(+ team=team,+ kind=Integration.IntegrationKind.S3_COMPATIBLE,+ integration_id="my-r2",+ config={"name": "my-r2", "endpoint_url": "https://account.r2.cloudflarestorage.com"},+ sensitive_config={"aws_access_key_id": "key", "aws_secret_access_key": "secret"},+ created_by=user,+ )+++ "destination_type,integration_fixture",+ [+ ("AwsS3", "aws_s3_integration"),+ ("S3Compatible", "s3_compatible_integration"),+ ],+)+def test_create_s3_family_batch_export_using_integration(+ client: HttpClient, temporal, organization, team, user, destination_type, integration_fixture, request+):+ """An S3-family export authenticates via a matching integration, with no inline credentials in config."""+ integration = request.getfixturevalue(integration_fixture)+ client.force_login(user)+ response = create_batch_export(+ client,+ team.pk,+ {+ "name": "my-export",+ "interval": "hour",+ "destination": {+ "type": destination_type,+ # No credentials (nor endpoint_url) inline — they come from the integration.+ "config": {"bucket_name": "my-bucket", "region": "us-east-1", "prefix": "events/"},+ "integration": integration.id,+ },+ },+ )+ assert response.status_code == status.HTTP_201_CREATED, response.json()+ data = response.json()+ assert data["destination"]["type"] == destination_type+ assert "aws_access_key_id" not in data["destination"]["config"]+ assert "aws_secret_access_key" not in data["destination"]["config"]++ schedule = describe_schedule(temporal, data["id"])+ assert isinstance(schedule.schedule.action, ScheduleActionStartWorkflow)+ assert schedule.schedule.action.workflow == "s3-export"+++ "destination_type,integration_fixture",+ [+ ("AwsS3", "s3_compatible_integration"),+ ("S3Compatible", "aws_s3_integration"),+ ],+)+def test_create_s3_family_batch_export_rejects_mismatched_integration_kind(+ client: HttpClient, temporal, organization, team, user, destination_type, integration_fixture, request+):+ """An S3-family export rejects an integration whose kind doesn't match the destination type."""+ integration = request.getfixturevalue(integration_fixture)+ client.force_login(user)+ response = create_batch_export(+ client,+ team.pk,+ {+ "name": "my-export",+ "interval": "hour",+ "destination": {+ "type": destination_type,+ "config": {"bucket_name": "my-bucket", "region": "us-east-1", "prefix": "events/"},+ "integration": integration.id,+ },+ },+ )+ assert response.status_code == status.HTTP_400_BAD_REQUEST, response.json()diff --git a/products/batch_exports/backend/tests/api/test_update_s3.py b/products/batch_exports/backend/tests/api/test_update_s3.pyindex 2c0625152f6e..0d8da0b73d2b 100644--- a/products/batch_exports/backend/tests/api/test_update_s3.py+++ b/products/batch_exports/backend/tests/api/test_update_s3.py@@ -4,6 +4,8 @@ from django.test.client import Client as HttpClientfrom rest_framework import status+from posthog.models.integration import Integration+from products.batch_exports.backend.models.batch_export import S3_CREATABLE_TYPES, BatchExportDestinationfrom products.batch_exports.backend.tests.api.fixtures import create_batch_export as create_batch_export_ormfrom products.batch_exports.backend.tests.api.operations import create_batch_export_ok, patch_batch_export@@ -82,3 +84,123 @@ def test_updating_legacy_s3_batch_export_validates_empty_inputs(client: HttpClieclient.force_login(user)_assert_empty_inputs_rejected(client, team.pk, str(batch_export.id), "S3")+++_S3_FAMILY_INTEGRATIONS = [+ ("AwsS3", Integration.IntegrationKind.AWS_S3, {"name": "prod-aws", "aws_account_id": "123456789012"}),+ (+ "S3Compatible",+ Integration.IntegrationKind.S3_COMPATIBLE,+ {"name": "my-r2", "endpoint_url": "https://account.r2.cloudflarestorage.com"},+ ),+]+++def _create_integration_backed_export(client: HttpClient, team, user, destination_type, kind, integration_config):+ integration = Integration.objects.create(+ team=team,+ kind=kind,+ integration_id=integration_config["name"],+ config=integration_config,+ sensitive_config={"aws_access_key_id": "key", "aws_secret_access_key": "secret"},+ created_by=user,+ )+ client.force_login(user)+ batch_export = create_batch_export_ok(+ client,+ team.pk,+ {+ "name": "my-export",+ "interval": "hour",+ "destination": {+ "type": destination_type,+ # No inline credentials (nor endpoint_url) — they come from the integration.+ "config": {"bucket_name": "my-bucket", "region": "us-east-1", "prefix": "events/"},+ "integration": integration.id,+ },+ },+ )+ return integration, batch_export++[email protected]("destination_type,kind,integration_config", _S3_FAMILY_INTEGRATIONS)[email protected]("integration_value", [None, "omitted"])+def test_updating_s3_family_batch_export_rejects_removing_integration(+ client: HttpClient,+ temporal,+ organization,+ team,+ user,+ destination_type,+ kind,+ integration_config,+ integration_value,+):+ """An integration-backed export can't drop back to inline credentials — whether the caller+ sends `integration: null` or omits it entirely (clients re-send the full destination on update).+ """+ _, batch_export = _create_integration_backed_export(client, team, user, destination_type, kind, integration_config)++ destination: dict = {"type": destination_type, "config": {}}+ if integration_value is None:+ destination["integration"] = None++ response = patch_batch_export(client, team.pk, batch_export["id"], {"destination": destination})+ assert response.status_code == status.HTTP_400_BAD_REQUEST, response.json()+ assert response.json()["detail"] == (+ "Cannot remove the integration from an S3 batch export that uses one. "+ "Re-send its `integration` to keep it (or a different one to swap)."+ )++[email protected]("destination_type,kind,integration_config", _S3_FAMILY_INTEGRATIONS)+def test_updating_integration_backed_s3_export_allows_config_patch_with_integration(+ client: HttpClient, temporal, organization, team, user, destination_type, kind, integration_config+):+ """Updating config while re-sending the integration succeeds and keeps it linked."""+ integration, batch_export = _create_integration_backed_export(+ client, team, user, destination_type, kind, integration_config+ )++ response = patch_batch_export(+ client,+ team.pk,+ batch_export["id"],+ {"destination": {"type": destination_type, "config": {"prefix": "new-prefix/"}, "integration": integration.id}},+ )+ assert response.status_code == status.HTTP_200_OK, response.json()+ assert response.json()["destination"]["config"]["prefix"] == "new-prefix/"+ assert response.json()["destination"]["integration"] == integration.id+++def test_updating_legacy_s3_batch_export_rejects_integration(client: HttpClient, temporal, organization, team, user):+ """The legacy `S3` type doesn't support integration-based credentials, so linking one is rejected."""+ destination = BatchExportDestination.objects.create(+ type="S3",+ config={+ "bucket_name": "my-s3-bucket",+ "region": "us-east-1",+ "prefix": "events/",+ "aws_access_key_id": "abc123",+ "aws_secret_access_key": "secret",+ },+ )+ batch_export = create_batch_export_orm(team, destination)+ integration = Integration.objects.create(+ team=team,+ kind=Integration.IntegrationKind.AWS_S3,+ integration_id="prod-aws",+ config={"name": "prod-aws", "aws_account_id": "123456789012"},+ sensitive_config={"aws_access_key_id": "key", "aws_secret_access_key": "secret"},+ created_by=user,+ )++ client.force_login(user)+ response = patch_batch_export(+ client,+ team.pk,+ str(batch_export.id),+ {"destination": {"type": "S3", "config": {}, "integration": integration.id}},+ )+ assert response.status_code == status.HTTP_400_BAD_REQUEST, response.json()+ assert response.json()["detail"] == "S3 destinations do not support integration-based credentials."diff --git a/products/batch_exports/backend/tests/temporal/destinations/s3/test_activity.py b/products/batch_exports/backend/tests/temporal/destinations/s3/test_activity.pyindex d7cd4822aa06..a2d1964f7d77 100644--- a/products/batch_exports/backend/tests/temporal/destinations/s3/test_activity.py+++ b/products/batch_exports/backend/tests/temporal/destinations/s3/test_activity.py@@ -6,6 +6,7 @@ from django.conf import settingsfrom temporalio.testing._activity import ActivityEnvironment+from posthog.models.integration import Integration, S3CredentialIntegrationErrorfrom posthog.temporal.tests.utils.events import generate_test_events_in_clickhousefrom products.batch_exports.backend.service import BatchExportModel, BatchExportSchema@@ -14,6 +15,7 @@ from products.batch_exports.backend.temporal.destinations.s3_batch_export importFILE_FORMAT_EXTENSIONS,SUPPORTED_COMPRESSIONS,S3InsertInputs,+ _get_s3_integration,s3_default_fields,)from products.batch_exports.backend.tests.temporal.destinations.s3.utils import (@@ -26,6 +28,26 @@ from products.batch_exports.backend.tests.temporal.utils.s3 import assert_files_pytestmark = [pytest.mark.asyncio, pytest.mark.django_db]+async def test_get_s3_integration_rejects_wrong_kind(ateam):+ """An integration whose kind is neither aws-s3 nor s3-compatible can't be resolved as an S3 one.++ The serializer validates the kind on create/update, so this only happens if the integration's+ kind is changed out from under an existing export (unlikely, but worth checking).+ """+ integration = await Integration.objects.acreate(+ team_id=ateam.pk,+ kind=Integration.IntegrationKind.SLACK,+ integration_id="not-s3",+ config={},+ sensitive_config={},+ )++ with pytest.raises(S3CredentialIntegrationError) as exc_info:+ await _get_s3_integration(integration.id, ateam.pk)+ assert "not an S3 integration" in str(exc_info.value)+ assert "kind='slack'" in str(exc_info.value)++@pytest.mark.parametrize("compression", COMPRESSION_EXTENSIONS.keys(), indirect=True)@pytest.mark.parametrize("model", TEST_S3_MODELS)@pytest.mark.parametrize("file_format", FILE_FORMAT_EXTENSIONS.keys())@@ -130,6 +152,80 @@ async def test_insert_into_s3_activity_puts_data_into_s3()[email protected]("exclude_events", [None], indirect=True)[email protected]("model", [BatchExportModel(name="events", schema=None)])[email protected]("compression", [None], indirect=True)[email protected]("file_format", ["JSONLines"], indirect=True)+async def test_insert_into_s3_activity_resolves_credentials_from_integration(+ clickhouse_client,+ bucket_name,+ minio_client,+ activity_environment: ActivityEnvironment,+ compression,+ exclude_events,+ file_format,+ data_interval_start,+ data_interval_end,+ model: BatchExportModel,+ generate_test_data,+ ateam,+):+ """An integration-backed S3-compatible export resolves credentials and endpoint_url from the+ linked Integration at run time, with none of them present on the activity inputs.+ """+ integration = await Integration.objects.acreate(+ team_id=ateam.pk,+ kind=Integration.IntegrationKind.S3_COMPATIBLE,+ integration_id="minio-test",+ config={"name": "minio-test", "endpoint_url": settings.OBJECT_STORAGE_ENDPOINT},+ sensitive_config={+ "aws_access_key_id": "object_storage_root_user",+ "aws_secret_access_key": "object_storage_root_password",+ },+ )++ prefix = str(uuid.uuid4())++ insert_inputs = S3InsertInputs(+ bucket_name=bucket_name,+ region="us-east-1",+ prefix=prefix,+ team_id=ateam.pk,+ data_interval_start=data_interval_start.isoformat(),+ data_interval_end=data_interval_end.isoformat(),+ # No inline credentials or endpoint_url — both are resolved from the integration.+ integration_id=integration.id,+ compression=compression,+ exclude_events=exclude_events,+ file_format=file_format,+ batch_export_model=model,+ batch_export_id=str(uuid.uuid4()),+ destination_default_fields=s3_default_fields(),+ )++ result = await run_activity(activity_environment, insert_inputs)+ assert result.error is None+ assert result.records_completed is not None and result.records_completed > 0+ assert result.bytes_exported is not None and result.bytes_exported > 0++ await assert_clickhouse_records_in_s3(+ s3_compatible_client=minio_client,+ clickhouse_client=clickhouse_client,+ bucket_name=bucket_name,+ key_prefix=prefix,+ team_id=ateam.pk,+ data_interval_start=data_interval_start,+ data_interval_end=data_interval_end,+ batch_export_model=model,+ exclude_events=exclude_events,+ include_events=None,+ compression=compression,+ file_format=file_format,+ backfill_details=None,+ sort_key="uuid",+ )++@pytest.mark.parametrize("exclude_events", [None, ["test-exclude"]], indirect=True)@pytest.mark.parametrize("model", [BatchExportModel(name="events", schema=None)])@pytest.mark.parametrize("compression", [None], indirect=True)diff --git a/products/batch_exports/frontend/generated/api.schemas.ts b/products/batch_exports/frontend/generated/api.schemas.tsindex 14228a0f1385..c8fec44f3f48 100644--- a/products/batch_exports/frontend/generated/api.schemas.ts+++ b/products/batch_exports/frontend/generated/api.schemas.ts@@ -107,14 +107,14 @@ export const CompressionEnumApi = {} as const/**- * * `JSONLines` - JSONLines* * `Parquet` - Parquet+ * * `JSONLines` - JSONLines*/export type FileFormatEnumApi = (typeof FileFormatEnumApi)[keyof typeof FileFormatEnumApi]export const FileFormatEnumApi = {- JSONLines: 'JSONLines',Parquet: 'Parquet',+ JSONLines: 'JSONLines',} as constexport type AzureBlobDestinationConfigApiType =@@ -206,18 +206,116 @@ export interface PostgresDestinationConfigApi {type: PostgresDestinationConfigApiType}+export type AwsS3DestinationConfigApiType =+ (typeof AwsS3DestinationConfigApiType)[keyof typeof AwsS3DestinationConfigApiType]++export const AwsS3DestinationConfigApiType = {+ AwsS3: 'AwsS3',+} as const++/**+ * Typed configuration for an AWS S3 batch-export destination.+ *+ * AWS credentials live in the linked aws-s3 Integration. Mirrors the non-credential fields of+ * `AwsS3BatchExportInputs` in `products/batch_exports/backend/service.py`.+ */+export interface AwsS3DestinationConfigApi {+ /** Name of the destination bucket. */+ bucket_name: string+ /** Region the bucket is in (e.g. 'us-east-1'). */+ region: string+ /** Object key prefix applied to every exported file. */+ prefix: string+ /** Optional compression codec applied to exported files. Valid codecs depend on file_format.+ *+ * * `brotli` - brotli+ * * `gzip` - gzip+ * * `lz4` - lz4+ * * `snappy` - snappy+ * * `zstd` - zstd */+ compression?: CompressionEnumApi | null+ /** File format used for exported objects.+ *+ * * `Parquet` - Parquet+ * * `JSONLines` - JSONLines */+ file_format?: FileFormatEnumApi+ /**+ * If set, rolls to a new file once the current file exceeds this size in MB.+ * @nullable+ */+ max_file_size_mb?: number | null+ /**+ * Optional S3 server-side encryption algorithm (e.g. 'AES256' or 'aws:kms').+ * @nullable+ */+ encryption?: string | null+ /**+ * KMS key ID to use when encryption is 'aws:kms'.+ * @nullable+ */+ kms_key_id?: string | null+ type: AwsS3DestinationConfigApiType+}++export type S3CompatibleDestinationConfigApiType =+ (typeof S3CompatibleDestinationConfigApiType)[keyof typeof S3CompatibleDestinationConfigApiType]++export const S3CompatibleDestinationConfigApiType = {+ S3Compatible: 'S3Compatible',+} as const++/**+ * Typed configuration for an S3-compatible batch-export destination (Cloudflare R2,+ * DigitalOcean Spaces, etc.).+ *+ * Credentials and the provider `endpoint_url` live in the linked s3-compatible Integration.+ * Mirrors the non-credential fields of `S3CompatibleBatchExportInputs` in+ * `products/batch_exports/backend/service.py`.+ */+export interface S3CompatibleDestinationConfigApi {+ /** Name of the destination bucket. */+ bucket_name: string+ /** Region the bucket is in (e.g. 'us-east-1'). */+ region: string+ /** Object key prefix applied to every exported file. */+ prefix: string+ /** Optional compression codec applied to exported files. Valid codecs depend on file_format.+ *+ * * `brotli` - brotli+ * * `gzip` - gzip+ * * `lz4` - lz4+ * * `snappy` - snappy+ * * `zstd` - zstd */+ compression?: CompressionEnumApi | null+ /** File format used for exported objects.+ *+ * * `Parquet` - Parquet+ * * `JSONLines` - JSONLines */+ file_format?: FileFormatEnumApi+ /**+ * If set, rolls to a new file once the current file exceeds this size in MB.+ * @nullable+ */+ max_file_size_mb?: number | null+ /** Use virtual-hosted-style addressing rather than path-style. */+ use_virtual_style_addressing?: boolean+ type: S3CompatibleDestinationConfigApiType+}+export type BatchExportDestinationConfigApi =| DatabricksDestinationConfigApi| AzureBlobDestinationConfigApi| BigQueryDestinationConfigApi| PostgresDestinationConfigApi+ | AwsS3DestinationConfigApi+ | S3CompatibleDestinationConfigApi/*** Serializer for an BatchExportDestination model.** The `config` field is polymorphic and typed only for destinations that keep- * credentials in the linked Integration (currently Databricks, AzureBlob, BigQuery, Postgres).- * Other destination types accept the same JSON shape but without a typed+ * credentials in the linked Integration (currently Databricks, AzureBlob, BigQuery, Postgres,+ * AwsS3, S3Compatible). Other destination types accept the same JSON shape but without a typed* OpenAPI schema. Secret fields are stripped from `config` on read.*/export interface BatchExportDestinationApi {@@ -237,7 +335,7 @@ export interface BatchExportDestinationApi {* * `NoOp` - Noop* * `FileDownload` - File Download */type: BatchExportDestinationTypeEnumApi- /** Destination-specific configuration. Fields depend on `type`. Credentials for integration-backed destinations (Databricks, AzureBlob, BigQuery, Postgres) are NOT stored here — they live in the linked Integration. Secret fields are stripped from responses. */+ /** Destination-specific configuration. Fields depend on `type`. Credentials for integration-backed destinations (Databricks, AzureBlob, BigQuery, Postgres, AwsS3, S3Compatible) are NOT stored here — they live in the linked Integration. Secret fields are stripped from responses. */config: BatchExportDestinationConfigApi/*** The integration for this destination.@@ -245,7 +343,7 @@ export interface BatchExportDestinationApi {*/integration?: number | null/**- * ID of a team-scoped Integration providing credentials. Required when creating Databricks, AzureBlob, BigQuery, and Postgres destinations; unused for other types.+ * ID of a team-scoped Integration providing credentials. Required when creating Databricks, AzureBlob, and BigQuery destinations; optional for AwsS3 and S3Compatible (inline credentials remain supported); unused for other types.* @nullable*/integration_id?: number | null@@ -1129,11 +1227,47 @@ export interface PostgresDestinationRequestApi {config: PostgresDestinationConfigApi}+export type AwsS3DestinationRequestApiType =+ (typeof AwsS3DestinationRequestApiType)[keyof typeof AwsS3DestinationRequestApiType]++export const AwsS3DestinationRequestApiType = {+ AwsS3: 'AwsS3',+} as const++/**+ * Request shape for creating or updating an AWS S3 batch-export destination.+ */+export interface AwsS3DestinationRequestApi {+ type: AwsS3DestinationRequestApiType+ /** ID of an aws-s3-kind Integration providing AWS credentials. Preferred over inline credentials. Use the integrations-list MCP tool to find one. */+ integration_id?: number+ config: AwsS3DestinationConfigApi+}++export type S3CompatibleDestinationRequestApiType =+ (typeof S3CompatibleDestinationRequestApiType)[keyof typeof S3CompatibleDestinationRequestApiType]++export const S3CompatibleDestinationRequestApiType = {+ S3Compatible: 'S3Compatible',+} as const++/**+ * Request shape for creating or updating an S3-compatible batch-export destination.+ */+export interface S3CompatibleDestinationRequestApi {+ type: S3CompatibleDestinationRequestApiType+ /** ID of an s3-compatible-kind Integration providing credentials and the provider endpoint URL. Preferred over inline credentials. Use the integrations-list MCP tool to find one. */+ integration_id?: number+ config: S3CompatibleDestinationConfigApi+}+export type BatchExportDestinationRequestApi =| DatabricksDestinationRequestApi| AzureBlobDestinationRequestApi| BigQueryDestinationRequestApi| PostgresDestinationRequestApi+ | AwsS3DestinationRequestApi+ | S3CompatibleDestinationRequestApi/*** Request body for create/partial_update on BatchExportViewSet.@@ -1659,6 +1793,26 @@ export const PostgresDestinationRequestTypeEnumApi = {Postgres: 'Postgres',} as const+/**+ * * `AwsS3` - AwsS3+ */+export type AwsS3DestinationRequestTypeEnumApi =+ (typeof AwsS3DestinationRequestTypeEnumApi)[keyof typeof AwsS3DestinationRequestTypeEnumApi]++export const AwsS3DestinationRequestTypeEnumApi = {+ AwsS3: 'AwsS3',+} as const++/**+ * * `S3Compatible` - S3Compatible+ */+export type S3CompatibleDestinationRequestTypeEnumApi =+ (typeof S3CompatibleDestinationRequestTypeEnumApi)[keyof typeof S3CompatibleDestinationRequestTypeEnumApi]++export const S3CompatibleDestinationRequestTypeEnumApi = {+ S3Compatible: 'S3Compatible',+} as const+export type BatchExportsListParams = {/*** Number of results to return per page.diff --git a/products/batch_exports/frontend/generated/api.zod.ts b/products/batch_exports/frontend/generated/api.zod.tsindex 4e050da89ac2..905a07e49f1e 100644--- a/products/batch_exports/frontend/generated/api.zod.ts+++ b/products/batch_exports/frontend/generated/api.zod.ts@@ -18,6 +18,9 @@ export const batchExportsCreateBodyDestinationOneThreeConfigUseJsonTypeDefault =export const batchExportsCreateBodyDestinationOneFourConfigSchemaDefault = `public`export const batchExportsCreateBodyDestinationOneFourConfigTableNameDefault = `events`export const batchExportsCreateBodyDestinationOneFourConfigHasSelfSignedCertDefault = false+export const batchExportsCreateBodyDestinationOneFiveConfigFileFormatDefault = `JSONLines`+export const batchExportsCreateBodyDestinationOneSixConfigFileFormatDefault = `JSONLines`+export const batchExportsCreateBodyDestinationOneSixConfigUseVirtualStyleAddressingDefault = falseexport const batchExportsCreateBodyOffsetDayMin = 0export const batchExportsCreateBodyOffsetDayMax = 6@@ -98,8 +101,8 @@ export const BatchExportsCreateBody = /* @__PURE__ */ zod'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'),file_format: zod- .enum(['JSONLines', 'Parquet'])- .describe('\* `JSONLines` - JSONLines\n\* `Parquet` - Parquet')+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines').default(batchExportsCreateBodyDestinationOneTwoConfigFileFormatDefault).describe('File format used for exported objects.\n\n\* `JSONLines` - JSONLines\n\* `Parquet` - Parquet'@@ -177,6 +180,116 @@ export const BatchExportsCreateBody = /* @__PURE__ */ zod),}).describe('Request shape for creating or updating a PostgreSQL batch-export destination.'),+ zod+ .object({+ type: zod.enum(['AwsS3']),+ integration_id: zod+ .number()+ .optional()+ .describe(+ 'ID of an aws-s3-kind Integration providing AWS credentials. Preferred over inline credentials. Use the integrations-list MCP tool to find one.'+ ),+ config: zod+ .object({+ bucket_name: zod.string().describe('Name of the destination bucket.'),+ region: zod.string().describe("Region the bucket is in (e.g. 'us-east-1')."),+ prefix: zod.string().describe('Object key prefix applied to every exported file.'),+ compression: zod+ .union([+ zod+ .enum(['brotli', 'gzip', 'lz4', 'snappy', 'zstd'])+ .describe(+ '\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ file_format: zod+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines')+ .default(batchExportsCreateBodyDestinationOneFiveConfigFileFormatDefault)+ .describe(+ 'File format used for exported objects.\n\n\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines'+ ),+ max_file_size_mb: zod+ .number()+ .nullish()+ .describe(+ 'If set, rolls to a new file once the current file exceeds this size in MB.'+ ),+ encryption: zod+ .string()+ .nullish()+ .describe(+ "Optional S3 server-side encryption algorithm (e.g. 'AES256' or 'aws:kms')."+ ),+ kms_key_id: zod+ .string()+ .nullish()+ .describe("KMS key ID to use when encryption is 'aws:kms'."),+ type: zod.enum(['AwsS3']),+ })+ .describe(+ 'Typed configuration for an AWS S3 batch-export destination.\n\nAWS credentials live in the linked aws-s3 Integration. Mirrors the non-credential fields of\n`AwsS3BatchExportInputs` in `products\/batch_exports\/backend\/service.py`.'+ ),+ })+ .describe('Request shape for creating or updating an AWS S3 batch-export destination.'),+ zod+ .object({+ type: zod.enum(['S3Compatible']),+ integration_id: zod+ .number()+ .optional()+ .describe(+ 'ID of an s3-compatible-kind Integration providing credentials and the provider endpoint URL. Preferred over inline credentials. Use the integrations-list MCP tool to find one.'+ ),+ config: zod+ .object({+ bucket_name: zod.string().describe('Name of the destination bucket.'),+ region: zod.string().describe("Region the bucket is in (e.g. 'us-east-1')."),+ prefix: zod.string().describe('Object key prefix applied to every exported file.'),+ compression: zod+ .union([+ zod+ .enum(['brotli', 'gzip', 'lz4', 'snappy', 'zstd'])+ .describe(+ '\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ file_format: zod+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines')+ .default(batchExportsCreateBodyDestinationOneSixConfigFileFormatDefault)+ .describe(+ 'File format used for exported objects.\n\n\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines'+ ),+ max_file_size_mb: zod+ .number()+ .nullish()+ .describe(+ 'If set, rolls to a new file once the current file exceeds this size in MB.'+ ),+ use_virtual_style_addressing: zod+ .boolean()+ .default(+ batchExportsCreateBodyDestinationOneSixConfigUseVirtualStyleAddressingDefault+ )+ .describe('Use virtual-hosted-style addressing rather than path-style.'),+ type: zod.enum(['S3Compatible']),+ })+ .describe(+ 'Typed configuration for an S3-compatible batch-export destination (Cloudflare R2,\nDigitalOcean Spaces, etc.).\n\nCredentials and the provider `endpoint_url` live in the linked s3-compatible Integration.\nMirrors the non-credential fields of `S3CompatibleBatchExportInputs` in\n`products\/batch_exports\/backend\/service.py`.'+ ),+ })+ .describe('Request shape for creating or updating an S3-compatible batch-export destination.'),]).describe('Destination configuration. Required integration_id is enforced per destination type.'),interval: zod@@ -472,6 +585,9 @@ export const batchExportsUpdateBodyDestinationOneThreeConfigUseJsonTypeDefault =export const batchExportsUpdateBodyDestinationOneFourConfigSchemaDefault = `public`export const batchExportsUpdateBodyDestinationOneFourConfigTableNameDefault = `events`export const batchExportsUpdateBodyDestinationOneFourConfigHasSelfSignedCertDefault = false+export const batchExportsUpdateBodyDestinationOneFiveConfigFileFormatDefault = `JSONLines`+export const batchExportsUpdateBodyDestinationOneSixConfigFileFormatDefault = `JSONLines`+export const batchExportsUpdateBodyDestinationOneSixConfigUseVirtualStyleAddressingDefault = falseexport const batchExportsUpdateBodyOffsetDayMin = 0export const batchExportsUpdateBodyOffsetDayMax = 6@@ -552,8 +668,8 @@ export const BatchExportsUpdateBody = /* @__PURE__ */ zod'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'),file_format: zod- .enum(['JSONLines', 'Parquet'])- .describe('\* `JSONLines` - JSONLines\n\* `Parquet` - Parquet')+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines').default(batchExportsUpdateBodyDestinationOneTwoConfigFileFormatDefault).describe('File format used for exported objects.\n\n\* `JSONLines` - JSONLines\n\* `Parquet` - Parquet'@@ -631,6 +747,116 @@ export const BatchExportsUpdateBody = /* @__PURE__ */ zod),}).describe('Request shape for creating or updating a PostgreSQL batch-export destination.'),+ zod+ .object({+ type: zod.enum(['AwsS3']),+ integration_id: zod+ .number()+ .optional()+ .describe(+ 'ID of an aws-s3-kind Integration providing AWS credentials. Preferred over inline credentials. Use the integrations-list MCP tool to find one.'+ ),+ config: zod+ .object({+ bucket_name: zod.string().describe('Name of the destination bucket.'),+ region: zod.string().describe("Region the bucket is in (e.g. 'us-east-1')."),+ prefix: zod.string().describe('Object key prefix applied to every exported file.'),+ compression: zod+ .union([+ zod+ .enum(['brotli', 'gzip', 'lz4', 'snappy', 'zstd'])+ .describe(+ '\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ file_format: zod+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines')+ .default(batchExportsUpdateBodyDestinationOneFiveConfigFileFormatDefault)+ .describe(+ 'File format used for exported objects.\n\n\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines'+ ),+ max_file_size_mb: zod+ .number()+ .nullish()+ .describe(+ 'If set, rolls to a new file once the current file exceeds this size in MB.'+ ),+ encryption: zod+ .string()+ .nullish()+ .describe(+ "Optional S3 server-side encryption algorithm (e.g. 'AES256' or 'aws:kms')."+ ),+ kms_key_id: zod+ .string()+ .nullish()+ .describe("KMS key ID to use when encryption is 'aws:kms'."),+ type: zod.enum(['AwsS3']),+ })+ .describe(+ 'Typed configuration for an AWS S3 batch-export destination.\n\nAWS credentials live in the linked aws-s3 Integration. Mirrors the non-credential fields of\n`AwsS3BatchExportInputs` in `products\/batch_exports\/backend\/service.py`.'+ ),+ })+ .describe('Request shape for creating or updating an AWS S3 batch-export destination.'),+ zod+ .object({+ type: zod.enum(['S3Compatible']),+ integration_id: zod+ .number()+ .optional()+ .describe(+ 'ID of an s3-compatible-kind Integration providing credentials and the provider endpoint URL. Preferred over inline credentials. Use the integrations-list MCP tool to find one.'+ ),+ config: zod+ .object({+ bucket_name: zod.string().describe('Name of the destination bucket.'),+ region: zod.string().describe("Region the bucket is in (e.g. 'us-east-1')."),+ prefix: zod.string().describe('Object key prefix applied to every exported file.'),+ compression: zod+ .union([+ zod+ .enum(['brotli', 'gzip', 'lz4', 'snappy', 'zstd'])+ .describe(+ '\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ file_format: zod+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines')+ .default(batchExportsUpdateBodyDestinationOneSixConfigFileFormatDefault)+ .describe(+ 'File format used for exported objects.\n\n\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines'+ ),+ max_file_size_mb: zod+ .number()+ .nullish()+ .describe(+ 'If set, rolls to a new file once the current file exceeds this size in MB.'+ ),+ use_virtual_style_addressing: zod+ .boolean()+ .default(+ batchExportsUpdateBodyDestinationOneSixConfigUseVirtualStyleAddressingDefault+ )+ .describe('Use virtual-hosted-style addressing rather than path-style.'),+ type: zod.enum(['S3Compatible']),+ })+ .describe(+ 'Typed configuration for an S3-compatible batch-export destination (Cloudflare R2,\nDigitalOcean Spaces, etc.).\n\nCredentials and the provider `endpoint_url` live in the linked s3-compatible Integration.\nMirrors the non-credential fields of `S3CompatibleBatchExportInputs` in\n`products\/batch_exports\/backend\/service.py`.'+ ),+ })+ .describe('Request shape for creating or updating an S3-compatible batch-export destination.'),]).describe('Destination configuration. Required integration_id is enforced per destination type.'),interval: zod@@ -679,6 +905,9 @@ export const batchExportsPartialUpdateBodyDestinationOneThreeConfigUseJsonTypeDeexport const batchExportsPartialUpdateBodyDestinationOneFourConfigSchemaDefault = `public`export const batchExportsPartialUpdateBodyDestinationOneFourConfigTableNameDefault = `events`export const batchExportsPartialUpdateBodyDestinationOneFourConfigHasSelfSignedCertDefault = false+export const batchExportsPartialUpdateBodyDestinationOneFiveConfigFileFormatDefault = `JSONLines`+export const batchExportsPartialUpdateBodyDestinationOneSixConfigFileFormatDefault = `JSONLines`+export const batchExportsPartialUpdateBodyDestinationOneSixConfigUseVirtualStyleAddressingDefault = falseexport const batchExportsPartialUpdateBodyOffsetDayMin = 0export const batchExportsPartialUpdateBodyOffsetDayMax = 6@@ -759,8 +988,8 @@ export const BatchExportsPartialUpdateBody = /* @__PURE__ */ zod'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'),file_format: zod- .enum(['JSONLines', 'Parquet'])- .describe('\* `JSONLines` - JSONLines\n\* `Parquet` - Parquet')+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines').default(batchExportsPartialUpdateBodyDestinationOneTwoConfigFileFormatDefault).describe('File format used for exported objects.\n\n\* `JSONLines` - JSONLines\n\* `Parquet` - Parquet'@@ -840,6 +1069,116 @@ export const BatchExportsPartialUpdateBody = /* @__PURE__ */ zod),}).describe('Request shape for creating or updating a PostgreSQL batch-export destination.'),+ zod+ .object({+ type: zod.enum(['AwsS3']),+ integration_id: zod+ .number()+ .optional()+ .describe(+ 'ID of an aws-s3-kind Integration providing AWS credentials. Preferred over inline credentials. Use the integrations-list MCP tool to find one.'+ ),+ config: zod+ .object({+ bucket_name: zod.string().describe('Name of the destination bucket.'),+ region: zod.string().describe("Region the bucket is in (e.g. 'us-east-1')."),+ prefix: zod.string().describe('Object key prefix applied to every exported file.'),+ compression: zod+ .union([+ zod+ .enum(['brotli', 'gzip', 'lz4', 'snappy', 'zstd'])+ .describe(+ '\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ file_format: zod+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines')+ .default(batchExportsPartialUpdateBodyDestinationOneFiveConfigFileFormatDefault)+ .describe(+ 'File format used for exported objects.\n\n\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines'+ ),+ max_file_size_mb: zod+ .number()+ .nullish()+ .describe(+ 'If set, rolls to a new file once the current file exceeds this size in MB.'+ ),+ encryption: zod+ .string()+ .nullish()+ .describe(+ "Optional S3 server-side encryption algorithm (e.g. 'AES256' or 'aws:kms')."+ ),+ kms_key_id: zod+ .string()+ .nullish()+ .describe("KMS key ID to use when encryption is 'aws:kms'."),+ type: zod.enum(['AwsS3']),+ })+ .describe(+ 'Typed configuration for an AWS S3 batch-export destination.\n\nAWS credentials live in the linked aws-s3 Integration. Mirrors the non-credential fields of\n`AwsS3BatchExportInputs` in `products\/batch_exports\/backend\/service.py`.'+ ),+ })+ .describe('Request shape for creating or updating an AWS S3 batch-export destination.'),+ zod+ .object({+ type: zod.enum(['S3Compatible']),+ integration_id: zod+ .number()+ .optional()+ .describe(+ 'ID of an s3-compatible-kind Integration providing credentials and the provider endpoint URL. Preferred over inline credentials. Use the integrations-list MCP tool to find one.'+ ),+ config: zod+ .object({+ bucket_name: zod.string().describe('Name of the destination bucket.'),+ region: zod.string().describe("Region the bucket is in (e.g. 'us-east-1')."),+ prefix: zod.string().describe('Object key prefix applied to every exported file.'),+ compression: zod+ .union([+ zod+ .enum(['brotli', 'gzip', 'lz4', 'snappy', 'zstd'])+ .describe(+ '\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ file_format: zod+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines')+ .default(batchExportsPartialUpdateBodyDestinationOneSixConfigFileFormatDefault)+ .describe(+ 'File format used for exported objects.\n\n\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines'+ ),+ max_file_size_mb: zod+ .number()+ .nullish()+ .describe(+ 'If set, rolls to a new file once the current file exceeds this size in MB.'+ ),+ use_virtual_style_addressing: zod+ .boolean()+ .default(+ batchExportsPartialUpdateBodyDestinationOneSixConfigUseVirtualStyleAddressingDefault+ )+ .describe('Use virtual-hosted-style addressing rather than path-style.'),+ type: zod.enum(['S3Compatible']),+ })+ .describe(+ 'Typed configuration for an S3-compatible batch-export destination (Cloudflare R2,\nDigitalOcean Spaces, etc.).\n\nCredentials and the provider `endpoint_url` live in the linked s3-compatible Integration.\nMirrors the non-credential fields of `S3CompatibleBatchExportInputs` in\n`products\/batch_exports\/backend\/service.py`.'+ ),+ })+ .describe('Request shape for creating or updating an S3-compatible batch-export destination.'),]).optional().describe('Destination configuration. Required integration_id is enforced per destination type.'),@@ -893,6 +1232,9 @@ export const batchExportsPauseCreateBodyDestinationOneConfigOneThreeUseJsonTypeDexport const batchExportsPauseCreateBodyDestinationOneConfigOneFourSchemaDefault = `public`export const batchExportsPauseCreateBodyDestinationOneConfigOneFourTableNameDefault = `events`export const batchExportsPauseCreateBodyDestinationOneConfigOneFourHasSelfSignedCertDefault = false+export const batchExportsPauseCreateBodyDestinationOneConfigOneFiveFileFormatDefault = `JSONLines`+export const batchExportsPauseCreateBodyDestinationOneConfigOneSixFileFormatDefault = `JSONLines`+export const batchExportsPauseCreateBodyDestinationOneConfigOneSixUseVirtualStyleAddressingDefault = falseexport const batchExportsPauseCreateBodyOffsetDayMin = 0export const batchExportsPauseCreateBodyOffsetDayMax = 6@@ -984,8 +1326,8 @@ export const BatchExportsPauseCreateBody = /* @__PURE__ */ zod'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'),file_format: zod- .enum(['JSONLines', 'Parquet'])- .describe('\* `JSONLines` - JSONLines\n\* `Parquet` - Parquet')+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines').default(batchExportsPauseCreateBodyDestinationOneConfigOneTwoFileFormatDefault).describe('File format used for exported objects.\n\n\* `JSONLines` - JSONLines\n\* `Parquet` - Parquet'@@ -1043,20 +1385,108 @@ export const BatchExportsPauseCreateBody = /* @__PURE__ */ zod.describe('Typed configuration for a PostgreSQL batch-export destination.\n\nConnection credentials may live in a linked Integration (when one is provided) or\ninline in this config (legacy). Mirrors the non-credential fields of\n`PostgresBatchExportInputs` in `products\/batch_exports\/backend\/service.py`.'),+ zod+ .object({+ bucket_name: zod.string().describe('Name of the destination bucket.'),+ region: zod.string().describe("Region the bucket is in (e.g. 'us-east-1')."),+ prefix: zod.string().describe('Object key prefix applied to every exported file.'),+ compression: zod+ .union([+ zod+ .enum(['brotli', 'gzip', 'lz4', 'snappy', 'zstd'])+ .describe(+ '\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ file_format: zod+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines')+ .default(batchExportsPauseCreateBodyDestinationOneConfigOneFiveFileFormatDefault)+ .describe(+ 'File format used for exported objects.\n\n\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines'+ ),+ max_file_size_mb: zod+ .number()+ .nullish()+ .describe(+ 'If set, rolls to a new file once the current file exceeds this size in MB.'+ ),+ encryption: zod+ .string()+ .nullish()+ .describe(+ "Optional S3 server-side encryption algorithm (e.g. 'AES256' or 'aws:kms')."+ ),+ kms_key_id: zod+ .string()+ .nullish()+ .describe("KMS key ID to use when encryption is 'aws:kms'."),+ type: zod.enum(['AwsS3']),+ })+ .describe(+ 'Typed configuration for an AWS S3 batch-export destination.\n\nAWS credentials live in the linked aws-s3 Integration. Mirrors the non-credential fields of\n`AwsS3BatchExportInputs` in `products\/batch_exports\/backend\/service.py`.'+ ),+ zod+ .object({+ bucket_name: zod.string().describe('Name of the destination bucket.'),+ region: zod.string().describe("Region the bucket is in (e.g. 'us-east-1')."),+ prefix: zod.string().describe('Object key prefix applied to every exported file.'),+ compression: zod+ .union([+ zod+ .enum(['brotli', 'gzip', 'lz4', 'snappy', 'zstd'])+ .describe(+ '\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ file_format: zod+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines')+ .default(batchExportsPauseCreateBodyDestinationOneConfigOneSixFileFormatDefault)+ .describe(+ 'File format used for exported objects.\n\n\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines'+ ),+ max_file_size_mb: zod+ .number()+ .nullish()+ .describe(+ 'If set, rolls to a new file once the current file exceeds this size in MB.'+ ),+ use_virtual_style_addressing: zod+ .boolean()+ .default(+ batchExportsPauseCreateBodyDestinationOneConfigOneSixUseVirtualStyleAddressingDefault+ )+ .describe('Use virtual-hosted-style addressing rather than path-style.'),+ type: zod.enum(['S3Compatible']),+ })+ .describe(+ 'Typed configuration for an S3-compatible batch-export destination (Cloudflare R2,\nDigitalOcean Spaces, etc.).\n\nCredentials and the provider `endpoint_url` live in the linked s3-compatible Integration.\nMirrors the non-credential fields of `S3CompatibleBatchExportInputs` in\n`products\/batch_exports\/backend\/service.py`.'+ ),]).describe(- 'Destination-specific configuration. Fields depend on `type`. Credentials for integration-backed destinations (Databricks, AzureBlob, BigQuery, Postgres) are NOT stored here — they live in the linked Integration. Secret fields are stripped from responses.'+ 'Destination-specific configuration. Fields depend on `type`. Credentials for integration-backed destinations (Databricks, AzureBlob, BigQuery, Postgres, AwsS3, S3Compatible) are NOT stored here — they live in the linked Integration. Secret fields are stripped from responses.'),integration: zod.number().nullish().describe('The integration for this destination.'),integration_id: zod.number().nullish().describe(- 'ID of a team-scoped Integration providing credentials. Required when creating Databricks, AzureBlob, BigQuery, and Postgres destinations; unused for other types.'+ 'ID of a team-scoped Integration providing credentials. Required when creating Databricks, AzureBlob, and BigQuery destinations; optional for AwsS3 and S3Compatible (inline credentials remain supported); unused for other types.'),}).describe(- 'Serializer for an BatchExportDestination model.\n\nThe `config` field is polymorphic and typed only for destinations that keep\ncredentials in the linked Integration (currently Databricks, AzureBlob, BigQuery, Postgres).\nOther destination types accept the same JSON shape but without a typed\nOpenAPI schema. Secret fields are stripped from `config` on read.'+ 'Serializer for an BatchExportDestination model.\n\nThe `config` field is polymorphic and typed only for destinations that keep\ncredentials in the linked Integration (currently Databricks, AzureBlob, BigQuery, Postgres,\nAwsS3, S3Compatible). Other destination types accept the same JSON shape but without a typed\nOpenAPI schema. Secret fields are stripped from `config` on read.').describe('Destination configuration (type, config, and optional integration).'),interval: zod@@ -1119,6 +1549,9 @@ export const batchExportsRunTestStepCreateBodyDestinationOneConfigOneThreeUseJsoexport const batchExportsRunTestStepCreateBodyDestinationOneConfigOneFourSchemaDefault = `public`export const batchExportsRunTestStepCreateBodyDestinationOneConfigOneFourTableNameDefault = `events`export const batchExportsRunTestStepCreateBodyDestinationOneConfigOneFourHasSelfSignedCertDefault = false+export const batchExportsRunTestStepCreateBodyDestinationOneConfigOneFiveFileFormatDefault = `JSONLines`+export const batchExportsRunTestStepCreateBodyDestinationOneConfigOneSixFileFormatDefault = `JSONLines`+export const batchExportsRunTestStepCreateBodyDestinationOneConfigOneSixUseVirtualStyleAddressingDefault = falseexport const batchExportsRunTestStepCreateBodyOffsetDayMin = 0export const batchExportsRunTestStepCreateBodyOffsetDayMax = 6@@ -1212,8 +1645,8 @@ export const BatchExportsRunTestStepCreateBody = /* @__PURE__ */ zod'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'),file_format: zod- .enum(['JSONLines', 'Parquet'])- .describe('\* `JSONLines` - JSONLines\n\* `Parquet` - Parquet')+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines').default(batchExportsRunTestStepCreateBodyDestinationOneConfigOneTwoFileFormatDefault)@@ -1279,20 +1712,112 @@ export const BatchExportsRunTestStepCreateBody = /* @__PURE__ */ zod.describe('Typed configuration for a PostgreSQL batch-export destination.\n\nConnection credentials may live in a linked Integration (when one is provided) or\ninline in this config (legacy). Mirrors the non-credential fields of\n`PostgresBatchExportInputs` in `products\/batch_exports\/backend\/service.py`.'),+ zod+ .object({+ bucket_name: zod.string().describe('Name of the destination bucket.'),+ region: zod.string().describe("Region the bucket is in (e.g. 'us-east-1')."),+ prefix: zod.string().describe('Object key prefix applied to every exported file.'),+ compression: zod+ .union([+ zod+ .enum(['brotli', 'gzip', 'lz4', 'snappy', 'zstd'])+ .describe(+ '\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ file_format: zod+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines')+ .default(+ batchExportsRunTestStepCreateBodyDestinationOneConfigOneFiveFileFormatDefault+ )+ .describe(+ 'File format used for exported objects.\n\n\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines'+ ),+ max_file_size_mb: zod+ .number()+ .nullish()+ .describe(+ 'If set, rolls to a new file once the current file exceeds this size in MB.'+ ),+ encryption: zod+ .string()+ .nullish()+ .describe(+ "Optional S3 server-side encryption algorithm (e.g. 'AES256' or 'aws:kms')."+ ),+ kms_key_id: zod+ .string()+ .nullish()+ .describe("KMS key ID to use when encryption is 'aws:kms'."),+ type: zod.enum(['AwsS3']),+ })+ .describe(+ 'Typed configuration for an AWS S3 batch-export destination.\n\nAWS credentials live in the linked aws-s3 Integration. Mirrors the non-credential fields of\n`AwsS3BatchExportInputs` in `products\/batch_exports\/backend\/service.py`.'+ ),+ zod+ .object({+ bucket_name: zod.string().describe('Name of the destination bucket.'),+ region: zod.string().describe("Region the bucket is in (e.g. 'us-east-1')."),+ prefix: zod.string().describe('Object key prefix applied to every exported file.'),+ compression: zod+ .union([+ zod+ .enum(['brotli', 'gzip', 'lz4', 'snappy', 'zstd'])+ .describe(+ '\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ file_format: zod+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines')+ .default(+ batchExportsRunTestStepCreateBodyDestinationOneConfigOneSixFileFormatDefault+ )+ .describe(+ 'File format used for exported objects.\n\n\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines'+ ),+ max_file_size_mb: zod+ .number()+ .nullish()+ .describe(+ 'If set, rolls to a new file once the current file exceeds this size in MB.'+ ),+ use_virtual_style_addressing: zod+ .boolean()+ .default(+ batchExportsRunTestStepCreateBodyDestinationOneConfigOneSixUseVirtualStyleAddressingDefault+ )+ .describe('Use virtual-hosted-style addressing rather than path-style.'),+ type: zod.enum(['S3Compatible']),+ })+ .describe(+ 'Typed configuration for an S3-compatible batch-export destination (Cloudflare R2,\nDigitalOcean Spaces, etc.).\n\nCredentials and the provider `endpoint_url` live in the linked s3-compatible Integration.\nMirrors the non-credential fields of `S3CompatibleBatchExportInputs` in\n`products\/batch_exports\/backend\/service.py`.'+ ),]).describe(- 'Destination-specific configuration. Fields depend on `type`. Credentials for integration-backed destinations (Databricks, AzureBlob, BigQuery, Postgres) are NOT stored here — they live in the linked Integration. Secret fields are stripped from responses.'+ 'Destination-specific configuration. Fields depend on `type`. Credentials for integration-backed destinations (Databricks, AzureBlob, BigQuery, Postgres, AwsS3, S3Compatible) are NOT stored here — they live in the linked Integration. Secret fields are stripped from responses.'),integration: zod.number().nullish().describe('The integration for this destination.'),integration_id: zod.number().nullish().describe(- 'ID of a team-scoped Integration providing credentials. Required when creating Databricks, AzureBlob, BigQuery, and Postgres destinations; unused for other types.'+ 'ID of a team-scoped Integration providing credentials. Required when creating Databricks, AzureBlob, and BigQuery destinations; optional for AwsS3 and S3Compatible (inline credentials remain supported); unused for other types.'),}).describe(- 'Serializer for an BatchExportDestination model.\n\nThe `config` field is polymorphic and typed only for destinations that keep\ncredentials in the linked Integration (currently Databricks, AzureBlob, BigQuery, Postgres).\nOther destination types accept the same JSON shape but without a typed\nOpenAPI schema. Secret fields are stripped from `config` on read.'+ 'Serializer for an BatchExportDestination model.\n\nThe `config` field is polymorphic and typed only for destinations that keep\ncredentials in the linked Integration (currently Databricks, AzureBlob, BigQuery, Postgres,\nAwsS3, S3Compatible). Other destination types accept the same JSON shape but without a typed\nOpenAPI schema. Secret fields are stripped from `config` on read.').describe('Destination configuration (type, config, and optional integration).'),interval: zod@@ -1358,6 +1883,9 @@ export const batchExportsUnpauseCreateBodyDestinationOneConfigOneThreeUseJsonTypexport const batchExportsUnpauseCreateBodyDestinationOneConfigOneFourSchemaDefault = `public`export const batchExportsUnpauseCreateBodyDestinationOneConfigOneFourTableNameDefault = `events`export const batchExportsUnpauseCreateBodyDestinationOneConfigOneFourHasSelfSignedCertDefault = false+export const batchExportsUnpauseCreateBodyDestinationOneConfigOneFiveFileFormatDefault = `JSONLines`+export const batchExportsUnpauseCreateBodyDestinationOneConfigOneSixFileFormatDefault = `JSONLines`+export const batchExportsUnpauseCreateBodyDestinationOneConfigOneSixUseVirtualStyleAddressingDefault = falseexport const batchExportsUnpauseCreateBodyOffsetDayMin = 0export const batchExportsUnpauseCreateBodyOffsetDayMax = 6@@ -1451,8 +1979,8 @@ export const BatchExportsUnpauseCreateBody = /* @__PURE__ */ zod'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'),file_format: zod- .enum(['JSONLines', 'Parquet'])- .describe('\* `JSONLines` - JSONLines\n\* `Parquet` - Parquet')+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines').default(batchExportsUnpauseCreateBodyDestinationOneConfigOneTwoFileFormatDefault).describe('File format used for exported objects.\n\n\* `JSONLines` - JSONLines\n\* `Parquet` - Parquet'@@ -1512,20 +2040,108 @@ export const BatchExportsUnpauseCreateBody = /* @__PURE__ */ zod.describe('Typed configuration for a PostgreSQL batch-export destination.\n\nConnection credentials may live in a linked Integration (when one is provided) or\ninline in this config (legacy). Mirrors the non-credential fields of\n`PostgresBatchExportInputs` in `products\/batch_exports\/backend\/service.py`.'),+ zod+ .object({+ bucket_name: zod.string().describe('Name of the destination bucket.'),+ region: zod.string().describe("Region the bucket is in (e.g. 'us-east-1')."),+ prefix: zod.string().describe('Object key prefix applied to every exported file.'),+ compression: zod+ .union([+ zod+ .enum(['brotli', 'gzip', 'lz4', 'snappy', 'zstd'])+ .describe(+ '\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ file_format: zod+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines')+ .default(batchExportsUnpauseCreateBodyDestinationOneConfigOneFiveFileFormatDefault)+ .describe(+ 'File format used for exported objects.\n\n\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines'+ ),+ max_file_size_mb: zod+ .number()+ .nullish()+ .describe(+ 'If set, rolls to a new file once the current file exceeds this size in MB.'+ ),+ encryption: zod+ .string()+ .nullish()+ .describe(+ "Optional S3 server-side encryption algorithm (e.g. 'AES256' or 'aws:kms')."+ ),+ kms_key_id: zod+ .string()+ .nullish()+ .describe("KMS key ID to use when encryption is 'aws:kms'."),+ type: zod.enum(['AwsS3']),+ })+ .describe(+ 'Typed configuration for an AWS S3 batch-export destination.\n\nAWS credentials live in the linked aws-s3 Integration. Mirrors the non-credential fields of\n`AwsS3BatchExportInputs` in `products\/batch_exports\/backend\/service.py`.'+ ),+ zod+ .object({+ bucket_name: zod.string().describe('Name of the destination bucket.'),+ region: zod.string().describe("Region the bucket is in (e.g. 'us-east-1')."),+ prefix: zod.string().describe('Object key prefix applied to every exported file.'),+ compression: zod+ .union([+ zod+ .enum(['brotli', 'gzip', 'lz4', 'snappy', 'zstd'])+ .describe(+ '\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ file_format: zod+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines')+ .default(batchExportsUnpauseCreateBodyDestinationOneConfigOneSixFileFormatDefault)+ .describe(+ 'File format used for exported objects.\n\n\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines'+ ),+ max_file_size_mb: zod+ .number()+ .nullish()+ .describe(+ 'If set, rolls to a new file once the current file exceeds this size in MB.'+ ),+ use_virtual_style_addressing: zod+ .boolean()+ .default(+ batchExportsUnpauseCreateBodyDestinationOneConfigOneSixUseVirtualStyleAddressingDefault+ )+ .describe('Use virtual-hosted-style addressing rather than path-style.'),+ type: zod.enum(['S3Compatible']),+ })+ .describe(+ 'Typed configuration for an S3-compatible batch-export destination (Cloudflare R2,\nDigitalOcean Spaces, etc.).\n\nCredentials and the provider `endpoint_url` live in the linked s3-compatible Integration.\nMirrors the non-credential fields of `S3CompatibleBatchExportInputs` in\n`products\/batch_exports\/backend\/service.py`.'+ ),]).describe(- 'Destination-specific configuration. Fields depend on `type`. Credentials for integration-backed destinations (Databricks, AzureBlob, BigQuery, Postgres) are NOT stored here — they live in the linked Integration. Secret fields are stripped from responses.'+ 'Destination-specific configuration. Fields depend on `type`. Credentials for integration-backed destinations (Databricks, AzureBlob, BigQuery, Postgres, AwsS3, S3Compatible) are NOT stored here — they live in the linked Integration. Secret fields are stripped from responses.'),integration: zod.number().nullish().describe('The integration for this destination.'),integration_id: zod.number().nullish().describe(- 'ID of a team-scoped Integration providing credentials. Required when creating Databricks, AzureBlob, BigQuery, and Postgres destinations; unused for other types.'+ 'ID of a team-scoped Integration providing credentials. Required when creating Databricks, AzureBlob, and BigQuery destinations; optional for AwsS3 and S3Compatible (inline credentials remain supported); unused for other types.'),}).describe(- 'Serializer for an BatchExportDestination model.\n\nThe `config` field is polymorphic and typed only for destinations that keep\ncredentials in the linked Integration (currently Databricks, AzureBlob, BigQuery, Postgres).\nOther destination types accept the same JSON shape but without a typed\nOpenAPI schema. Secret fields are stripped from `config` on read.'+ 'Serializer for an BatchExportDestination model.\n\nThe `config` field is polymorphic and typed only for destinations that keep\ncredentials in the linked Integration (currently Databricks, AzureBlob, BigQuery, Postgres,\nAwsS3, S3Compatible). Other destination types accept the same JSON shape but without a typed\nOpenAPI schema. Secret fields are stripped from `config` on read.').describe('Destination configuration (type, config, and optional integration).'),interval: zod@@ -1588,6 +2204,9 @@ export const batchExportsRunTestStepNewCreateBodyDestinationOneConfigOneThreeUseexport const batchExportsRunTestStepNewCreateBodyDestinationOneConfigOneFourSchemaDefault = `public`export const batchExportsRunTestStepNewCreateBodyDestinationOneConfigOneFourTableNameDefault = `events`export const batchExportsRunTestStepNewCreateBodyDestinationOneConfigOneFourHasSelfSignedCertDefault = false+export const batchExportsRunTestStepNewCreateBodyDestinationOneConfigOneFiveFileFormatDefault = `JSONLines`+export const batchExportsRunTestStepNewCreateBodyDestinationOneConfigOneSixFileFormatDefault = `JSONLines`+export const batchExportsRunTestStepNewCreateBodyDestinationOneConfigOneSixUseVirtualStyleAddressingDefault = falseexport const batchExportsRunTestStepNewCreateBodyOffsetDayMin = 0export const batchExportsRunTestStepNewCreateBodyOffsetDayMax = 6@@ -1683,8 +2302,8 @@ export const BatchExportsRunTestStepNewCreateBody = /* @__PURE__ */ zod'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'),file_format: zod- .enum(['JSONLines', 'Parquet'])- .describe('\* `JSONLines` - JSONLines\n\* `Parquet` - Parquet')+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines').default(batchExportsRunTestStepNewCreateBodyDestinationOneConfigOneTwoFileFormatDefault)@@ -1752,20 +2371,112 @@ export const BatchExportsRunTestStepNewCreateBody = /* @__PURE__ */ zod.describe('Typed configuration for a PostgreSQL batch-export destination.\n\nConnection credentials may live in a linked Integration (when one is provided) or\ninline in this config (legacy). Mirrors the non-credential fields of\n`PostgresBatchExportInputs` in `products\/batch_exports\/backend\/service.py`.'),+ zod+ .object({+ bucket_name: zod.string().describe('Name of the destination bucket.'),+ region: zod.string().describe("Region the bucket is in (e.g. 'us-east-1')."),+ prefix: zod.string().describe('Object key prefix applied to every exported file.'),+ compression: zod+ .union([+ zod+ .enum(['brotli', 'gzip', 'lz4', 'snappy', 'zstd'])+ .describe(+ '\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ file_format: zod+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines')+ .default(+ batchExportsRunTestStepNewCreateBodyDestinationOneConfigOneFiveFileFormatDefault+ )+ .describe(+ 'File format used for exported objects.\n\n\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines'+ ),+ max_file_size_mb: zod+ .number()+ .nullish()+ .describe(+ 'If set, rolls to a new file once the current file exceeds this size in MB.'+ ),+ encryption: zod+ .string()+ .nullish()+ .describe(+ "Optional S3 server-side encryption algorithm (e.g. 'AES256' or 'aws:kms')."+ ),+ kms_key_id: zod+ .string()+ .nullish()+ .describe("KMS key ID to use when encryption is 'aws:kms'."),+ type: zod.enum(['AwsS3']),+ })+ .describe(+ 'Typed configuration for an AWS S3 batch-export destination.\n\nAWS credentials live in the linked aws-s3 Integration. Mirrors the non-credential fields of\n`AwsS3BatchExportInputs` in `products\/batch_exports\/backend\/service.py`.'+ ),+ zod+ .object({+ bucket_name: zod.string().describe('Name of the destination bucket.'),+ region: zod.string().describe("Region the bucket is in (e.g. 'us-east-1')."),+ prefix: zod.string().describe('Object key prefix applied to every exported file.'),+ compression: zod+ .union([+ zod+ .enum(['brotli', 'gzip', 'lz4', 'snappy', 'zstd'])+ .describe(+ '\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n\* `brotli` - brotli\n\* `gzip` - gzip\n\* `lz4` - lz4\n\* `snappy` - snappy\n\* `zstd` - zstd'+ ),+ file_format: zod+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines')+ .default(+ batchExportsRunTestStepNewCreateBodyDestinationOneConfigOneSixFileFormatDefault+ )+ .describe(+ 'File format used for exported objects.\n\n\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines'+ ),+ max_file_size_mb: zod+ .number()+ .nullish()+ .describe(+ 'If set, rolls to a new file once the current file exceeds this size in MB.'+ ),+ use_virtual_style_addressing: zod+ .boolean()+ .default(+ batchExportsRunTestStepNewCreateBodyDestinationOneConfigOneSixUseVirtualStyleAddressingDefault+ )+ .describe('Use virtual-hosted-style addressing rather than path-style.'),+ type: zod.enum(['S3Compatible']),+ })+ .describe(+ 'Typed configuration for an S3-compatible batch-export destination (Cloudflare R2,\nDigitalOcean Spaces, etc.).\n\nCredentials and the provider `endpoint_url` live in the linked s3-compatible Integration.\nMirrors the non-credential fields of `S3CompatibleBatchExportInputs` in\n`products\/batch_exports\/backend\/service.py`.'+ ),]).describe(- 'Destination-specific configuration. Fields depend on `type`. Credentials for integration-backed destinations (Databricks, AzureBlob, BigQuery, Postgres) are NOT stored here — they live in the linked Integration. Secret fields are stripped from responses.'+ 'Destination-specific configuration. Fields depend on `type`. Credentials for integration-backed destinations (Databricks, AzureBlob, BigQuery, Postgres, AwsS3, S3Compatible) are NOT stored here — they live in the linked Integration. Secret fields are stripped from responses.'),integration: zod.number().nullish().describe('The integration for this destination.'),integration_id: zod.number().nullish().describe(- 'ID of a team-scoped Integration providing credentials. Required when creating Databricks, AzureBlob, BigQuery, and Postgres destinations; unused for other types.'+ 'ID of a team-scoped Integration providing credentials. Required when creating Databricks, AzureBlob, and BigQuery destinations; optional for AwsS3 and S3Compatible (inline credentials remain supported); unused for other types.'),}).describe(- 'Serializer for an BatchExportDestination model.\n\nThe `config` field is polymorphic and typed only for destinations that keep\ncredentials in the linked Integration (currently Databricks, AzureBlob, BigQuery, Postgres).\nOther destination types accept the same JSON shape but without a typed\nOpenAPI schema. Secret fields are stripped from `config` on read.'+ 'Serializer for an BatchExportDestination model.\n\nThe `config` field is polymorphic and typed only for destinations that keep\ncredentials in the linked Integration (currently Databricks, AzureBlob, BigQuery, Postgres,\nAwsS3, S3Compatible). Other destination types accept the same JSON shape but without a typed\nOpenAPI schema. Secret fields are stripped from `config` on read.').describe('Destination configuration (type, config, and optional integration).'),interval: zod@@ -1837,8 +2548,8 @@ export const FileDownloadBatchExportsCreateBody = /* @__PURE__ */ zod.union([file: zod.object({format: zod- .enum(['JSONLines', 'Parquet'])- .describe('\* `JSONLines` - JSONLines\n\* `Parquet` - Parquet')+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines').default(fileDownloadBatchExportsCreateBodyOneFileFormatDefault).describe('File format\n\n\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines'),compression: zod@@ -1873,8 +2584,8 @@ export const FileDownloadBatchExportsCreateBody = /* @__PURE__ */ zod.union([file: zod.object({format: zod- .enum(['JSONLines', 'Parquet'])- .describe('\* `JSONLines` - JSONLines\n\* `Parquet` - Parquet')+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines').default(fileDownloadBatchExportsCreateBodyTwoFileFormatDefault).describe('File format\n\n\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines'),compression: zod@@ -1907,8 +2618,8 @@ export const FileDownloadBatchExportsCreateBody = /* @__PURE__ */ zod.union([file: zod.object({format: zod- .enum(['JSONLines', 'Parquet'])- .describe('\* `JSONLines` - JSONLines\n\* `Parquet` - Parquet')+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines').default(fileDownloadBatchExportsCreateBodyThreeFileFormatDefault).describe('File format\n\n\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines'),compression: zod@@ -1949,8 +2660,8 @@ export const FileDownloadBatchExportsCancelCreateBody = /* @__PURE__ */ zodfile: zod.object({format: zod- .enum(['JSONLines', 'Parquet'])- .describe('\* `JSONLines` - JSONLines\n\* `Parquet` - Parquet')+ .enum(['Parquet', 'JSONLines'])+ .describe('\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines').default(fileDownloadBatchExportsCancelCreateBodyFileFormatDefault).describe('File format\n\n\* `Parquet` - Parquet\n\* `JSONLines` - JSONLines'),compression: zoddiff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex c45b0392b500..9914c54dadf0 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -9902,11 +9902,11 @@ export namespace Schemas {UsePosthogInSlack: 'use_posthog_in_slack',} as const;- export type AzureBlobDestinationConfigType = typeof AzureBlobDestinationConfigType[keyof typeof AzureBlobDestinationConfigType];+ export type AwsS3DestinationConfigType = typeof AwsS3DestinationConfigType[keyof typeof AwsS3DestinationConfigType];- export const AzureBlobDestinationConfigType = {- AzureBlob: 'AzureBlob',+ export const AwsS3DestinationConfigType = {+ AwsS3: 'AwsS3',} as const;/**@@ -9928,15 +9928,93 @@ export namespace Schemas {} as const;/**- * * `JSONLines` - JSONLines* * `Parquet` - Parquet+ * * `JSONLines` - JSONLines*/export type FileFormatEnum = typeof FileFormatEnum[keyof typeof FileFormatEnum];export const FileFormatEnum = {- JSONLines: 'JSONLines',Parquet: 'Parquet',+ JSONLines: 'JSONLines',+ } as const;++ /**+ * Typed configuration for an AWS S3 batch-export destination.+ *+ * AWS credentials live in the linked aws-s3 Integration. Mirrors the non-credential fields of+ * `AwsS3BatchExportInputs` in `products/batch_exports/backend/service.py`.+ */+ export interface AwsS3DestinationConfig {+ /** Name of the destination bucket. */+ bucket_name: string;+ /** Region the bucket is in (e.g. 'us-east-1'). */+ region: string;+ /** Object key prefix applied to every exported file. */+ prefix: string;+ /** Optional compression codec applied to exported files. Valid codecs depend on file_format.+ *+ * * `brotli` - brotli+ * * `gzip` - gzip+ * * `lz4` - lz4+ * * `snappy` - snappy+ * * `zstd` - zstd */+ compression?: CompressionEnum | null;+ /** File format used for exported objects.+ *+ * * `Parquet` - Parquet+ * * `JSONLines` - JSONLines */+ file_format?: FileFormatEnum;+ /**+ * If set, rolls to a new file once the current file exceeds this size in MB.+ * @nullable+ */+ max_file_size_mb?: number | null;+ /**+ * Optional S3 server-side encryption algorithm (e.g. 'AES256' or 'aws:kms').+ * @nullable+ */+ encryption?: string | null;+ /**+ * KMS key ID to use when encryption is 'aws:kms'.+ * @nullable+ */+ kms_key_id?: string | null;+ type: AwsS3DestinationConfigType;+ }++ export type AwsS3DestinationRequestType = typeof AwsS3DestinationRequestType[keyof typeof AwsS3DestinationRequestType];+++ export const AwsS3DestinationRequestType = {+ AwsS3: 'AwsS3',+ } as const;++ /**+ * Request shape for creating or updating an AWS S3 batch-export destination.+ */+ export interface AwsS3DestinationRequest {+ type: AwsS3DestinationRequestType;+ /** ID of an aws-s3-kind Integration providing AWS credentials. Preferred over inline credentials. Use the integrations-list MCP tool to find one. */+ integration_id?: number;+ config: AwsS3DestinationConfig;+ }++ /**+ * * `AwsS3` - AwsS3+ */+ export type AwsS3DestinationRequestTypeEnum = typeof AwsS3DestinationRequestTypeEnum[keyof typeof AwsS3DestinationRequestTypeEnum];+++ export const AwsS3DestinationRequestTypeEnum = {+ AwsS3: 'AwsS3',+ } as const;++ export type AzureBlobDestinationConfigType = typeof AzureBlobDestinationConfigType[keyof typeof AzureBlobDestinationConfigType];+++ export const AzureBlobDestinationConfigType = {+ AzureBlob: 'AzureBlob',} as const;/**@@ -10541,14 +10619,59 @@ export namespace Schemas {type: PostgresDestinationConfigType;}- export type BatchExportDestinationConfig = DatabricksDestinationConfig | AzureBlobDestinationConfig | BigQueryDestinationConfig | PostgresDestinationConfig;+ export type S3CompatibleDestinationConfigType = typeof S3CompatibleDestinationConfigType[keyof typeof S3CompatibleDestinationConfigType];+++ export const S3CompatibleDestinationConfigType = {+ S3Compatible: 'S3Compatible',+ } as const;++ /**+ * Typed configuration for an S3-compatible batch-export destination (Cloudflare R2,+ * DigitalOcean Spaces, etc.).+ *+ * Credentials and the provider `endpoint_url` live in the linked s3-compatible Integration.+ * Mirrors the non-credential fields of `S3CompatibleBatchExportInputs` in+ * `products/batch_exports/backend/service.py`.+ */+ export interface S3CompatibleDestinationConfig {+ /** Name of the destination bucket. */+ bucket_name: string;+ /** Region the bucket is in (e.g. 'us-east-1'). */+ region: string;+ /** Object key prefix applied to every exported file. */+ prefix: string;+ /** Optional compression codec applied to exported files. Valid codecs depend on file_format.+ *+ * * `brotli` - brotli+ * * `gzip` - gzip+ * * `lz4` - lz4+ * * `snappy` - snappy+ * * `zstd` - zstd */+ compression?: CompressionEnum | null;+ /** File format used for exported objects.+ *+ * * `Parquet` - Parquet+ * * `JSONLines` - JSONLines */+ file_format?: FileFormatEnum;+ /**+ * If set, rolls to a new file once the current file exceeds this size in MB.+ * @nullable+ */+ max_file_size_mb?: number | null;+ /** Use virtual-hosted-style addressing rather than path-style. */+ use_virtual_style_addressing?: boolean;+ type: S3CompatibleDestinationConfigType;+ }++ export type BatchExportDestinationConfig = DatabricksDestinationConfig | AzureBlobDestinationConfig | BigQueryDestinationConfig | PostgresDestinationConfig | AwsS3DestinationConfig | S3CompatibleDestinationConfig;/*** Serializer for an BatchExportDestination model.** The `config` field is polymorphic and typed only for destinations that keep- * credentials in the linked Integration (currently Databricks, AzureBlob, BigQuery, Postgres).- * Other destination types accept the same JSON shape but without a typed+ * credentials in the linked Integration (currently Databricks, AzureBlob, BigQuery, Postgres,+ * AwsS3, S3Compatible). Other destination types accept the same JSON shape but without a typed* OpenAPI schema. Secret fields are stripped from `config` on read.*/export interface BatchExportDestination {@@ -10568,7 +10691,7 @@ export namespace Schemas {* * `NoOp` - Noop* * `FileDownload` - File Download */type: BatchExportDestinationTypeEnum;- /** Destination-specific configuration. Fields depend on `type`. Credentials for integration-backed destinations (Databricks, AzureBlob, BigQuery, Postgres) are NOT stored here — they live in the linked Integration. Secret fields are stripped from responses. */+ /** Destination-specific configuration. Fields depend on `type`. Credentials for integration-backed destinations (Databricks, AzureBlob, BigQuery, Postgres, AwsS3, S3Compatible) are NOT stored here — they live in the linked Integration. Secret fields are stripped from responses. */config: BatchExportDestinationConfig;/*** The integration for this destination.@@ -10576,7 +10699,7 @@ export namespace Schemas {*/integration?: number | null;/**- * ID of a team-scoped Integration providing credentials. Required when creating Databricks, AzureBlob, BigQuery, and Postgres destinations; unused for other types.+ * ID of a team-scoped Integration providing credentials. Required when creating Databricks, AzureBlob, and BigQuery destinations; optional for AwsS3 and S3Compatible (inline credentials remain supported); unused for other types.* @nullable*/integration_id?: number | null;@@ -11527,7 +11650,24 @@ export namespace Schemas {config: PostgresDestinationConfig;}- export type BatchExportDestinationRequest = DatabricksDestinationRequest | AzureBlobDestinationRequest | BigQueryDestinationRequest | PostgresDestinationRequest;+ export type S3CompatibleDestinationRequestType = typeof S3CompatibleDestinationRequestType[keyof typeof S3CompatibleDestinationRequestType];+++ export const S3CompatibleDestinationRequestType = {+ S3Compatible: 'S3Compatible',+ } as const;++ /**+ * Request shape for creating or updating an S3-compatible batch-export destination.+ */+ export interface S3CompatibleDestinationRequest {+ type: S3CompatibleDestinationRequestType;+ /** ID of an s3-compatible-kind Integration providing credentials and the provider endpoint URL. Preferred over inline credentials. Use the integrations-list MCP tool to find one. */+ integration_id?: number;+ config: S3CompatibleDestinationConfig;+ }++ export type BatchExportDestinationRequest = DatabricksDestinationRequest | AzureBlobDestinationRequest | BigQueryDestinationRequest | PostgresDestinationRequest | AwsS3DestinationRequest | S3CompatibleDestinationRequest;/*** Request body for create/partial_update on BatchExportViewSet.@@ -47014,6 +47154,16 @@ export namespace Schemas {recommended_running_time_days: number | null;}+ /**+ * * `S3Compatible` - S3Compatible+ */+ export type S3CompatibleDestinationRequestTypeEnum = typeof S3CompatibleDestinationRequestTypeEnum[keyof typeof S3CompatibleDestinationRequestTypeEnum];+++ export const S3CompatibleDestinationRequestTypeEnum = {+ S3Compatible: 'S3Compatible',+ } as const;+/*** Form fields that must be submitted verbatim with the file upload*/diff --git a/services/mcp/src/generated/batch_exports/api.ts b/services/mcp/src/generated/batch_exports/api.tsindex bb60e715c42c..4bf35002c6f5 100644--- a/services/mcp/src/generated/batch_exports/api.ts+++ b/services/mcp/src/generated/batch_exports/api.ts@@ -38,6 +38,9 @@ export const batchExportsCreateBodyDestinationOneThreeConfigUseJsonTypeDefault =export const batchExportsCreateBodyDestinationOneFourConfigSchemaDefault = `public`export const batchExportsCreateBodyDestinationOneFourConfigTableNameDefault = `events`export const batchExportsCreateBodyDestinationOneFourConfigHasSelfSignedCertDefault = false+export const batchExportsCreateBodyDestinationOneFiveConfigFileFormatDefault = `JSONLines`+export const batchExportsCreateBodyDestinationOneSixConfigFileFormatDefault = `JSONLines`+export const batchExportsCreateBodyDestinationOneSixConfigUseVirtualStyleAddressingDefault = falseexport const batchExportsCreateBodyOffsetDayMin = 0export const batchExportsCreateBodyOffsetDayMax = 6@@ -117,8 +120,8 @@ export const BatchExportsCreateBody = /* @__PURE__ */ zod'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd'),file_format: zod- .enum(['JSONLines', 'Parquet'])- .describe('* `JSONLines` - JSONLines\n* `Parquet` - Parquet')+ .enum(['Parquet', 'JSONLines'])+ .describe('* `Parquet` - Parquet\n* `JSONLines` - JSONLines').default(batchExportsCreateBodyDestinationOneTwoConfigFileFormatDefault).describe('File format used for exported objects.\n\n* `JSONLines` - JSONLines\n* `Parquet` - Parquet'@@ -193,6 +196,114 @@ export const BatchExportsCreateBody = /* @__PURE__ */ zod),}).describe('Request shape for creating or updating a PostgreSQL batch-export destination.'),+ zod+ .object({+ type: zod.enum(['AwsS3']),+ integration_id: zod+ .number()+ .optional()+ .describe(+ 'ID of an aws-s3-kind Integration providing AWS credentials. Preferred over inline credentials. Use the integrations-list MCP tool to find one.'+ ),+ config: zod+ .object({+ bucket_name: zod.string().describe('Name of the destination bucket.'),+ region: zod.string().describe("Region the bucket is in (e.g. 'us-east-1')."),+ prefix: zod.string().describe('Object key prefix applied to every exported file.'),+ compression: zod+ .union([+ zod+ .enum(['brotli', 'gzip', 'lz4', 'snappy', 'zstd'])+ .describe(+ '* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd'+ ),+ file_format: zod+ .enum(['Parquet', 'JSONLines'])+ .describe('* `Parquet` - Parquet\n* `JSONLines` - JSONLines')+ .default(batchExportsCreateBodyDestinationOneFiveConfigFileFormatDefault)+ .describe(+ 'File format used for exported objects.\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines'+ ),+ max_file_size_mb: zod+ .number()+ .nullish()+ .describe(+ 'If set, rolls to a new file once the current file exceeds this size in MB.'+ ),+ encryption: zod+ .string()+ .nullish()+ .describe(+ "Optional S3 server-side encryption algorithm (e.g. 'AES256' or 'aws:kms')."+ ),+ kms_key_id: zod+ .string()+ .nullish()+ .describe("KMS key ID to use when encryption is 'aws:kms'."),+ })+ .describe(+ 'Typed configuration for an AWS S3 batch-export destination.\n\nAWS credentials live in the linked aws-s3 Integration. Mirrors the non-credential fields of\n`AwsS3BatchExportInputs` in `products/batch_exports/backend/service.py`.'+ ),+ })+ .describe('Request shape for creating or updating an AWS S3 batch-export destination.'),+ zod+ .object({+ type: zod.enum(['S3Compatible']),+ integration_id: zod+ .number()+ .optional()+ .describe(+ 'ID of an s3-compatible-kind Integration providing credentials and the provider endpoint URL. Preferred over inline credentials. Use the integrations-list MCP tool to find one.'+ ),+ config: zod+ .object({+ bucket_name: zod.string().describe('Name of the destination bucket.'),+ region: zod.string().describe("Region the bucket is in (e.g. 'us-east-1')."),+ prefix: zod.string().describe('Object key prefix applied to every exported file.'),+ compression: zod+ .union([+ zod+ .enum(['brotli', 'gzip', 'lz4', 'snappy', 'zstd'])+ .describe(+ '* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd'+ ),+ file_format: zod+ .enum(['Parquet', 'JSONLines'])+ .describe('* `Parquet` - Parquet\n* `JSONLines` - JSONLines')+ .default(batchExportsCreateBodyDestinationOneSixConfigFileFormatDefault)+ .describe(+ 'File format used for exported objects.\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines'+ ),+ max_file_size_mb: zod+ .number()+ .nullish()+ .describe(+ 'If set, rolls to a new file once the current file exceeds this size in MB.'+ ),+ use_virtual_style_addressing: zod+ .boolean()+ .default(+ batchExportsCreateBodyDestinationOneSixConfigUseVirtualStyleAddressingDefault+ )+ .describe('Use virtual-hosted-style addressing rather than path-style.'),+ })+ .describe(+ 'Typed configuration for an S3-compatible batch-export destination (Cloudflare R2,\nDigitalOcean Spaces, etc.).\n\nCredentials and the provider `endpoint_url` live in the linked s3-compatible Integration.\nMirrors the non-credential fields of `S3CompatibleBatchExportInputs` in\n`products/batch_exports/backend/service.py`.'+ ),+ })+ .describe('Request shape for creating or updating an S3-compatible batch-export destination.'),]).describe('Destination configuration. Required integration_id is enforced per destination type.'),interval: zod@@ -254,6 +365,9 @@ export const batchExportsPartialUpdateBodyDestinationOneThreeConfigUseJsonTypeDeexport const batchExportsPartialUpdateBodyDestinationOneFourConfigSchemaDefault = `public`export const batchExportsPartialUpdateBodyDestinationOneFourConfigTableNameDefault = `events`export const batchExportsPartialUpdateBodyDestinationOneFourConfigHasSelfSignedCertDefault = false+export const batchExportsPartialUpdateBodyDestinationOneFiveConfigFileFormatDefault = `JSONLines`+export const batchExportsPartialUpdateBodyDestinationOneSixConfigFileFormatDefault = `JSONLines`+export const batchExportsPartialUpdateBodyDestinationOneSixConfigUseVirtualStyleAddressingDefault = falseexport const batchExportsPartialUpdateBodyOffsetDayMin = 0export const batchExportsPartialUpdateBodyOffsetDayMax = 6@@ -333,8 +447,8 @@ export const BatchExportsPartialUpdateBody = /* @__PURE__ */ zod'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd'),file_format: zod- .enum(['JSONLines', 'Parquet'])- .describe('* `JSONLines` - JSONLines\n* `Parquet` - Parquet')+ .enum(['Parquet', 'JSONLines'])+ .describe('* `Parquet` - Parquet\n* `JSONLines` - JSONLines').default(batchExportsPartialUpdateBodyDestinationOneTwoConfigFileFormatDefault).describe('File format used for exported objects.\n\n* `JSONLines` - JSONLines\n* `Parquet` - Parquet'@@ -411,6 +525,114 @@ export const BatchExportsPartialUpdateBody = /* @__PURE__ */ zod),}).describe('Request shape for creating or updating a PostgreSQL batch-export destination.'),+ zod+ .object({+ type: zod.enum(['AwsS3']),+ integration_id: zod+ .number()+ .optional()+ .describe(+ 'ID of an aws-s3-kind Integration providing AWS credentials. Preferred over inline credentials. Use the integrations-list MCP tool to find one.'+ ),+ config: zod+ .object({+ bucket_name: zod.string().describe('Name of the destination bucket.'),+ region: zod.string().describe("Region the bucket is in (e.g. 'us-east-1')."),+ prefix: zod.string().describe('Object key prefix applied to every exported file.'),+ compression: zod+ .union([+ zod+ .enum(['brotli', 'gzip', 'lz4', 'snappy', 'zstd'])+ .describe(+ '* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd'+ ),+ file_format: zod+ .enum(['Parquet', 'JSONLines'])+ .describe('* `Parquet` - Parquet\n* `JSONLines` - JSONLines')+ .default(batchExportsPartialUpdateBodyDestinationOneFiveConfigFileFormatDefault)+ .describe(+ 'File format used for exported objects.\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines'+ ),+ max_file_size_mb: zod+ .number()+ .nullish()+ .describe(+ 'If set, rolls to a new file once the current file exceeds this size in MB.'+ ),+ encryption: zod+ .string()+ .nullish()+ .describe(+ "Optional S3 server-side encryption algorithm (e.g. 'AES256' or 'aws:kms')."+ ),+ kms_key_id: zod+ .string()+ .nullish()+ .describe("KMS key ID to use when encryption is 'aws:kms'."),+ })+ .describe(+ 'Typed configuration for an AWS S3 batch-export destination.\n\nAWS credentials live in the linked aws-s3 Integration. Mirrors the non-credential fields of\n`AwsS3BatchExportInputs` in `products/batch_exports/backend/service.py`.'+ ),+ })+ .describe('Request shape for creating or updating an AWS S3 batch-export destination.'),+ zod+ .object({+ type: zod.enum(['S3Compatible']),+ integration_id: zod+ .number()+ .optional()+ .describe(+ 'ID of an s3-compatible-kind Integration providing credentials and the provider endpoint URL. Preferred over inline credentials. Use the integrations-list MCP tool to find one.'+ ),+ config: zod+ .object({+ bucket_name: zod.string().describe('Name of the destination bucket.'),+ region: zod.string().describe("Region the bucket is in (e.g. 'us-east-1')."),+ prefix: zod.string().describe('Object key prefix applied to every exported file.'),+ compression: zod+ .union([+ zod+ .enum(['brotli', 'gzip', 'lz4', 'snappy', 'zstd'])+ .describe(+ '* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd'+ ),+ file_format: zod+ .enum(['Parquet', 'JSONLines'])+ .describe('* `Parquet` - Parquet\n* `JSONLines` - JSONLines')+ .default(batchExportsPartialUpdateBodyDestinationOneSixConfigFileFormatDefault)+ .describe(+ 'File format used for exported objects.\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines'+ ),+ max_file_size_mb: zod+ .number()+ .nullish()+ .describe(+ 'If set, rolls to a new file once the current file exceeds this size in MB.'+ ),+ use_virtual_style_addressing: zod+ .boolean()+ .default(+ batchExportsPartialUpdateBodyDestinationOneSixConfigUseVirtualStyleAddressingDefault+ )+ .describe('Use virtual-hosted-style addressing rather than path-style.'),+ })+ .describe(+ 'Typed configuration for an S3-compatible batch-export destination (Cloudflare R2,\nDigitalOcean Spaces, etc.).\n\nCredentials and the provider `endpoint_url` live in the linked s3-compatible Integration.\nMirrors the non-credential fields of `S3CompatibleBatchExportInputs` in\n`products/batch_exports/backend/service.py`.'+ ),+ })+ .describe('Request shape for creating or updating an S3-compatible batch-export destination.'),]).optional().describe('Destination configuration. Required integration_id is enforced per destination type.'),@@ -482,8 +704,8 @@ export const FileDownloadBatchExportsCreateBody = /* @__PURE__ */ zod.union([file: zod.object({format: zod- .enum(['JSONLines', 'Parquet'])- .describe('* `JSONLines` - JSONLines\n* `Parquet` - Parquet')+ .enum(['Parquet', 'JSONLines'])+ .describe('* `Parquet` - Parquet\n* `JSONLines` - JSONLines').default(fileDownloadBatchExportsCreateBodyOneFileFormatDefault).describe('File format\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines'),compression: zod@@ -518,8 +740,8 @@ export const FileDownloadBatchExportsCreateBody = /* @__PURE__ */ zod.union([file: zod.object({format: zod- .enum(['JSONLines', 'Parquet'])- .describe('* `JSONLines` - JSONLines\n* `Parquet` - Parquet')+ .enum(['Parquet', 'JSONLines'])+ .describe('* `Parquet` - Parquet\n* `JSONLines` - JSONLines').default(fileDownloadBatchExportsCreateBodyTwoFileFormatDefault).describe('File format\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines'),compression: zod@@ -552,8 +774,8 @@ export const FileDownloadBatchExportsCreateBody = /* @__PURE__ */ zod.union([file: zod.object({format: zod- .enum(['JSONLines', 'Parquet'])- .describe('* `JSONLines` - JSONLines\n* `Parquet` - Parquet')+ .enum(['Parquet', 'JSONLines'])+ .describe('* `Parquet` - Parquet\n* `JSONLines` - JSONLines').default(fileDownloadBatchExportsCreateBodyThreeFileFormatDefault).describe('File format\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines'),compression: zod@@ -619,8 +841,8 @@ export const FileDownloadBatchExportsCancelCreateBody = /* @__PURE__ */ zodfile: zod.object({format: zod- .enum(['JSONLines', 'Parquet'])- .describe('* `JSONLines` - JSONLines\n* `Parquet` - Parquet')+ .enum(['Parquet', 'JSONLines'])+ .describe('* `Parquet` - Parquet\n* `JSONLines` - JSONLines').default(fileDownloadBatchExportsCancelCreateBodyFileFormatDefault).describe('File format\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines'),compression: zoddiff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/batch-export-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/batch-export-create.jsonindex 030052b82848..44a4f56976e5 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/batch-export-create.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/batch-export-create.json@@ -78,7 +78,7 @@"file_format": {"default": "JSONLines","description": "File format used for exported objects.\n\n* `JSONLines` - JSONLines\n* `Parquet` - Parquet",- "enum": ["JSONLines", "Parquet"],+ "enum": ["Parquet", "JSONLines"],"type": "string"},"max_file_size_mb": {@@ -189,6 +189,161 @@},"required": ["type", "integration_id", "config"],"type": "object"+ },+ {+ "description": "Request shape for creating or updating an AWS S3 batch-export destination.",+ "properties": {+ "config": {+ "description": "Typed configuration for an AWS S3 batch-export destination.\n\nAWS credentials live in the linked aws-s3 Integration. Mirrors the non-credential fields of\n`AwsS3BatchExportInputs` in `products/batch_exports/backend/service.py`.",+ "properties": {+ "bucket_name": {+ "description": "Name of the destination bucket.",+ "type": "string"+ },+ "compression": {+ "anyOf": [+ {+ "description": "* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd",+ "enum": ["brotli", "gzip", "lz4", "snappy", "zstd"],+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd"+ },+ "encryption": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "Optional S3 server-side encryption algorithm (e.g. 'AES256' or 'aws:kms')."+ },+ "file_format": {+ "default": "JSONLines",+ "description": "File format used for exported objects.\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines",+ "enum": ["Parquet", "JSONLines"],+ "type": "string"+ },+ "kms_key_id": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "KMS key ID to use when encryption is 'aws:kms'."+ },+ "max_file_size_mb": {+ "anyOf": [+ {+ "type": "number"+ },+ {+ "type": "null"+ }+ ],+ "description": "If set, rolls to a new file once the current file exceeds this size in MB."+ },+ "prefix": {+ "description": "Object key prefix applied to every exported file.",+ "type": "string"+ },+ "region": {+ "description": "Region the bucket is in (e.g. 'us-east-1').",+ "type": "string"+ }+ },+ "required": ["bucket_name", "region", "prefix"],+ "type": "object"+ },+ "integration_id": {+ "description": "ID of an aws-s3-kind Integration providing AWS credentials. Preferred over inline credentials. Use the integrations-list MCP tool to find one.",+ "type": "number"+ },+ "type": {+ "enum": ["AwsS3"],+ "type": "string"+ }+ },+ "required": ["type", "config"],+ "type": "object"+ },+ {+ "description": "Request shape for creating or updating an S3-compatible batch-export destination.",+ "properties": {+ "config": {+ "description": "Typed configuration for an S3-compatible batch-export destination (Cloudflare R2,\nDigitalOcean Spaces, etc.).\n\nCredentials and the provider `endpoint_url` live in the linked s3-compatible Integration.\nMirrors the non-credential fields of `S3CompatibleBatchExportInputs` in\n`products/batch_exports/backend/service.py`.",+ "properties": {+ "bucket_name": {+ "description": "Name of the destination bucket.",+ "type": "string"+ },+ "compression": {+ "anyOf": [+ {+ "description": "* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd",+ "enum": ["brotli", "gzip", "lz4", "snappy", "zstd"],+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd"+ },+ "file_format": {+ "default": "JSONLines",+ "description": "File format used for exported objects.\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines",+ "enum": ["Parquet", "JSONLines"],+ "type": "string"+ },+ "max_file_size_mb": {+ "anyOf": [+ {+ "type": "number"+ },+ {+ "type": "null"+ }+ ],+ "description": "If set, rolls to a new file once the current file exceeds this size in MB."+ },+ "prefix": {+ "description": "Object key prefix applied to every exported file.",+ "type": "string"+ },+ "region": {+ "description": "Region the bucket is in (e.g. 'us-east-1').",+ "type": "string"+ },+ "use_virtual_style_addressing": {+ "default": false,+ "description": "Use virtual-hosted-style addressing rather than path-style.",+ "type": "boolean"+ }+ },+ "required": ["bucket_name", "region", "prefix"],+ "type": "object"+ },+ "integration_id": {+ "description": "ID of an s3-compatible-kind Integration providing credentials and the provider endpoint URL. Preferred over inline credentials. Use the integrations-list MCP tool to find one.",+ "type": "number"+ },+ "type": {+ "enum": ["S3Compatible"],+ "type": "string"+ }+ },+ "required": ["type", "config"],+ "type": "object"}],"description": "Destination configuration. Required integration_id is enforced per destination type."diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/batch-export-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/batch-export-update.jsonindex 341e393f8718..080cbab78779 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/batch-export-update.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/batch-export-update.json@@ -77,7 +77,7 @@"file_format": {"default": "JSONLines","description": "File format used for exported objects.\n\n* `JSONLines` - JSONLines\n* `Parquet` - Parquet",- "enum": ["JSONLines", "Parquet"],+ "enum": ["Parquet", "JSONLines"],"type": "string"},"max_file_size_mb": {@@ -188,6 +188,161 @@},"required": ["type", "integration_id", "config"],"type": "object"+ },+ {+ "description": "Request shape for creating or updating an AWS S3 batch-export destination.",+ "properties": {+ "config": {+ "description": "Typed configuration for an AWS S3 batch-export destination.\n\nAWS credentials live in the linked aws-s3 Integration. Mirrors the non-credential fields of\n`AwsS3BatchExportInputs` in `products/batch_exports/backend/service.py`.",+ "properties": {+ "bucket_name": {+ "description": "Name of the destination bucket.",+ "type": "string"+ },+ "compression": {+ "anyOf": [+ {+ "description": "* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd",+ "enum": ["brotli", "gzip", "lz4", "snappy", "zstd"],+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd"+ },+ "encryption": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "Optional S3 server-side encryption algorithm (e.g. 'AES256' or 'aws:kms')."+ },+ "file_format": {+ "default": "JSONLines",+ "description": "File format used for exported objects.\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines",+ "enum": ["Parquet", "JSONLines"],+ "type": "string"+ },+ "kms_key_id": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "KMS key ID to use when encryption is 'aws:kms'."+ },+ "max_file_size_mb": {+ "anyOf": [+ {+ "type": "number"+ },+ {+ "type": "null"+ }+ ],+ "description": "If set, rolls to a new file once the current file exceeds this size in MB."+ },+ "prefix": {+ "description": "Object key prefix applied to every exported file.",+ "type": "string"+ },+ "region": {+ "description": "Region the bucket is in (e.g. 'us-east-1').",+ "type": "string"+ }+ },+ "required": ["bucket_name", "region", "prefix"],+ "type": "object"+ },+ "integration_id": {+ "description": "ID of an aws-s3-kind Integration providing AWS credentials. Preferred over inline credentials. Use the integrations-list MCP tool to find one.",+ "type": "number"+ },+ "type": {+ "enum": ["AwsS3"],+ "type": "string"+ }+ },+ "required": ["type", "config"],+ "type": "object"+ },+ {+ "description": "Request shape for creating or updating an S3-compatible batch-export destination.",+ "properties": {+ "config": {+ "description": "Typed configuration for an S3-compatible batch-export destination (Cloudflare R2,\nDigitalOcean Spaces, etc.).\n\nCredentials and the provider `endpoint_url` live in the linked s3-compatible Integration.\nMirrors the non-credential fields of `S3CompatibleBatchExportInputs` in\n`products/batch_exports/backend/service.py`.",+ "properties": {+ "bucket_name": {+ "description": "Name of the destination bucket.",+ "type": "string"+ },+ "compression": {+ "anyOf": [+ {+ "description": "* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd",+ "enum": ["brotli", "gzip", "lz4", "snappy", "zstd"],+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "description": "Optional compression codec applied to exported files. Valid codecs depend on file_format.\n\n* `brotli` - brotli\n* `gzip` - gzip\n* `lz4` - lz4\n* `snappy` - snappy\n* `zstd` - zstd"+ },+ "file_format": {+ "default": "JSONLines",+ "description": "File format used for exported objects.\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines",+ "enum": ["Parquet", "JSONLines"],+ "type": "string"+ },+ "max_file_size_mb": {+ "anyOf": [+ {+ "type": "number"+ },+ {+ "type": "null"+ }+ ],+ "description": "If set, rolls to a new file once the current file exceeds this size in MB."+ },+ "prefix": {+ "description": "Object key prefix applied to every exported file.",+ "type": "string"+ },+ "region": {+ "description": "Region the bucket is in (e.g. 'us-east-1').",+ "type": "string"+ },+ "use_virtual_style_addressing": {+ "default": false,+ "description": "Use virtual-hosted-style addressing rather than path-style.",+ "type": "boolean"+ }+ },+ "required": ["bucket_name", "region", "prefix"],+ "type": "object"+ },+ "integration_id": {+ "description": "ID of an s3-compatible-kind Integration providing credentials and the provider endpoint URL. Preferred over inline credentials. Use the integrations-list MCP tool to find one.",+ "type": "number"+ },+ "type": {+ "enum": ["S3Compatible"],+ "type": "string"+ }+ },+ "required": ["type", "config"],+ "type": "object"}],"description": "Destination configuration. Required integration_id is enforced per destination type."diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/file-download-batch-exports-cancel-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/file-download-batch-exports-cancel-create.jsonindex 75bce140fa78..6e21d761a6cf 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/file-download-batch-exports-cancel-create.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/file-download-batch-exports-cancel-create.json@@ -36,7 +36,7 @@"format": {"default": "Parquet","description": "File format\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines",- "enum": ["JSONLines", "Parquet"],+ "enum": ["Parquet", "JSONLines"],"type": "string"},"max_size_mb": {diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/file-download-batch-exports-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/file-download-batch-exports-create.jsonindex 02ca4b6588fb..668e5d0603fb 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/file-download-batch-exports-create.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/file-download-batch-exports-create.json@@ -39,7 +39,7 @@"format": {"default": "Parquet","description": "File format\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines",- "enum": ["JSONLines", "Parquet"],+ "enum": ["Parquet", "JSONLines"],"type": "string"},"max_size_mb": {@@ -103,7 +103,7 @@"format": {"default": "Parquet","description": "File format\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines",- "enum": ["JSONLines", "Parquet"],+ "enum": ["Parquet", "JSONLines"],"type": "string"},"max_size_mb": {@@ -161,7 +161,7 @@"format": {"default": "Parquet","description": "File format\n\n* `Parquet` - Parquet\n* `JSONLines` - JSONLines",- "enum": ["JSONLines", "Parquet"],+ "enum": ["Parquet", "JSONLines"],"type": "string"},"max_size_mb": {