: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(warehouse): add per-table access control for schemas (#72440)
Alex Lider2e0131ae618b
diff --git a/frontend/src/types.ts b/frontend/src/types.tsindex b3a35637dbff..d2230f2c7a8f 100644--- a/frontend/src/types.ts+++ b/frontend/src/types.ts@@ -6456,6 +6456,8 @@ export interface ExternalDataSourceSchema extends SimpleExternalDataSourceSchemaapi_version?: string | null/** Set when this schema's version override is deprecated by the vendor */api_version_deprecation?: ExternalDataSourceApiVersionDeprecation | null+ /** The requesting user's effective access level for this table (inherits the source). */+ user_access_level?: AccessControlLevel}/** Lightweight parent-source summary embedded in the single-schema retrieve endpoint. */diff --git a/posthog/rbac/user_access_control.py b/posthog/rbac/user_access_control.pyindex 5dc46a788885..e81a4a3a1483 100644--- a/posthog/rbac/user_access_control.py+++ b/posthog/rbac/user_access_control.py@@ -97,7 +97,6 @@ ACCESS_CONTROL_RESOURCES: tuple[APIScopeObject, ...] = (# Resource inheritance mapping - child resources inherit access from parent resourcesRESOURCE_INHERITANCE_MAP: dict[APIScopeObject, APIScopeObject] = {"session_recording_playlist": "session_recording",- "external_data_schema": "external_data_source","warehouse_table": "warehouse_objects","warehouse_view": "warehouse_objects","evaluation": "llm_analytics",@@ -456,8 +455,6 @@ def model_to_resource(model: Model) -> Optional[APIScopeObject]:return "hog_flow"if name == "externaldatasource":return "external_data_source"- if name == "externaldataschema":- return "external_data_schema"if name == "datawarehousesavedquery":return "warehouse_view"if name == "datawarehousesavedqueryfolder":diff --git a/products/data_warehouse/frontend/scenes/SchemaScene/ConfigurationTab.tsx b/products/data_warehouse/frontend/scenes/SchemaScene/ConfigurationTab.tsxindex e0d9dba2f7d6..86d9e1afb9e3 100644--- a/products/data_warehouse/frontend/scenes/SchemaScene/ConfigurationTab.tsx+++ b/products/data_warehouse/frontend/scenes/SchemaScene/ConfigurationTab.tsx@@ -38,8 +38,8 @@ import {SyncMethodFormHandle,} from 'products/data_warehouse/frontend/shared/components/forms/SyncMethodForm'import {- SourceEditorAction,- useSourceEditorAccess,+ SchemaEditorAction,+ useSchemaEditorAccess,} from 'products/data_warehouse/frontend/shared/components/SourceEditorAction'import {StatusTagSetting,@@ -105,7 +105,6 @@ export function ConfigurationTab({case 'details':return (<DetailsSection- source={source}schema={schema}reloadSchema={reloadSchema}cancelSchema={cancelSchema}@@ -117,7 +116,7 @@ export function ConfigurationTab({case 'sync-method':return (<div className="flex flex-col gap-6">- <SyncMethodSection sourceId={sourceId} source={source} schema={schema} />+ <SyncMethodSection sourceId={sourceId} schema={schema} /><ApiVersionSection sourceId={sourceId} source={source} schema={schema} /></div>)@@ -137,7 +136,6 @@ export function ConfigurationTab({return (<ScheduleSectionsourceId={sourceId}- source={source}schema={schema}isProjectTime={isProjectTime}setIsProjectTime={setIsProjectTime}@@ -146,7 +144,7 @@ export function ConfigurationTab({case 'descriptions':// Deep-link guard: the section nav already hides this when the flag is off.return featureFlags[FEATURE_FLAGS.DATA_WAREHOUSE_SEMANTIC_ENRICHMENT] ? (- <DescriptionsSection schema={schema} source={source} />+ <DescriptionsSection schema={schema} />) : (<></>)@@ -173,7 +171,6 @@ function SectionHeader({ title, description }: { title: string; description?: st}function DetailsSection({- source,schema,reloadSchema,cancelSchema,@@ -181,7 +178,6 @@ function DetailsSection({onConfigureSyncMethod,syncHistoryUrl,}: {- source: ExternalDataSource | nullschema: ExternalDataSourceSchemareloadSchema: (schema: ExternalDataSourceSchema) => voidcancelSchema: (schema: ExternalDataSourceSchema) => void@@ -207,7 +203,7 @@ function DetailsSection({re-enable.</span></div>- <SourceEditorAction source={source}>+ <SchemaEditorAction schema={schema}><LemonSwitchchecked={schema.should_sync}label={schema.should_sync ? 'Syncing' : 'Disabled'}@@ -257,7 +253,7 @@ function DetailsSection({}}}/>- </SourceEditorAction>+ </SchemaEditorAction></div><div className="flex items-center justify-between"><span className="text-muted">Current status</span>@@ -305,7 +301,7 @@ function DetailsSection({</div></div><div className="mt-4 flex gap-2 flex-wrap">- <SourceEditorAction source={source}>+ <SchemaEditorAction schema={schema}>{({ disabledReason }) => (<Tooltiptitle={@@ -332,9 +328,9 @@ function DetailsSection({</LemonButton></Tooltip>)}- </SourceEditorAction>+ </SchemaEditorAction>{schema.status === 'Running' && (- <SourceEditorAction source={source}>+ <SchemaEditorAction schema={schema}>{({ disabledReason }) => (<LemonButtontype="secondary"@@ -345,7 +341,7 @@ function DetailsSection({Cancel current sync</LemonButton>)}- </SourceEditorAction>+ </SchemaEditorAction>)}{syncHistoryUrl && (<LemonButton type="secondary" to={syncHistoryUrl}>@@ -357,15 +353,7 @@ function DetailsSection({)}-function SyncMethodSection({- sourceId,- source,- schema,-}: {- sourceId: string- source: ExternalDataSource | null- schema: ExternalDataSourceSchema-}): JSX.Element {+function SyncMethodSection({ sourceId, schema }: { sourceId: string; schema: ExternalDataSourceSchema }): JSX.Element {// Incremental fields + saving both go through schemaSceneLogic — deliberately NOT// syncMethodModalLogic, which connects sourceManagementLogic and would mount + poll the full// sources list (the heavy `external_data_sources` fetch this page is meant to avoid).@@ -377,7 +365,7 @@ function SyncMethodSection({const [saveDisabledReason, setSaveDisabledReason] = useState<string | undefined>()const [saving, setSaving] = useState(false)- const { disabledReason: accessDisabledReason } = useSourceEditorAccess(source)+ const { disabledReason: accessDisabledReason } = useSchemaEditorAccess(schema)// Load incremental fields only when the schema id changes. We intentionally exclude the kea// action refs from the deps — if they aren't stable, the effect would re-fire on every parent@@ -524,7 +512,7 @@ function ApiVersionSection({schema: ExternalDataSourceSchema}): JSX.Element | null {const { loadSchema, resyncSchema } = useActions(schemaSceneLogic({ sourceId, schemaId: schema.id }))- const { disabledReason: accessDisabledReason } = useSourceEditorAccess(source)+ const { disabledReason: accessDisabledReason } = useSchemaEditorAccess(schema)const supportedVersions = source?.supported_api_versions ?? []const sourceVersion = source?.api_version@@ -681,9 +669,9 @@ function ColumnsAndRowFiltersSection({const available = schema.available_columns ?? []const hasAvailableColumns = available.length > 0- // Plain value, not the render-prop form of SourceEditorAction: a fresh inline render-prop on- // every edit would remount the editors and wipe their drafts. See useSourceEditorAccess's docstring.- const { disabledReason: editorDisabledReason } = useSourceEditorAccess(source)+ // Plain value, not the render-prop form of SchemaEditorAction: a fresh inline render-prop on+ // every edit would remount the editors and wipe their drafts. See useSchemaEditorAccess's docstring.+ const { disabledReason: editorDisabledReason } = useSchemaEditorAccess(schema)// Both editors run in `hideActions` mode and report edits up here, so one Save commits both.const [draftColumns, setDraftColumns] = useState<string[] | null>(schema.enabled_columns ?? null)@@ -785,7 +773,7 @@ function ColumnsAndRowFiltersSection({? 'No columns discovered yet for this schema — they will appear after the first successful sync.': 'No columns discovered yet for this schema.'}</span>- <SourceEditorAction source={source}>+ <SchemaEditorAction schema={schema}><LemonButtontype="secondary"size="small"@@ -794,7 +782,7 @@ function ColumnsAndRowFiltersSection({>Pull new schemas</LemonButton>- </SourceEditorAction>+ </SchemaEditorAction></div>) : (<>@@ -855,13 +843,11 @@ function ColumnsAndRowFiltersSection({function ScheduleSection({sourceId,- source,schema,isProjectTime,setIsProjectTime,}: {sourceId: string- source: ExternalDataSource | nullschema: ExternalDataSourceSchemaisProjectTime: booleansetIsProjectTime: (v: boolean) => void@@ -878,7 +864,7 @@ function ScheduleSection({)const [draftSyncTimeOfDay, setDraftSyncTimeOfDay] = useState<string | null>(schema.sync_time_of_day ?? null)const [saving, setSaving] = useState(false)- const { disabledReason: accessDisabledReason } = useSourceEditorAccess(source)+ const { disabledReason: accessDisabledReason } = useSchemaEditorAccess(schema)const serverFrequency = schema.sync_frequency || (isCdc ? '5min' : '6hour')const serverSyncTimeOfDay = schema.sync_time_of_day ?? null@@ -940,7 +926,6 @@ function ScheduleSection({/></div><AnchorTimeField- source={source}schema={schema}draftFrequency={draftFrequency}draftSyncTimeOfDay={draftSyncTimeOfDay}@@ -964,7 +949,6 @@ function ScheduleSection({}function AnchorTimeField({- source,schema,draftFrequency,draftSyncTimeOfDay,@@ -972,7 +956,6 @@ function AnchorTimeField({isProjectTime,setIsProjectTime,}: {- source: ExternalDataSource | nullschema: ExternalDataSourceSchemadraftFrequency: DataWarehouseSyncIntervaldraftSyncTimeOfDay: string | null@@ -981,7 +964,7 @@ function AnchorTimeField({setIsProjectTime: (v: boolean) => void}): JSX.Element {const { currentTeam } = useValues(teamLogic)- const { disabledReason: accessDisabledReason } = useSourceEditorAccess(source)+ const { disabledReason: accessDisabledReason } = useSchemaEditorAccess(schema)const isSyncTimeSet = draftSyncTimeOfDay !== nullconst utcTime = draftSyncTimeOfDay || '00:00:00'@@ -1108,7 +1091,7 @@ function DangerZoneSection({description="Destructive actions that rebuild or remove data. Use only if you understand the impact."/><div className="border border-danger/40 rounded p-4 bg-surface-primary flex flex-col gap-2">- <SourceEditorAction source={source}>+ <SchemaEditorAction schema={schema}>{({ disabledReason }) => (<>{hasFullCdcResync && (@@ -1203,7 +1186,7 @@ function DangerZoneSection({)}</>)}- </SourceEditorAction>+ </SchemaEditorAction></div></div>)@@ -1279,15 +1262,9 @@ function DescriptionRow({)}-function DescriptionsSection({- schema,- source,-}: {- schema: ExternalDataSourceSchema- source: SchemaSceneSource | null-}): JSX.Element {+function DescriptionsSection({ schema }: { schema: ExternalDataSourceSchema }): JSX.Element {const tableId = schema.table?.id- const { disabledReason: accessDisabledReason } = useSourceEditorAccess(source)+ const { disabledReason: accessDisabledReason } = useSchemaEditorAccess(schema)if (!tableId) {return (diff --git a/products/data_warehouse/frontend/scenes/SourceScene/tabs/DirectQuerySchemasTab.tsx b/products/data_warehouse/frontend/scenes/SourceScene/tabs/DirectQuerySchemasTab.tsxindex 6e0054f91397..f4b6288d4332 100644--- a/products/data_warehouse/frontend/scenes/SourceScene/tabs/DirectQuerySchemasTab.tsx+++ b/products/data_warehouse/frontend/scenes/SourceScene/tabs/DirectQuerySchemasTab.tsx@@ -19,7 +19,10 @@ import { pluralize } from 'lib/utils/strings'import { ExternalDataSource, ExternalDataSourceSchema } from '~/types'-import { SourceEditorAction } from 'products/data_warehouse/frontend/shared/components/SourceEditorAction'+import {+ SchemaEditorAction,+ SourceEditorAction,+} from 'products/data_warehouse/frontend/shared/components/SourceEditorAction'import { buildTableQueryUrl } from 'products/data_warehouse/frontend/utils'import { ColumnSelectionModal } from './ColumnSelectionModal'@@ -261,12 +264,12 @@ function DirectQuerySchemaGroups({key={schema.id}className="grid grid-cols-[auto_minmax(0,1fr)_auto] gap-2 px-6 py-1 items-center">- <SourceEditorAction source={source}>+ <SchemaEditorAction schema={schema}><LemonCheckboxchecked={schema.should_sync}onChange={(active) => setDirectQuerySchemaEnabled(schema, active)}/>- </SourceEditorAction>+ </SchemaEditorAction><div className="flex items-center gap-1 min-w-0">{schema.should_sync ? (<Link@@ -289,7 +292,7 @@ function DirectQuerySchemaGroups({)}</div>{onConfigureColumns && (- <SourceEditorAction source={source}>+ <SchemaEditorAction schema={schema}><LemonButtontype="tertiary"size="xsmall"@@ -297,7 +300,7 @@ function DirectQuerySchemaGroups({>Columns</LemonButton>- </SourceEditorAction>+ </SchemaEditorAction>)}</div>)diff --git a/products/data_warehouse/frontend/scenes/SourceScene/tabs/SchemasTab.tsx b/products/data_warehouse/frontend/scenes/SourceScene/tabs/SchemasTab.tsxindex 1ba40e6377f8..e6271c5ddf5a 100644--- a/products/data_warehouse/frontend/scenes/SourceScene/tabs/SchemasTab.tsx+++ b/products/data_warehouse/frontend/scenes/SourceScene/tabs/SchemasTab.tsx@@ -24,10 +24,14 @@ import { More } from 'lib/lemon-ui/LemonButton/More'import { LemonMenu } from 'lib/lemon-ui/LemonMenu'import { LemonTableLink } from 'lib/lemon-ui/LemonTable/LemonTableLink'import { featureFlagLogic } from 'lib/logic/featureFlagLogic'+import { getAccessControlDisabledReason } from 'lib/utils/accessControlUtils'import { pluralize } from 'lib/utils/strings'import { urls } from 'scenes/urls'+import { AccessControlObjectModal } from '~/layout/navigation-3000/sidepanel/panels/access_control/AccessControlObjectModal'import {+ AccessControlLevel,+ AccessControlResourceType,DataWarehouseSyncInterval,ExternalDataSchemaStatus,ExternalDataSource,@@ -40,8 +44,8 @@ import {} from 'products/data_warehouse/frontend/shared/components/forms/schemaGroupingUtils'import { DATA_WAREHOUSE_APP_SOURCE } from 'products/data_warehouse/frontend/shared/components/metrics/DataWarehouseMetrics'import {+ SchemaEditorAction,SourceEditorAction,- useSourceEditorAccess,} from 'products/data_warehouse/frontend/shared/components/SourceEditorAction'import { sourceManagementLogic } from 'products/data_warehouse/frontend/shared/logics/sourceManagementLogic'import {@@ -58,6 +62,14 @@ import { sourceSettingsLogic } from './sourceSettingsLogic'const frequencyRank = (frequency: DataWarehouseSyncInterval | null | undefined): number =>frequency ? SYNC_FREQUENCY_ORDER.indexOf(frequency) : -1+// Disabled reason for a row's edit controls, based on the user's effective access to that table.+const schemaEditDisabledReason = (schema: ExternalDataSourceSchema): string | null =>+ getAccessControlDisabledReason(+ AccessControlResourceType.WarehouseTable,+ AccessControlLevel.Editor,+ schema.user_access_level+ )+export interface SchemasTabProps {id: string}@@ -125,9 +137,16 @@ function ManagedSchemasTab({ id }: { id: string }): JSX.Element {}, [loadJobs, source])const showMetrics = !!featureFlags[FEATURE_FLAGS.DWH_SOURCE_METRICS]+ const warehouseAccessControlEnabled = !!featureFlags[FEATURE_FLAGS.HOGQL_WAREHOUSE_ACCESS_CONTROL]// `id` is the cleaned source id; URLs use the `managed-` prefixconst prefixedSourceId = `managed-${id}`+ // Singleton modal — track which schema's access controls are open.+ const [accessControlSchema, setAccessControlSchema] = useState<ExternalDataSourceSchema | null>(null)+ const openAccessControl = warehouseAccessControlEnabled+ ? (schema: ExternalDataSourceSchema): void => setAccessControlSchema(schema)+ : undefined+return (<><div className="flex items-start justify-between gap-2 mb-2">@@ -269,6 +288,7 @@ function ManagedSchemasTab({ id }: { id: string }): JSX.Element {resyncSchema={resyncSchema}cancelSchema={cancelSchema}deleteTable={deleteTable}+ openAccessControl={openAccessControl}showMetrics={showMetrics}/>),@@ -287,9 +307,20 @@ function ManagedSchemasTab({ id }: { id: string }): JSX.Element {resyncSchema={resyncSchema}cancelSchema={cancelSchema}deleteTable={deleteTable}+ openAccessControl={openAccessControl}showMetrics={showMetrics}/>)}+ {accessControlSchema?.table && (+ <AccessControlObjectModal+ isOpen={!!accessControlSchema}+ onClose={() => setAccessControlSchema(null)}+ resource={AccessControlResourceType.WarehouseTable}+ resource_id={accessControlSchema.table.id}+ title={accessControlSchema.label ?? accessControlSchema.name}+ description="Control who can query, sync, and manage this table. Members without editor access can't trigger syncs, change its settings, or delete it."+ />+ )}</>)}@@ -305,6 +336,8 @@ interface ManagedSchemaTableProps {resyncSchema: (schema: ExternalDataSourceSchema) => voidcancelSchema: (schema: ExternalDataSourceSchema) => voiddeleteTable: (schema: ExternalDataSourceSchema) => void+ /** Undefined when the warehouse access control feature is off. */+ openAccessControl?: (schema: ExternalDataSourceSchema) => voidshowMetrics: boolean/** Rendered inside a namespace group — the group header already shows the namespace, so strip it from row names. */inSchemaGroup?: boolean@@ -321,13 +354,13 @@ function ManagedSchemaTable({resyncSchema,cancelSchema,deleteTable,+ openAccessControl,showMetrics,inSchemaGroup = false,}: ManagedSchemaTableProps): JSX.Element {const { schemaReloadingById } = useValues(sourceManagementLogic)const { inProgressRowsBySchema } = useValues(sourceSettingsLogic)const { setSelectedSchemas } = useActions(sourceSettingsLogic)- const { disabledReason: editDisabledReason } = useSourceEditorAccess(source)const [initialLoad, setInitialLoad] = useState(true)useEffect(() => {@@ -344,7 +377,10 @@ function ManagedSchemaTable({pagination={{ pageSize: 100, hideOnSinglePage: true }}bulkSelection={{getKey: (schema) => schema.id,- isRowSelectable: () => (editDisabledReason ? { disabledReason: editDisabledReason } : true),+ isRowSelectable: (schema) => {+ const reason = schemaEditDisabledReason(schema)+ return reason ? { disabledReason: reason } : true+ },noun: ['schema', 'schemas'],barClassName: 'mb-2',renderActions: (ctx) => (@@ -509,7 +545,7 @@ function ManagedSchemaTable({sorter: (a, b) => Number(a.should_sync) - Number(b.should_sync),render: function RenderShouldSync(_, schema) {return (- <SourceEditorAction source={source}>+ <SchemaEditorAction schema={schema}><LemonSwitchchecked={schema.should_sync}onChange={(active) => {@@ -567,7 +603,7 @@ function ManagedSchemaTable({}}}/>- </SourceEditorAction>+ </SchemaEditorAction>)},},@@ -588,7 +624,7 @@ function ManagedSchemaTable({type="secondary"size="xsmall"to={urls.dataWarehouseSourceSchema(prefixedSourceId, schema.id, 'configuration')}- disabledReason={editDisabledReason}+ disabledReason={schemaEditDisabledReason(schema)}>Configure</LemonButton>@@ -599,6 +635,7 @@ function ManagedSchemaTable({resyncSchema={resyncSchema}cancelSchema={cancelSchema}deleteTable={deleteTable}+ onOpenAccessControl={openAccessControl}/></div>)@@ -766,6 +803,7 @@ function SchemaRowMore({resyncSchema,cancelSchema,deleteTable,+ onOpenAccessControl,}: {source: ExternalDataSource | nullschema: ExternalDataSourceSchema@@ -773,11 +811,12 @@ function SchemaRowMore({resyncSchema: (schema: ExternalDataSourceSchema) => voidcancelSchema: (schema: ExternalDataSourceSchema) => voiddeleteTable: (schema: ExternalDataSourceSchema) => void+ onOpenAccessControl?: (schema: ExternalDataSourceSchema) => void}): JSX.Element {const { pausePolling, resumePolling } = useActions(sourceSettingsLogic)return (- <SourceEditorAction source={source}>+ <SchemaEditorAction schema={schema}>{({ disabledReason }) => (<MoredisabledReason={disabledReason}@@ -788,6 +827,16 @@ function SchemaRowMore({}}overlay={<>+ {onOpenAccessControl && schema.table && (+ <LemonButton+ type="tertiary"+ size="xsmall"+ fullWidth+ onClick={() => onOpenAccessControl(schema)}+ >+ Access control+ </LemonButton>+ )}<Tooltiptitle={schema.sync_type === 'cdc'@@ -919,6 +968,6 @@ function SchemaRowMore({}/>)}- </SourceEditorAction>+ </SchemaEditorAction>)}diff --git a/products/data_warehouse/frontend/shared/components/SourceEditorAction.tsx b/products/data_warehouse/frontend/shared/components/SourceEditorAction.tsxindex deb30fb3a09b..1e36cd7641ba 100644--- a/products/data_warehouse/frontend/shared/components/SourceEditorAction.tsx+++ b/products/data_warehouse/frontend/shared/components/SourceEditorAction.tsx@@ -3,7 +3,7 @@ import React from 'react'import { AccessControlAction, AccessControlActionChildrenProps } from 'lib/components/AccessControlAction'import { getAccessControlDisabledReason } from 'lib/utils/accessControlUtils'-import { AccessControlLevel, AccessControlResourceType, ExternalDataSource } from '~/types'+import { AccessControlLevel, AccessControlResourceType, ExternalDataSource, ExternalDataSourceSchema } from '~/types'/*** Compute the editor access-disabled reason for an external data source as plain values.@@ -29,6 +29,26 @@ export function useSourceEditorAccess(source: ExternalDataSource | null): {}}+/**+ * Per-table variant of {@link useSourceEditorAccess}. `schema.user_access_level` is the effective+ * level for the table (the most restrictive of the source and the synced table), so it covers both+ * the source-level and per-table-locked cases.+ */+export function useSchemaEditorAccess(schema: ExternalDataSourceSchema | null): {+ disabled: boolean+ disabledReason: string | undefined+} {+ const disabledReason = getAccessControlDisabledReason(+ AccessControlResourceType.WarehouseTable,+ AccessControlLevel.Editor,+ schema?.user_access_level+ )+ return {+ disabled: !!disabledReason,+ disabledReason: disabledReason ?? undefined,+ }+}+/*** Gates children on Editor access for an external data source — used consistently across schema* and source settings UI so that viewers see the control as disabled with a clear reason.@@ -52,3 +72,28 @@ export function SourceEditorAction({</AccessControlAction>)}++/**+ * Per-table variant of `SourceEditorAction`. `schema.user_access_level` is the effective level for the+ * table (it already inherits the source), so gating a row's sync/delete controls on it covers both the+ * source-level and per-table-locked cases.+ */+export function SchemaEditorAction({+ schema,+ children,+}: {+ schema: ExternalDataSourceSchema | null+ children:+ | React.ComponentType<AccessControlActionChildrenProps>+ | React.ReactElement<AccessControlActionChildrenProps>+}): JSX.Element {+ return (+ <AccessControlAction+ resourceType={AccessControlResourceType.WarehouseTable}+ minAccessLevel={AccessControlLevel.Editor}+ userAccessLevel={schema?.user_access_level}+ >+ {children}+ </AccessControlAction>+ )+}diff --git a/products/warehouse_sources/backend/presentation/views/external_data_schema.py b/products/warehouse_sources/backend/presentation/views/external_data_schema.pyindex 01267c64680a..bccc0d4f21a7 100644--- a/products/warehouse_sources/backend/presentation/views/external_data_schema.py+++ b/products/warehouse_sources/backend/presentation/views/external_data_schema.py@@ -20,6 +20,8 @@ from posthog.api.routing import TeamAndOrgViewSetMixinfrom posthog.api.utils import actionfrom posthog.exceptions_capture import capture_exceptionfrom posthog.models.user import User+from posthog.permissions import AccessControlPermission, is_service_auth+from posthog.rbac.user_access_control import UserAccessControlSerializerMixin, access_level_satisfied_for_resourcefrom posthog.utils import str_to_boolfrom products.data_warehouse.backend.facade.api import (@@ -240,7 +242,9 @@ def _apply_primary_key_columns()-class ExternalDataSchemaSerializer(serializers.ModelSerializer):+class ExternalDataSchemaSerializer(UserAccessControlSerializerMixin, serializers.ModelSerializer):+ """A schema of an external data source: its sync configuration and the warehouse table it syncs into."""+table = serializers.SerializerMethodField(read_only=True)incremental = serializers.SerializerMethodField(read_only=True)status = serializers.SerializerMethodField(read_only=True)@@ -387,6 +391,7 @@ class ExternalDataSchemaSerializer(serializers.ModelSerializer):"source","api_version","api_version_deprecation",+ "user_access_level",]read_only_fields = [@@ -401,6 +406,7 @@ class ExternalDataSchemaSerializer(serializers.ModelSerializer):"available_columns","source","api_version_deprecation",+ "user_access_level",]@extend_schema_field(@@ -487,6 +493,14 @@ class ExternalDataSchemaSerializer(serializers.ModelSerializer):"supported_api_versions": supported_api_versions,}+ def get_user_access_level(self, schema: ExternalDataSchema) -> str | None: # type: ignore[override] # narrows the mixin's Model — DRF always dispatches with this serializer's instance+ # The synced table's access, which itself falls back to the source via RESOURCE_FALLBACK_MAP.+ # Drives the row's sync/delete gating in the UI.+ uac = self.user_access_control+ if uac is None:+ return None+ return uac.get_user_access_level(schema.table or schema.source)+@extend_schema_field(ExternalDataSourceApiVersionDeprecationSerializer(allow_null=True))def get_api_version_deprecation(self, schema: ExternalDataSchema) -> dict[str, Any] | None:# Only the schema-level override is judged here; a deprecated source pin surfaces on the@@ -1318,9 +1332,34 @@ class SimpleExternalDataSchemaSerializer(serializers.ModelSerializer):fields = ["id", "name", "label", "should_sync", "last_synced_at", "sync_type"]+class WarehouseTableAccessPermission(AccessControlPermission):+ """Resolves a schema's access through the table it syncs.++ No access control rules are written against a schema, so the base class - which looks for rules+ keyed to the object's own id - finds none and lets everything through. Resolve through the table+ instead (whose access falls back to the source via RESOURCE_FALLBACK_MAP), or the source directly+ before the first sync. The required level still comes from the base class: viewer to read, editor+ to write."""++ def has_object_permission(self, request: Request, view, obj: ExternalDataSchema) -> bool:+ # Service credentials (PSAK/TST) are synthetic users UserAccessControl can't evaluate; they're+ # gated by API scope + project membership. Mirror AccessControlPermission.+ if is_service_auth(request):+ return True+ required_level = self._get_required_access_level(request, view)+ if not required_level:+ return True+ level = view.user_access_control.get_user_access_level(obj.table or obj.source)+ if level is None or not access_level_satisfied_for_resource("warehouse_table", level, required_level):+ self.message = f"You do not have {required_level} access to this table."+ return False+ return True++@extend_schema(extensions={"x-product": "warehouse_sources"})class ExternalDataSchemaViewset(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):scope_object = "external_data_source"+ permission_classes = [WarehouseTableAccessPermission]scope_object_write_actions = ["update","partial_update",@@ -1372,6 +1411,26 @@ class ExternalDataSchemaViewset(TeamAndOrgViewSetMixin, viewsets.ModelViewSet):queryset = queryset.select_related("table__credential")return queryset.order_by(self.ordering)+ def filter_queryset(self, queryset):+ queryset = super().filter_queryset(queryset)+ if self.action != "list" or is_service_auth(self.request):+ return queryset+ # A schema has no rules of its own, so the generic queryset filtering can't see its access.+ # Resolve each row the way retrieve does and drop the ones the user can't view - otherwise+ # the list serves names and sync metadata for tables and sources they're denied on.+ schemas = list(queryset)+ uac = self.user_access_control+ uac.preload_object_access_controls([schema.table or schema.source for schema in schemas])+ visible = [+ schema.id+ for schema in schemas+ if (level := uac.get_user_access_level(schema.table or schema.source)) is not None+ and access_level_satisfied_for_resource("warehouse_table", level, "viewer")+ ]+ if len(visible) == len(schemas):+ return queryset+ return queryset.filter(id__in=visible)+def destroy(self, request: Request, *args: Any, **kwargs: Any) -> Response:instance: ExternalDataSchema = self.get_object()diff --git a/products/warehouse_sources/backend/presentation/views/external_data_source.py b/products/warehouse_sources/backend/presentation/views/external_data_source.pyindex ba2cb50b1908..ea33f5ece27d 100644--- a/products/warehouse_sources/backend/presentation/views/external_data_source.py+++ b/products/warehouse_sources/backend/presentation/views/external_data_source.py@@ -2,7 +2,7 @@ from __future__ import annotationsimport uuidimport dataclasses-from collections.abc import Callable+from collections.abc import Callable, Iterablefrom datetime import UTC, datetime, timedeltafrom typing import Any, castfrom urllib.parse import quote@@ -54,6 +54,7 @@ from posthog.permissions import (APIScopePermission,TeamMemberAccessPermission,TeamMemberAdminManagementPermission,+ is_service_auth,)from posthog.rate_limit import (CustomSourceAIBuilderBurstThrottle,@@ -61,7 +62,7 @@ from posthog.rate_limit import (CustomSourceAIBuilderSustainedThrottle,)from posthog.rbac.access_control_api_mixin import AccessControlViewSetMixin-from posthog.rbac.user_access_control import UserAccessControlSerializerMixin+from posthog.rbac.user_access_control import UserAccessControlSerializerMixin, access_level_satisfied_for_resourcefrom products.cdp.backend.facade.api import HogFunctionSerializerfrom products.cdp.backend.facade.models import HogFunction@@ -1756,6 +1757,24 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixiif obj.is_system_managed:raise PermissionDenied("This source is managed by PostHog and cannot be changed through this API.")+ def _assert_can_write_schemas(self, schemas: Iterable[ExternalDataSchema]) -> None:+ """Per-table gate for source-level endpoints that write or sync schemas.++ Editor on the source isn't enough: a table can be locked below that, and these endpoints+ never resolve a schema through DRF's object permissions, so nothing else checks it. Each+ schema resolves like the schema viewset's permission: through its table, which falls back+ to the source via RESOURCE_FALLBACK_MAP.+ """+ # Service credentials are synthetic users UserAccessControl can't evaluate; they're gated by+ # API scope + project membership. Mirror AccessControlPermission.+ if is_service_auth(self.request):+ return+ uac = self.user_access_control+ for schema in schemas:+ level = uac.get_user_access_level(schema.table or schema.source)+ if level is None or not access_level_satisfied_for_resource("warehouse_table", level, "editor"):+ raise PermissionDenied("You do not have editor access to every table in this source.")+def dangerously_get_permissions(self):# The account picker enumerates every account/site the connected provider exposes, so require# manage access even though it's a GET — a read-only member shouldn't discover unrelated@@ -2727,6 +2746,9 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixi.all())+ # Deleting the source deletes every table it synced, so it needs editor on each of them.+ self._assert_can_write_schemas(schemas)+# Soft-delete source, schemas, tables, and companion _cdc tables atomically# first so DB state is consistent even if the external cleanup below failswith transaction.atomic():@@ -2819,6 +2841,14 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixiif instance.is_direct_query:return self.refresh_schemas(request, *args, **kwargs)+ # Syncs every enabled schema, so it needs editor on each - a table locked below the source+ # would otherwise be refreshed here, and for a full refresh that drops and reloads it.+ self._assert_can_write_schemas(+ ExternalDataSchema.objects.filter(team_id=self.team_id, source_id=instance.id, should_sync=True)+ .exclude(deleted=True)+ .select_related("source", "table")+ )+if is_any_external_data_schema_paused(self.team_id):return Response(status=status.HTTP_400_BAD_REQUEST,@@ -4895,6 +4925,9 @@ class ExternalDataSourceViewSet(TeamAndOrgViewSetMixin, AccessControlViewSetMixiif len(source_schemas_by_id) != len(schema_ids):raise ValidationError("One or more schemas could not be found for this source")+ # Reject up front rather than per-schema, so a batch touching a locked table writes nothing.+ self._assert_can_write_schemas(source_schemas_by_id.values())+# Items that ask for sync defaults on a not-yet-configured schema get them discovered and# filled in up front. Tables that can't get defaults (dropped from the source, webhook-only)# fail individually and are skipped below, without blocking the rest of the batch.diff --git a/products/warehouse_sources/backend/tests/api/test_external_data_schema_access_control.py b/products/warehouse_sources/backend/tests/api/test_external_data_schema_access_control.pynew file mode 100644index 000000000000..a07c494c4b16--- /dev/null+++ b/products/warehouse_sources/backend/tests/api/test_external_data_schema_access_control.py@@ -0,0 +1,200 @@+import uuid++import pytest+from posthog.test.base import APIBaseTest++from parameterized import parameterized+from rest_framework import status++from posthog.constants import AvailableFeature+from posthog.models.organization import OrganizationMembership+from posthog.models.user import User++from products.warehouse_sources.backend.facade.models import DataWarehouseTable, ExternalDataSchema, ExternalDataSource++try:+ from ee.models.rbac.access_control import AccessControl+except ImportError:+ pass+++class TestExternalDataSchemaAccessControl(APIBaseTest):+ def setUp(self):+ super().setUp()++ self.organization.available_product_features = [+ {"key": AvailableFeature.ACCESS_CONTROL, "name": AvailableFeature.ACCESS_CONTROL},+ ]+ self.organization.save()++ # editor_user is the subject; self.user (org admin) is only used to create objects.+ self.organization_membership.level = OrganizationMembership.Level.ADMIN+ self.organization_membership.save()+ self.editor_user = User.objects.create_and_join(self.organization, "[email protected]", "testtest")++ self.source = ExternalDataSource.objects.create(+ team_id=self.team.pk,+ source_id=str(uuid.uuid4()),+ connection_id=str(uuid.uuid4()),+ destination_id=str(uuid.uuid4()),+ source_type="Stripe",+ created_by=self.user,+ prefix="test",+ job_inputs={"auth_method": {"selection": "api_key", "stripe_secret_key": "sk_test_123"}},+ )+ self.table = DataWarehouseTable.objects.create(+ name="Customers",+ format=DataWarehouseTable.TableFormat.Parquet,+ team=self.team,+ external_data_source=self.source,+ columns={"id": {"clickhouse": "Int32", "hogql": "integer", "valid": True}},+ )+ self.schema = ExternalDataSchema.objects.create(+ name="Customers", team_id=self.team.pk, source_id=self.source.id, table=self.table+ )++ def _grant(self, user, resource, resource_id, level):+ membership = OrganizationMembership.objects.get(user=user, organization=self.organization)+ return AccessControl.objects.create(+ team=self.team,+ resource=resource,+ resource_id=resource_id,+ access_level=level,+ organization_member=membership,+ )++ def _reported_level(self, user):+ self.client.force_login(user)+ listed = self.client.get(f"/api/environments/{self.team.pk}/external_data_schemas/")+ self.assertEqual(listed.status_code, status.HTTP_200_OK)+ row = next(r for r in listed.json()["results"] if r["id"] == str(self.schema.id))+ return row["user_access_level"]++ def _reload(self, user):+ self.client.force_login(user)+ return self.client.post(f"/api/environments/{self.team.pk}/external_data_schemas/{self.schema.id}/reload/")++ def _patch(self, user):+ self.client.force_login(user)+ return self.client.patch(+ f"/api/environments/{self.team.pk}/external_data_schemas/{self.schema.id}/", {"sync_frequency": "6hour"}+ )++ @parameterized.expand(+ [+ # A rule on the table itself wins over whatever the source says, in both directions.+ ("table_lock_beats_source_editor", ("external_data_source", None, "editor"), "viewer", "viewer", False),+ (+ "table_grant_beats_source_viewer",+ ("external_data_source", "SOURCE_ID", "viewer"),+ "editor",+ "editor",+ True,+ ),+ # Without a table rule the source's access applies, whether it's set on the source+ # object or across all sources.+ (+ "source_object_restriction_cascades",+ ("external_data_source", "SOURCE_ID", "viewer"),+ None,+ "viewer",+ False,+ ),+ ("source_editor_without_table_rule", ("external_data_source", None, "editor"), None, "editor", True),+ ]+ )+ def test_effective_access(self, _name, source_rule, table_level, expected_level, may_write):+ resource, resource_id, level = source_rule+ self._grant(self.editor_user, resource, str(self.source.id) if resource_id else None, level)+ if table_level:+ self._grant(self.editor_user, "warehouse_table", str(self.table.id), table_level)++ self.assertEqual(self._reported_level(self.editor_user), expected_level)+ if may_write:+ self.assertEqual(self._patch(self.editor_user).status_code, status.HTTP_200_OK)+ self.assertNotEqual(self._reload(self.editor_user).status_code, status.HTTP_403_FORBIDDEN)+ else:+ self.assertEqual(self._patch(self.editor_user).status_code, status.HTTP_403_FORBIDDEN)+ self.assertEqual(self._reload(self.editor_user).status_code, status.HTTP_403_FORBIDDEN)++ def test_unsynced_schema_falls_back_to_source(self):+ # No table exists until the first sync, so there's nothing to carry a per-table rule.+ self.schema.table = None+ self.schema.save()+ self._grant(self.editor_user, "external_data_source", None, "editor")++ self.assertEqual(self._reported_level(self.editor_user), "editor")++ def test_org_admin_bypasses_table_lock(self):+ admin = User.objects.create_and_join(self.organization, "[email protected]", "testtest")+ membership = OrganizationMembership.objects.get(user=admin, organization=self.organization)+ membership.level = OrganizationMembership.Level.ADMIN+ membership.save()+ self._grant(admin, "warehouse_table", str(self.table.id), "none")++ self.assertEqual(self._reported_level(admin), "manager")+ self.assertEqual(self._patch(admin).status_code, status.HTTP_200_OK)++ def test_reads_follow_source_access(self):+ # Reads resolve through the schema's source/table too, so a member restricted from one+ # source can't read its schemas, while the source they were granted stays readable.+ other_source = ExternalDataSource.objects.create(+ team_id=self.team.pk,+ source_id=str(uuid.uuid4()),+ connection_id=str(uuid.uuid4()),+ destination_id=str(uuid.uuid4()),+ source_type="Stripe",+ created_by=self.user,+ prefix="other",+ job_inputs={"auth_method": {"selection": "api_key", "stripe_secret_key": "sk_test_123"}},+ )+ other_schema = ExternalDataSchema.objects.create(+ name="Invoices", team_id=self.team.pk, source_id=other_source.id, table=None+ )+ self._grant(self.editor_user, "external_data_source", None, "none")+ self._grant(self.editor_user, "external_data_source", str(self.source.id), "viewer")++ self.client.force_login(self.editor_user)+ base = f"/api/environments/{self.team.pk}/external_data_schemas"+ self.assertEqual(self.client.get(f"{base}/{self.schema.id}/").status_code, status.HTTP_200_OK)+ self.assertEqual(self.client.get(f"{base}/{other_schema.id}/").status_code, status.HTTP_403_FORBIDDEN)++ # The list must agree with retrieve: the denied source's schemas aren't served at all,+ # not just blocked on the detail endpoint.+ listed = self.client.get(f"{base}/")+ self.assertEqual(listed.status_code, status.HTTP_200_OK)+ listed_ids = {row["id"] for row in listed.json()["results"]}+ self.assertIn(str(self.schema.id), listed_ids)+ self.assertNotIn(str(other_schema.id), listed_ids)++ def test_source_endpoints_respect_table_lock(self):+ # These live on the source viewset, which authorizes the source and never resolves a schema+ # through object permissions, so the per-table check has to happen there explicitly.+ self._grant(self.editor_user, "external_data_source", None, "editor")+ self._grant(self.editor_user, "warehouse_table", str(self.table.id), "viewer")+ self.schema.should_sync = True+ self.schema.save()++ self.client.force_login(self.editor_user)+ source_base = f"/api/environments/{self.team.pk}/external_data_sources/{self.source.id}"+ bulk = self.client.patch(+ f"{source_base}/bulk_update_schemas/",+ {"schemas": [{"id": str(self.schema.id), "should_sync": True}]},+ format="json",+ )+ self.assertEqual(bulk.status_code, status.HTTP_403_FORBIDDEN)+ self.assertEqual(self.client.post(f"{source_base}/reload/").status_code, status.HTTP_403_FORBIDDEN)+ # Deleting the source deletes every table it synced, so the same lock blocks it.+ self.assertEqual(self.client.delete(f"{source_base}/").status_code, status.HTTP_403_FORBIDDEN)+ self.assertFalse(ExternalDataSource.objects.get(id=self.source.id).deleted)++ def test_source_wide_sync_allowed_without_locked_tables(self):+ # The guard above must not break the ordinary case.+ self._grant(self.editor_user, "external_data_source", None, "editor")+ self.schema.should_sync = True+ self.schema.save()++ self.client.force_login(self.editor_user)+ resp = self.client.post(f"/api/environments/{self.team.pk}/external_data_sources/{self.source.id}/reload/")+ self.assertNotEqual(resp.status_code, status.HTTP_403_FORBIDDEN)diff --git a/products/warehouse_sources/backend/tests/api/test_external_data_source.py b/products/warehouse_sources/backend/tests/api/test_external_data_source.pyindex b1af0ff4023d..3c1a084cec14 100644--- a/products/warehouse_sources/backend/tests/api/test_external_data_source.py+++ b/products/warehouse_sources/backend/tests/api/test_external_data_source.py@@ -2591,6 +2591,7 @@ class TestExternalDataSource(APIBaseTest):"source": None,"api_version": None,"api_version_deprecation": None,+ "user_access_level": "manager",}],)diff --git a/products/warehouse_sources/frontend/generated/api.schemas.ts b/products/warehouse_sources/frontend/generated/api.schemas.tsindex 0d0e58e90983..1e6e48fd9991 100644--- a/products/warehouse_sources/frontend/generated/api.schemas.ts+++ b/products/warehouse_sources/frontend/generated/api.schemas.ts@@ -136,6 +136,9 @@ export type ExternalDataSchemaApiSource = {readonly supported_api_versions?: string[]} | null+/**+ * A schema of an external data source: its sync configuration and the warehouse table it syncs into.+ */export interface ExternalDataSchemaApi {readonly id: stringreadonly name: string@@ -241,6 +244,11 @@ export interface ExternalDataSchemaApi {api_version?: string | null/** Set when this schema's version override is deprecated by the vendor; null when there is no override or it is not deprecated. The source-level field covers the source pin. */readonly api_version_deprecation: ExternalDataSourceApiVersionDeprecationApi | null+ /**+ * The effective access level the user has for this object+ * @nullable+ */+ readonly user_access_level: string | null}export interface PaginatedExternalDataSchemaListApi {@@ -288,6 +296,9 @@ export type PatchedExternalDataSchemaApiSource = {readonly supported_api_versions?: string[]} | null+/**+ * A schema of an external data source: its sync configuration and the warehouse table it syncs into.+ */export interface PatchedExternalDataSchemaApi {readonly id?: stringreadonly name?: string@@ -393,6 +404,11 @@ export interface PatchedExternalDataSchemaApi {api_version?: string | null/** Set when this schema's version override is deprecated by the vendor; null when there is no override or it is not deprecated. The source-level field covers the source pin. */readonly api_version_deprecation?: ExternalDataSourceApiVersionDeprecationApi | null+ /**+ * The effective access level the user has for this object+ * @nullable+ */+ readonly user_access_level?: string | null}/**diff --git a/products/warehouse_sources/frontend/generated/api.zod.ts b/products/warehouse_sources/frontend/generated/api.zod.tsindex 56fcd608def1..a1dd37627686 100644--- a/products/warehouse_sources/frontend/generated/api.zod.ts+++ b/products/warehouse_sources/frontend/generated/api.zod.ts@@ -14,495 +14,505 @@ export const externalDataSchemasUpdateBodyIncrementalFieldLookbackSecondsMax = 5export const externalDataSchemasUpdateBodyApiVersionMax = 128-export const ExternalDataSchemasUpdateBody = /* @__PURE__ */ zod.object({- should_sync: zod.boolean().optional(),- sync_type: zod- .union([- zod- .enum(['full_refresh', 'incremental', 'append', 'webhook', 'cdc', 'xmin'])- .describe(- '\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'- ),- zod.null(),- ])- .optional()- .describe(- 'Sync strategy: incremental, full_refresh, append, cdc, or xmin.\n\n\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'- ),- incremental_field: zod.string().nullish().describe('Column name used to track sync progress.'),- incremental_field_type: zod- .union([- zod- .enum(['integer', 'numeric', 'datetime', 'date', 'timestamp', 'objectid', 'xid'])- .describe(- '\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'- ),- zod.null(),- ])- .optional()- .describe(- 'Data type of the incremental field.\n\n\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'- ),- incremental_field_lookback_seconds: zod- .number()- .min(externalDataSchemasUpdateBodyIncrementalFieldLookbackSecondsMin)- .max(externalDataSchemasUpdateBodyIncrementalFieldLookbackSecondsMax)- .nullish()- .describe(- 'Seconds to subtract from the stored incremental watermark at sync time, so each incremental run re-reads a rolling overlap window and catches late or backdated rows. Applies to timestamp\/date incremental fields only. The stored watermark is unchanged. Maximum 5184000 (60 days).'- ),- sync_frequency: zod- .union([- zod- .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])- .describe(- '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'- ),- zod.null(),- ])- .optional()- .describe(- 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'- ),- sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),- primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),- cdc_table_mode: zod- .union([- zod- .enum(['consolidated', 'cdc_only', 'both'])- .describe('\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'),- zod.null(),- ])- .optional()- .describe(- 'For CDC syncs: consolidated, cdc_only, or both.\n\n\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'- ),- enabled_columns: zod- .array(zod.string())- .nullish()- .describe(- 'Names of source columns to sync. `null` (default) syncs all columns. Primary-key columns and the active incremental field are always retained, even if not listed here.'- ),- row_filters: zod- .array(- zod.object({- column: zod.string(),- operator: zod.string().describe('One of: > >= < <= = != IN \"NOT IN\".'),- value: zod- .unknown()+export const ExternalDataSchemasUpdateBody = /* @__PURE__ */ zod+ .object({+ should_sync: zod.boolean().optional(),+ sync_type: zod+ .union([+ zod+ .enum(['full_refresh', 'incremental', 'append', 'webhook', 'cdc', 'xmin']).describe(- "Comparison value; must match the column's type. For `IN` \/ `NOT IN`, a comma-separated list (e.g. `1, 2, 3` or `'a','b'`)."+ '\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'),- })- )- .nullish()- .describe(- "Predicates ANDed onto the source query so only matching rows sync. Each is `{column, operator, value}`; `null`\/empty (default) syncs all rows. The operator must be one of `> >= < <= = != IN \"NOT IN\"` and the value must match the column's type (for `IN`\/`NOT IN`, a comma-separated list like `1, 2, 3` or `'a','b'`). Applied on the next sync — not retroactive to already-synced rows."- ),- api_version: zod- .string()- .max(externalDataSchemasUpdateBodyApiVersionMax)- .nullish()- .describe(- "Vendor API version override for this schema. `null` (default) syncs on the source's pinned version. Must be one of the source type's supported versions. User-managed: version-migration tooling never changes it. Not available for webhook-sync schemas."- ),-})+ zod.null(),+ ])+ .optional()+ .describe(+ 'Sync strategy: incremental, full_refresh, append, cdc, or xmin.\n\n\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'+ ),+ incremental_field: zod.string().nullish().describe('Column name used to track sync progress.'),+ incremental_field_type: zod+ .union([+ zod+ .enum(['integer', 'numeric', 'datetime', 'date', 'timestamp', 'objectid', 'xid'])+ .describe(+ '\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Data type of the incremental field.\n\n\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'+ ),+ incremental_field_lookback_seconds: zod+ .number()+ .min(externalDataSchemasUpdateBodyIncrementalFieldLookbackSecondsMin)+ .max(externalDataSchemasUpdateBodyIncrementalFieldLookbackSecondsMax)+ .nullish()+ .describe(+ 'Seconds to subtract from the stored incremental watermark at sync time, so each incremental run re-reads a rolling overlap window and catches late or backdated rows. Applies to timestamp\/date incremental fields only. The stored watermark is unchanged. Maximum 5184000 (60 days).'+ ),+ sync_frequency: zod+ .union([+ zod+ .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])+ .describe(+ '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'+ ),+ sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),+ primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),+ cdc_table_mode: zod+ .union([+ zod+ .enum(['consolidated', 'cdc_only', 'both'])+ .describe('\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'),+ zod.null(),+ ])+ .optional()+ .describe(+ 'For CDC syncs: consolidated, cdc_only, or both.\n\n\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'+ ),+ enabled_columns: zod+ .array(zod.string())+ .nullish()+ .describe(+ 'Names of source columns to sync. `null` (default) syncs all columns. Primary-key columns and the active incremental field are always retained, even if not listed here.'+ ),+ row_filters: zod+ .array(+ zod.object({+ column: zod.string(),+ operator: zod.string().describe('One of: > >= < <= = != IN \"NOT IN\".'),+ value: zod+ .unknown()+ .describe(+ "Comparison value; must match the column's type. For `IN` \/ `NOT IN`, a comma-separated list (e.g. `1, 2, 3` or `'a','b'`)."+ ),+ })+ )+ .nullish()+ .describe(+ "Predicates ANDed onto the source query so only matching rows sync. Each is `{column, operator, value}`; `null`\/empty (default) syncs all rows. The operator must be one of `> >= < <= = != IN \"NOT IN\"` and the value must match the column's type (for `IN`\/`NOT IN`, a comma-separated list like `1, 2, 3` or `'a','b'`). Applied on the next sync — not retroactive to already-synced rows."+ ),+ api_version: zod+ .string()+ .max(externalDataSchemasUpdateBodyApiVersionMax)+ .nullish()+ .describe(+ "Vendor API version override for this schema. `null` (default) syncs on the source's pinned version. Must be one of the source type's supported versions. User-managed: version-migration tooling never changes it. Not available for webhook-sync schemas."+ ),+ })+ .describe('A schema of an external data source: its sync configuration and the warehouse table it syncs into.')export const externalDataSchemasPartialUpdateBodyIncrementalFieldLookbackSecondsMin = 0export const externalDataSchemasPartialUpdateBodyIncrementalFieldLookbackSecondsMax = 5184000export const externalDataSchemasPartialUpdateBodyApiVersionMax = 128-export const ExternalDataSchemasPartialUpdateBody = /* @__PURE__ */ zod.object({- should_sync: zod.boolean().optional(),- sync_type: zod- .union([- zod- .enum(['full_refresh', 'incremental', 'append', 'webhook', 'cdc', 'xmin'])- .describe(- '\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'- ),- zod.null(),- ])- .optional()- .describe(- 'Sync strategy: incremental, full_refresh, append, cdc, or xmin.\n\n\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'- ),- incremental_field: zod.string().nullish().describe('Column name used to track sync progress.'),- incremental_field_type: zod- .union([- zod- .enum(['integer', 'numeric', 'datetime', 'date', 'timestamp', 'objectid', 'xid'])- .describe(- '\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'- ),- zod.null(),- ])- .optional()- .describe(- 'Data type of the incremental field.\n\n\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'- ),- incremental_field_lookback_seconds: zod- .number()- .min(externalDataSchemasPartialUpdateBodyIncrementalFieldLookbackSecondsMin)- .max(externalDataSchemasPartialUpdateBodyIncrementalFieldLookbackSecondsMax)- .nullish()- .describe(- 'Seconds to subtract from the stored incremental watermark at sync time, so each incremental run re-reads a rolling overlap window and catches late or backdated rows. Applies to timestamp\/date incremental fields only. The stored watermark is unchanged. Maximum 5184000 (60 days).'- ),- sync_frequency: zod- .union([- zod- .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])- .describe(- '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'- ),- zod.null(),- ])- .optional()- .describe(- 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'- ),- sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),- primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),- cdc_table_mode: zod- .union([- zod- .enum(['consolidated', 'cdc_only', 'both'])- .describe('\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'),- zod.null(),- ])- .optional()- .describe(- 'For CDC syncs: consolidated, cdc_only, or both.\n\n\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'- ),- enabled_columns: zod- .array(zod.string())- .nullish()- .describe(- 'Names of source columns to sync. `null` (default) syncs all columns. Primary-key columns and the active incremental field are always retained, even if not listed here.'- ),- row_filters: zod- .array(- zod.object({- column: zod.string(),- operator: zod.string().describe('One of: > >= < <= = != IN \"NOT IN\".'),- value: zod- .unknown()+export const ExternalDataSchemasPartialUpdateBody = /* @__PURE__ */ zod+ .object({+ should_sync: zod.boolean().optional(),+ sync_type: zod+ .union([+ zod+ .enum(['full_refresh', 'incremental', 'append', 'webhook', 'cdc', 'xmin']).describe(- "Comparison value; must match the column's type. For `IN` \/ `NOT IN`, a comma-separated list (e.g. `1, 2, 3` or `'a','b'`)."+ '\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'),- })- )- .nullish()- .describe(- "Predicates ANDed onto the source query so only matching rows sync. Each is `{column, operator, value}`; `null`\/empty (default) syncs all rows. The operator must be one of `> >= < <= = != IN \"NOT IN\"` and the value must match the column's type (for `IN`\/`NOT IN`, a comma-separated list like `1, 2, 3` or `'a','b'`). Applied on the next sync — not retroactive to already-synced rows."- ),- api_version: zod- .string()- .max(externalDataSchemasPartialUpdateBodyApiVersionMax)- .nullish()- .describe(- "Vendor API version override for this schema. `null` (default) syncs on the source's pinned version. Must be one of the source type's supported versions. User-managed: version-migration tooling never changes it. Not available for webhook-sync schemas."- ),-})+ zod.null(),+ ])+ .optional()+ .describe(+ 'Sync strategy: incremental, full_refresh, append, cdc, or xmin.\n\n\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'+ ),+ incremental_field: zod.string().nullish().describe('Column name used to track sync progress.'),+ incremental_field_type: zod+ .union([+ zod+ .enum(['integer', 'numeric', 'datetime', 'date', 'timestamp', 'objectid', 'xid'])+ .describe(+ '\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Data type of the incremental field.\n\n\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'+ ),+ incremental_field_lookback_seconds: zod+ .number()+ .min(externalDataSchemasPartialUpdateBodyIncrementalFieldLookbackSecondsMin)+ .max(externalDataSchemasPartialUpdateBodyIncrementalFieldLookbackSecondsMax)+ .nullish()+ .describe(+ 'Seconds to subtract from the stored incremental watermark at sync time, so each incremental run re-reads a rolling overlap window and catches late or backdated rows. Applies to timestamp\/date incremental fields only. The stored watermark is unchanged. Maximum 5184000 (60 days).'+ ),+ sync_frequency: zod+ .union([+ zod+ .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])+ .describe(+ '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'+ ),+ sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),+ primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),+ cdc_table_mode: zod+ .union([+ zod+ .enum(['consolidated', 'cdc_only', 'both'])+ .describe('\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'),+ zod.null(),+ ])+ .optional()+ .describe(+ 'For CDC syncs: consolidated, cdc_only, or both.\n\n\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'+ ),+ enabled_columns: zod+ .array(zod.string())+ .nullish()+ .describe(+ 'Names of source columns to sync. `null` (default) syncs all columns. Primary-key columns and the active incremental field are always retained, even if not listed here.'+ ),+ row_filters: zod+ .array(+ zod.object({+ column: zod.string(),+ operator: zod.string().describe('One of: > >= < <= = != IN \"NOT IN\".'),+ value: zod+ .unknown()+ .describe(+ "Comparison value; must match the column's type. For `IN` \/ `NOT IN`, a comma-separated list (e.g. `1, 2, 3` or `'a','b'`)."+ ),+ })+ )+ .nullish()+ .describe(+ "Predicates ANDed onto the source query so only matching rows sync. Each is `{column, operator, value}`; `null`\/empty (default) syncs all rows. The operator must be one of `> >= < <= = != IN \"NOT IN\"` and the value must match the column's type (for `IN`\/`NOT IN`, a comma-separated list like `1, 2, 3` or `'a','b'`). Applied on the next sync — not retroactive to already-synced rows."+ ),+ api_version: zod+ .string()+ .max(externalDataSchemasPartialUpdateBodyApiVersionMax)+ .nullish()+ .describe(+ "Vendor API version override for this schema. `null` (default) syncs on the source's pinned version. Must be one of the source type's supported versions. User-managed: version-migration tooling never changes it. Not available for webhook-sync schemas."+ ),+ })+ .describe('A schema of an external data source: its sync configuration and the warehouse table it syncs into.')export const externalDataSchemasIncrementalFieldsCreateBodyIncrementalFieldLookbackSecondsMin = 0export const externalDataSchemasIncrementalFieldsCreateBodyIncrementalFieldLookbackSecondsMax = 5184000export const externalDataSchemasIncrementalFieldsCreateBodyApiVersionMax = 128-export const ExternalDataSchemasIncrementalFieldsCreateBody = /* @__PURE__ */ zod.object({- should_sync: zod.boolean().optional(),- sync_type: zod- .union([- zod- .enum(['full_refresh', 'incremental', 'append', 'webhook', 'cdc', 'xmin'])- .describe(- '\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'- ),- zod.null(),- ])- .optional()- .describe(- 'Sync strategy: incremental, full_refresh, append, cdc, or xmin.\n\n\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'- ),- incremental_field: zod.string().nullish().describe('Column name used to track sync progress.'),- incremental_field_type: zod- .union([- zod- .enum(['integer', 'numeric', 'datetime', 'date', 'timestamp', 'objectid', 'xid'])- .describe(- '\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'- ),- zod.null(),- ])- .optional()- .describe(- 'Data type of the incremental field.\n\n\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'- ),- incremental_field_lookback_seconds: zod- .number()- .min(externalDataSchemasIncrementalFieldsCreateBodyIncrementalFieldLookbackSecondsMin)- .max(externalDataSchemasIncrementalFieldsCreateBodyIncrementalFieldLookbackSecondsMax)- .nullish()- .describe(- 'Seconds to subtract from the stored incremental watermark at sync time, so each incremental run re-reads a rolling overlap window and catches late or backdated rows. Applies to timestamp\/date incremental fields only. The stored watermark is unchanged. Maximum 5184000 (60 days).'- ),- sync_frequency: zod- .union([- zod- .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])- .describe(- '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'- ),- zod.null(),- ])- .optional()- .describe(- 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'- ),- sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),- primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),- cdc_table_mode: zod- .union([- zod- .enum(['consolidated', 'cdc_only', 'both'])- .describe('\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'),- zod.null(),- ])- .optional()- .describe(- 'For CDC syncs: consolidated, cdc_only, or both.\n\n\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'- ),- enabled_columns: zod- .array(zod.string())- .nullish()- .describe(- 'Names of source columns to sync. `null` (default) syncs all columns. Primary-key columns and the active incremental field are always retained, even if not listed here.'- ),- row_filters: zod- .array(- zod.object({- column: zod.string(),- operator: zod.string().describe('One of: > >= < <= = != IN \"NOT IN\".'),- value: zod- .unknown()+export const ExternalDataSchemasIncrementalFieldsCreateBody = /* @__PURE__ */ zod+ .object({+ should_sync: zod.boolean().optional(),+ sync_type: zod+ .union([+ zod+ .enum(['full_refresh', 'incremental', 'append', 'webhook', 'cdc', 'xmin']).describe(- "Comparison value; must match the column's type. For `IN` \/ `NOT IN`, a comma-separated list (e.g. `1, 2, 3` or `'a','b'`)."+ '\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'),- })- )- .nullish()- .describe(- "Predicates ANDed onto the source query so only matching rows sync. Each is `{column, operator, value}`; `null`\/empty (default) syncs all rows. The operator must be one of `> >= < <= = != IN \"NOT IN\"` and the value must match the column's type (for `IN`\/`NOT IN`, a comma-separated list like `1, 2, 3` or `'a','b'`). Applied on the next sync — not retroactive to already-synced rows."- ),- api_version: zod- .string()- .max(externalDataSchemasIncrementalFieldsCreateBodyApiVersionMax)- .nullish()- .describe(- "Vendor API version override for this schema. `null` (default) syncs on the source's pinned version. Must be one of the source type's supported versions. User-managed: version-migration tooling never changes it. Not available for webhook-sync schemas."- ),-})+ zod.null(),+ ])+ .optional()+ .describe(+ 'Sync strategy: incremental, full_refresh, append, cdc, or xmin.\n\n\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'+ ),+ incremental_field: zod.string().nullish().describe('Column name used to track sync progress.'),+ incremental_field_type: zod+ .union([+ zod+ .enum(['integer', 'numeric', 'datetime', 'date', 'timestamp', 'objectid', 'xid'])+ .describe(+ '\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Data type of the incremental field.\n\n\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'+ ),+ incremental_field_lookback_seconds: zod+ .number()+ .min(externalDataSchemasIncrementalFieldsCreateBodyIncrementalFieldLookbackSecondsMin)+ .max(externalDataSchemasIncrementalFieldsCreateBodyIncrementalFieldLookbackSecondsMax)+ .nullish()+ .describe(+ 'Seconds to subtract from the stored incremental watermark at sync time, so each incremental run re-reads a rolling overlap window and catches late or backdated rows. Applies to timestamp\/date incremental fields only. The stored watermark is unchanged. Maximum 5184000 (60 days).'+ ),+ sync_frequency: zod+ .union([+ zod+ .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])+ .describe(+ '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'+ ),+ sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),+ primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),+ cdc_table_mode: zod+ .union([+ zod+ .enum(['consolidated', 'cdc_only', 'both'])+ .describe('\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'),+ zod.null(),+ ])+ .optional()+ .describe(+ 'For CDC syncs: consolidated, cdc_only, or both.\n\n\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'+ ),+ enabled_columns: zod+ .array(zod.string())+ .nullish()+ .describe(+ 'Names of source columns to sync. `null` (default) syncs all columns. Primary-key columns and the active incremental field are always retained, even if not listed here.'+ ),+ row_filters: zod+ .array(+ zod.object({+ column: zod.string(),+ operator: zod.string().describe('One of: > >= < <= = != IN \"NOT IN\".'),+ value: zod+ .unknown()+ .describe(+ "Comparison value; must match the column's type. For `IN` \/ `NOT IN`, a comma-separated list (e.g. `1, 2, 3` or `'a','b'`)."+ ),+ })+ )+ .nullish()+ .describe(+ "Predicates ANDed onto the source query so only matching rows sync. Each is `{column, operator, value}`; `null`\/empty (default) syncs all rows. The operator must be one of `> >= < <= = != IN \"NOT IN\"` and the value must match the column's type (for `IN`\/`NOT IN`, a comma-separated list like `1, 2, 3` or `'a','b'`). Applied on the next sync — not retroactive to already-synced rows."+ ),+ api_version: zod+ .string()+ .max(externalDataSchemasIncrementalFieldsCreateBodyApiVersionMax)+ .nullish()+ .describe(+ "Vendor API version override for this schema. `null` (default) syncs on the source's pinned version. Must be one of the source type's supported versions. User-managed: version-migration tooling never changes it. Not available for webhook-sync schemas."+ ),+ })+ .describe('A schema of an external data source: its sync configuration and the warehouse table it syncs into.')export const externalDataSchemasReloadCreateBodyIncrementalFieldLookbackSecondsMin = 0export const externalDataSchemasReloadCreateBodyIncrementalFieldLookbackSecondsMax = 5184000export const externalDataSchemasReloadCreateBodyApiVersionMax = 128-export const ExternalDataSchemasReloadCreateBody = /* @__PURE__ */ zod.object({- should_sync: zod.boolean().optional(),- sync_type: zod- .union([- zod- .enum(['full_refresh', 'incremental', 'append', 'webhook', 'cdc', 'xmin'])- .describe(- '\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'- ),- zod.null(),- ])- .optional()- .describe(- 'Sync strategy: incremental, full_refresh, append, cdc, or xmin.\n\n\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'- ),- incremental_field: zod.string().nullish().describe('Column name used to track sync progress.'),- incremental_field_type: zod- .union([- zod- .enum(['integer', 'numeric', 'datetime', 'date', 'timestamp', 'objectid', 'xid'])- .describe(- '\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'- ),- zod.null(),- ])- .optional()- .describe(- 'Data type of the incremental field.\n\n\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'- ),- incremental_field_lookback_seconds: zod- .number()- .min(externalDataSchemasReloadCreateBodyIncrementalFieldLookbackSecondsMin)- .max(externalDataSchemasReloadCreateBodyIncrementalFieldLookbackSecondsMax)- .nullish()- .describe(- 'Seconds to subtract from the stored incremental watermark at sync time, so each incremental run re-reads a rolling overlap window and catches late or backdated rows. Applies to timestamp\/date incremental fields only. The stored watermark is unchanged. Maximum 5184000 (60 days).'- ),- sync_frequency: zod- .union([- zod- .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])- .describe(- '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'- ),- zod.null(),- ])- .optional()- .describe(- 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'- ),- sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),- primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),- cdc_table_mode: zod- .union([- zod- .enum(['consolidated', 'cdc_only', 'both'])- .describe('\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'),- zod.null(),- ])- .optional()- .describe(- 'For CDC syncs: consolidated, cdc_only, or both.\n\n\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'- ),- enabled_columns: zod- .array(zod.string())- .nullish()- .describe(- 'Names of source columns to sync. `null` (default) syncs all columns. Primary-key columns and the active incremental field are always retained, even if not listed here.'- ),- row_filters: zod- .array(- zod.object({- column: zod.string(),- operator: zod.string().describe('One of: > >= < <= = != IN \"NOT IN\".'),- value: zod- .unknown()+export const ExternalDataSchemasReloadCreateBody = /* @__PURE__ */ zod+ .object({+ should_sync: zod.boolean().optional(),+ sync_type: zod+ .union([+ zod+ .enum(['full_refresh', 'incremental', 'append', 'webhook', 'cdc', 'xmin']).describe(- "Comparison value; must match the column's type. For `IN` \/ `NOT IN`, a comma-separated list (e.g. `1, 2, 3` or `'a','b'`)."+ '\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'),- })- )- .nullish()- .describe(- "Predicates ANDed onto the source query so only matching rows sync. Each is `{column, operator, value}`; `null`\/empty (default) syncs all rows. The operator must be one of `> >= < <= = != IN \"NOT IN\"` and the value must match the column's type (for `IN`\/`NOT IN`, a comma-separated list like `1, 2, 3` or `'a','b'`). Applied on the next sync — not retroactive to already-synced rows."- ),- api_version: zod- .string()- .max(externalDataSchemasReloadCreateBodyApiVersionMax)- .nullish()- .describe(- "Vendor API version override for this schema. `null` (default) syncs on the source's pinned version. Must be one of the source type's supported versions. User-managed: version-migration tooling never changes it. Not available for webhook-sync schemas."- ),-})+ zod.null(),+ ])+ .optional()+ .describe(+ 'Sync strategy: incremental, full_refresh, append, cdc, or xmin.\n\n\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'+ ),+ incremental_field: zod.string().nullish().describe('Column name used to track sync progress.'),+ incremental_field_type: zod+ .union([+ zod+ .enum(['integer', 'numeric', 'datetime', 'date', 'timestamp', 'objectid', 'xid'])+ .describe(+ '\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Data type of the incremental field.\n\n\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'+ ),+ incremental_field_lookback_seconds: zod+ .number()+ .min(externalDataSchemasReloadCreateBodyIncrementalFieldLookbackSecondsMin)+ .max(externalDataSchemasReloadCreateBodyIncrementalFieldLookbackSecondsMax)+ .nullish()+ .describe(+ 'Seconds to subtract from the stored incremental watermark at sync time, so each incremental run re-reads a rolling overlap window and catches late or backdated rows. Applies to timestamp\/date incremental fields only. The stored watermark is unchanged. Maximum 5184000 (60 days).'+ ),+ sync_frequency: zod+ .union([+ zod+ .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])+ .describe(+ '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'+ ),+ sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),+ primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),+ cdc_table_mode: zod+ .union([+ zod+ .enum(['consolidated', 'cdc_only', 'both'])+ .describe('\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'),+ zod.null(),+ ])+ .optional()+ .describe(+ 'For CDC syncs: consolidated, cdc_only, or both.\n\n\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'+ ),+ enabled_columns: zod+ .array(zod.string())+ .nullish()+ .describe(+ 'Names of source columns to sync. `null` (default) syncs all columns. Primary-key columns and the active incremental field are always retained, even if not listed here.'+ ),+ row_filters: zod+ .array(+ zod.object({+ column: zod.string(),+ operator: zod.string().describe('One of: > >= < <= = != IN \"NOT IN\".'),+ value: zod+ .unknown()+ .describe(+ "Comparison value; must match the column's type. For `IN` \/ `NOT IN`, a comma-separated list (e.g. `1, 2, 3` or `'a','b'`)."+ ),+ })+ )+ .nullish()+ .describe(+ "Predicates ANDed onto the source query so only matching rows sync. Each is `{column, operator, value}`; `null`\/empty (default) syncs all rows. The operator must be one of `> >= < <= = != IN \"NOT IN\"` and the value must match the column's type (for `IN`\/`NOT IN`, a comma-separated list like `1, 2, 3` or `'a','b'`). Applied on the next sync — not retroactive to already-synced rows."+ ),+ api_version: zod+ .string()+ .max(externalDataSchemasReloadCreateBodyApiVersionMax)+ .nullish()+ .describe(+ "Vendor API version override for this schema. `null` (default) syncs on the source's pinned version. Must be one of the source type's supported versions. User-managed: version-migration tooling never changes it. Not available for webhook-sync schemas."+ ),+ })+ .describe('A schema of an external data source: its sync configuration and the warehouse table it syncs into.')export const externalDataSchemasResyncCreateBodyIncrementalFieldLookbackSecondsMin = 0export const externalDataSchemasResyncCreateBodyIncrementalFieldLookbackSecondsMax = 5184000export const externalDataSchemasResyncCreateBodyApiVersionMax = 128-export const ExternalDataSchemasResyncCreateBody = /* @__PURE__ */ zod.object({- should_sync: zod.boolean().optional(),- sync_type: zod- .union([- zod- .enum(['full_refresh', 'incremental', 'append', 'webhook', 'cdc', 'xmin'])- .describe(- '\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'- ),- zod.null(),- ])- .optional()- .describe(- 'Sync strategy: incremental, full_refresh, append, cdc, or xmin.\n\n\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'- ),- incremental_field: zod.string().nullish().describe('Column name used to track sync progress.'),- incremental_field_type: zod- .union([- zod- .enum(['integer', 'numeric', 'datetime', 'date', 'timestamp', 'objectid', 'xid'])- .describe(- '\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'- ),- zod.null(),- ])- .optional()- .describe(- 'Data type of the incremental field.\n\n\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'- ),- incremental_field_lookback_seconds: zod- .number()- .min(externalDataSchemasResyncCreateBodyIncrementalFieldLookbackSecondsMin)- .max(externalDataSchemasResyncCreateBodyIncrementalFieldLookbackSecondsMax)- .nullish()- .describe(- 'Seconds to subtract from the stored incremental watermark at sync time, so each incremental run re-reads a rolling overlap window and catches late or backdated rows. Applies to timestamp\/date incremental fields only. The stored watermark is unchanged. Maximum 5184000 (60 days).'- ),- sync_frequency: zod- .union([- zod- .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])- .describe(- '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'- ),- zod.null(),- ])- .optional()- .describe(- 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'- ),- sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),- primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),- cdc_table_mode: zod- .union([- zod- .enum(['consolidated', 'cdc_only', 'both'])- .describe('\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'),- zod.null(),- ])- .optional()- .describe(- 'For CDC syncs: consolidated, cdc_only, or both.\n\n\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'- ),- enabled_columns: zod- .array(zod.string())- .nullish()- .describe(- 'Names of source columns to sync. `null` (default) syncs all columns. Primary-key columns and the active incremental field are always retained, even if not listed here.'- ),- row_filters: zod- .array(- zod.object({- column: zod.string(),- operator: zod.string().describe('One of: > >= < <= = != IN \"NOT IN\".'),- value: zod- .unknown()+export const ExternalDataSchemasResyncCreateBody = /* @__PURE__ */ zod+ .object({+ should_sync: zod.boolean().optional(),+ sync_type: zod+ .union([+ zod+ .enum(['full_refresh', 'incremental', 'append', 'webhook', 'cdc', 'xmin']).describe(- "Comparison value; must match the column's type. For `IN` \/ `NOT IN`, a comma-separated list (e.g. `1, 2, 3` or `'a','b'`)."+ '\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'),- })- )- .nullish()- .describe(- "Predicates ANDed onto the source query so only matching rows sync. Each is `{column, operator, value}`; `null`\/empty (default) syncs all rows. The operator must be one of `> >= < <= = != IN \"NOT IN\"` and the value must match the column's type (for `IN`\/`NOT IN`, a comma-separated list like `1, 2, 3` or `'a','b'`). Applied on the next sync — not retroactive to already-synced rows."- ),- api_version: zod- .string()- .max(externalDataSchemasResyncCreateBodyApiVersionMax)- .nullish()- .describe(- "Vendor API version override for this schema. `null` (default) syncs on the source's pinned version. Must be one of the source type's supported versions. User-managed: version-migration tooling never changes it. Not available for webhook-sync schemas."- ),-})+ zod.null(),+ ])+ .optional()+ .describe(+ 'Sync strategy: incremental, full_refresh, append, cdc, or xmin.\n\n\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'+ ),+ incremental_field: zod.string().nullish().describe('Column name used to track sync progress.'),+ incremental_field_type: zod+ .union([+ zod+ .enum(['integer', 'numeric', 'datetime', 'date', 'timestamp', 'objectid', 'xid'])+ .describe(+ '\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Data type of the incremental field.\n\n\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'+ ),+ incremental_field_lookback_seconds: zod+ .number()+ .min(externalDataSchemasResyncCreateBodyIncrementalFieldLookbackSecondsMin)+ .max(externalDataSchemasResyncCreateBodyIncrementalFieldLookbackSecondsMax)+ .nullish()+ .describe(+ 'Seconds to subtract from the stored incremental watermark at sync time, so each incremental run re-reads a rolling overlap window and catches late or backdated rows. Applies to timestamp\/date incremental fields only. The stored watermark is unchanged. Maximum 5184000 (60 days).'+ ),+ sync_frequency: zod+ .union([+ zod+ .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])+ .describe(+ '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'+ ),+ sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),+ primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),+ cdc_table_mode: zod+ .union([+ zod+ .enum(['consolidated', 'cdc_only', 'both'])+ .describe('\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'),+ zod.null(),+ ])+ .optional()+ .describe(+ 'For CDC syncs: consolidated, cdc_only, or both.\n\n\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'+ ),+ enabled_columns: zod+ .array(zod.string())+ .nullish()+ .describe(+ 'Names of source columns to sync. `null` (default) syncs all columns. Primary-key columns and the active incremental field are always retained, even if not listed here.'+ ),+ row_filters: zod+ .array(+ zod.object({+ column: zod.string(),+ operator: zod.string().describe('One of: > >= < <= = != IN \"NOT IN\".'),+ value: zod+ .unknown()+ .describe(+ "Comparison value; must match the column's type. For `IN` \/ `NOT IN`, a comma-separated list (e.g. `1, 2, 3` or `'a','b'`)."+ ),+ })+ )+ .nullish()+ .describe(+ "Predicates ANDed onto the source query so only matching rows sync. Each is `{column, operator, value}`; `null`\/empty (default) syncs all rows. The operator must be one of `> >= < <= = != IN \"NOT IN\"` and the value must match the column's type (for `IN`\/`NOT IN`, a comma-separated list like `1, 2, 3` or `'a','b'`). Applied on the next sync — not retroactive to already-synced rows."+ ),+ api_version: zod+ .string()+ .max(externalDataSchemasResyncCreateBodyApiVersionMax)+ .nullish()+ .describe(+ "Vendor API version override for this schema. `null` (default) syncs on the source's pinned version. Must be one of the source type's supported versions. User-managed: version-migration tooling never changes it. Not available for webhook-sync schemas."+ ),+ })+ .describe('A schema of an external data source: its sync configuration and the warehouse table it syncs into.')/*** Create, Read, Update and Delete External data Sources.diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex fd2b29be4608..4e1a2144c35a 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -28609,6 +28609,9 @@ export namespace Schemas {default_version: string;}+ /**+ * A schema of an external data source: its sync configuration and the warehouse table it syncs into.+ */export interface ExternalDataSchema {readonly id: string;readonly name: string;@@ -28714,6 +28717,11 @@ export namespace Schemas {api_version?: string | null;/** Set when this schema's version override is deprecated by the vendor; null when there is no override or it is not deprecated. The source-level field covers the source pin. */readonly api_version_deprecation: ExternalDataSourceApiVersionDeprecation | null;+ /**+ * The effective access level the user has for this object+ * @nullable+ */+ readonly user_access_level: string | null;}export type ExternalDataSourceBulkUpdateSchemaRowFiltersItem = {@@ -49748,6 +49756,9 @@ export namespace Schemas {readonly supported_api_versions?: string[];} | null;+ /**+ * A schema of an external data source: its sync configuration and the warehouse table it syncs into.+ */export interface PatchedExternalDataSchema {readonly id?: string;readonly name?: string;@@ -49853,6 +49864,11 @@ export namespace Schemas {api_version?: string | null;/** Set when this schema's version override is deprecated by the vendor; null when there is no override or it is not deprecated. The source-level field covers the source pin. */readonly api_version_deprecation?: ExternalDataSourceApiVersionDeprecation | null;+ /**+ * The effective access level the user has for this object+ * @nullable+ */+ readonly user_access_level?: string | null;}export interface PatchedExternalDataSourceBulkUpdateSchemas {diff --git a/services/mcp/src/generated/warehouse_sources/api.ts b/services/mcp/src/generated/warehouse_sources/api.tsindex baa16ced5389..1f584d1483ff 100644--- a/services/mcp/src/generated/warehouse_sources/api.ts+++ b/services/mcp/src/generated/warehouse_sources/api.ts@@ -45,99 +45,101 @@ export const externalDataSchemasPartialUpdateBodyIncrementalFieldLookbackSecondsexport const externalDataSchemasPartialUpdateBodyApiVersionMax = 128-export const ExternalDataSchemasPartialUpdateBody = /* @__PURE__ */ zod.object({- should_sync: zod.boolean().optional(),- sync_type: zod- .union([- zod- .enum(['full_refresh', 'incremental', 'append', 'webhook', 'cdc', 'xmin'])- .describe(- '\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'- ),- zod.null(),- ])- .optional()- .describe(- 'Sync strategy: incremental, full_refresh, append, cdc, or xmin.\n\n\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'- ),- incremental_field: zod.string().nullish().describe('Column name used to track sync progress.'),- incremental_field_type: zod- .union([- zod- .enum(['integer', 'numeric', 'datetime', 'date', 'timestamp', 'objectid', 'xid'])- .describe(- '\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'- ),- zod.null(),- ])- .optional()- .describe(- 'Data type of the incremental field.\n\n\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'- ),- incremental_field_lookback_seconds: zod- .number()- .min(externalDataSchemasPartialUpdateBodyIncrementalFieldLookbackSecondsMin)- .max(externalDataSchemasPartialUpdateBodyIncrementalFieldLookbackSecondsMax)- .nullish()- .describe(- 'Seconds to subtract from the stored incremental watermark at sync time, so each incremental run re-reads a rolling overlap window and catches late or backdated rows. Applies to timestamp\/date incremental fields only. The stored watermark is unchanged. Maximum 5184000 (60 days).'- ),- sync_frequency: zod- .union([- zod- .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])- .describe(- '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'- ),- zod.null(),- ])- .optional()- .describe(- 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'- ),- sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),- primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),- cdc_table_mode: zod- .union([- zod- .enum(['consolidated', 'cdc_only', 'both'])- .describe('\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'),- zod.null(),- ])- .optional()- .describe(- 'For CDC syncs: consolidated, cdc_only, or both.\n\n\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'- ),- enabled_columns: zod- .array(zod.string())- .nullish()- .describe(- 'Names of source columns to sync. `null` (default) syncs all columns. Primary-key columns and the active incremental field are always retained, even if not listed here.'- ),- row_filters: zod- .array(- zod.object({- column: zod.string(),- operator: zod.string().describe('One of: > >= < <= = != IN \"NOT IN\".'),- value: zod- .unknown()+export const ExternalDataSchemasPartialUpdateBody = /* @__PURE__ */ zod+ .object({+ should_sync: zod.boolean().optional(),+ sync_type: zod+ .union([+ zod+ .enum(['full_refresh', 'incremental', 'append', 'webhook', 'cdc', 'xmin']).describe(- "Comparison value; must match the column's type. For `IN` \/ `NOT IN`, a comma-separated list (e.g. `1, 2, 3` or `'a','b'`)."+ '\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'),- })- )- .nullish()- .describe(- "Predicates ANDed onto the source query so only matching rows sync. Each is `{column, operator, value}`; `null`\/empty (default) syncs all rows. The operator must be one of `> >= < <= = != IN \"NOT IN\"` and the value must match the column's type (for `IN`\/`NOT IN`, a comma-separated list like `1, 2, 3` or `'a','b'`). Applied on the next sync — not retroactive to already-synced rows."- ),- api_version: zod- .string()- .max(externalDataSchemasPartialUpdateBodyApiVersionMax)- .nullish()- .describe(- "Vendor API version override for this schema. `null` (default) syncs on the source's pinned version. Must be one of the source type's supported versions. User-managed: version-migration tooling never changes it. Not available for webhook-sync schemas."- ),-})+ zod.null(),+ ])+ .optional()+ .describe(+ 'Sync strategy: incremental, full_refresh, append, cdc, or xmin.\n\n\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'+ ),+ incremental_field: zod.string().nullish().describe('Column name used to track sync progress.'),+ incremental_field_type: zod+ .union([+ zod+ .enum(['integer', 'numeric', 'datetime', 'date', 'timestamp', 'objectid', 'xid'])+ .describe(+ '\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Data type of the incremental field.\n\n\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'+ ),+ incremental_field_lookback_seconds: zod+ .number()+ .min(externalDataSchemasPartialUpdateBodyIncrementalFieldLookbackSecondsMin)+ .max(externalDataSchemasPartialUpdateBodyIncrementalFieldLookbackSecondsMax)+ .nullish()+ .describe(+ 'Seconds to subtract from the stored incremental watermark at sync time, so each incremental run re-reads a rolling overlap window and catches late or backdated rows. Applies to timestamp\/date incremental fields only. The stored watermark is unchanged. Maximum 5184000 (60 days).'+ ),+ sync_frequency: zod+ .union([+ zod+ .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])+ .describe(+ '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'+ ),+ sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),+ primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),+ cdc_table_mode: zod+ .union([+ zod+ .enum(['consolidated', 'cdc_only', 'both'])+ .describe('\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'),+ zod.null(),+ ])+ .optional()+ .describe(+ 'For CDC syncs: consolidated, cdc_only, or both.\n\n\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'+ ),+ enabled_columns: zod+ .array(zod.string())+ .nullish()+ .describe(+ 'Names of source columns to sync. `null` (default) syncs all columns. Primary-key columns and the active incremental field are always retained, even if not listed here.'+ ),+ row_filters: zod+ .array(+ zod.object({+ column: zod.string(),+ operator: zod.string().describe('One of: > >= < <= = != IN \"NOT IN\".'),+ value: zod+ .unknown()+ .describe(+ "Comparison value; must match the column's type. For `IN` \/ `NOT IN`, a comma-separated list (e.g. `1, 2, 3` or `'a','b'`)."+ ),+ })+ )+ .nullish()+ .describe(+ "Predicates ANDed onto the source query so only matching rows sync. Each is `{column, operator, value}`; `null`\/empty (default) syncs all rows. The operator must be one of `> >= < <= = != IN \"NOT IN\"` and the value must match the column's type (for `IN`\/`NOT IN`, a comma-separated list like `1, 2, 3` or `'a','b'`). Applied on the next sync — not retroactive to already-synced rows."+ ),+ api_version: zod+ .string()+ .max(externalDataSchemasPartialUpdateBodyApiVersionMax)+ .nullish()+ .describe(+ "Vendor API version override for this schema. `null` (default) syncs on the source's pinned version. Must be one of the source type's supported versions. User-managed: version-migration tooling never changes it. Not available for webhook-sync schemas."+ ),+ })+ .describe('A schema of an external data source: its sync configuration and the warehouse table it syncs into.')export const ExternalDataSchemasCancelCreateParams = /* @__PURE__ */ zod.object({id: zod.string().describe('A UUID string identifying this external data schema.'),@@ -171,99 +173,101 @@ export const externalDataSchemasIncrementalFieldsCreateBodyIncrementalFieldLookbexport const externalDataSchemasIncrementalFieldsCreateBodyApiVersionMax = 128-export const ExternalDataSchemasIncrementalFieldsCreateBody = /* @__PURE__ */ zod.object({- should_sync: zod.boolean().optional(),- sync_type: zod- .union([- zod- .enum(['full_refresh', 'incremental', 'append', 'webhook', 'cdc', 'xmin'])- .describe(- '\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'- ),- zod.null(),- ])- .optional()- .describe(- 'Sync strategy: incremental, full_refresh, append, cdc, or xmin.\n\n\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'- ),- incremental_field: zod.string().nullish().describe('Column name used to track sync progress.'),- incremental_field_type: zod- .union([- zod- .enum(['integer', 'numeric', 'datetime', 'date', 'timestamp', 'objectid', 'xid'])- .describe(- '\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'- ),- zod.null(),- ])- .optional()- .describe(- 'Data type of the incremental field.\n\n\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'- ),- incremental_field_lookback_seconds: zod- .number()- .min(externalDataSchemasIncrementalFieldsCreateBodyIncrementalFieldLookbackSecondsMin)- .max(externalDataSchemasIncrementalFieldsCreateBodyIncrementalFieldLookbackSecondsMax)- .nullish()- .describe(- 'Seconds to subtract from the stored incremental watermark at sync time, so each incremental run re-reads a rolling overlap window and catches late or backdated rows. Applies to timestamp\/date incremental fields only. The stored watermark is unchanged. Maximum 5184000 (60 days).'- ),- sync_frequency: zod- .union([- zod- .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])- .describe(- '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'- ),- zod.null(),- ])- .optional()- .describe(- 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'- ),- sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),- primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),- cdc_table_mode: zod- .union([- zod- .enum(['consolidated', 'cdc_only', 'both'])- .describe('\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'),- zod.null(),- ])- .optional()- .describe(- 'For CDC syncs: consolidated, cdc_only, or both.\n\n\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'- ),- enabled_columns: zod- .array(zod.string())- .nullish()- .describe(- 'Names of source columns to sync. `null` (default) syncs all columns. Primary-key columns and the active incremental field are always retained, even if not listed here.'- ),- row_filters: zod- .array(- zod.object({- column: zod.string(),- operator: zod.string().describe('One of: > >= < <= = != IN \"NOT IN\".'),- value: zod- .unknown()+export const ExternalDataSchemasIncrementalFieldsCreateBody = /* @__PURE__ */ zod+ .object({+ should_sync: zod.boolean().optional(),+ sync_type: zod+ .union([+ zod+ .enum(['full_refresh', 'incremental', 'append', 'webhook', 'cdc', 'xmin']).describe(- "Comparison value; must match the column's type. For `IN` \/ `NOT IN`, a comma-separated list (e.g. `1, 2, 3` or `'a','b'`)."+ '\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'),- })- )- .nullish()- .describe(- "Predicates ANDed onto the source query so only matching rows sync. Each is `{column, operator, value}`; `null`\/empty (default) syncs all rows. The operator must be one of `> >= < <= = != IN \"NOT IN\"` and the value must match the column's type (for `IN`\/`NOT IN`, a comma-separated list like `1, 2, 3` or `'a','b'`). Applied on the next sync — not retroactive to already-synced rows."- ),- api_version: zod- .string()- .max(externalDataSchemasIncrementalFieldsCreateBodyApiVersionMax)- .nullish()- .describe(- "Vendor API version override for this schema. `null` (default) syncs on the source's pinned version. Must be one of the source type's supported versions. User-managed: version-migration tooling never changes it. Not available for webhook-sync schemas."- ),-})+ zod.null(),+ ])+ .optional()+ .describe(+ 'Sync strategy: incremental, full_refresh, append, cdc, or xmin.\n\n\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'+ ),+ incremental_field: zod.string().nullish().describe('Column name used to track sync progress.'),+ incremental_field_type: zod+ .union([+ zod+ .enum(['integer', 'numeric', 'datetime', 'date', 'timestamp', 'objectid', 'xid'])+ .describe(+ '\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Data type of the incremental field.\n\n\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'+ ),+ incremental_field_lookback_seconds: zod+ .number()+ .min(externalDataSchemasIncrementalFieldsCreateBodyIncrementalFieldLookbackSecondsMin)+ .max(externalDataSchemasIncrementalFieldsCreateBodyIncrementalFieldLookbackSecondsMax)+ .nullish()+ .describe(+ 'Seconds to subtract from the stored incremental watermark at sync time, so each incremental run re-reads a rolling overlap window and catches late or backdated rows. Applies to timestamp\/date incremental fields only. The stored watermark is unchanged. Maximum 5184000 (60 days).'+ ),+ sync_frequency: zod+ .union([+ zod+ .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])+ .describe(+ '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'+ ),+ sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),+ primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),+ cdc_table_mode: zod+ .union([+ zod+ .enum(['consolidated', 'cdc_only', 'both'])+ .describe('\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'),+ zod.null(),+ ])+ .optional()+ .describe(+ 'For CDC syncs: consolidated, cdc_only, or both.\n\n\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'+ ),+ enabled_columns: zod+ .array(zod.string())+ .nullish()+ .describe(+ 'Names of source columns to sync. `null` (default) syncs all columns. Primary-key columns and the active incremental field are always retained, even if not listed here.'+ ),+ row_filters: zod+ .array(+ zod.object({+ column: zod.string(),+ operator: zod.string().describe('One of: > >= < <= = != IN \"NOT IN\".'),+ value: zod+ .unknown()+ .describe(+ "Comparison value; must match the column's type. For `IN` \/ `NOT IN`, a comma-separated list (e.g. `1, 2, 3` or `'a','b'`)."+ ),+ })+ )+ .nullish()+ .describe(+ "Predicates ANDed onto the source query so only matching rows sync. Each is `{column, operator, value}`; `null`\/empty (default) syncs all rows. The operator must be one of `> >= < <= = != IN \"NOT IN\"` and the value must match the column's type (for `IN`\/`NOT IN`, a comma-separated list like `1, 2, 3` or `'a','b'`). Applied on the next sync — not retroactive to already-synced rows."+ ),+ api_version: zod+ .string()+ .max(externalDataSchemasIncrementalFieldsCreateBodyApiVersionMax)+ .nullish()+ .describe(+ "Vendor API version override for this schema. `null` (default) syncs on the source's pinned version. Must be one of the source type's supported versions. User-managed: version-migration tooling never changes it. Not available for webhook-sync schemas."+ ),+ })+ .describe('A schema of an external data source: its sync configuration and the warehouse table it syncs into.')export const ExternalDataSchemasReloadCreateParams = /* @__PURE__ */ zod.object({id: zod.string().describe('A UUID string identifying this external data schema.'),@@ -279,99 +283,101 @@ export const externalDataSchemasReloadCreateBodyIncrementalFieldLookbackSecondsMexport const externalDataSchemasReloadCreateBodyApiVersionMax = 128-export const ExternalDataSchemasReloadCreateBody = /* @__PURE__ */ zod.object({- should_sync: zod.boolean().optional(),- sync_type: zod- .union([- zod- .enum(['full_refresh', 'incremental', 'append', 'webhook', 'cdc', 'xmin'])- .describe(- '\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'- ),- zod.null(),- ])- .optional()- .describe(- 'Sync strategy: incremental, full_refresh, append, cdc, or xmin.\n\n\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'- ),- incremental_field: zod.string().nullish().describe('Column name used to track sync progress.'),- incremental_field_type: zod- .union([- zod- .enum(['integer', 'numeric', 'datetime', 'date', 'timestamp', 'objectid', 'xid'])- .describe(- '\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'- ),- zod.null(),- ])- .optional()- .describe(- 'Data type of the incremental field.\n\n\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'- ),- incremental_field_lookback_seconds: zod- .number()- .min(externalDataSchemasReloadCreateBodyIncrementalFieldLookbackSecondsMin)- .max(externalDataSchemasReloadCreateBodyIncrementalFieldLookbackSecondsMax)- .nullish()- .describe(- 'Seconds to subtract from the stored incremental watermark at sync time, so each incremental run re-reads a rolling overlap window and catches late or backdated rows. Applies to timestamp\/date incremental fields only. The stored watermark is unchanged. Maximum 5184000 (60 days).'- ),- sync_frequency: zod- .union([- zod- .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])- .describe(- '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'- ),- zod.null(),- ])- .optional()- .describe(- 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'- ),- sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),- primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),- cdc_table_mode: zod- .union([- zod- .enum(['consolidated', 'cdc_only', 'both'])- .describe('\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'),- zod.null(),- ])- .optional()- .describe(- 'For CDC syncs: consolidated, cdc_only, or both.\n\n\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'- ),- enabled_columns: zod- .array(zod.string())- .nullish()- .describe(- 'Names of source columns to sync. `null` (default) syncs all columns. Primary-key columns and the active incremental field are always retained, even if not listed here.'- ),- row_filters: zod- .array(- zod.object({- column: zod.string(),- operator: zod.string().describe('One of: > >= < <= = != IN \"NOT IN\".'),- value: zod- .unknown()+export const ExternalDataSchemasReloadCreateBody = /* @__PURE__ */ zod+ .object({+ should_sync: zod.boolean().optional(),+ sync_type: zod+ .union([+ zod+ .enum(['full_refresh', 'incremental', 'append', 'webhook', 'cdc', 'xmin']).describe(- "Comparison value; must match the column's type. For `IN` \/ `NOT IN`, a comma-separated list (e.g. `1, 2, 3` or `'a','b'`)."+ '\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'),- })- )- .nullish()- .describe(- "Predicates ANDed onto the source query so only matching rows sync. Each is `{column, operator, value}`; `null`\/empty (default) syncs all rows. The operator must be one of `> >= < <= = != IN \"NOT IN\"` and the value must match the column's type (for `IN`\/`NOT IN`, a comma-separated list like `1, 2, 3` or `'a','b'`). Applied on the next sync — not retroactive to already-synced rows."- ),- api_version: zod- .string()- .max(externalDataSchemasReloadCreateBodyApiVersionMax)- .nullish()- .describe(- "Vendor API version override for this schema. `null` (default) syncs on the source's pinned version. Must be one of the source type's supported versions. User-managed: version-migration tooling never changes it. Not available for webhook-sync schemas."- ),-})+ zod.null(),+ ])+ .optional()+ .describe(+ 'Sync strategy: incremental, full_refresh, append, cdc, or xmin.\n\n\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'+ ),+ incremental_field: zod.string().nullish().describe('Column name used to track sync progress.'),+ incremental_field_type: zod+ .union([+ zod+ .enum(['integer', 'numeric', 'datetime', 'date', 'timestamp', 'objectid', 'xid'])+ .describe(+ '\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Data type of the incremental field.\n\n\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'+ ),+ incremental_field_lookback_seconds: zod+ .number()+ .min(externalDataSchemasReloadCreateBodyIncrementalFieldLookbackSecondsMin)+ .max(externalDataSchemasReloadCreateBodyIncrementalFieldLookbackSecondsMax)+ .nullish()+ .describe(+ 'Seconds to subtract from the stored incremental watermark at sync time, so each incremental run re-reads a rolling overlap window and catches late or backdated rows. Applies to timestamp\/date incremental fields only. The stored watermark is unchanged. Maximum 5184000 (60 days).'+ ),+ sync_frequency: zod+ .union([+ zod+ .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])+ .describe(+ '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'+ ),+ sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),+ primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),+ cdc_table_mode: zod+ .union([+ zod+ .enum(['consolidated', 'cdc_only', 'both'])+ .describe('\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'),+ zod.null(),+ ])+ .optional()+ .describe(+ 'For CDC syncs: consolidated, cdc_only, or both.\n\n\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'+ ),+ enabled_columns: zod+ .array(zod.string())+ .nullish()+ .describe(+ 'Names of source columns to sync. `null` (default) syncs all columns. Primary-key columns and the active incremental field are always retained, even if not listed here.'+ ),+ row_filters: zod+ .array(+ zod.object({+ column: zod.string(),+ operator: zod.string().describe('One of: > >= < <= = != IN \"NOT IN\".'),+ value: zod+ .unknown()+ .describe(+ "Comparison value; must match the column's type. For `IN` \/ `NOT IN`, a comma-separated list (e.g. `1, 2, 3` or `'a','b'`)."+ ),+ })+ )+ .nullish()+ .describe(+ "Predicates ANDed onto the source query so only matching rows sync. Each is `{column, operator, value}`; `null`\/empty (default) syncs all rows. The operator must be one of `> >= < <= = != IN \"NOT IN\"` and the value must match the column's type (for `IN`\/`NOT IN`, a comma-separated list like `1, 2, 3` or `'a','b'`). Applied on the next sync — not retroactive to already-synced rows."+ ),+ api_version: zod+ .string()+ .max(externalDataSchemasReloadCreateBodyApiVersionMax)+ .nullish()+ .describe(+ "Vendor API version override for this schema. `null` (default) syncs on the source's pinned version. Must be one of the source type's supported versions. User-managed: version-migration tooling never changes it. Not available for webhook-sync schemas."+ ),+ })+ .describe('A schema of an external data source: its sync configuration and the warehouse table it syncs into.')export const ExternalDataSchemasResyncCreateParams = /* @__PURE__ */ zod.object({id: zod.string().describe('A UUID string identifying this external data schema.'),@@ -387,99 +393,101 @@ export const externalDataSchemasResyncCreateBodyIncrementalFieldLookbackSecondsMexport const externalDataSchemasResyncCreateBodyApiVersionMax = 128-export const ExternalDataSchemasResyncCreateBody = /* @__PURE__ */ zod.object({- should_sync: zod.boolean().optional(),- sync_type: zod- .union([- zod- .enum(['full_refresh', 'incremental', 'append', 'webhook', 'cdc', 'xmin'])- .describe(- '\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'- ),- zod.null(),- ])- .optional()- .describe(- 'Sync strategy: incremental, full_refresh, append, cdc, or xmin.\n\n\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'- ),- incremental_field: zod.string().nullish().describe('Column name used to track sync progress.'),- incremental_field_type: zod- .union([- zod- .enum(['integer', 'numeric', 'datetime', 'date', 'timestamp', 'objectid', 'xid'])- .describe(- '\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'- ),- zod.null(),- ])- .optional()- .describe(- 'Data type of the incremental field.\n\n\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'- ),- incremental_field_lookback_seconds: zod- .number()- .min(externalDataSchemasResyncCreateBodyIncrementalFieldLookbackSecondsMin)- .max(externalDataSchemasResyncCreateBodyIncrementalFieldLookbackSecondsMax)- .nullish()- .describe(- 'Seconds to subtract from the stored incremental watermark at sync time, so each incremental run re-reads a rolling overlap window and catches late or backdated rows. Applies to timestamp\/date incremental fields only. The stored watermark is unchanged. Maximum 5184000 (60 days).'- ),- sync_frequency: zod- .union([- zod- .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])- .describe(- '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'- ),- zod.null(),- ])- .optional()- .describe(- 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'- ),- sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),- primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),- cdc_table_mode: zod- .union([- zod- .enum(['consolidated', 'cdc_only', 'both'])- .describe('\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'),- zod.null(),- ])- .optional()- .describe(- 'For CDC syncs: consolidated, cdc_only, or both.\n\n\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'- ),- enabled_columns: zod- .array(zod.string())- .nullish()- .describe(- 'Names of source columns to sync. `null` (default) syncs all columns. Primary-key columns and the active incremental field are always retained, even if not listed here.'- ),- row_filters: zod- .array(- zod.object({- column: zod.string(),- operator: zod.string().describe('One of: > >= < <= = != IN \"NOT IN\".'),- value: zod- .unknown()+export const ExternalDataSchemasResyncCreateBody = /* @__PURE__ */ zod+ .object({+ should_sync: zod.boolean().optional(),+ sync_type: zod+ .union([+ zod+ .enum(['full_refresh', 'incremental', 'append', 'webhook', 'cdc', 'xmin']).describe(- "Comparison value; must match the column's type. For `IN` \/ `NOT IN`, a comma-separated list (e.g. `1, 2, 3` or `'a','b'`)."+ '\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'),- })- )- .nullish()- .describe(- "Predicates ANDed onto the source query so only matching rows sync. Each is `{column, operator, value}`; `null`\/empty (default) syncs all rows. The operator must be one of `> >= < <= = != IN \"NOT IN\"` and the value must match the column's type (for `IN`\/`NOT IN`, a comma-separated list like `1, 2, 3` or `'a','b'`). Applied on the next sync — not retroactive to already-synced rows."- ),- api_version: zod- .string()- .max(externalDataSchemasResyncCreateBodyApiVersionMax)- .nullish()- .describe(- "Vendor API version override for this schema. `null` (default) syncs on the source's pinned version. Must be one of the source type's supported versions. User-managed: version-migration tooling never changes it. Not available for webhook-sync schemas."- ),-})+ zod.null(),+ ])+ .optional()+ .describe(+ 'Sync strategy: incremental, full_refresh, append, cdc, or xmin.\n\n\* `full_refresh` - full_refresh\n\* `incremental` - incremental\n\* `append` - append\n\* `webhook` - webhook\n\* `cdc` - cdc\n\* `xmin` - xmin'+ ),+ incremental_field: zod.string().nullish().describe('Column name used to track sync progress.'),+ incremental_field_type: zod+ .union([+ zod+ .enum(['integer', 'numeric', 'datetime', 'date', 'timestamp', 'objectid', 'xid'])+ .describe(+ '\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'Data type of the incremental field.\n\n\* `integer` - integer\n\* `numeric` - numeric\n\* `datetime` - datetime\n\* `date` - date\n\* `timestamp` - timestamp\n\* `objectid` - objectid\n\* `xid` - xid'+ ),+ incremental_field_lookback_seconds: zod+ .number()+ .min(externalDataSchemasResyncCreateBodyIncrementalFieldLookbackSecondsMin)+ .max(externalDataSchemasResyncCreateBodyIncrementalFieldLookbackSecondsMax)+ .nullish()+ .describe(+ 'Seconds to subtract from the stored incremental watermark at sync time, so each incremental run re-reads a rolling overlap window and catches late or backdated rows. Applies to timestamp\/date incremental fields only. The stored watermark is unchanged. Maximum 5184000 (60 days).'+ ),+ sync_frequency: zod+ .union([+ zod+ .enum(['never', '5min', '15min', '30min', '1hour', '6hour', '12hour', '24hour', '7day', '30day'])+ .describe(+ '\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'+ ),+ zod.null(),+ ])+ .optional()+ .describe(+ 'How often to sync. The fastest sync frequency is 5 minutes.\n\n\* `never` - never\n\* `5min` - 5min\n\* `15min` - 15min\n\* `30min` - 30min\n\* `1hour` - 1hour\n\* `6hour` - 6hour\n\* `12hour` - 12hour\n\* `24hour` - 24hour\n\* `7day` - 7day\n\* `30day` - 30day'+ ),+ sync_time_of_day: zod.iso.time({}).nullish().describe('UTC time of day to run the sync (HH:MM:SS).'),+ primary_key_columns: zod.array(zod.string()).nullish().describe('Column names for primary key deduplication.'),+ cdc_table_mode: zod+ .union([+ zod+ .enum(['consolidated', 'cdc_only', 'both'])+ .describe('\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'),+ zod.null(),+ ])+ .optional()+ .describe(+ 'For CDC syncs: consolidated, cdc_only, or both.\n\n\* `consolidated` - consolidated\n\* `cdc_only` - cdc_only\n\* `both` - both'+ ),+ enabled_columns: zod+ .array(zod.string())+ .nullish()+ .describe(+ 'Names of source columns to sync. `null` (default) syncs all columns. Primary-key columns and the active incremental field are always retained, even if not listed here.'+ ),+ row_filters: zod+ .array(+ zod.object({+ column: zod.string(),+ operator: zod.string().describe('One of: > >= < <= = != IN \"NOT IN\".'),+ value: zod+ .unknown()+ .describe(+ "Comparison value; must match the column's type. For `IN` \/ `NOT IN`, a comma-separated list (e.g. `1, 2, 3` or `'a','b'`)."+ ),+ })+ )+ .nullish()+ .describe(+ "Predicates ANDed onto the source query so only matching rows sync. Each is `{column, operator, value}`; `null`\/empty (default) syncs all rows. The operator must be one of `> >= < <= = != IN \"NOT IN\"` and the value must match the column's type (for `IN`\/`NOT IN`, a comma-separated list like `1, 2, 3` or `'a','b'`). Applied on the next sync — not retroactive to already-synced rows."+ ),+ api_version: zod+ .string()+ .max(externalDataSchemasResyncCreateBodyApiVersionMax)+ .nullish()+ .describe(+ "Vendor API version override for this schema. `null` (default) syncs on the source's pinned version. Must be one of the source type's supported versions. User-managed: version-migration tooling never changes it. Not available for webhook-sync schemas."+ ),+ })+ .describe('A schema of an external data source: its sync configuration and the warehouse table it syncs into.')/*** Create, Read, Update and Delete External data Sources.