Skip to content

: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.

feat(devex): derive OpenAPI enum names from Choices classes (#92285)

Julian Bezbc048facc6d0
diff --git a/.agents/skills/improving-drf-endpoints/SKILL.md b/.agents/skills/improving-drf-endpoints/SKILL.md
index b2d35ed685fc..2f0c852bfdca 100644
--- a/.agents/skills/improving-drf-endpoints/SKILL.md
+++ b/.agents/skills/improving-drf-endpoints/SKILL.md
@@ -53,7 +53,7 @@ Work through this list for every serializer and viewset you touch.
3. **No bare `JSONField()`** — create a custom field class with `@extend_schema_field(TypedSchema)`
4. **`SerializerMethodField` has `@extend_schema_field`** on its `get_*` method
5. **`ChoiceField` has explicit `choices=`** with all valid values listed
-6. **Avoid collision-prone enum field names** — `format`, `type`, `status`, `kind`, `level`, `mode`, `state`, `platform`, `provider` clash with existing choices and fail CI under `--fail-on-warn`; pick a specific name or add an `ENUM_NAME_OVERRIDES` entry up front. A product enum's entry must point at a re-export in the product's `backend/facade/enums.py`, never at an internal module — an internal target goes stale invisibly when the product refactors (see [serializer-fields.md](references/serializer-fields.md#choicefield--explicit-choices))
+6. **Define choices as a `models.TextChoices` class** — the OpenAPI component is named after the class (`EarlyAccessFeature.Stage` -> `EarlyAccessFeatureStageEnum`, via `ChoicesEnumNameOverrides` in `posthog/openapi/enum_names.py`), so a class-backed enum never collides on field names like `format`, `type`, `status`, `kind`. Inline `choices=[...]` lists have no class to read, collide with existing choices, and fail CI under `--fail-on-warn`; an explicit `ENUM_NAME_OVERRIDES` entry in `posthog/settings/web.py` is the fallback for choice sets no class can carry, and a product enum's entry must point at a re-export in the product's `backend/facade/enums.py`, never at an internal module (see [serializer-fields.md](references/serializer-fields.md#choicefield--explicit-choices))
7. **Read vs write serializers are separate** when input shape differs from output
8. **Every success response is backed by a serializer** — returning raw dicts or untyped lists means no generated types downstream
diff --git a/.agents/skills/improving-drf-endpoints/references/serializer-fields.md b/.agents/skills/improving-drf-endpoints/references/serializer-fields.md
index 56fca8934ef7..85b7f772ab65 100644
--- a/.agents/skills/improving-drf-endpoints/references/serializer-fields.md
+++ b/.agents/skills/improving-drf-endpoints/references/serializer-fields.md
@@ -131,13 +131,15 @@ status = serializers.ChoiceField(
**Collision-prone field names.** Generic names like `format`, `type`, `status`,
`kind`, `level`, `mode`, `state`, `platform`, `provider` already exist on multiple
-components with different choices. Reusing one for a new ChoiceField means
-drf-spectacular auto-names your enum (`Format5eaEnum` and similar), which fails CI
-under `--fail-on-warn`. Either pick a more specific field name, or add a stable
-name to `ENUM_NAME_OVERRIDES` in `posthog/settings/web.py` when you introduce the
-field. Run `python manage.py find_enum_collisions` after the change — it prints
-a suggested override entry (pastable as-is for type-hint enum collisions; for
-ChoiceField collisions you fill in the Choices/Enum class path).
+components with different choices. A ChoiceField built from a
+`models.TextChoices` class is safe: the component is named after the class
+(`ChoicesEnumNameOverrides` in `posthog/openapi/enum_names.py`), independent of
+the field name. An inline `choices=[...]` list on a colliding field name makes
+drf-spectacular auto-name your enum (`Format5eaEnum` and similar), which fails CI
+under `--fail-on-warn` — so define the choices as a TextChoices class, or as a
+fallback add an explicit `ENUM_NAME_OVERRIDES` entry in
+`posthog/settings/web.py`. Run `python manage.py find_enum_collisions` after the
+change — it prints the colliding fields and a suggested override entry.
## DictField — typed values
diff --git a/.agents/skills/improving-drf-endpoints/references/viewset-annotations.md b/.agents/skills/improving-drf-endpoints/references/viewset-annotations.md
index cae3df01cd12..f2d4215c2fe7 100644
--- a/.agents/skills/improving-drf-endpoints/references/viewset-annotations.md
+++ b/.agents/skills/improving-drf-endpoints/references/viewset-annotations.md
@@ -200,13 +200,21 @@ drf-spectacular's `COMPONENT_SPLIT_PATCH` setting (enabled by default) handles
the PATCH case automatically, creating separate schemas for PATCH vs POST
since PATCH doesn't require all fields.
-## ENUM_NAME_OVERRIDES — fixing enum naming warnings
+## Enum naming — derived from Choices classes, overrides as fallback
-When multiple serializer fields share the same choice values (or the same field name
-is used across components with different choices), drf-spectacular emits warnings.
-These are fixed via `ENUM_NAME_OVERRIDES` in `posthog/settings/web.py`.
+Enum components are named after the `django.db.models.Choices` class that defines
+the choices: `ChoicesEnumNameOverrides` (`posthog/openapi/enum_names.py`) walks
+every Choices subclass at schema-build time and registers it under a name derived
+from its qualname. A field whose choices come from a TextChoices class therefore
+gets a stable name with no configuration.
-**The hash trap:** overrides must produce the same hash that drf-spectacular computes
+When choices have no class behind them (inline lists, computed lists, pydantic
+literals) and multiple fields collide, drf-spectacular emits warnings. Those are
+fixed by defining a TextChoices class, or as a fallback via the explicit
+`ENUM_NAME_OVERRIDES` dict in `posthog/settings/web.py`; the comment on the dict
+lists the reasons an entry can be required.
+
+**The hash trap** (applies to explicit entries): overrides must produce the same hash that drf-spectacular computes
at schema generation time. There are two different hash paths:
1. **ChoiceField** (model-backed fields) — drf-spectacular injects `x-spec-enum-id`
diff --git a/frontend/src/generated/core/api.schemas.ts b/frontend/src/generated/core/api.schemas.ts
index 1ac47c8a906e..2e9967482e8f 100644
--- a/frontend/src/generated/core/api.schemas.ts
+++ b/frontend/src/generated/core/api.schemas.ts
@@ -3495,9 +3495,9 @@ export const RestrictionTypeEnumApi = {
* * `clientwarnings` - Clientwarnings
* * `ai` - Ai
*/
-export type PipelinesEnumApi = (typeof PipelinesEnumApi)[keyof typeof PipelinesEnumApi]
+export type IngestionPipelineEnumApi = (typeof IngestionPipelineEnumApi)[keyof typeof IngestionPipelineEnumApi]
-export const PipelinesEnumApi = {
+export const IngestionPipelineEnumApi = {
Analytics: 'analytics',
SessionRecordings: 'session_recordings',
Errortracking: 'errortracking',
@@ -3523,7 +3523,7 @@ export interface EventIngestionRestrictionApi {
/** Event UUIDs the restriction applies to. Empty means it is not filtered by event UUID. */
event_uuids: string[]
/** Ingestion pipelines the restriction applies to. Filters combine with AND; values within a filter combine with OR. */
- pipelines: PipelinesEnumApi[]
+ pipelines: IngestionPipelineEnumApi[]
}
export interface SharePasswordApi {
@@ -3916,10 +3916,9 @@ export interface PatchedProjectSecretAPIKeyApi {
* * `Boolean` - Boolean
* * `Duration` - Duration
*/
-export type PropertyDefinitionTypeEnumApi =
- (typeof PropertyDefinitionTypeEnumApi)[keyof typeof PropertyDefinitionTypeEnumApi]
+export type PropertyTypeEnumApi = (typeof PropertyTypeEnumApi)[keyof typeof PropertyTypeEnumApi]
-export const PropertyDefinitionTypeEnumApi = {
+export const PropertyTypeEnumApi = {
DateTime: 'DateTime',
String: 'String',
Numeric: 'Numeric',
@@ -3941,7 +3940,7 @@ export interface EnterprisePropertyDefinitionApi {
readonly updated_by: UserBasicApi
/** @nullable */
readonly is_seen_on_filtered_events: boolean | null
- property_type?: PropertyDefinitionTypeEnumApi | BlankEnumApi | null
+ property_type?: PropertyTypeEnumApi | BlankEnumApi | null
verified?: boolean
/** @nullable */
readonly verified_at: string | null
@@ -3975,7 +3974,7 @@ export interface PatchedEnterprisePropertyDefinitionApi {
readonly updated_by?: UserBasicApi
/** @nullable */
readonly is_seen_on_filtered_events?: boolean | null
- property_type?: PropertyDefinitionTypeEnumApi | BlankEnumApi | null
+ property_type?: PropertyTypeEnumApi | BlankEnumApi | null
verified?: boolean
/** @nullable */
readonly verified_at?: string | null
@@ -4159,9 +4158,10 @@ export interface TeamBasicApi {
* * `6` - install
* * `9` - root
*/
-export type PluginsAccessLevelEnumApi = (typeof PluginsAccessLevelEnumApi)[keyof typeof PluginsAccessLevelEnumApi]
+export type OrganizationPluginsAccessLevelEnumApi =
+ (typeof OrganizationPluginsAccessLevelEnumApi)[keyof typeof OrganizationPluginsAccessLevelEnumApi]
-export const PluginsAccessLevelEnumApi = {
+export const OrganizationPluginsAccessLevelEnumApi = {
Number0: 0,
Number3: 3,
Number6: 6,
@@ -4172,10 +4172,10 @@ export const PluginsAccessLevelEnumApi = {
* * `bayesian` - Bayesian
* * `frequentist` - Frequentist
*/
-export type DefaultExperimentStatsMethodEnumApi =
- (typeof DefaultExperimentStatsMethodEnumApi)[keyof typeof DefaultExperimentStatsMethodEnumApi]
+export type OrganizationDefaultExperimentStatsMethodEnumApi =
+ (typeof OrganizationDefaultExperimentStatsMethodEnumApi)[keyof typeof OrganizationDefaultExperimentStatsMethodEnumApi]
-export const DefaultExperimentStatsMethodEnumApi = {
+export const OrganizationDefaultExperimentStatsMethodEnumApi = {
Bayesian: 'bayesian',
Frequentist: 'frequentist',
} as const
@@ -4197,7 +4197,7 @@ export interface OrganizationApi {
readonly created_at: string
readonly updated_at: string
readonly membership_level: OrganizationMembershipLevelEnumApi
- readonly plugins_access_level: PluginsAccessLevelEnumApi
+ readonly plugins_access_level: OrganizationPluginsAccessLevelEnumApi
readonly teams: readonly OrganizationApiTeamsItem[]
readonly projects: readonly OrganizationApiProjectsItem[]
/** @nullable */
@@ -4254,7 +4254,7 @@ export interface OrganizationApi {
*
* * `bayesian` - Bayesian
* * `frequentist` - Frequentist */
- default_experiment_stats_method?: DefaultExperimentStatsMethodEnumApi | BlankEnumApi | null
+ default_experiment_stats_method?: OrganizationDefaultExperimentStatsMethodEnumApi | BlankEnumApi | null
/** Default setting for 'Discard client IP data' for new projects in this organization. */
default_anonymize_ips?: boolean
/**
@@ -4721,10 +4721,10 @@ export interface GitHubReposRefreshResponseApi {
* * `approved` - Approved
* * `unidentified` - Unidentified
*/
-export type GitHubInstallRequestItemStatusEnumApi =
- (typeof GitHubInstallRequestItemStatusEnumApi)[keyof typeof GitHubInstallRequestItemStatusEnumApi]
+export type GitHubInstallRequestStatusEnumApi =
+ (typeof GitHubInstallRequestStatusEnumApi)[keyof typeof GitHubInstallRequestStatusEnumApi]
-export const GitHubInstallRequestItemStatusEnumApi = {
+export const GitHubInstallRequestStatusEnumApi = {
Pending: 'pending',
Approved: 'approved',
Unidentified: 'unidentified',
@@ -4740,7 +4740,7 @@ export interface GitHubInstallRequestItemApi {
* * `pending` - Pending
* * `approved` - Approved
* * `unidentified` - Unidentified */
- status: GitHubInstallRequestItemStatusEnumApi
+ status: GitHubInstallRequestStatusEnumApi
/**
* GitHub App installation id, set once the request is approved.
* @nullable
@@ -4909,9 +4909,10 @@ export interface OnboardingSkipRequestApi {
* * `android` - Android
* * `web` - Web
*/
-export type PushTokenPlatformEnumApi = (typeof PushTokenPlatformEnumApi)[keyof typeof PushTokenPlatformEnumApi]
+export type UserPushTokenPlatformEnumApi =
+ (typeof UserPushTokenPlatformEnumApi)[keyof typeof UserPushTokenPlatformEnumApi]
-export const PushTokenPlatformEnumApi = {
+export const UserPushTokenPlatformEnumApi = {
Ios: 'ios',
Android: 'android',
Web: 'web',
@@ -4928,7 +4929,7 @@ export interface UserPushTokenRegisterRequestApi {
* * `ios` - iOS
* * `android` - Android
* * `web` - Web */
- platform: PushTokenPlatformEnumApi
+ platform: UserPushTokenPlatformEnumApi
}
export interface UserPushTokenItemApi {
@@ -4939,7 +4940,7 @@ export interface UserPushTokenItemApi {
* * `ios` - iOS
* * `android` - Android
* * `web` - Web */
- platform: PushTokenPlatformEnumApi
+ platform: UserPushTokenPlatformEnumApi
/** When this token was first registered. */
created_at: string
/** Last time the mobile app re-registered this token. */
diff --git a/frontend/src/layout/navigation/EventIngestionRestrictionDetails.tsx b/frontend/src/layout/navigation/EventIngestionRestrictionDetails.tsx
index 7a3f079f870f..aab67f9ce435 100644
--- a/frontend/src/layout/navigation/EventIngestionRestrictionDetails.tsx
+++ b/frontend/src/layout/navigation/EventIngestionRestrictionDetails.tsx
@@ -1,7 +1,7 @@
import { LemonTag } from 'lib/lemon-ui/LemonTag'
import { EventIngestionRestriction, RestrictionType } from 'lib/logic/eventIngestionRestrictionLogic'
-import type { PipelinesEnumApi } from '~/generated/core/api.schemas'
+import type { IngestionPipelineEnumApi } from '~/generated/core/api.schemas'
interface RestrictionEffect {
label: string
@@ -38,7 +38,7 @@ const UNKNOWN_EFFECT: RestrictionEffect = {
description: 'Matching events are handled differently from normal. Contact support for details.',
}
-const PIPELINE_LABELS: Record<PipelinesEnumApi, string> = {
+const PIPELINE_LABELS: Record<IngestionPipelineEnumApi, string> = {
analytics: 'analytics',
session_recordings: 'session recordings',
errortracking: 'error tracking',
diff --git a/frontend/src/scenes/data-management/properties/PropertyDefinitionEditModal.tsx b/frontend/src/scenes/data-management/properties/PropertyDefinitionEditModal.tsx
index ca84f95dee3e..ab641d9a99e1 100644
--- a/frontend/src/scenes/data-management/properties/PropertyDefinitionEditModal.tsx
+++ b/frontend/src/scenes/data-management/properties/PropertyDefinitionEditModal.tsx
@@ -8,13 +8,13 @@ import { ObjectTags } from 'lib/components/ObjectTags/ObjectTags'
import { LemonField } from 'lib/lemon-ui/LemonField'
import { LemonTextArea } from 'lib/lemon-ui/LemonTextArea/LemonTextArea'
-import type { PropertyDefinitionTypeEnumApi } from '~/generated/core/api.schemas'
+import type { PropertyTypeEnumApi } from '~/generated/core/api.schemas'
import { tagsModel } from '~/models/tagsModel'
import { isCoreFilter } from '~/taxonomy/helpers'
import { PropertyDefinitionEditModalProps, propertyDefinitionEditModalLogic } from './propertyDefinitionEditModalLogic'
-const PROPERTY_TYPE_OPTIONS: { label: string; value: PropertyDefinitionTypeEnumApi }[] = [
+const PROPERTY_TYPE_OPTIONS: { label: string; value: PropertyTypeEnumApi }[] = [
{ value: 'DateTime', label: 'DateTime' },
{ value: 'String', label: 'String' },
{ value: 'Numeric', label: 'Numeric' },
@@ -115,7 +115,7 @@ export function PropertyDefinitionEditModal(props: PropertyDefinitionEditModalPr
<div className="ph-ignore-input">
<LemonField name="property_type" label="Property type" data-attr="property-type">
{({ value, onChange }) => (
- <LemonSelect<PropertyDefinitionTypeEnumApi>
+ <LemonSelect<PropertyTypeEnumApi>
value={value ?? undefined}
onChange={onChange}
options={PROPERTY_TYPE_OPTIONS}
diff --git a/frontend/src/scenes/data-management/properties/propertyDefinitionEditModalLogic.ts b/frontend/src/scenes/data-management/properties/propertyDefinitionEditModalLogic.ts
index abc8bc3aaa7a..7383d6d197c9 100644
--- a/frontend/src/scenes/data-management/properties/propertyDefinitionEditModalLogic.ts
+++ b/frontend/src/scenes/data-management/properties/propertyDefinitionEditModalLogic.ts
@@ -6,7 +6,7 @@ import { lemonToast } from 'lib/lemon-ui/LemonToast/LemonToast'
import { teamLogic } from 'scenes/teamLogic'
import { propertyDefinitionsPartialUpdate } from '~/generated/core/api'
-import type { EnterprisePropertyDefinitionApi, PropertyDefinitionTypeEnumApi } from '~/generated/core/api.schemas'
+import type { EnterprisePropertyDefinitionApi, PropertyTypeEnumApi } from '~/generated/core/api.schemas'
import { tagsModel } from '~/models/tagsModel'
export interface PropertyDefinitionEditModalProps {
@@ -18,7 +18,7 @@ export interface PropertyDefinitionEditModalProps {
export interface PropertyDefinitionEditForm {
description: string
hidden: boolean
- property_type: PropertyDefinitionTypeEnumApi | null
+ property_type: PropertyTypeEnumApi | null
tags: string[]
verified: boolean
}
diff --git a/frontend/src/scenes/experiments/experimentLogic.tsx b/frontend/src/scenes/experiments/experimentLogic.tsx
index ddf0bfa59cc6..2d196e0a820a 100644
--- a/frontend/src/scenes/experiments/experimentLogic.tsx
+++ b/frontend/src/scenes/experiments/experimentLogic.tsx
@@ -187,7 +187,7 @@ export type ExperimentTriggeredBy =
| 'experiment_config_change'
| 'metric_config_change'
-// Triggers that kick off a metrics recalculation. Each is also a valid API TriggerEnumApi value, so a
+// Triggers that kick off a metrics recalculation. Each is also a valid API ExperimentMetricsRecalculationTriggerEnumApi value, so a
// narrowed triggeredBy passes straight to triggerRecalculation. page_load and manual are handled elsewhere.
const RECALCULATION_TRIGGERS = ['experiment_config_change', 'metric_config_change', 'auto_refresh'] as const
diff --git a/frontend/src/scenes/experiments/experimentMetricsLogic.ts b/frontend/src/scenes/experiments/experimentMetricsLogic.ts
index 0a1af6b8eaa2..d41d8042041d 100644
--- a/frontend/src/scenes/experiments/experimentMetricsLogic.ts
+++ b/frontend/src/scenes/experiments/experimentMetricsLogic.ts
@@ -20,7 +20,7 @@ import {
} from 'products/experiments/frontend/generated/api'
import type {
ExperimentMetricsRecalculationApi,
- TriggerEnumApi,
+ ExperimentMetricsRecalculationTriggerEnumApi,
} from 'products/experiments/frontend/generated/api.schemas'
type ExperimentSavedMetric = {
@@ -260,8 +260,8 @@ export interface experimentMetricsLogicActions {
setSecondaryMetricsResultsErrors: (errors: (unknown | null)[]) => {
errors: unknown[]
}
- triggerRecalculation: (trigger?: TriggerEnumApi) => {
- trigger: TriggerEnumApi
+ triggerRecalculation: (trigger?: ExperimentMetricsRecalculationTriggerEnumApi) => {
+ trigger: ExperimentMetricsRecalculationTriggerEnumApi
}
}
@@ -309,7 +309,7 @@ export const experimentMetricsLogic = kea<experimentMetricsLogicType>([
actions({
setCurrentRecalculation: (recalculation: ExperimentMetricsRecalculationApi | null) => ({ recalculation }),
loadLatestRecalculation: true,
- triggerRecalculation: (trigger: TriggerEnumApi = 'manual') => ({ trigger }),
+ triggerRecalculation: (trigger: ExperimentMetricsRecalculationTriggerEnumApi = 'manual') => ({ trigger }),
pollRecalculation: (recalculationId: string) => ({ recalculationId }),
setPrimaryMetricsResults: (results: CachedNewExperimentQueryResponse[]) => ({ results }),
setSecondaryMetricsResults: (results: CachedNewExperimentQueryResponse[]) => ({ results }),
diff --git a/frontend/src/scenes/max/maxThreadLogic.test.ts b/frontend/src/scenes/max/maxThreadLogic.test.ts
index 40f6c5e27e23..60c18c40ba0c 100644
--- a/frontend/src/scenes/max/maxThreadLogic.test.ts
+++ b/frontend/src/scenes/max/maxThreadLogic.test.ts
@@ -33,7 +33,7 @@ import { initKeaTests } from '~/test/init'
import { Conversation, ConversationDetail, ConversationStatus, ConversationType, OrganizationType } from '~/types'
import { attachedContextLogic, runStreamLogic } from 'products/posthog_ai/frontend/api/logics'
-import { RuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
+import { TaskRuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
import { EnhancedToolCall, TOOL_DEFINITIONS } from './max-constants'
import { maxContextLogic } from './maxContextLogic'
@@ -721,7 +721,7 @@ describe('maxThreadLogic', () => {
const conversation: ConversationDetail = {
...MOCK_IN_PROGRESS_CONVERSATION,
agent_runtime: 'sandbox',
- task: { id: 'pi-task', latest_run: 'pi-run', runtime: RuntimeEnumApi.Pi },
+ task: { id: 'pi-task', latest_run: 'pi-run', runtime: TaskRuntimeEnumApi.Pi },
}
logic.actions.setConversation(conversation)
@@ -1713,7 +1713,7 @@ describe('maxThreadLogic', () => {
function sandboxConversation(
currentRunId: string | null,
- runtime: RuntimeEnumApi = RuntimeEnumApi.Acp
+ runtime: TaskRuntimeEnumApi = TaskRuntimeEnumApi.Acp
): ConversationDetail {
return {
id: MOCK_CONVERSATION_ID,
@@ -1755,7 +1755,7 @@ describe('maxThreadLogic', () => {
it('does not bootstrap a Pi task run', async () => {
logic.unmount()
- const conversation = sandboxConversation(SANDBOX_RUN_ID, RuntimeEnumApi.Pi)
+ const conversation = sandboxConversation(SANDBOX_RUN_ID, TaskRuntimeEnumApi.Pi)
jest.spyOn(api.conversations, 'get').mockResolvedValue(conversation)
const logsSpy = jest.spyOn(api.tasks.runs, 'getLogEntries')
const streamSpy = mockStream()
@@ -3631,7 +3631,7 @@ describe('maxThreadLogic', () => {
maxLogicInstance.actions.setPendingBindTaskId('pi-task')
const taskSpy = jest
.spyOn(api.tasks, 'get')
- .mockResolvedValue({ id: 'pi-task', runtime: RuntimeEnumApi.Pi } as any)
+ .mockResolvedValue({ id: 'pi-task', runtime: TaskRuntimeEnumApi.Pi } as any)
const openSpy = jest.spyOn(api.conversations, 'open')
logic.actions.askMax('hello')
@@ -3648,7 +3648,7 @@ describe('maxThreadLogic', () => {
maxLogicInstance.actions.setPendingBindTaskId('acp-task')
const taskSpy = jest
.spyOn(api.tasks, 'get')
- .mockResolvedValue({ id: 'acp-task', runtime: RuntimeEnumApi.Acp } as any)
+ .mockResolvedValue({ id: 'acp-task', runtime: TaskRuntimeEnumApi.Acp } as any)
jest.spyOn(api.conversations, 'open').mockResolvedValue(sandboxRunResponse)
await expectLogic(logic, () => {
diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index 50a1d8a23101..47f5b92bb2a3 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -91,7 +91,7 @@ import type { IntegrationConfigApi } from 'products/integrations/frontend/genera
import type { CommentSlackThreadRefApi } from 'products/platform_features/frontend/generated/api.schemas'
import type { InsightFilterOverrideContextApi } from 'products/product_analytics/frontend/generated/api.schemas'
import type { AIPromptConfigApi, DeliveryConfigApi } from 'products/subscriptions/frontend/generated/api.schemas'
-import type { RuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
+import type { TaskRuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
import { CyclotronInputType } from 'products/workflows/frontend/Workflows/hogflows/steps/types'
import type { HogFlow } from 'products/workflows/frontend/Workflows/hogflows/types'
@@ -7782,7 +7782,7 @@ export interface Conversation {
*/
agent_runtime?: 'langgraph' | 'sandbox'
/** Backing products/tasks Task for sandbox conversations. Null until the first message creates it. `latest_run` is the newest TaskRun id used to bootstrap the sandbox stream. */
- task?: { id: string; latest_run: string | null; runtime?: RuntimeEnumApi } | null
+ task?: { id: string; latest_run: string | null; runtime?: TaskRuntimeEnumApi } | null
}
export interface ConversationDetail extends Conversation {
diff --git a/posthog/api/documentation.py b/posthog/api/documentation.py
index c2520f491a1b..d3771886a726 100644
--- a/posthog/api/documentation.py
+++ b/posthog/api/documentation.py
@@ -3,6 +3,7 @@ import re
from typing import Any, get_args
from django.core.exceptions import ImproperlyConfigured
+from django.db import models
from drf_spectacular.drainage import warn as spectacular_warn
from drf_spectacular.extensions import OpenApiAuthenticationExtension
@@ -234,6 +235,19 @@ class _PropertyFilterBase(serializers.Serializer):
)
+class StringMatchOperator(models.TextChoices):
+ EXACT = "exact", "exact"
+ IS_NOT = "is_not", "is_not"
+ ICONTAINS = "icontains", "icontains"
+ NOT_ICONTAINS = "not_icontains", "not_icontains"
+ STARTS_WITH = "starts_with", "starts_with"
+ NOT_STARTS_WITH = "not_starts_with", "not_starts_with"
+ ENDS_WITH = "ends_with", "ends_with"
+ NOT_ENDS_WITH = "not_ends_with", "not_ends_with"
+ REGEX = "regex", "regex"
+ NOT_REGEX = "not_regex", "not_regex"
+
+
class StringPropertyFilterSerializer(_PropertyFilterBase):
"""Matches string values with text-oriented operators."""
@@ -242,18 +256,7 @@ class StringPropertyFilterSerializer(_PropertyFilterBase):
required=True,
)
operator = serializers.ChoiceField(
- choices=[
- "exact",
- "is_not",
- "icontains",
- "not_icontains",
- "starts_with",
- "not_starts_with",
- "ends_with",
- "not_ends_with",
- "regex",
- "not_regex",
- ],
+ choices=StringMatchOperator.choices,
default="exact",
required=False,
help_text="String comparison operator.",
@@ -291,6 +294,12 @@ class ArrayPropertyFilterSerializer(_PropertyFilterBase):
)
+class DateOperator(models.TextChoices):
+ IS_DATE_EXACT = "is_date_exact", "is_date_exact"
+ IS_DATE_BEFORE = "is_date_before", "is_date_before"
+ IS_DATE_AFTER = "is_date_after", "is_date_after"
+
+
class DatePropertyFilterSerializer(_PropertyFilterBase):
"""Matches date/datetime values with date-specific operators."""
@@ -299,18 +308,23 @@ class DatePropertyFilterSerializer(_PropertyFilterBase):
required=True,
)
operator = serializers.ChoiceField(
- choices=["is_date_exact", "is_date_before", "is_date_after"],
+ choices=DateOperator.choices,
default="is_date_exact",
required=False,
help_text="Date comparison operator.",
)
+class ExistenceOperator(models.TextChoices):
+ IS_SET = "is_set", "is_set"
+ IS_NOT_SET = "is_not_set", "is_not_set"
+
+
class ExistencePropertyFilterSerializer(_PropertyFilterBase):
"""Checks whether a property is set or not, without comparing values."""
operator = serializers.ChoiceField(
- choices=["is_set", "is_not_set"],
+ choices=ExistenceOperator.choices,
required=True,
help_text="Existence check operator.",
)
@@ -369,7 +383,7 @@ class FeatureFlagFilterPropertyGenericSchemaSerializer(_FeatureFlagFilterPropert
class FeatureFlagFilterPropertyExistsSchemaSerializer(_FeatureFlagFilterPropertyBaseSerializer):
operator = serializers.ChoiceField(
- choices=["is_set", "is_not_set"],
+ choices=ExistenceOperator.choices,
required=True,
help_text="Existence operator.",
)
@@ -557,6 +571,11 @@ class FeatureFlagFiltersSchemaSerializer(serializers.Serializer):
property_help_text = "Filter events by event property, person property, cohort, groups and more."
+class PropertyGroupOperator(models.TextChoices):
+ AND = "AND", "AND"
+ OR = "OR", "OR"
+
+
class PropertySerializer(serializers.Serializer):
def run_validation(self, data=fields.empty):
if isinstance(data, list):
@@ -618,7 +637,7 @@ Or you can create more complicated queries with AND and OR:
}
```
""",
- choices=["AND", "OR"],
+ choices=PropertyGroupOperator.choices,
default="AND",
)
values = PropertyItemSerializer(many=True, required=True)
diff --git a/posthog/api/tagged_item.py b/posthog/api/tagged_item.py
index ed6b0ddcec69..265622775fb9 100644
--- a/posthog/api/tagged_item.py
+++ b/posthog/api/tagged_item.py
@@ -187,6 +187,12 @@ class TaggedItemSerializerMixin(serializers.Serializer):
BULK_UPDATE_TAGS_MAX_IDS = 500
+class BulkUpdateTagsAction(models.TextChoices):
+ ADD = "add", "add"
+ REMOVE = "remove", "remove"
+ SET = "set", "set"
+
+
class BulkUpdateTagsRequestSerializer(serializers.Serializer):
ids = serializers.ListField(
child=serializers.IntegerField(),
@@ -195,7 +201,7 @@ class BulkUpdateTagsRequestSerializer(serializers.Serializer):
help_text="List of object IDs to update tags on.",
)
action = serializers.ChoiceField(
- choices=["add", "remove", "set"],
+ choices=BulkUpdateTagsAction.choices,
help_text="'add' merges with existing tags, 'remove' deletes specific tags, 'set' replaces all tags.",
)
tags = serializers.ListField(
diff --git a/posthog/cdp/validation.py b/posthog/cdp/validation.py
index cf84fdc1e644..145045f56ad3 100644
--- a/posthog/cdp/validation.py
+++ b/posthog/cdp/validation.py
@@ -3,6 +3,8 @@ import json
import logging
from typing import Any, Optional
+from django.db import models
+
from drf_spectacular.utils import extend_schema_field
from rest_framework import serializers
from rest_framework.exceptions import ValidationError
@@ -573,9 +575,14 @@ class AnyInputField(serializers.Field):
return value
+class HogFunctionTemplating(models.TextChoices):
+ HOG = "hog", "hog"
+ LIQUID = "liquid", "liquid"
+
+
class InputsItemSerializer(serializers.Serializer):
value = AnyInputField(required=False)
- templating = serializers.ChoiceField(choices=["hog", "liquid"], required=False)
+ templating = serializers.ChoiceField(choices=HogFunctionTemplating.choices, required=False)
bytecode = serializers.ListField(required=False, read_only=True)
order = serializers.IntegerField(required=False, read_only=True)
transpiled = serializers.JSONField(required=False, read_only=True)
diff --git a/posthog/openapi/enum_name_guard.py b/posthog/openapi/enum_name_guard.py
new file mode 100644
index 000000000000..772101866c7f
--- /dev/null
+++ b/posthog/openapi/enum_name_guard.py
@@ -0,0 +1,82 @@
+"""Fail schema generation when two different choice sets get one component name.
+
+postprocess_schema_enums replaces each enum property with a reference to a
+component named for the property's choice-set hash. When two different hashes
+end up with the same name, the component registry keeps the first schema and
+drops the second one without a warning: the second property then references
+an enum with the wrong values. drf-spectacular never reports this, so these
+two hooks make it loud. record_enum_hashes runs before the enum hook and
+remembers the hash each property carries; check_enum_name_clashes runs right
+after it, resolves the component each of those properties references now, and
+raises when one component name serves two different hashes.
+"""
+
+from collections import defaultdict
+from typing import Any
+
+from posthog.openapi.enum_collisions import _collect_enum_metadata, _iter_prop_containers
+
+_RECORDED_ATTR = "_posthog_enum_prop_hashes"
+_VALUES_ATTR = "_posthog_enum_hash_values"
+
+
+def record_enum_hashes(result: dict[str, Any], generator: Any, request: Any, public: bool) -> dict[str, Any]:
+ schemas = result.get("components", {}).get("schemas", {})
+ _, hash_name_mapping, hash_values, _ = _collect_enum_metadata(schemas)
+ prop_hashes: dict[tuple[str, str], set[str]] = defaultdict(set)
+ for enum_hash, locations in hash_name_mapping.items():
+ for location in locations:
+ prop_hashes[location].add(enum_hash)
+ setattr(generator, _RECORDED_ATTR, dict(prop_hashes))
+ setattr(generator, _VALUES_ATTR, hash_values)
+ return result
+
+
+def check_enum_name_clashes(result: dict[str, Any], generator: Any, request: Any, public: bool) -> dict[str, Any]:
+ recorded: dict[tuple[str, str], set[str]] | None = getattr(generator, _RECORDED_ATTR, None)
+ if recorded is None:
+ return result
+ hash_values: dict[str, list[Any]] = getattr(generator, _VALUES_ATTR, {})
+
+ name_hashes: dict[str, set[str]] = defaultdict(set)
+ schemas = result.get("components", {}).get("schemas", {})
+ for component_name, props in _iter_prop_containers(schemas):
+ for prop_name, prop_schema in props.items():
+ hashes = recorded.get((component_name, prop_name))
+ # A property carrying several hashes (a oneOf of enums) cannot be
+ # attributed to a single reference, so it is skipped here.
+ if not hashes or len(hashes) != 1:
+ continue
+ ref_name = _resolve_enum_ref(prop_schema)
+ if ref_name:
+ name_hashes[ref_name].update(hashes)
+
+ clashes = {name: hashes for name, hashes in name_hashes.items() if len(hashes) > 1}
+ if clashes:
+ lines = []
+ for name, hashes in sorted(clashes.items()):
+ value_sets = " vs ".join(str(hash_values.get(h, "?")) for h in sorted(hashes))
+ lines.append(f' "{name}": {value_sets}')
+ raise RuntimeError(
+ "One enum component name refers to two different choice sets, and the schema "
+ "silently dropped one of them:\n"
+ + "\n".join(lines)
+ + "\nRename one of the Choices classes involved, or give one choice set its own "
+ "name in ENUM_NAME_OVERRIDES (posthog/settings/web.py)."
+ )
+ return result
+
+
+def _resolve_enum_ref(prop_schema: dict[str, Any]) -> str | None:
+ """Return the enum component a post-processed property references."""
+ schema = prop_schema
+ if schema.get("type") == "array":
+ schema = schema.get("items", {})
+ nodes = [schema, *schema.get("allOf", []), *schema.get("oneOf", []), *schema.get("anyOf", [])]
+ for node in nodes:
+ if not isinstance(node, dict):
+ continue
+ name = node.get("$ref", "").rsplit("/", 1)[-1]
+ if name and name not in ("BlankEnum", "NullEnum"):
+ return name
+ return None
diff --git a/posthog/openapi/enum_names.py b/posthog/openapi/enum_names.py
new file mode 100644
index 000000000000..ec0bfb33dbbf
--- /dev/null
+++ b/posthog/openapi/enum_names.py
@@ -0,0 +1,164 @@
+"""Derive OpenAPI enum component names from Django Choices classes.
+
+drf-spectacular names an enum component by hashing the field's (value, label)
+pairs and looking the hash up in ENUM_NAME_OVERRIDES first. Without an
+override entry the name is built from the field name and the serializer name,
+so it depends on which other serializers declare a field with the same name:
+a new colliding field anywhere renames an unrelated enum.
+
+ChoicesEnumNameOverrides makes the name independent of that pool. On first
+access it walks every django.db.models.Choices subclass and registers the class under a
+name derived from its qualname, so the schema name follows the definition
+site of the choices and never depends on the enum pool. The explicit dict
+passed in wins over anything derived; it is reserved for choice sets no class
+can name (see the comment on the dict in posthog/settings/web.py).
+
+This module is imported while settings load, before Django is set up, so
+everything Django- or DRF-related is imported inside the functions that run
+at schema-generation time.
+"""
+
+import inspect
+from collections import defaultdict
+from collections.abc import ItemsView, Iterable, Iterator, KeysView, Mapping, ValuesView
+from enum import Enum
+from typing import Any
+
+ENUM_SUFFIX = "Enum"
+
+
+def derive_enum_name(qualname: str) -> str | None:
+ """EarlyAccessFeature.Stage -> EarlyAccessFeatureStageEnum.
+
+ A nested part that restates the outer name is collapsed, so
+ Survey.SurveyType derives SurveyTypeEnum, not SurveySurveyTypeEnum.
+ Returns None for names that cannot appear in a schema (locals).
+ """
+ name: str | None = None
+ for part in qualname.split("."):
+ if not part or "<" in part:
+ return None
+ name = part if name is None or part.startswith(name) else f"{name}{part}"
+ if name is None:
+ return None
+ return name if name.endswith(ENUM_SUFFIX) else f"{name}{ENUM_SUFFIX}"
+
+
+def build_derived_overrides(classes: Iterable[type], explicit: Mapping[str, Any]) -> dict[str, Any]:
+ """Name -> Choices class for every class the explicit dict does not displace.
+
+ Two safety rules keep the result unambiguous:
+ - Classes with identical (value, label) pairs share one hash, so the
+ override machinery cannot tell them apart. None of them is registered;
+ the explicit dict has to name that choice set.
+ - Classes that derive the same name from different choice sets are all
+ skipped, because registering one would leave the others resolving to a
+ component with the wrong values.
+ Both cases, and a derived name colliding with a field-name based default,
+ are caught loudly by posthog.openapi.enum_name_guard.
+ """
+ explicit_hashes = {_choices_hash(value) for value in explicit.values()}
+ by_hash: dict[str, set[type]] = defaultdict(set)
+ for cls in classes:
+ cls_hash = _choices_hash(cls)
+ if cls_hash is not None:
+ by_hash[cls_hash].add(cls)
+
+ hashes_by_name: dict[str, list[str]] = defaultdict(list)
+ class_by_name: dict[str, type] = {}
+ for cls_hash, class_set in by_hash.items():
+ if cls_hash in explicit_hashes:
+ continue
+ names = {name for name in (derive_enum_name(cls.__qualname__) for cls in class_set) if name}
+ if len(names) != 1:
+ continue
+ name = names.pop()
+ if name in explicit:
+ continue
+ hashes_by_name[name].append(cls_hash)
+ class_by_name[name] = next(iter(class_set))
+ # The value registered is the class itself, so drf-spectacular applies its own
+ # normalization and the hash always matches the fields built from the class.
+ return {name: class_by_name[name] for name, hashes in hashes_by_name.items() if len(hashes) == 1}
+
+
+def _choices_hash(value: Any) -> str | None:
+ """Hash a choices value the way drf-spectacular's override loader does.
+
+ Used only to decide which derived entries an explicit entry displaces, so
+ a value that fails to normalize maps to None instead of raising.
+ """
+ from django.db.models import Choices # noqa: PLC0415 because settings import this module before Django is ready
+
+ from drf_spectacular.plumbing import ( # noqa: PLC0415 because importing DRF reads settings
+ deep_import_string,
+ list_hash,
+ )
+
+ try:
+ if isinstance(value, str):
+ value = deep_import_string(value)
+ if inspect.isclass(value) and issubclass(value, Choices):
+ value = value.choices
+ if inspect.isclass(value) and issubclass(value, Enum):
+ value = [(member.value, member.name) for member in value]
+ if callable(value):
+ value = value()
+ normalized: list[tuple[Any, Any]] = []
+ for choice in value:
+ if isinstance(choice, str) or choice is None:
+ normalized.append((choice, choice))
+ elif isinstance(choice[1], list | tuple):
+ normalized.extend(choice[1])
+ else:
+ normalized.append((choice[0], choice[1]))
+ return list_hash([(v, label) for v, label in normalized if v not in ("", None)])
+ except Exception:
+ return None
+
+
+def _all_subclasses(cls: type) -> Iterator[type]:
+ for sub in cls.__subclasses__():
+ yield sub
+ yield from _all_subclasses(sub)
+
+
+class ChoicesEnumNameOverrides(Mapping[str, Any]):
+ """A lazy ENUM_NAME_OVERRIDES value: explicit entries over derived ones.
+
+ The mapping is built on every read from the Choices classes imported at
+ that moment. drf-spectacular reads it once per process, inside schema
+ generation, after every serializer module (and with them every Choices
+ class) has been imported. The result is deliberately not cached here: a
+ read from a partially imported process (a test, a management command)
+ must not freeze an incomplete mapping for the schema build that follows.
+ """
+
+ def __init__(self, explicit: dict[str, Any]) -> None:
+ self._explicit = explicit
+
+ def __getitem__(self, key: str) -> Any:
+ return self._load()[key]
+
+ def __iter__(self) -> Iterator[str]:
+ return iter(self._load())
+
+ def __len__(self) -> int:
+ return len(self._load())
+
+ # The Mapping default views call __getitem__ once per key, which would
+ # rebuild the derived mapping for every entry. One build serves the view.
+ def keys(self) -> KeysView[str]:
+ return self._load().keys()
+
+ def values(self) -> ValuesView[Any]:
+ return self._load().values()
+
+ def items(self) -> ItemsView[str, Any]:
+ return self._load().items()
+
+ def _load(self) -> dict[str, Any]:
+ from django.db.models import Choices # noqa: PLC0415 because settings import this module before Django is ready
+
+ derived = build_derived_overrides(_all_subclasses(Choices), self._explicit)
+ return {**derived, **self._explicit}
diff --git a/posthog/openapi/test/test_enum_names.py b/posthog/openapi/test/test_enum_names.py
new file mode 100644
index 000000000000..189a165f6f6e
--- /dev/null
+++ b/posthog/openapi/test/test_enum_names.py
@@ -0,0 +1,52 @@
+from django.db import models
+from django.test import SimpleTestCase
+
+from parameterized import parameterized
+
+from posthog.openapi.enum_names import build_derived_overrides, derive_enum_name
+
+
+class Fruit(models.TextChoices):
+ APPLE = "apple", "Apple"
+ PEAR = "pear", "Pear"
+
+
+class FruitCopy(models.TextChoices):
+ APPLE = "apple", "Apple"
+ PEAR = "pear", "Pear"
+
+
+class Basket(models.TextChoices):
+ SMALL = "small", "Small"
+ LARGE = "large", "Large"
+
+
+class TestDeriveEnumName(SimpleTestCase):
+ @parameterized.expand(
+ [
+ ("plain class", "Fruit", "FruitEnum"),
+ ("nested class", "EarlyAccessFeature.Stage", "EarlyAccessFeatureStageEnum"),
+ ("repeated prefix collapses", "Survey.SurveyType", "SurveyTypeEnum"),
+ ("existing suffix kept", "Basket.BasketEnum", "BasketEnum"),
+ ("locals rejected", "make_choices.<locals>.Fruit", None),
+ ]
+ )
+ def test_derives(self, _name: str, qualname: str, expected: str | None) -> None:
+ assert derive_enum_name(qualname) == expected
+
+
+class TestBuildDerivedOverrides(SimpleTestCase):
+ def test_registers_class_under_derived_name(self) -> None:
+ overrides = build_derived_overrides([Fruit, Basket], {})
+ assert overrides == {"FruitEnum": Fruit, "BasketEnum": Basket}
+
+ def test_identical_choice_sets_are_left_to_the_explicit_dict(self) -> None:
+ overrides = build_derived_overrides([Fruit, FruitCopy, Basket], {})
+ assert overrides == {"BasketEnum": Basket}
+
+ def test_explicit_entry_displaces_derived_by_name_and_by_hash(self) -> None:
+ explicit = {"FruitEnum": ["kiwi"], "ProduceEnum": [["apple", "Apple"], ["pear", "Pear"]]}
+ overrides = build_derived_overrides([Fruit, Basket], explicit)
+ # FruitEnum is taken by name, and Fruit's own pairs are taken by hash
+ # through ProduceEnum, so only Basket survives.
+ assert overrides == {"BasketEnum": Basket}
diff --git a/posthog/settings/web.py b/posthog/settings/web.py
index 7ce69e866cfe..48b0980f5496 100644
--- a/posthog/settings/web.py
+++ b/posthog/settings/web.py
@@ -7,6 +7,7 @@ import structlog
from corsheaders.defaults import default_headers
from whitenoise.compress import Compressor
+from posthog.openapi.enum_names import ChoicesEnumNameOverrides
from posthog.scopes import get_scope_descriptions
from posthog.settings.base_variables import BASE_DIR, CLOUD_DEPLOYMENT, DEBUG, TEST
from posthog.settings.utils import generate_rsa_private_key_pem, get_from_env, get_list, str_to_bool
@@ -530,7 +531,12 @@ SPECTACULAR_SETTINGS = {
"GET_MOCK_REQUEST": "posthog.api.documentation.build_openapi_mock_request",
"PREPROCESSING_HOOKS": ["posthog.api.documentation.preprocess_exclude_path_format"],
"POSTPROCESSING_HOOKS": [
+ # The guard pair around postprocess_schema_enums fails the build when two
+ # different choice sets resolve to one component name, which the enum hook
+ # would otherwise resolve by silently dropping one schema.
+ "posthog.openapi.enum_name_guard.record_enum_hashes",
"drf_spectacular.hooks.postprocess_schema_enums",
+ "posthog.openapi.enum_name_guard.check_enum_name_clashes",
"products.dashboards.backend.widget_specs.pydantic_openapi.inject_widget_spec_pydantic_components",
"posthog.api.documentation.custom_postprocessing_hook",
# Runs last so it sees the final post-processed spec. Emits drf-spectacular warnings
@@ -538,478 +544,204 @@ SPECTACULAR_SETTINGS = {
# so `--fail-on-warn` in `hogli build:openapi-schema` catches them in CI.
"posthog.api.documentation.lint_spec_consistency_hook",
],
- "ENUM_NAME_OVERRIDES": {
- # If CI is failing with "enum naming encountered a non-optimally resolvable
- # collision" / "Format5eaEnum"-style warnings from `hogli build:openapi-schema`,
- # this is the dict you need to add an entry to. The warning fails CI because
- # `--fail-on-warn` is set on the `spectacular` invocation in hogli.yaml.
- #
- # Workflow to resolve a collision:
- # 1. Run `python manage.py find_enum_collisions` — it prints the field name,
- # the auto-generated name (e.g. `Format5eaEnum`), the enum values, which
- # components share the hash, and a suggested override entry. The suggestion
- # is pastable as-is for inline-list collisions (type-hint enums and
- # ChoiceFields with plain `choices=["A", "B"]`); only ChoiceFields with
- # custom labels (TextChoices where labels differ from values) need the
- # Choices/Enum class path filled in.
- # 2. Add the suggested entry below (pick the right category — see "hash trap"
- # note below). Optionally rename the key from the auto-generated name to a
- # more semantic one to improve the generated schema type's name.
- # 3. Re-run `hogli build:openapi-schema` locally to confirm the warning is gone.
- #
- # Full guide (when to use which pattern, anti-patterns, MCP/typegen implications):
- # /improving-drf-endpoints (skill — invoke it for the walkthrough)
- #
- # Hash trap — overrides fall into two categories depending on how drf-spectacular
- # hashes them, and using the wrong format silently fails (the override is ignored
- # and the warning persists):
- #
- # 1. Model class paths — used for ChoiceField-backed enums whose labels differ
- # from their values (typical `TextChoices` with explicit labels). The override
- # must point to the same Choices/Enum class so _load_enum_name_overrides hashes
- # identically to the x-spec-enum-id.
- #
- # 2. Inline value lists — used for Enum type-hint enums (SerializerMethodField
- # return types) AND ChoiceFields whose choices are plain lists (labels equal
- # values). The override must be a plain value list, which
- # _load_enum_name_overrides normalizes to (value, value) tuples — matching
- # both the no-x-spec-enum-id type-hint path and the inline-choices ChoiceField
- # path (drf-spectacular generates the x-spec-enum-id from the same tuples).
- # --- Model class paths (ChoiceField x-spec-enum-id hashes) ---
- "SignalReportRefundReasonEnum": "products.signals.backend.models.SignalReportRefund.Reason",
- "ScoutConfigStatusEnum": "products.signals.backend.models.SignalScoutConfig.Status",
- "ScoutConfigPauseReasonEnum": "products.signals.backend.models.SignalScoutConfig.PauseReason",
- "ScoutConfigNetworkAccessEnum": "products.signals.backend.models.SignalScoutConfig.NetworkAccess",
- # Shared by growth's identity-matching `tier` and the scout suggestion `confidence` fields.
- "ConfidenceTierEnum": ["low", "medium", "high"],
- # `source_product` names the same choice set on several signals components, so pin one name.
- "SignalSourceProductEnum": "products.signals.backend.enums.signal_source_product_choices",
- "EngineeringAnalyticsPRStateEnum": "products.engineering_analytics.backend.facade.contracts.PRState",
- "QuarantineModeEnum": "products.engineering_analytics.backend.facade.contracts.QuarantineMode",
- "CITestRunnerEnum": "products.engineering_analytics.backend.facade.contracts.CITestRunner",
- "RestrictionLevelEnum": "products.dashboards.backend.models.dashboard.Dashboard.RestrictionLevel",
- "DashboardSavedViewScopeEnum": "products.dashboards.backend.models.dashboard_saved_view.DashboardSavedView.Scope",
- "OrganizationMembershipLevelEnum": "posthog.models.organization.OrganizationMembership.Level",
- "SetupTaskId": "posthog.models.team.setup_tasks.SetupTaskId",
- "SurveyType": "products.surveys.backend.models.Survey.SurveyType",
- "ConversationStatus": "products.posthog_ai.backend.models.assistant.Conversation.Status",
- "ConversationType": "products.posthog_ai.backend.models.assistant.Conversation.Type",
- "DetailModeEnum": "products.ai_observability.backend.summarization.models.SummarizationMode",
- "SavedQueryStatusEnum": "products.data_modeling.backend.models.datawarehouse_saved_query.DataWarehouseSavedQuery.Status",
- "PushTokenPlatformEnum": "posthog.models.user_push_token.UserPushToken.Platform",
- "PropertyDefinitionTypeEnum": "products.event_definitions.backend.models.property_definition.PropertyType",
- "ExternalDataSourceTypeEnum": "products.warehouse_sources.backend.facade.types.ExternalDataSourceType",
- "ExperimentMetricKindEnum": "products.ai_observability.backend.models.score_definitions.ScoreDefinition.Kind",
- "EvaluationTargetEnum": "products.ai_observability.backend.models.evaluations.EvaluationTarget",
- "IntegrationKindEnum": "posthog.models.integration.Integration.IntegrationKind",
- # Shared by TaskCreate.origin_product and TaskWrite.origin_product. Needs naming because
- # WarmTaskRequest.origin_product offers only the warmable subset, so "origin_product" alone
- # no longer identifies one choice set. Keyed to the name the generator already produced
- # (`OriginProductEnumApi`) so naming it doesn't rename the type its consumers import.
- "OriginProductEnum": "products.tasks.backend.models.Task.OriginProduct",
- "TicketStatusEnum": "products.conversations.backend.models.constants.Status",
- "EmailChannelKindEnum": "products.conversations.backend.models.team_conversations_email_config.EmailChannelKind",
- "EmailThreadMessageDirectionEnum": "products.conversations.backend.models.email_thread.EmailThreadMessageDirection",
- "EmailThreadParticipantKindEnum": "products.conversations.backend.models.email_thread.EmailThreadParticipantKind",
- # Shared by Ticket.priority and TicketViewFilters.priority (same choice set).
- "TicketPriorityEnum": "products.conversations.backend.models.constants.Priority",
- "TicketChannelFilterEnum": "products.conversations.backend.api.ticket_filters.TICKET_CHANNEL_FILTER_CHOICES",
- "TicketSlaFilterEnum": "products.conversations.backend.api.ticket_filters.TICKET_SLA_FILTER_CHOICES",
- "TicketTagsMatchEnum": "products.conversations.backend.api.ticket_filters.TICKET_TAGS_MATCH_CHOICES",
- "TicketSortOrderEnum": "products.conversations.backend.api.ticket_filters.TICKET_SORT_ORDER_CHOICES",
- "BatchImportStatusEnum": "products.managed_migrations.backend.models.batch_imports.BatchImport.Status",
- # Shared by HogFlowBatchJob.status and HogFlowBatchJobCancelResponse.status (same choice set).
- "HogFlowBatchJobStatusEnum": "products.workflows.backend.models.hog_flow_batch_job.HogFlowBatchJob.State",
- # Shared by ExperimentMetricsRecalculation.status and ActiveRecalculationRun.status (same choice set).
- "MetricsRecalculationStatusEnum": (
- "products.experiments.backend.models.experiment.ExperimentMetricsRecalculation.Status"
- ),
- "AnnouncementStatusEnum": "products.customer_analytics.backend.models.announcement.Announcement.Status",
- "AnnouncementDeliveryStatusEnum": "products.customer_analytics.backend.models.announcement_delivery.AnnouncementDelivery.Status",
- "FeatureRequestStatusEnum": "products.customer_analytics.backend.models.feature_request.FeatureRequestStatus",
- "HealthIssueStatusEnum": "posthog.models.health_issue.HealthIssue.Status",
- "HealthIssueSeverityEnum": "posthog.models.health_issue.HealthIssue.Severity",
- "IngestionWarningSeverityEnum": "posthog.api.ingestion_warnings_v2.INGESTION_WARNING_SEVERITIES",
- "BillingAlertMetricEnum": "products.billing_alerts.backend.models.BillingAlertConfiguration.Metric",
- "BillingAlertStateEnum": "products.billing_alerts.backend.models.BillingAlertConfiguration.State",
- # Shared by ChangeRequest.state and ChangeRequestSummary.state (same choice set).
- "ChangeRequestStateEnum": "products.approvals.backend.models.ChangeRequestState",
- # Disambiguates from the same-valued inline enum on the signals LogsAlertStateChangeSignalExtra contract.
- "LogsAlertThresholdOperatorEnum": "products.logs.backend.models.LogsAlertConfiguration.ThresholdOperator",
- # Shared by _LogsGroupByBody.groupBySource and _LogsGroupByDimension.source (labels == values).
- "LogsGroupBySourceEnum": "products.logs.backend.group_by_query_runner.GROUP_SOURCES",
- "LLMProviderEnum": "products.ai_observability.backend.models.provider_keys.LLMProvider",
- "EvaluationReportFrequencyEnum": (
- "products.ai_observability.backend.models.evaluation_reports.EvaluationReport.Frequency"
- ),
- "HogFlowStatusEnum": "products.workflows.backend.models.hog_flow.hog_flow.HogFlow.State",
- "MCPAuthTypeEnum": "products.mcp_store.backend.models.AUTH_TYPE_CHOICES",
- "UtmIssueKindEnum": "products.marketing_analytics.backend.services.types.UTM_ISSUE_KIND_CHOICES",
- # Shared by ConversionGoalSummary.kind and GoalExplanation.kind (same choice set).
- "ConversionGoalKindEnum": "products.marketing_analytics.backend.hogql_queries.constants.CONVERSION_GOAL_KIND_CHOICES",
- "MCPInstallationScopeEnum": ["personal", "shared"],
- # Same field name as the installation scope above, different values.
- "MCPAgentGrantScopeEnum": "products.mcp_store.backend.models.AGENT_GRANT_SCOPE_CHOICES",
- "MCPServiceAccountStatusEnum": "products.mcp_store.backend.models.SERVICE_ACCOUNT_STATUS_CHOICES",
- "MCPServerCategoryEnum": "products.mcp_store.backend.models.CATEGORY_CHOICES",
- "MCPToolApprovalStateEnum": "products.mcp_store.backend.models.APPROVAL_STATES",
- "MCPPolicyPresetEnum": "products.mcp_store.backend.models.POLICY_PRESET_CHOICES",
- "MCPAuditDecisionEnum": "products.mcp_store.backend.models.AUDIT_DECISION_CHOICES",
- # Keeps agent_platform's approval-request enum on its pre-collision name now
- # that mcp_store also has a "decision" field.
- "DecisionEnum": ["approve", "reject"],
- # Disambiguates from data_modeling's node_type (table/view/matview/endpoint).
- "NotebookSQLV2NodeTypeEnum": ["hogql", "python"],
- "NotebookSQLV2RefKindEnum": ["hogql", "local"],
- "TaskRunStatusEnum": "products.tasks.backend.models.TaskRun.Status",
- # Inline-choices variant of TaskRun.Status (labels == values), shared by
- # TaskRunUpdate.status and ExperimentFlagCleanupTask.run_status.
- "RunStatusEnum": ["not_started", "queued", "in_progress", "completed", "failed", "cancelled"],
- "TaskRunEnvironmentEnum": "products.tasks.backend.models.TaskRun.Environment",
- "ReasoningEffortEnum": ["low", "medium", "high", "xhigh", "max", "ultracode", None],
- "TaskRunReasoningEffortEnum": [
- "off",
- "minimal",
- "low",
- "medium",
- "high",
- "xhigh",
- "max",
- "ultracode",
- None,
- ],
- "ModelEnum": "products.batch_exports.backend.models.batch_export.BatchExport.Model",
- # Shared by FileDownloadHogQLRequest.model and FileDownloadCountRowsRequest.model.
- "FileDownloadHogQLModelEnum": ["hogql"],
- "RecurrenceIntervalEnum": "products.reminders.backend.models.reminder.Reminder.RecurrenceInterval",
- "ScannerModelEnum": "products.replay_vision.backend.models.replay_scanner.ScannerModel",
- "ScannerTypeEnum": "products.replay_vision.backend.models.replay_scanner.ScannerType",
- "ScannerProviderEnum": "products.replay_vision.backend.models.replay_scanner.ScannerProvider",
- "ObservationStatusEnum": "products.replay_vision.backend.models.replay_observation.ObservationStatus",
- "ObservationTriggerEnum": "products.replay_vision.backend.models.replay_observation.ObservationTrigger",
- "BackfillStatusEnum": "products.replay_vision.backend.models.replay_scanner_backfill.BackfillStatus",
- "ExportedRecordingStatusEnum": "products.replay.backend.models.exported_recording.ExportedRecording.Status",
- "VisionActionRunStatusEnum": "products.replay_vision.backend.models.vision_action.VisionActionRunStatus",
- "VisionAlertMetricEnum": "products.replay_vision.backend.models.vision_action.AlertMetric",
- "VisionAlertDirectionEnum": "products.replay_vision.backend.models.vision_action.AlertDirection",
- "AutonomyPriorityEnum": "products.signals.backend.models.AutonomyPriority",
- "TriggerEnum": "products.experiments.backend.models.experiment.ExperimentMetricsRecalculation.Trigger",
- "ProductBriefTriggerEnum": "products.pulse.backend.models.ProductBrief.Trigger",
- "ProductBriefStatusEnum": "products.pulse.backend.models.ProductBrief.Status",
- "UserInterviewSearchDocumentTypeEnum": "products.user_interviews.backend.facade.enums.SEARCH_DOCUMENT_TYPES",
- "BatchExportRunStatusEnum": "products.batch_exports.backend.models.batch_export.BatchExportRun.Status",
- "HeatmapType": "products.web_analytics.backend.models.heatmap_saved.SavedHeatmap.Type",
- # Pin the subscriptions target enum to its existing name so adding customer_analytics'
- # `target_type` (below, inline-list category) doesn't auto-rename this shared-basename enum
- # and churn subscriptions' generated types.
- "TargetTypeEnum": "products.exports.backend.models.subscription.Subscription.SubscriptionTarget",
- # --- Inline value lists (type-hint enums, no x-spec-enum-id) ---
- "TileSpacingEnum": ["tight", "condensed", "standard", "relaxed", "wide"],
- "LayoutCompactionEnum": ["vertical", "horizontal", "stable"],
- "DesktopAccessReasonEnum": "products.tasks.backend.facade.contracts.DESKTOP_ACCESS_REASON_SCHEMA_VALUES",
- "PropertyGroupOperator": ["AND", "OR"],
- # `mode` is a generic field name; name the Redshift batch-export mode set explicitly.
- "RedshiftExportModeEnum": ["INSERT", "COPY"],
- # `severity` is shared by a data quality check, its overview projection, and the severity a
- # past run was judged at.
- "DataQualityCheckSeverityEnum": ["error", "warn"],
- # `scope`/`state` are generic field names; one shared name for the canvas state scope set.
- "CanvasStateScopeEnum": ["user", "shared"],
- # `kind` is a generic field name; one shared name for the canvas kind set.
- "CanvasKindEnum": ["freeform", "grid", "component"],
- # `status`/`op`/`columns`/`schemaVersion` are generic field names; pin the grid layout sets.
- "CanvasPlacementStatusEnum": ["pending", "generating", "live", "failed"],
- "CanvasLayoutOpEnum": ["set_grid", "add_placement", "update_placement", "remove_placement"],
- # Integer choice sets need explicit (value, label) pairs; a bare list is
- # only matched for string choices.
- "CanvasGridColumnsEnum": [(4, 4), (6, 6), (8, 8), (10, 10), (12, 12)],
- "CanvasLayoutSchemaVersionEnum": [(1, 1)],
- # `bucket` is a generic field name; name the experiment recordings bucket set explicitly.
- "ExperimentSessionBucketEnum": ["fired_any", "no_metric_activity", "funnel_dropoff"],
- # `strength` and `kind` are generic enough that the next one added anywhere would collide,
- # and `multiple_variant_handling` would otherwise generate a bare `MultipleVariantHandling`
- # sitting next to the schema type of the same name. One prefix for all three.
- "ExperimentWatchCardKindEnum": ["behavior", "friction", "metric"],
- "ExperimentWatchCardStrengthEnum": ["only", "far_more", "more", "slightly_more"],
- "ExperimentWatchMultipleVariantHandlingEnum": ["exclude", "first_seen"],
- # Account.slack_summary_cadence and AccountChannelSummary.cadence share the same
- # daily/weekly/monthly choice set; pin one name for both.
- "SlackSummaryCadenceEnum": ["daily", "weekly", "monthly"],
- # Canvas source diagnostics and marketing-analytics UTM issues share the same
- # error/warning severity pair; pin one shared name for the choice set.
- "DiagnosticSeverityEnum": ["error", "warning"],
- # ReviewHog findings expose the same priority set on two fields (effective_priority +
- # reviewer_priority); pin one shared name for the choice set.
- "ReviewIssuePriorityEnum": ["must_fix", "should_fix", "consider"],
- # Pin the customer_analytics custom-property target so it doesn't auto-collide with the
- # subscriptions `target_type` enum (which would rename subscriptions' generated type).
- "CustomPropertyDefinitionTargetType": ["account", "person"],
- # The metrics query's OTel metric-type filter; without a pinned name it
- # collides with the experiments MetricTypeEnum (funnel/ratio/...).
- "OtelMetricTypeEnum": ["gauge", "sum", "histogram", "exponential_histogram", "summary"],
- # Staff flags-cache warm-run status; 'state'/'scope' are collision-prone field names.
- "FlagsWarmRunStateEnum": ["running", "completed", "cancelled"],
- "FlagsWarmRunScopeEnum": ["all_teams", "teams_with_flags"],
- # bulk_update_tags exposes an identical add/remove/set `action` ChoiceField on both
- # BulkUpdateTagsRequest and its UUID subclass, so the shared enum can't be component-prefixed
- # unambiguously and auto-resolves to a hash name. Pin it to a stable name.
- "BulkUpdateTagsActionEnum": ["add", "remove", "set"],
- "ManagedWarehouseReadinessStateEnum": [
- "not_configured",
- "waiting",
- "backfilling",
- "up_to_date",
- "needs_attention",
- "sync_paused",
- ],
- "ManagedWarehouseMonitoringMetricEnum": [
- "query_rate",
- "error_ratio",
- "duration_p50",
- "duration_p95",
- "sessions_active",
- "s3_bytes_rate",
- "acquire_p95",
- "acquire_by_source",
- "storage_bytes",
- "worker_crash_rate",
- ],
- "ManagedWarehouseMonitoringWindowEnum": ["1h", "6h", "24h", "7d", "30d"],
- # Full signal taxonomy on the report `signals` endpoint; the source-config serializer's
- # subset enums keep their own auto-resolved names.
- "SignalSourceProduct": "products.signals.backend.enums.SIGNAL_SOURCE_PRODUCT_VALUES",
- "SignalSourceType": "products.signals.backend.enums.SIGNAL_SOURCE_TYPE_VALUES",
- # Shared by alert checks and analytics anomaly-investigation signals.
- "InvestigationVerdictEnum": ["true_positive", "false_positive", "inconclusive"],
- # Preserve Replay Vision's existing verdict type name after introducing the shared enum above.
- "VerdictEnum": ["yes", "no", "inconclusive"],
- # Tracing's span-filter `type` and attribute-breakdown `breakdownType` share one
- # choice set (top-level column vs span attribute vs resource attribute).
- "SpanPropertyTypeEnum": ["span", "span_attribute", "span_resource_attribute"],
- "LogsViewColumnTypeEnum": ["timestamp", "level", "source", "trace_id", "span_id", "message", "custom"],
- # The AI observability instrumentation checklist exposes the same key set twice: as `key` on a
- # graded check and as `check` on the dismiss/restore body. Mirrors CheckKey in
- # products/ai_observability/backend/instrumentation_checklist/grading.py; a member added there
- # changes the hash, so this warning comes back rather than drifting silently.
- "AIObservabilityInstrumentationCheckEnum": ["sessions", "tool_calls", "user_identity", "trace_structure"],
- # LoopTriggerWrite.type and LoopPreviewRequest.trigger_type share the same
- # schedule/github/api choice set — pin them to a single named enum.
- "LoopTriggerTypeEnum": ["schedule", "github", "api"],
- "CustomPropertyDisplayTypeEnum": [
- "text",
- "link",
- "number",
- "currency",
- "percent",
- "date",
- "datetime",
- "boolean",
- "select",
- ],
- # Pinned pre-emptively: the auto-name would be the collision-prone "ColorEnum", and adding a
- # palette color later would change the hash and silently rename the generated type.
- "CustomPropertyOptionColorEnum": [f"preset-{i}" for i in range(1, 11)],
- # Experiment now has two serializers (full ExperimentSerializer + ExperimentBasicSerializer
- # for the list endpoint) that both expose `type`/`status`. Pin both to their pre-existing
- # generated names so the shared enums don't get component-prefixed auto-names on collision.
- "ExperimentTypeEnum": ["web", "product", None],
- "ExperimentStatusEnum": ["draft", "running", "paused", "exposure_frozen", "stopped"],
- # Two `sync_frequency` ChoiceFields with different member sets: warehouse-source schemas
- # accept sub-15min cadences, while saved-query (view) materialization floors at 15min.
- # Pin both to stable names so neither gets a component-prefixed auto-name on collision.
- # "SyncFrequencyEnum" keeps the source-schema enum at its pre-existing generated name.
- "SyncFrequencyEnum": [
- "never",
- "1min",
- "5min",
- "15min",
- "30min",
- "1hour",
- "6hour",
- "12hour",
- "24hour",
- "7day",
- "30day",
- ],
- "SavedQuerySyncFrequencyEnum": [
- "never",
- "15min",
- "30min",
- "1hour",
- "6hour",
- "12hour",
- "24hour",
- "7day",
- "30day",
- ],
- # Same member set minus `never`, shared by the `materialize` body and by each cadence the
- # saved-query sync frequency bounds offer. Both mean "a cadence to run at", so one name.
- "MaterializeSyncFrequencyEnum": [
- "15min",
- "30min",
- "1hour",
- "6hour",
- "12hour",
- "24hour",
- "7day",
- "30day",
- ],
- # Two unrelated products now expose a `blocked_by` ChoiceField. Collision resolution keys off
- # how many choice sets share the field name and ignores overrides, so pinning only one still
- # component-prefixes the other. Both are pinned to keep either name stable as more appear.
- "SyncFrequencyBlockedByEnum": ["source", "consumer"],
- "BlockedByEnum": ["x_frame_options", "frame_ancestors"],
- # Signals now has two serializers (single SignalReportStateRequest + bulk
- # SignalReportBulkStateRequest) that both expose the same `state` ChoiceField. Pin the
- # shared enum to a stable name so it doesn't collide with the other `state` enums
- # (tasks, cdp) into a component-prefixed auto-name.
- "SignalReportStateEnum": ["suppressed", "potential", "resolved"],
- # Two serializers now expose an `op` ChoiceField (metrics filters and email-template design
- # patches). Pin both to stable names so neither gets a component-prefixed auto-name on collision.
- # "OpEnum" keeps the metrics filter enum at its pre-existing generated name.
- "OpEnum": ["eq", "neq", "regex", "not_regex"],
- "EmailTemplateDesignOperationEnum": [
- "update_content",
- "update_column",
- "update_row",
- "update_body",
- "add_content",
- "remove_content",
- "move_content",
- "add_row",
- "remove_row",
- ],
- "PropertyFilterTypeEnum": [
- "event",
- "event_metadata",
- "feature",
- "person",
- "person_metadata",
- "cohort",
- "element",
- "static-cohort",
- "dynamic-cohort",
- "precalculated-cohort",
- "group",
- "recording",
- "log_entry",
- "behavioral",
- "session",
- "hogql",
- "data_warehouse",
- "data_warehouse_person_property",
- "error_tracking_issue",
- "log",
- "log_attribute",
- "log_resource_attribute",
- "metric_attribute",
- "span",
- "span_attribute",
- "span_resource_attribute",
- "revenue_analytics",
- "account_custom_property",
- "flag",
- "workflow_variable",
- ],
- "AssigneeTypeEnum": ["user", "role"],
- "ScoutOriginEnum": ["canonical", "custom"],
- "FileFormatEnum": ["Parquet", "JSONLines"],
- "MetricAttributeScopeEnum": ["resource", "attribute", "auto"],
- "MetricQueryIntervalEnum": ["second", "minute", "minute_5", "minute_15", "hour", "hour_6", "day", "week"],
- "MetricAnomalyDirectionEnum": ["up", "down", "flat"],
- "WoWChangeDirectionEnum": ["Up", "Down"],
- "BatchExportIntervalEnum": ["hour", "day", "week", "every 5 minutes", "every 15 minutes"],
- "ErrorTrackingIssueOrderByEnum": ["last_seen", "first_seen", "occurrences", "users", "sessions"],
- "ErrorTrackingIssueSeverityRuleEnum": ["low", "medium", "high", "critical"],
- "ErrorTrackingIssueStatusEnum": ["archived", "active", "resolved", "pending_release", "suppressed", "all"],
- # Dashboard widget polymorphic OpenAPI: each per-type serializer uses a singleton
- # widget_type ChoiceField (one value). drf-spectacular hashes enum value sets — without
- # a per-type override they all collide into one mangled name. Override key is the
- # stable component name; value is the singleton list even though length is 1.
- "ActivityEventsListWidgetTypeEnum": ["activity_events_list"],
- "ErrorTrackingListWidgetTypeEnum": ["error_tracking_list"],
- "SessionReplayListWidgetTypeEnum": ["session_replay_list"],
- "ExperimentsListWidgetTypeEnum": ["experiments_list"],
- "ExperimentResultsWidgetTypeEnum": ["experiment_results"],
- "SurveyResultsWidgetTypeEnum": ["survey_results"],
- "LogsListWidgetTypeEnum": ["logs_list"],
- "ConversationsRecentTicketsWidgetTypeEnum": ["conversations_recent_tickets"],
- "OrderByEnum": ["latest", "earliest"],
- "PropertyGroupTypeEnum": ["cohort", "person", "group"],
- "ExistenceOperatorEnum": ["is_set", "is_not_set"],
- "TaskExecutionModeEnum": ["interactive", "background"],
- # Shared by ClaudeTaskRunCreateSchema and SandboxOpen (the conversations `open` body).
- "InitialPermissionModeEnum": ["default", "acceptEdits", "plan", "bypassPermissions", "auto"],
- "TaskRunBootstrapCreateRequestInitialPermissionModeEnum": [
- "default",
- "acceptEdits",
- "plan",
- "bypassPermissions",
- "auto",
- "read-only",
- "full-access",
- None,
- ],
- "HogFunctionTemplatingEnum": ["hog", "liquid"],
- "HogFlowEdgeTypeEnum": ["continue", "branch"],
- "SourceMatchEnum": ["none", "auto", "mapped"],
- "NotificationDestinationTypeEnum": ["slack", "webhook", "teams"],
- "TaskRunArtifactTypeEnum": [
- "plan",
- "context",
- "reference",
- "output",
- "artifact",
- "tree_snapshot",
- "user_attachment",
- "skill_bundle",
- ],
- "AdapterEnum": ["slack_message", "slack_canvas", "slack_file", "document_connector", "github_pr"],
- "TaskArtifactStatusEnum": ["active", "failed"],
- # Same-value collisions: identical choice sets appear on fields with different names.
- # href_matching, text_matching, url_matching on ActionStep all share the same choices.
- "ActionStepMatchingEnum": ["contains", "regex", "exact"],
- # descriptionContentType and thankYouMessageDescriptionContentType share values.
- "DescriptionContentTypeEnum": ["text", "html"],
- # Field-name collisions: multiple different choice sets use the same field name
- # across different serializer components.
- "StringMatchOperatorEnum": [
- "exact",
- "is_not",
- "icontains",
- "not_icontains",
- "starts_with",
- "not_starts_with",
- "ends_with",
- "not_ends_with",
- "regex",
- "not_regex",
- ],
- # Survey url/device match types keep the operator subset without starts_with/ends_with.
- "SurveyMatchTypeEnum": ["exact", "is_not", "icontains", "not_icontains", "regex", "not_regex"],
- "DateOperatorEnum": ["is_date_exact", "is_date_before", "is_date_after"],
- "DetailModeValueEnum": ["minimal", "detailed"],
- "LogsAlertConfigurationStateEnum": "products.logs.backend.models.LogsAlertConfiguration.State",
- # runtime_adapter on TaskRunCreateRequestSerializer (full set) vs
- # ClaudeTaskRunCreateSchemaSerializer and CodexTaskRunCreateSchemaSerializer (subsets).
- "RuntimeAdapterEnum": ["claude", "codex"],
- "ClaudeRuntimeAdapterEnum": ["claude"],
- "CodexRuntimeAdapterEnum": ["codex"],
- # StaffCacheEntryResponse.source and StaffCacheEntryStatus.source share the same
- # redis/miss choice set. Pin to a stable name so the collision doesn't auto-resolve
- # to a hash name.
- "StaffCacheSourceEnum": ["redis", "miss"],
- # StaffCacheEntryQuery/Response's singular `cache` field and StaffCacheMutation's
- # `caches` list item share the same evaluation/definitions choice set. Pin to a
- # stable name so "cache" and "caches" don't collide into a hash name.
- "StaffCacheKindEnum": ["evaluation", "definitions"],
- # Logs anomaly scan: `verdict` (per-bucket) and `kind` (per-issue) share the
- # spike/drop/silence choice set; pin one stable name for both. `stage` would
- # otherwise collide with EarlyAccessFeature's stage, so both sides get pinned.
- "LogsAnomalyVerdictEnum": ["spike", "drop", "silence"],
- "LogsAnomalyBaselineStageEnum": ["insufficient", "cold_start", "developing", "mature", None],
- "EarlyAccessFeatureStageEnum": "products.early_access_features.backend.models.EarlyAccessFeature.Stage",
- },
+ "ENUM_NAME_OVERRIDES": ChoicesEnumNameOverrides(
+ {
+ # Most enum components are named automatically: ChoicesEnumNameOverrides walks
+ # every django.db.models.Choices subclass at schema-build time and names the
+ # component after the class (EarlyAccessFeature.Stage -> EarlyAccessFeatureStageEnum),
+ # so defining choices as a TextChoices class is all a new enum needs. See
+ # posthog/openapi/enum_names.py for the derivation and its safety rules.
+ #
+ # An entry below is for a choice set no class can carry, and each group states
+ # why. drf-spectacular matches an entry to fields by a hash of the exact
+ # (value, label) pairs, so editing values or labels on either side silently
+ # detaches the entry. posthog/openapi/enum_name_guard.py and --fail-on-warn in
+ # `hogli build:openapi-schema` turn the fallout into a build failure.
+ # `python manage.py find_enum_collisions` diagnoses a fresh collision and
+ # suggests a fix.
+ #
+ # Two definitions share identical (value, label) pairs but mean different
+ # things. The hash cannot tell them apart, so no class is derived and the
+ # entry decides the name.
+ # Matches ErrorTrackingIssue severity (low/medium/high/critical).
+ "TicketPriorityEnum": "products.conversations.backend.models.constants.Priority",
+ # ExperimentMetricsRecalculation and ExperimentTimeseriesRecalculation both define this Status.
+ "MetricsRecalculationStatusEnum": "products.experiments.backend.models.experiment.ExperimentMetricsRecalculation.Status",
+ # Matches tasks' LoopVisibility (personal/team).
+ "MCPAgentGrantScopeEnum": "products.mcp_store.backend.models.AGENT_GRANT_SCOPE_CHOICES",
+ # BatchExport.Model and BatchExportOnDemand.Model are identical.
+ "ModelEnum": "products.batch_exports.backend.models.batch_export.BatchExport.Model",
+ # Matches Subscription frequency (daily/weekly/monthly).
+ "RecurrenceIntervalEnum": "products.reminders.backend.models.reminder.Reminder.RecurrenceInterval",
+ # Matches the messaging email channel setup provider list.
+ "ScannerProviderEnum": "products.replay_vision.backend.models.replay_scanner.ScannerProvider",
+ # vision_action and vision_alert both define AlertDirection.
+ "VisionAlertDirectionEnum": "products.replay_vision.backend.models.vision_action.AlertDirection",
+ # Matches replay_vision's VisionAlertState.
+ "LogsAlertConfigurationStateEnum": "products.logs.backend.models.LogsAlertConfiguration.State",
+ #
+ # The published name is already derived by a different choice set, so the
+ # entry holds this one apart.
+ "SlackSummaryCadenceEnum": ["daily", "weekly", "monthly"],
+ "ExperimentStatusEnum": ["draft", "running", "paused", "exposure_frozen", "stopped"],
+ "ErrorTrackingIssueStatusEnum": ["archived", "active", "resolved", "pending_release", "suppressed", "all"],
+ "TaskArtifactStatusEnum": ["active", "failed"],
+ #
+ # The same choice set is declared in more than one product. A shared Choices
+ # class would cross a product boundary, so the entry names the set centrally.
+ "RunStatusEnum": ["not_started", "queued", "in_progress", "completed", "failed", "cancelled"],
+ "DiagnosticSeverityEnum": ["error", "warning"],
+ "InitialPermissionModeEnum": ["default", "acceptEdits", "plan", "bypassPermissions", "auto"],
+ "NotificationDestinationTypeEnum": ["slack", "webhook", "teams"],
+ # growth's identity-matching tier and the signals scout suggestion confidence.
+ "ConfidenceTierEnum": ["low", "medium", "high"],
+ #
+ # The definition site is a deliberately Django-free module (facade contracts,
+ # signals taxonomy), so it cannot define a models.Choices class.
+ "SignalSourceProductEnum": "products.signals.backend.enums.signal_source_product_choices",
+ "EngineeringAnalyticsPRStateEnum": "products.engineering_analytics.backend.facade.contracts.PRState",
+ "QuarantineModeEnum": "products.engineering_analytics.backend.facade.contracts.QuarantineMode",
+ "CITestRunnerEnum": "products.engineering_analytics.backend.facade.contracts.CITestRunner",
+ "UserInterviewSearchDocumentTypeEnum": "products.user_interviews.backend.facade.enums.SEARCH_DOCUMENT_TYPES",
+ "DesktopAccessReasonEnum": "products.tasks.backend.facade.contracts.DESKTOP_ACCESS_REASON_SCHEMA_VALUES",
+ "SignalSourceProduct": "products.signals.backend.enums.SIGNAL_SOURCE_PRODUCT_VALUES",
+ "SignalSourceType": "products.signals.backend.enums.SIGNAL_SOURCE_TYPE_VALUES",
+ "ErrorTrackingIssueSeverityRuleEnum": ["low", "medium", "high", "critical"],
+ #
+ # The choices come from a typing.Literal via get_args; there is no class.
+ "BlockedByEnum": ["x_frame_options", "frame_ancestors"],
+ "PropertyFilterTypeEnum": [
+ "event",
+ "event_metadata",
+ "feature",
+ "person",
+ "person_metadata",
+ "cohort",
+ "element",
+ "static-cohort",
+ "dynamic-cohort",
+ "precalculated-cohort",
+ "group",
+ "recording",
+ "log_entry",
+ "behavioral",
+ "session",
+ "hogql",
+ "data_warehouse",
+ "data_warehouse_person_property",
+ "error_tracking_issue",
+ "log",
+ "log_attribute",
+ "log_resource_attribute",
+ "metric_attribute",
+ "span",
+ "span_attribute",
+ "span_resource_attribute",
+ "revenue_analytics",
+ "account_custom_property",
+ "flag",
+ "workflow_variable",
+ ],
+ "PropertyGroupTypeEnum": ["cohort", "person", "group"],
+ "TaskRunBootstrapCreateRequestInitialPermissionModeEnum": [
+ "default",
+ "acceptEdits",
+ "plan",
+ "bypassPermissions",
+ "auto",
+ "read-only",
+ "full-access",
+ None,
+ ],
+ #
+ # The choices are computed: a subset or union of another definition, a plain
+ # Python enum's values, or a per-widget constant. Converting each producer to
+ # a TextChoices class would delete its entry here.
+ "TicketChannelFilterEnum": "products.conversations.backend.api.ticket_filters.TICKET_CHANNEL_FILTER_CHOICES",
+ "TicketSlaFilterEnum": "products.conversations.backend.api.ticket_filters.TICKET_SLA_FILTER_CHOICES",
+ "TicketSortOrderEnum": "products.conversations.backend.api.ticket_filters.TICKET_SORT_ORDER_CHOICES",
+ "UtmIssueKindEnum": "products.marketing_analytics.backend.services.types.UTM_ISSUE_KIND_CHOICES",
+ "ConversionGoalKindEnum": "products.marketing_analytics.backend.hogql_queries.constants.CONVERSION_GOAL_KIND_CHOICES",
+ "ReasoningEffortEnum": ["low", "medium", "high", "xhigh", "max", "ultracode", None],
+ "TaskRunReasoningEffortEnum": [
+ "off",
+ "minimal",
+ "low",
+ "medium",
+ "high",
+ "xhigh",
+ "max",
+ "ultracode",
+ None,
+ ],
+ "TileSpacingEnum": ["tight", "condensed", "standard", "relaxed", "wide"],
+ "DataQualityCheckSeverityEnum": ["error", "warn"],
+ "CanvasStateScopeEnum": ["user", "shared"],
+ "CanvasKindEnum": ["freeform", "grid", "component"],
+ "CanvasPlacementStatusEnum": ["pending", "generating", "live", "failed"],
+ "CanvasGridColumnsEnum": [(4, 4), (6, 6), (8, 8), (10, 10), (12, 12)],
+ "CanvasLayoutSchemaVersionEnum": [(1, 1)],
+ "ExperimentSessionBucketEnum": ["fired_any", "no_metric_activity", "funnel_dropoff"],
+ "ExperimentWatchCardStrengthEnum": ["only", "far_more", "more", "slightly_more"],
+ "ExperimentWatchMultipleVariantHandlingEnum": ["exclude", "first_seen"],
+ "ReviewIssuePriorityEnum": ["must_fix", "should_fix", "consider"],
+ "OtelMetricTypeEnum": ["gauge", "sum", "histogram", "exponential_histogram", "summary"],
+ "VerdictEnum": ["yes", "no", "inconclusive"],
+ "AIObservabilityInstrumentationCheckEnum": ["sessions", "tool_calls", "user_identity", "trace_structure"],
+ "LoopTriggerTypeEnum": ["schedule", "github", "api"],
+ "CustomPropertyOptionColorEnum": [f"preset-{i}" for i in range(1, 11)],
+ "SavedQuerySyncFrequencyEnum": [
+ "never",
+ "15min",
+ "30min",
+ "1hour",
+ "6hour",
+ "12hour",
+ "24hour",
+ "7day",
+ "30day",
+ ],
+ "MaterializeSyncFrequencyEnum": [
+ "15min",
+ "30min",
+ "1hour",
+ "6hour",
+ "12hour",
+ "24hour",
+ "7day",
+ "30day",
+ ],
+ "AssigneeTypeEnum": ["user", "role"],
+ "TaskRunArtifactTypeEnum": [
+ "plan",
+ "context",
+ "reference",
+ "output",
+ "artifact",
+ "tree_snapshot",
+ "user_attachment",
+ "skill_bundle",
+ ],
+ "AdapterEnum": ["slack_message", "slack_canvas", "slack_file", "document_connector", "github_pr"],
+ "ActionStepMatchingEnum": ["contains", "regex", "exact"],
+ "DetailModeValueEnum": ["minimal", "detailed"],
+ "RuntimeAdapterEnum": ["claude", "codex"],
+ "ClaudeRuntimeAdapterEnum": ["claude"],
+ "CodexRuntimeAdapterEnum": ["codex"],
+ "StaffCacheKindEnum": ["evaluation", "definitions"],
+ #
+ # One single-value discriminator enum per dashboard widget.
+ # bin/build-dashboard-widget-types.py checks these against WIDGET_SPECS.
+ "ActivityEventsListWidgetTypeEnum": ["activity_events_list"],
+ "ErrorTrackingListWidgetTypeEnum": ["error_tracking_list"],
+ "SessionReplayListWidgetTypeEnum": ["session_replay_list"],
+ "ExperimentsListWidgetTypeEnum": ["experiments_list"],
+ "ExperimentResultsWidgetTypeEnum": ["experiment_results"],
+ "SurveyResultsWidgetTypeEnum": ["survey_results"],
+ "LogsListWidgetTypeEnum": ["logs_list"],
+ "ConversationsRecentTicketsWidgetTypeEnum": ["conversations_recent_tickets"],
+ }
+ ),
}
EXCEPTIONS_HOG = {"EXCEPTION_REPORTING": "posthog.exceptions.exception_reporting"}
diff --git a/products/ai_observability/frontend/generated/api.schemas.ts b/products/ai_observability/frontend/generated/api.schemas.ts
index 68a2893cc407..3247d9dc6a65 100644
--- a/products/ai_observability/frontend/generated/api.schemas.ts
+++ b/products/ai_observability/frontend/generated/api.schemas.ts
@@ -767,9 +767,10 @@ export const EvaluationStatusEnumApi = {
* * `model_not_found` - Model not found
* * `hog_error` - Hog evaluation code failed
*/
-export type StatusReasonEnumApi = (typeof StatusReasonEnumApi)[keyof typeof StatusReasonEnumApi]
+export type EvaluationStatusReasonEnumApi =
+ (typeof EvaluationStatusReasonEnumApi)[keyof typeof EvaluationStatusReasonEnumApi]
-export const StatusReasonEnumApi = {
+export const EvaluationStatusReasonEnumApi = {
ProviderKeyRequired: 'provider_key_required',
ProviderKeyDeleted: 'provider_key_deleted',
NoDefaultModel: 'no_default_model',
@@ -962,7 +963,7 @@ export interface EvaluationApi {
/** Whether the evaluation runs automatically on new $ai_generation events. */
enabled?: boolean
readonly status: EvaluationStatusEnumApi
- readonly status_reason: StatusReasonEnumApi | null
+ readonly status_reason: EvaluationStatusReasonEnumApi | null
/**
* Additional detail for the current system-disabled status. This is only populated when the detail is safe to show in the evaluation UI.
* @nullable
@@ -1099,7 +1100,7 @@ export interface PatchedEvaluationApi {
/** Whether the evaluation runs automatically on new $ai_generation events. */
enabled?: boolean
readonly status?: EvaluationStatusEnumApi
- readonly status_reason?: StatusReasonEnumApi | null
+ readonly status_reason?: EvaluationStatusReasonEnumApi | null
/**
* Additional detail for the current system-disabled status. This is only populated when the detail is safe to show in the evaluation UI.
* @nullable
@@ -1833,9 +1834,10 @@ export interface EvaluationReportRunContentApi {
* * `partial_failure` - Partial Failure
* * `failed` - Failed
*/
-export type DeliveryStatusEnumApi = (typeof DeliveryStatusEnumApi)[keyof typeof DeliveryStatusEnumApi]
+export type EvaluationReportRunDeliveryStatusEnumApi =
+ (typeof EvaluationReportRunDeliveryStatusEnumApi)[keyof typeof EvaluationReportRunDeliveryStatusEnumApi]
-export const DeliveryStatusEnumApi = {
+export const EvaluationReportRunDeliveryStatusEnumApi = {
Pending: 'pending',
Generated: 'generated',
Delivered: 'delivered',
@@ -1863,7 +1865,7 @@ export interface EvaluationReportRunApi {
* * `delivered` - Delivered
* * `partial_failure` - Partial Failure
* * `failed` - Failed */
- readonly delivery_status: DeliveryStatusEnumApi
+ readonly delivery_status: EvaluationReportRunDeliveryStatusEnumApi
/** Delivery error messages. Empty when all configured deliveries succeeded. */
readonly delivery_errors: readonly string[]
/** When this report run was created. */
@@ -2096,9 +2098,9 @@ export interface PatchedReviewQueueUpdateApi {
* * `numeric` - numeric
* * `boolean` - boolean
*/
-export type ExperimentMetricKindEnumApi = (typeof ExperimentMetricKindEnumApi)[keyof typeof ExperimentMetricKindEnumApi]
+export type ScoreDefinitionKindEnumApi = (typeof ScoreDefinitionKindEnumApi)[keyof typeof ScoreDefinitionKindEnumApi]
-export const ExperimentMetricKindEnumApi = {
+export const ScoreDefinitionKindEnumApi = {
Categorical: 'categorical',
Numeric: 'numeric',
Boolean: 'boolean',
@@ -2184,7 +2186,7 @@ export interface ScoreDefinitionApi {
readonly id: string
readonly name: string
readonly description: string
- readonly kind: ExperimentMetricKindEnumApi
+ readonly kind: ScoreDefinitionKindEnumApi
readonly archived: boolean
/** Current immutable configuration version number. */
readonly current_version: number
@@ -2228,7 +2230,7 @@ export interface ScoreDefinitionCreateApi {
* * `categorical` - categorical
* * `numeric` - numeric
* * `boolean` - boolean */
- kind: ExperimentMetricKindEnumApi
+ kind: ScoreDefinitionKindEnumApi
/** New scorers are always created as active. */
archived?: boolean
/** Initial immutable scorer configuration. */
diff --git a/products/ai_observability/frontend/scoreDefinitions/AIObservabilityScoreDefinitions.tsx b/products/ai_observability/frontend/scoreDefinitions/AIObservabilityScoreDefinitions.tsx
index b8fa6d48eac2..b3676f1aaffa 100644
--- a/products/ai_observability/frontend/scoreDefinitions/AIObservabilityScoreDefinitions.tsx
+++ b/products/ai_observability/frontend/scoreDefinitions/AIObservabilityScoreDefinitions.tsx
@@ -21,7 +21,7 @@ import { updatedAtColumn } from '~/lib/lemon-ui/LemonTable/columnUtils'
import { AccessControlLevel, AccessControlResourceType } from '~/types'
import type {
- ExperimentMetricKindEnumApi as ScoreDefinitionKind,
+ ScoreDefinitionKindEnumApi as ScoreDefinitionKind,
ScoreDefinitionApi as ScoreDefinition,
} from '../generated/api.schemas'
import {
diff --git a/products/ai_observability/frontend/scoreDefinitions/aiObservabilityScoreDefinitionsLogic.ts b/products/ai_observability/frontend/scoreDefinitions/aiObservabilityScoreDefinitionsLogic.ts
index 9dcbf629c992..a918183fe55f 100644
--- a/products/ai_observability/frontend/scoreDefinitions/aiObservabilityScoreDefinitionsLogic.ts
+++ b/products/ai_observability/frontend/scoreDefinitions/aiObservabilityScoreDefinitionsLogic.ts
@@ -19,7 +19,7 @@ import {
llmAnalyticsScoreDefinitionsPartialUpdate as aiObservabilityScoreDefinitionsPartialUpdate,
} from '../generated/api'
import type {
- ExperimentMetricKindEnumApi as ScoreDefinitionKind,
+ ScoreDefinitionKindEnumApi as ScoreDefinitionKind,
PaginatedScoreDefinitionListApi,
ScoreDefinitionApi,
} from '../generated/api.schemas'
diff --git a/products/ai_observability/frontend/scoreDefinitions/scoreDefinitionModalUtils.ts b/products/ai_observability/frontend/scoreDefinitions/scoreDefinitionModalUtils.ts
index b8332591f9a7..0f5969e95c36 100644
--- a/products/ai_observability/frontend/scoreDefinitions/scoreDefinitionModalUtils.ts
+++ b/products/ai_observability/frontend/scoreDefinitions/scoreDefinitionModalUtils.ts
@@ -4,7 +4,7 @@ import type {
BooleanScoreDefinitionConfigApi as BooleanScoreDefinitionConfig,
CategoricalScoreDefinitionConfigApi as CategoricalScoreDefinitionConfig,
CategoricalScoreOptionApi as ScoreDefinitionOption,
- ExperimentMetricKindEnumApi as ScoreDefinitionKind,
+ ScoreDefinitionKindEnumApi as ScoreDefinitionKind,
NumericScoreDefinitionConfigApi as NumericScoreDefinitionConfig,
ScoreDefinitionApi as ScoreDefinition,
ScoreDefinitionConfigApi as ScoreDefinitionConfig,
diff --git a/products/ai_observability/frontend/traceReviews/types.ts b/products/ai_observability/frontend/traceReviews/types.ts
index cada050d159a..9e707e02a135 100644
--- a/products/ai_observability/frontend/traceReviews/types.ts
+++ b/products/ai_observability/frontend/traceReviews/types.ts
@@ -1,7 +1,7 @@
import type { UserBasicType } from '~/types'
import type {
- ExperimentMetricKindEnumApi as ScoreDefinitionKind,
+ ScoreDefinitionKindEnumApi as ScoreDefinitionKind,
ScoreDefinitionConfigApi as ScoreDefinitionConfig,
} from '../generated/api.schemas'
diff --git a/products/annotations/frontend/generated/api.schemas.ts b/products/annotations/frontend/generated/api.schemas.ts
index 5deb0056e930..ccc2ae42f3dc 100644
--- a/products/annotations/frontend/generated/api.schemas.ts
+++ b/products/annotations/frontend/generated/api.schemas.ts
@@ -11,9 +11,10 @@
* * `USR` - user
* * `GIT` - GitHub
*/
-export type CreationTypeEnumApi = (typeof CreationTypeEnumApi)[keyof typeof CreationTypeEnumApi]
+export type AnnotationCreationTypeEnumApi =
+ (typeof AnnotationCreationTypeEnumApi)[keyof typeof AnnotationCreationTypeEnumApi]
-export const CreationTypeEnumApi = {
+export const AnnotationCreationTypeEnumApi = {
Usr: 'USR',
Git: 'GIT',
} as const
@@ -109,7 +110,7 @@ export interface AnnotationApi {
*
* * `USR` - user
* * `GIT` - GitHub */
- creation_type?: CreationTypeEnumApi
+ creation_type?: AnnotationCreationTypeEnumApi
/**
* Optional insight ID to attach this annotation to. Must belong to the current project.
* @nullable
@@ -181,7 +182,7 @@ export interface PatchedAnnotationApi {
*
* * `USR` - user
* * `GIT` - GitHub */
- creation_type?: CreationTypeEnumApi
+ creation_type?: AnnotationCreationTypeEnumApi
/**
* Optional insight ID to attach this annotation to. Must belong to the current project.
* @nullable
diff --git a/products/batch_exports/backend/api/batch_export.py b/products/batch_exports/backend/api/batch_export.py
index 461ee25e73cb..96e6f01d3fe9 100644
--- a/products/batch_exports/backend/api/batch_export.py
+++ b/products/batch_exports/backend/api/batch_export.py
@@ -11,7 +11,7 @@ from typing import Any, TypedDict, cast
from urllib.parse import urlparse
from django.conf import settings
-from django.db import transaction
+from django.db import models, transaction
from django.utils.timezone import now
import structlog
@@ -560,6 +560,11 @@ class RedshiftCopyInputsSerializer(serializers.Serializer):
)
+class RedshiftExportMode(models.TextChoices):
+ INSERT = "INSERT", "INSERT"
+ COPY = "COPY", "COPY"
+
+
class RedshiftDestinationConfigSerializer(serializers.Serializer):
"""Typed configuration for a Redshift batch-export destination.
@@ -598,7 +603,7 @@ class RedshiftDestinationConfigSerializer(serializers.Serializer):
help_text="Data type used for JSON-like columns such as event properties.",
)
mode = serializers.ChoiceField(
- choices=["INSERT", "COPY"],
+ choices=RedshiftExportMode.choices,
required=False,
default="INSERT",
help_text="How rows reach Redshift: batched INSERT statements, or COPY from files staged in S3.",
diff --git a/products/batch_exports/backend/api/file_download.py b/products/batch_exports/backend/api/file_download.py
index 49dd5f7745d8..aca6d1255c6a 100644
--- a/products/batch_exports/backend/api/file_download.py
+++ b/products/batch_exports/backend/api/file_download.py
@@ -5,7 +5,7 @@ import datetime as dt
import posixpath
from django.conf import settings
-from django.db import connection, transaction
+from django.db import connection, models, transaction
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
@@ -61,10 +61,19 @@ _FILE_DOWNLOAD_BATCH_EXPORTS_LOCK_KEY = int.from_bytes(
)
+class FileFormat(models.TextChoices):
+ PARQUET = "Parquet", "Parquet"
+ JSONLINES = "JSONLines", "JSONLines"
+
+
+class FileDownloadHogQLModel(models.TextChoices):
+ HOGQL = "hogql", "hogql"
+
+
class FileDownloadDestinationFileConfigSerializer(serializers.Serializer):
"""Typed configuration for a FileDownload batch-export destination."""
- format = serializers.ChoiceField(choices=["Parquet", "JSONLines"], default="Parquet", help_text="File format")
+ format = serializers.ChoiceField(choices=FileFormat.choices, default="Parquet", help_text="File format")
compression = serializers.ChoiceField(
choices=["zstd", "gzip", "brotli", "lz4", "snappy"],
required=False,
@@ -125,7 +134,7 @@ class FileDownloadHogQLRequestSerializer(serializers.Serializer):
"""Typed configuration for the hogql model."""
file = FileDownloadDestinationFileConfigSerializer()
- model = serializers.ChoiceField(choices=["hogql"])
+ model = serializers.ChoiceField(choices=FileDownloadHogQLModel.choices)
hogql_query = serializers.CharField(help_text=HOGQL_QUERY_HELP_TEXT)
@@ -133,7 +142,7 @@ class FileDownloadCountRowsRequestSerializer(serializers.Serializer):
"""Request shape for counting the rows a file download batch export would produce."""
model = serializers.ChoiceField(
- choices=["hogql"],
+ choices=FileDownloadHogQLModel.choices,
help_text="Model to count rows for. Only 'hogql' is supported.",
)
hogql_query = serializers.CharField(help_text=HOGQL_QUERY_HELP_TEXT)
diff --git a/products/batch_exports/backend/models/batch_export.py b/products/batch_exports/backend/models/batch_export.py
index 001a63ecf534..2ea443fe8151 100644
--- a/products/batch_exports/backend/models/batch_export.py
+++ b/products/batch_exports/backend/models/batch_export.py
@@ -279,13 +279,15 @@ class BatchExportRun(UUIDTModel):
raise ValueError("One of batch export or batch export on demand must always be defined")
-BATCH_EXPORT_INTERVALS = [
- ("hour", "hour"),
- ("day", "day"),
- ("week", "week"),
- ("every 5 minutes", "every 5 minutes"),
- ("every 15 minutes", "every 15 minutes"),
-]
+class BatchExportInterval(models.TextChoices):
+ HOUR = "hour", "hour"
+ DAY = "day", "day"
+ WEEK = "week", "week"
+ EVERY_5_MINUTES = "every 5 minutes", "every 5 minutes"
+ EVERY_15_MINUTES = "every 15 minutes", "every 15 minutes"
+
+
+BATCH_EXPORT_INTERVALS = BatchExportInterval.choices
BATCH_EXPORT_INTERVAL_TO_START_JITTER = {
"hour": timedelta(minutes=15),
diff --git a/products/batch_exports/frontend/generated/api.schemas.ts b/products/batch_exports/frontend/generated/api.schemas.ts
index d3189db097ab..3b1c111f3fc3 100644
--- a/products/batch_exports/frontend/generated/api.schemas.ts
+++ b/products/batch_exports/frontend/generated/api.schemas.ts
@@ -43,10 +43,10 @@ export const BlankEnumApi = {
* * `NoOp` - Noop
* * `FileDownload` - File Download
*/
-export type BatchExportDestinationTypeEnumApi =
- (typeof BatchExportDestinationTypeEnumApi)[keyof typeof BatchExportDestinationTypeEnumApi]
+export type BatchExportDestinationDestinationEnumApi =
+ (typeof BatchExportDestinationDestinationEnumApi)[keyof typeof BatchExportDestinationDestinationEnumApi]
-export const BatchExportDestinationTypeEnumApi = {
+export const BatchExportDestinationDestinationEnumApi = {
S3: 'S3',
AwsS3: 'AwsS3',
S3Compatible: 'S3Compatible',
@@ -468,7 +468,7 @@ export interface BatchExportDestinationApi {
* * `HTTP` - Http
* * `NoOp` - Noop
* * `FileDownload` - File Download */
- type: BatchExportDestinationTypeEnumApi
+ type: BatchExportDestinationDestinationEnumApi
/** Destination-specific configuration. Fields depend on `type`. Credentials for integration-backed destinations (Databricks, AzureBlob, BigQuery, Postgres, AwsS3, S3Compatible, Snowflake, Redshift) are NOT stored here — they live in the linked Integration. Secret fields are stripped from responses. */
config: BatchExportDestinationConfigApi
/**
diff --git a/products/billing/frontend/generated/api.schemas.ts b/products/billing/frontend/generated/api.schemas.ts
index 1ed86eb463ce..12e1d553e534 100644
--- a/products/billing/frontend/generated/api.schemas.ts
+++ b/products/billing/frontend/generated/api.schemas.ts
@@ -119,9 +119,10 @@ export interface BillingTimeSeriesResponseApi {
* * `spend` - Spend
* * `projected_spend` - Projected spend
*/
-export type BillingAlertMetricEnumApi = (typeof BillingAlertMetricEnumApi)[keyof typeof BillingAlertMetricEnumApi]
+export type BillingAlertConfigurationMetricEnumApi =
+ (typeof BillingAlertConfigurationMetricEnumApi)[keyof typeof BillingAlertConfigurationMetricEnumApi]
-export const BillingAlertMetricEnumApi = {
+export const BillingAlertConfigurationMetricEnumApi = {
Spend: 'spend',
ProjectedSpend: 'projected_spend',
} as const
@@ -140,9 +141,10 @@ export const CurrencyEnumApi = {
* * `absolute_value` - Absolute value
* * `absolute_increase` - Absolute increase
*/
-export type ThresholdTypeEnumApi = (typeof ThresholdTypeEnumApi)[keyof typeof ThresholdTypeEnumApi]
+export type BillingAlertConfigurationThresholdTypeEnumApi =
+ (typeof BillingAlertConfigurationThresholdTypeEnumApi)[keyof typeof BillingAlertConfigurationThresholdTypeEnumApi]
-export const ThresholdTypeEnumApi = {
+export const BillingAlertConfigurationThresholdTypeEnumApi = {
RelativeIncrease: 'relative_increase',
AbsoluteValue: 'absolute_value',
AbsoluteIncrease: 'absolute_increase',
@@ -155,9 +157,10 @@ export const ThresholdTypeEnumApi = {
* * `snoozed` - Snoozed
* * `broken` - Broken
*/
-export type BillingAlertStateEnumApi = (typeof BillingAlertStateEnumApi)[keyof typeof BillingAlertStateEnumApi]
+export type BillingAlertConfigurationStateEnumApi =
+ (typeof BillingAlertConfigurationStateEnumApi)[keyof typeof BillingAlertConfigurationStateEnumApi]
-export const BillingAlertStateEnumApi = {
+export const BillingAlertConfigurationStateEnumApi = {
NotFiring: 'not_firing',
Firing: 'firing',
Errored: 'errored',
@@ -243,7 +246,7 @@ export interface BillingAlertConfigurationApi {
*
* * `spend` - Spend
* * `projected_spend` - Projected spend */
- metric?: BillingAlertMetricEnumApi
+ metric?: BillingAlertConfigurationMetricEnumApi
/** Server-controlled currency for spend values.
*
* * `USD` - USD */
@@ -255,7 +258,7 @@ export interface BillingAlertConfigurationApi {
* * `relative_increase` - Relative increase
* * `absolute_value` - Absolute value
* * `absolute_increase` - Absolute increase */
- threshold_type?: ThresholdTypeEnumApi
+ threshold_type?: BillingAlertConfigurationThresholdTypeEnumApi
/**
* Reserved for future increase-over-baseline rules. Not used by absolute value alerts.
* @nullable
@@ -292,7 +295,7 @@ export interface BillingAlertConfigurationApi {
* * `errored` - Errored
* * `snoozed` - Snoozed
* * `broken` - Broken */
- readonly state: BillingAlertStateEnumApi
+ readonly state: BillingAlertConfigurationStateEnumApi
/**
* Minimum hours between repeated firing notifications.
* @minimum 0
@@ -376,7 +379,7 @@ export interface PatchedBillingAlertConfigurationApi {
*
* * `spend` - Spend
* * `projected_spend` - Projected spend */
- metric?: BillingAlertMetricEnumApi
+ metric?: BillingAlertConfigurationMetricEnumApi
/** Server-controlled currency for spend values.
*
* * `USD` - USD */
@@ -388,7 +391,7 @@ export interface PatchedBillingAlertConfigurationApi {
* * `relative_increase` - Relative increase
* * `absolute_value` - Absolute value
* * `absolute_increase` - Absolute increase */
- threshold_type?: ThresholdTypeEnumApi
+ threshold_type?: BillingAlertConfigurationThresholdTypeEnumApi
/**
* Reserved for future increase-over-baseline rules. Not used by absolute value alerts.
* @nullable
@@ -425,7 +428,7 @@ export interface PatchedBillingAlertConfigurationApi {
* * `errored` - Errored
* * `snoozed` - Snoozed
* * `broken` - Broken */
- readonly state?: BillingAlertStateEnumApi
+ readonly state?: BillingAlertConfigurationStateEnumApi
/**
* Minimum hours between repeated firing notifications.
* @minimum 0
@@ -538,7 +541,7 @@ export interface BillingAlertEventApi {
*
* * `spend` - Spend
* * `projected_spend` - Projected spend */
- readonly metric: BillingAlertMetricEnumApi
+ readonly metric: BillingAlertConfigurationMetricEnumApi
/**
* Metric value for the evaluated billing date.
* @nullable
@@ -572,7 +575,7 @@ export interface BillingAlertEventApi {
* * `errored` - Errored
* * `snoozed` - Snoozed
* * `broken` - Broken */
- readonly state_before: BillingAlertStateEnumApi | null
+ readonly state_before: BillingAlertConfigurationStateEnumApi | null
/** Alert state after this event was applied.
*
* * `not_firing` - Not firing
@@ -580,7 +583,7 @@ export interface BillingAlertEventApi {
* * `errored` - Errored
* * `snoozed` - Snoozed
* * `broken` - Broken */
- readonly state_after: BillingAlertStateEnumApi | null
+ readonly state_after: BillingAlertConfigurationStateEnumApi | null
/**
* When notifications for this event were delivered.
* @nullable
diff --git a/products/business_knowledge/frontend/generated/api.schemas.ts b/products/business_knowledge/frontend/generated/api.schemas.ts
index 7d0c0457f0a0..2bb7ec8d6045 100644
--- a/products/business_knowledge/frontend/generated/api.schemas.ts
+++ b/products/business_knowledge/frontend/generated/api.schemas.ts
@@ -119,10 +119,9 @@ export interface GapTopicActionResultApi {
* * `url` - URL
* * `file` - File
*/
-export type KnowledgeSourceSourceTypeEnumApi =
- (typeof KnowledgeSourceSourceTypeEnumApi)[keyof typeof KnowledgeSourceSourceTypeEnumApi]
+export type SourceTypeEnumApi = (typeof SourceTypeEnumApi)[keyof typeof SourceTypeEnumApi]
-export const KnowledgeSourceSourceTypeEnumApi = {
+export const SourceTypeEnumApi = {
Text: 'text',
Url: 'url',
File: 'file',
@@ -134,10 +133,9 @@ export const KnowledgeSourceSourceTypeEnumApi = {
* * `ready` - Ready
* * `error` - Error
*/
-export type KnowledgeSourceStatusEnumApi =
- (typeof KnowledgeSourceStatusEnumApi)[keyof typeof KnowledgeSourceStatusEnumApi]
+export type SourceStatusEnumApi = (typeof SourceStatusEnumApi)[keyof typeof SourceStatusEnumApi]
-export const KnowledgeSourceStatusEnumApi = {
+export const SourceStatusEnumApi = {
Pending: 'pending',
Processing: 'processing',
Ready: 'ready',
@@ -149,9 +147,9 @@ export const KnowledgeSourceStatusEnumApi = {
* * `not_modified` - Not modified
* * `error` - Error
*/
-export type LastRefreshStatusEnumApi = (typeof LastRefreshStatusEnumApi)[keyof typeof LastRefreshStatusEnumApi]
+export type RefreshStatusEnumApi = (typeof RefreshStatusEnumApi)[keyof typeof RefreshStatusEnumApi]
-export const LastRefreshStatusEnumApi = {
+export const RefreshStatusEnumApi = {
Success: 'success',
NotModified: 'not_modified',
Error: 'error',
@@ -201,8 +199,8 @@ export interface KnowledgeSourceApi {
readonly id: string
readonly team_id: number
readonly name: string
- readonly source_type: KnowledgeSourceSourceTypeEnumApi
- readonly status: KnowledgeSourceStatusEnumApi
+ readonly source_type: SourceTypeEnumApi
+ readonly status: SourceStatusEnumApi
readonly error_message: string
/** Number of documents belonging to this source. */
readonly document_count: number
@@ -214,7 +212,7 @@ export interface KnowledgeSourceApi {
readonly source_url: string
/** @nullable */
readonly last_refresh_at: string | null
- readonly last_refresh_status: LastRefreshStatusEnumApi
+ readonly last_refresh_status: RefreshStatusEnumApi
readonly last_refresh_error: string
readonly refresh_interval: RefreshIntervalEnumApi
/**
diff --git a/products/canvas/backend/presentation/serializers.py b/products/canvas/backend/presentation/serializers.py
index e17998a1fa2d..1a8375075e9d 100644
--- a/products/canvas/backend/presentation/serializers.py
+++ b/products/canvas/backend/presentation/serializers.py
@@ -1,6 +1,7 @@
from typing import Any
from django.conf import settings
+from django.db import models
from drf_spectacular.utils import extend_schema_field
from rest_framework import serializers
@@ -455,11 +456,18 @@ class CanvasPlacementChangesSerializer(CanvasPlacementSerializer):
field.required = False
+class CanvasLayoutOp(models.TextChoices):
+ SET_GRID = "set_grid", "set_grid"
+ ADD_PLACEMENT = "add_placement", "add_placement"
+ UPDATE_PLACEMENT = "update_placement", "update_placement"
+ REMOVE_PLACEMENT = "remove_placement", "remove_placement"
+
+
class CanvasLayoutPatchOperationSerializer(serializers.Serializer):
"""One surgical layout operation."""
op = serializers.ChoiceField(
- choices=["set_grid", "add_placement", "update_placement", "remove_placement"],
+ choices=CanvasLayoutOp.choices,
help_text="The operation to apply.",
)
grid = CanvasGridSerializer(required=False, help_text="For set_grid: the new grid definition.")
diff --git a/products/cohorts/frontend/generated/api.schemas.ts b/products/cohorts/frontend/generated/api.schemas.ts
index 369c82be51c1..0e08eef9b2a5 100644
--- a/products/cohorts/frontend/generated/api.schemas.ts
+++ b/products/cohorts/frontend/generated/api.schemas.ts
@@ -116,9 +116,10 @@ export interface StaffStuckCohortsResponseApi {
total_count: number
}
-export type PropertyGroupOperatorApi = (typeof PropertyGroupOperatorApi)[keyof typeof PropertyGroupOperatorApi]
+export type PropertyGroupOperatorEnumApi =
+ (typeof PropertyGroupOperatorEnumApi)[keyof typeof PropertyGroupOperatorEnumApi]
-export const PropertyGroupOperatorApi = {
+export const PropertyGroupOperatorEnumApi = {
And: 'AND',
Or: 'OR',
} as const
@@ -207,7 +208,7 @@ export interface PersonMetadataFilterApi {
* AND/OR group containing cohort filters. Named to avoid collision with analytics Group model.
*/
export interface CohortFilterGroupApi {
- type: PropertyGroupOperatorApi
+ type: PropertyGroupOperatorEnumApi
values: (BehavioralFilterApi | CohortFilterApi | PersonFilterApi | PersonMetadataFilterApi | CohortFilterGroupApi)[]
}
diff --git a/products/conversations/backend/api/ticket_filters.py b/products/conversations/backend/api/ticket_filters.py
index 8ffcb9818672..dae5b08cca9e 100644
--- a/products/conversations/backend/api/ticket_filters.py
+++ b/products/conversations/backend/api/ticket_filters.py
@@ -16,6 +16,7 @@ from collections.abc import Mapping
from datetime import timedelta
from typing import TYPE_CHECKING, Any
+from django.db import models
from django.db.models import CharField, F, OrderBy, Q, QuerySet
from django.db.models.functions import Cast
from django.utils import timezone
@@ -58,7 +59,14 @@ VALID_CHANNEL_VALUES = frozenset(c.value for c in Channel)
# ChannelEnum/SlaEnum/OrderEnum in the shared OpenAPI namespace.
TICKET_CHANNEL_FILTER_CHOICES = [*(c.value for c in Channel), "all"]
TICKET_SLA_FILTER_CHOICES = [*SLA_FILTER_VALUES, "all"]
-TICKET_TAGS_MATCH_CHOICES = ["any", "all"]
+
+
+class TicketTagsMatch(models.TextChoices):
+ ANY = "any", "any"
+ ALL = "all", "all"
+
+
+TICKET_TAGS_MATCH_CHOICES = list(TicketTagsMatch.values)
# Tuple pairs, not bare ints: drf-spectacular's override loader only accepts strings
# in plain value lists and crashes on anything else.
TICKET_SORT_ORDER_CHOICES = [(1, 1), (-1, -1)]
diff --git a/products/conversations/backend/models/constants.py b/products/conversations/backend/models/constants.py
index 5a62df7bf70c..6c5229ea6093 100644
--- a/products/conversations/backend/models/constants.py
+++ b/products/conversations/backend/models/constants.py
@@ -24,7 +24,7 @@ class ChannelDetail(models.TextChoices):
GITHUB_ISSUE = "github_issue", "GitHub issue"
-class Status(models.TextChoices):
+class TicketStatus(models.TextChoices):
NEW = "new", "New"
OPEN = "open", "Open"
PENDING = "pending", "Pending"
@@ -32,6 +32,11 @@ class Status(models.TextChoices):
RESOLVED = "resolved", "Resolved"
+# The class name feeds the derived OpenAPI component name TicketStatusEnum.
+# Status is an alias for the many callers that import the short name.
+Status = TicketStatus
+
+
class Priority(models.TextChoices):
LOW = "low", "Low"
MEDIUM = "medium", "Medium"
diff --git a/products/conversations/frontend/generated/api.schemas.ts b/products/conversations/frontend/generated/api.schemas.ts
index d339b622bcdf..ff8f5ae27f24 100644
--- a/products/conversations/frontend/generated/api.schemas.ts
+++ b/products/conversations/frontend/generated/api.schemas.ts
@@ -14,9 +14,9 @@
* * `teams` - Microsoft Teams
* * `github` - GitHub
*/
-export type ChannelSourceEnumApi = (typeof ChannelSourceEnumApi)[keyof typeof ChannelSourceEnumApi]
+export type ChannelEnumApi = (typeof ChannelEnumApi)[keyof typeof ChannelEnumApi]
-export const ChannelSourceEnumApi = {
+export const ChannelEnumApi = {
Widget: 'widget',
Email: 'email',
Slack: 'slack',
@@ -128,7 +128,7 @@ export interface TicketPersonApi {
export interface TicketApi {
readonly id: string
readonly ticket_number: number
- readonly channel_source: ChannelSourceEnumApi
+ readonly channel_source: ChannelEnumApi
readonly channel_detail: ChannelDetailEnumApi | null
readonly distinct_id: string
/** Ticket status: new, open, pending, on_hold, or resolved
diff --git a/products/customer_analytics/backend/constants.py b/products/customer_analytics/backend/constants.py
index 9702f79cf278..07ee239463af 100644
--- a/products/customer_analytics/backend/constants.py
+++ b/products/customer_analytics/backend/constants.py
@@ -1,3 +1,5 @@
+from django.db import models
+
DEFAULT_ACTIVITY_EVENT = {"kind": "EventsNode", "event": "$pageview", "name": "$pageview"}
# Mirrors frontend `SLACK_ARCHIVES_ORIGIN` in accountLinksLogic.ts. PostHog-internal: hardcodes our
@@ -22,17 +24,20 @@ WAREHOUSE_PERSON_PROPERTIES_FLAG = "warehouse-person-properties"
BILLING_USAGE_INSIGHT_SHORT_IDS = ["fiJDsKLp"]
BILLING_SPEND_INSIGHT_SHORT_IDS = ["o4I9sdFE", "Tjo4bsux"]
-CUSTOM_PROPERTY_DISPLAY_TYPE_CHOICES = [
- "text",
- "link",
- "number",
- "currency",
- "percent",
- "date",
- "datetime",
- "boolean",
- "select",
-]
+
+class CustomPropertyDisplayType(models.TextChoices):
+ TEXT = "text", "text"
+ LINK = "link", "link"
+ NUMBER = "number", "number"
+ CURRENCY = "currency", "currency"
+ PERCENT = "percent", "percent"
+ DATE = "date", "date"
+ DATETIME = "datetime", "datetime"
+ BOOLEAN = "boolean", "boolean"
+ SELECT = "select", "select"
+
+
+CUSTOM_PROPERTY_DISPLAY_TYPE_CHOICES = list(CustomPropertyDisplayType.values)
# Mirrors OPTION_COLOR_TOKENS in the frontend's customPropertyTypes.ts (DataColorToken presets).
CUSTOM_PROPERTY_OPTION_COLORS = [f"preset-{i}" for i in range(1, 11)]
diff --git a/products/customer_analytics/frontend/components/FeatureRequests/FeatureRequestEditModal.tsx b/products/customer_analytics/frontend/components/FeatureRequests/FeatureRequestEditModal.tsx
index 39372d8d31e4..7b7e3f05e786 100644
--- a/products/customer_analytics/frontend/components/FeatureRequests/FeatureRequestEditModal.tsx
+++ b/products/customer_analytics/frontend/components/FeatureRequests/FeatureRequestEditModal.tsx
@@ -11,7 +11,7 @@ import {
LemonTextArea,
} from '@posthog/lemon-ui'
-import type { FeatureRequestStatusEnumApi, RequestPriorityEnumApi } from '../../generated/api.schemas'
+import type { FeatureRequestStatusEnumApi, FeatureRequestPriorityEnumApi } from '../../generated/api.schemas'
import { FEATURE_REQUEST_PRIORITY_OPTIONS, FEATURE_REQUEST_STATUS_OPTIONS } from './featureRequestOptions'
import { featureRequestsLogic } from './featureRequestsLogic'
@@ -92,7 +92,7 @@ export function FeatureRequestEditModal(): JSX.Element {
</div>
<div className="flex flex-col gap-1">
<LemonLabel>Priority</LemonLabel>
- <LemonSelect<RequestPriorityEnumApi | 'none'>
+ <LemonSelect<FeatureRequestPriorityEnumApi | 'none'>
value={editPriority ?? 'none'}
onChange={(value) => setEditPriority(value === 'none' ? null : value)}
options={[{ value: 'none', label: 'No priority' }, ...FEATURE_REQUEST_PRIORITY_OPTIONS]}
diff --git a/products/customer_analytics/frontend/components/FeatureRequests/FeatureRequestHistory.tsx b/products/customer_analytics/frontend/components/FeatureRequests/FeatureRequestHistory.tsx
index 565b499dd8e6..af367f770f88 100644
--- a/products/customer_analytics/frontend/components/FeatureRequests/FeatureRequestHistory.tsx
+++ b/products/customer_analytics/frontend/components/FeatureRequests/FeatureRequestHistory.tsx
@@ -9,7 +9,7 @@ import type {
FeatureRequestHistoryApi,
FeatureRequestHistoryChangeApi,
FeatureRequestStatusEnumApi,
- RequestPriorityEnumApi,
+ FeatureRequestPriorityEnumApi,
} from '../../generated/api.schemas'
import { featureRequestPriorityLabel, featureRequestStatusLabel } from './featureRequestOptions'
@@ -63,7 +63,7 @@ function statusName(value: unknown): string {
function priorityName(value: unknown): string {
return value === null || (typeof value === 'string' && FEATURE_REQUEST_PRIORITIES.has(value))
- ? featureRequestPriorityLabel(value as RequestPriorityEnumApi | null)
+ ? featureRequestPriorityLabel(value as FeatureRequestPriorityEnumApi | null)
: 'Unknown priority'
}
diff --git a/products/customer_analytics/frontend/components/FeatureRequests/FeatureRequestPriorityBadge.tsx b/products/customer_analytics/frontend/components/FeatureRequests/FeatureRequestPriorityBadge.tsx
index 65b0ec1045fc..efa877c1dacc 100644
--- a/products/customer_analytics/frontend/components/FeatureRequests/FeatureRequestPriorityBadge.tsx
+++ b/products/customer_analytics/frontend/components/FeatureRequests/FeatureRequestPriorityBadge.tsx
@@ -1,9 +1,13 @@
import { LemonTag } from '@posthog/lemon-ui'
-import type { RequestPriorityEnumApi } from '../../generated/api.schemas'
+import type { FeatureRequestPriorityEnumApi } from '../../generated/api.schemas'
import { featureRequestPriorityLabel } from './featureRequestOptions'
-export function FeatureRequestPriorityBadge({ priority }: { priority: RequestPriorityEnumApi | null }): JSX.Element {
+export function FeatureRequestPriorityBadge({
+ priority,
+}: {
+ priority: FeatureRequestPriorityEnumApi | null
+}): JSX.Element {
const type =
priority === 'high' ? 'danger' : priority === 'medium' ? 'warning' : priority === 'low' ? 'muted' : 'default'
return (
diff --git a/products/customer_analytics/frontend/components/FeatureRequests/featureRequestOptions.ts b/products/customer_analytics/frontend/components/FeatureRequests/featureRequestOptions.ts
index 47ffe218ea71..aa3027ecd323 100644
--- a/products/customer_analytics/frontend/components/FeatureRequests/featureRequestOptions.ts
+++ b/products/customer_analytics/frontend/components/FeatureRequests/featureRequestOptions.ts
@@ -1,6 +1,6 @@
import type { LemonTagType } from '@posthog/lemon-ui'
-import type { FeatureRequestStatusEnumApi, RequestPriorityEnumApi } from '../../generated/api.schemas'
+import type { FeatureRequestStatusEnumApi, FeatureRequestPriorityEnumApi } from '../../generated/api.schemas'
export type FeatureRequestArchiveState = 'active' | 'archived' | 'all'
export type FeatureRequestOrdering =
@@ -22,7 +22,7 @@ export type FeatureRequestOrdering =
| '-created_by'
| 'evidence_count'
| '-evidence_count'
-export type FeatureRequestPriorityFilter = RequestPriorityEnumApi | 'none'
+export type FeatureRequestPriorityFilter = FeatureRequestPriorityEnumApi | 'none'
// Event names are consumed by product analytics, so changing one splits its historical data.
export const FeatureRequestEvents = {
@@ -37,7 +37,7 @@ export const FEATURE_REQUEST_STATUS_OPTIONS: { value: FeatureRequestStatusEnumAp
{ value: 'duplicate', label: 'Duplicate' },
]
-export const FEATURE_REQUEST_PRIORITY_OPTIONS: { value: RequestPriorityEnumApi; label: string }[] = [
+export const FEATURE_REQUEST_PRIORITY_OPTIONS: { value: FeatureRequestPriorityEnumApi; label: string }[] = [
{ value: 'high', label: 'High' },
{ value: 'medium', label: 'Medium' },
{ value: 'low', label: 'Low' },
@@ -94,7 +94,7 @@ export function featureRequestStatusTagType(status: FeatureRequestStatusEnumApi)
}
}
-export function featureRequestPriorityLabel(priority: RequestPriorityEnumApi | null): string {
+export function featureRequestPriorityLabel(priority: FeatureRequestPriorityEnumApi | null): string {
return priority
? (FEATURE_REQUEST_PRIORITY_OPTIONS.find((option) => option.value === priority)?.label ?? priority)
: 'No priority'
diff --git a/products/customer_analytics/frontend/components/FeatureRequests/featureRequestsLogic.ts b/products/customer_analytics/frontend/components/FeatureRequests/featureRequestsLogic.ts
index 1927666122e3..34de81aca64a 100644
--- a/products/customer_analytics/frontend/components/FeatureRequests/featureRequestsLogic.ts
+++ b/products/customer_analytics/frontend/components/FeatureRequests/featureRequestsLogic.ts
@@ -42,7 +42,7 @@ import type {
FeatureRequestProductAreaApi,
FeatureRequestStatusEnumApi,
PaginatedFeatureRequestListApi,
- RequestPriorityEnumApi,
+ FeatureRequestPriorityEnumApi,
} from '../../generated/api.schemas'
import { getFeatureRequestBackLabel, getFeatureRequestBackUrl } from './featureRequestNavigation'
import {
@@ -263,7 +263,7 @@ export interface featureRequestsLogicValues {
editError: string | null
editExpectedVersion: number
editIsStale: boolean
- editPriority: RequestPriorityEnumApi | null
+ editPriority: FeatureRequestPriorityEnumApi | null
editProductAreaIds: string[]
editProductAreaOptions: {
disabledReason?: string
@@ -529,8 +529,8 @@ export interface featureRequestsLogicActions {
setEditIsStale: (editIsStale: boolean) => {
editIsStale: boolean
}
- setEditPriority: (editPriority: RequestPriorityEnumApi | null) => {
- editPriority: RequestPriorityEnumApi | null
+ setEditPriority: (editPriority: FeatureRequestPriorityEnumApi | null) => {
+ editPriority: FeatureRequestPriorityEnumApi | null
}
setEditProductAreaIds: (editProductAreaIds: string[]) => {
editProductAreaIds: string[]
@@ -809,7 +809,7 @@ export const featureRequestsLogic = kea<featureRequestsLogicType>([
setEditAccountIds: (editAccountIds: string[]) => ({ editAccountIds }),
setEditProductAreaIds: (editProductAreaIds: string[]) => ({ editProductAreaIds }),
setEditStatus: (editStatus: FeatureRequestStatusEnumApi) => ({ editStatus }),
- setEditPriority: (editPriority: RequestPriorityEnumApi | null) => ({ editPriority }),
+ setEditPriority: (editPriority: FeatureRequestPriorityEnumApi | null) => ({ editPriority }),
setEditExpectedVersion: (editExpectedVersion: number) => ({ editExpectedVersion }),
setEditError: (editError: string | null) => ({ editError }),
setEditIsStale: (editIsStale: boolean) => ({ editIsStale }),
@@ -1192,7 +1192,7 @@ export const featureRequestsLogic = kea<featureRequestsLogicType>([
},
],
editPriority: [
- null as RequestPriorityEnumApi | null,
+ null as FeatureRequestPriorityEnumApi | null,
{
openEditRequest: (_, { featureRequest }) => featureRequest.request_priority,
setEditPriority: (_, { editPriority }) => editPriority,
diff --git a/products/customer_analytics/frontend/generated/api.schemas.ts b/products/customer_analytics/frontend/generated/api.schemas.ts
index 90ef9d121d0b..8e5d1501c7c3 100644
--- a/products/customer_analytics/frontend/generated/api.schemas.ts
+++ b/products/customer_analytics/frontend/generated/api.schemas.ts
@@ -2283,9 +2283,9 @@ export interface CustomPropertyOptionApi {
* * `tracked` - tracked
* * `ignored` - ignored
*/
-export type AccountSegmentEnumApi = (typeof AccountSegmentEnumApi)[keyof typeof AccountSegmentEnumApi]
+export type SyncSegmentEnumApi = (typeof SyncSegmentEnumApi)[keyof typeof SyncSegmentEnumApi]
-export const AccountSegmentEnumApi = {
+export const SyncSegmentEnumApi = {
Tracked: 'tracked',
Ignored: 'ignored',
} as const
@@ -2319,7 +2319,7 @@ export interface CustomPropertySyncRunApi {
*
* * `tracked` - tracked
* * `ignored` - ignored */
- readonly account_segment: AccountSegmentEnumApi | null
+ readonly account_segment: SyncSegmentEnumApi | null
/** Current account sync phase. Person and group property runs return null.
*
* * `staging` - staging
@@ -2957,9 +2957,10 @@ export const FeatureRequestStatusEnumApi = {
* * `medium` - Medium
* * `low` - Low
*/
-export type RequestPriorityEnumApi = (typeof RequestPriorityEnumApi)[keyof typeof RequestPriorityEnumApi]
+export type FeatureRequestPriorityEnumApi =
+ (typeof FeatureRequestPriorityEnumApi)[keyof typeof FeatureRequestPriorityEnumApi]
-export const RequestPriorityEnumApi = {
+export const FeatureRequestPriorityEnumApi = {
High: 'high',
Medium: 'medium',
Low: 'low',
@@ -3050,7 +3051,7 @@ export interface FeatureRequestApi {
* * `high` - High
* * `medium` - Medium
* * `low` - Low */
- readonly request_priority: RequestPriorityEnumApi | null
+ readonly request_priority: FeatureRequestPriorityEnumApi | null
/** Whether the request is archived. */
readonly is_archived: boolean
/**
@@ -3177,7 +3178,7 @@ export interface FeatureRequestUpdateApi {
* * `high` - High
* * `medium` - Medium
* * `low` - Low */
- request_priority?: RequestPriorityEnumApi | null
+ request_priority?: FeatureRequestPriorityEnumApi | null
}
export interface PatchedFeatureRequestUpdateApi {
@@ -3212,7 +3213,7 @@ export interface PatchedFeatureRequestUpdateApi {
* * `high` - High
* * `medium` - Medium
* * `low` - Low */
- request_priority?: RequestPriorityEnumApi | null
+ request_priority?: FeatureRequestPriorityEnumApi | null
}
export interface FeatureRequestAddAccountApi {
@@ -3362,9 +3363,10 @@ export interface FeatureRequestHistoryChangeApi {
/**
* * `manual` - Manual
*/
-export type ChangeSourceEnumApi = (typeof ChangeSourceEnumApi)[keyof typeof ChangeSourceEnumApi]
+export type FeatureRequestHistorySourceEnumApi =
+ (typeof FeatureRequestHistorySourceEnumApi)[keyof typeof FeatureRequestHistorySourceEnumApi]
-export const ChangeSourceEnumApi = {
+export const FeatureRequestHistorySourceEnumApi = {
Manual: 'manual',
} as const
@@ -3378,7 +3380,7 @@ export interface FeatureRequestHistoryApi {
/** System that recorded the request change.
*
* * `manual` - Manual */
- readonly change_source: ChangeSourceEnumApi
+ readonly change_source: FeatureRequestHistorySourceEnumApi
/**
* ID of the user who changed the request, if known.
* @nullable
@@ -3425,7 +3427,7 @@ export interface FeatureRequestStatusHistoryApi {
/** System that recorded the status change.
*
* * `manual` - Manual */
- readonly change_source: ChangeSourceEnumApi
+ readonly change_source: FeatureRequestHistorySourceEnumApi
/**
* ID of the user who changed the status, if known.
* @nullable
@@ -3496,9 +3498,9 @@ export const GroupUsageMetricDisplayEnumApi = {
* * `count` - count
* * `sum` - sum
*/
-export type MathEnumApi = (typeof MathEnumApi)[keyof typeof MathEnumApi]
+export type GroupUsageMetricMathEnumApi = (typeof GroupUsageMetricMathEnumApi)[keyof typeof GroupUsageMetricMathEnumApi]
-export const MathEnumApi = {
+export const GroupUsageMetricMathEnumApi = {
Count: 'count',
Sum: 'sum',
} as const
@@ -3541,7 +3543,7 @@ export interface GroupUsageMetricApi {
*
* * `count` - count
* * `sum` - sum */
- math?: MathEnumApi
+ math?: GroupUsageMetricMathEnumApi
/**
* Required when `math` is `sum`; must be empty when `math` is `count`. For events metrics this is an event property name. For data warehouse metrics this is the column name (or HogQL expression) to sum on the DW table.
* @maxLength 255
@@ -3597,7 +3599,7 @@ export interface PatchedGroupUsageMetricApi {
*
* * `count` - count
* * `sum` - sum */
- math?: MathEnumApi
+ math?: GroupUsageMetricMathEnumApi
/**
* Required when `math` is `sum`; must be empty when `math` is `count`. For events metrics this is an event property name. For data warehouse metrics this is the column name (or HogQL expression) to sum on the DW table.
* @maxLength 255
diff --git a/products/dashboards/backend/models/dashboard.py b/products/dashboards/backend/models/dashboard.py
index 30fdac4f3499..aa9664e85b47 100644
--- a/products/dashboards/backend/models/dashboard.py
+++ b/products/dashboards/backend/models/dashboard.py
@@ -25,7 +25,14 @@ DASHBOARD_GRID_SPACING_GAPS = {
"wide": 48,
}
-DASHBOARD_GRID_COMPACTION_MODES = ("vertical", "horizontal", "stable")
+
+class LayoutCompaction(models.TextChoices):
+ VERTICAL = "vertical", "vertical"
+ HORIZONTAL = "horizontal", "horizontal"
+ STABLE = "stable", "stable"
+
+
+DASHBOARD_GRID_COMPACTION_MODES = tuple(LayoutCompaction.values)
class DashboardManager(RootTeamManager):
diff --git a/products/dashboards/frontend/generated/api.schemas.ts b/products/dashboards/frontend/generated/api.schemas.ts
index f56ce2f205ae..b7e5c0073c4b 100644
--- a/products/dashboards/frontend/generated/api.schemas.ts
+++ b/products/dashboards/frontend/generated/api.schemas.ts
@@ -296,9 +296,10 @@ export interface CopyDashboardTemplateApi {
* * `duplicate` - Duplicate
* * `unlisted` - Unlisted (product-embedded)
*/
-export type CreationModeEnumApi = (typeof CreationModeEnumApi)[keyof typeof CreationModeEnumApi]
+export type DashboardCreationModeEnumApi =
+ (typeof DashboardCreationModeEnumApi)[keyof typeof DashboardCreationModeEnumApi]
-export const CreationModeEnumApi = {
+export const DashboardCreationModeEnumApi = {
Default: 'default',
Template: 'template',
Duplicate: 'duplicate',
@@ -320,10 +321,9 @@ export const RestrictionLevelEnumApi = {
* * `21` - Can view dashboard
* * `37` - Can edit dashboard
*/
-export type EffectivePrivilegeLevelEnumApi =
- (typeof EffectivePrivilegeLevelEnumApi)[keyof typeof EffectivePrivilegeLevelEnumApi]
+export type PrivilegeLevelEnumApi = (typeof PrivilegeLevelEnumApi)[keyof typeof PrivilegeLevelEnumApi]
-export const EffectivePrivilegeLevelEnumApi = {
+export const PrivilegeLevelEnumApi = {
Number21: 21,
Number37: 37,
} as const
@@ -372,7 +372,7 @@ export interface DashboardBasicApi {
readonly file_system_path: string | null
readonly is_shared: boolean
readonly deleted: boolean
- readonly creation_mode: CreationModeEnumApi
+ readonly creation_mode: DashboardCreationModeEnumApi
tags?: unknown[]
/** Controls who can edit the dashboard.
*
@@ -380,7 +380,7 @@ export interface DashboardBasicApi {
* * `37` - Only those invited to this dashboard can edit */
readonly restriction_level: RestrictionLevelEnumApi
readonly effective_restriction_level: RestrictionLevelEnumApi
- readonly effective_privilege_level: EffectivePrivilegeLevelEnumApi
+ readonly effective_privilege_level: PrivilegeLevelEnumApi
/**
* The effective access level the user has for this object
* @nullable
@@ -504,7 +504,7 @@ export interface DashboardApi {
readonly file_system_path: string | null
readonly is_shared: boolean
deleted?: boolean
- readonly creation_mode: CreationModeEnumApi
+ readonly creation_mode: DashboardCreationModeEnumApi
readonly filters: DashboardApiFilters
/** @nullable */
readonly variables: DashboardApiVariables
@@ -518,7 +518,7 @@ export interface DashboardApi {
tags?: unknown[]
restriction_level?: RestrictionLevelEnumApi
readonly effective_restriction_level: RestrictionLevelEnumApi
- readonly effective_privilege_level: EffectivePrivilegeLevelEnumApi
+ readonly effective_privilege_level: PrivilegeLevelEnumApi
/**
* The effective access level the user has for this object
* @nullable
@@ -9262,7 +9262,7 @@ export interface InsightApi {
readonly last_modified_by: UserBasicApi
readonly is_sample: boolean
readonly effective_restriction_level: RestrictionLevelEnumApi
- readonly effective_privilege_level: EffectivePrivilegeLevelEnumApi
+ readonly effective_privilege_level: PrivilegeLevelEnumApi
/**
* The effective access level the user has for this object
* @nullable
diff --git a/products/data_warehouse/backend/presentation/managed_warehouse_data_status.py b/products/data_warehouse/backend/presentation/managed_warehouse_data_status.py
index b94ecd2b556f..1e57a4038eae 100644
--- a/products/data_warehouse/backend/presentation/managed_warehouse_data_status.py
+++ b/products/data_warehouse/backend/presentation/managed_warehouse_data_status.py
@@ -1,13 +1,18 @@
+from django.db import models
+
from rest_framework import serializers
-READINESS_STATE_CHOICES = [
- "not_configured",
- "waiting",
- "backfilling",
- "up_to_date",
- "needs_attention",
- "sync_paused",
-]
+
+class ManagedWarehouseReadinessState(models.TextChoices):
+ NOT_CONFIGURED = "not_configured", "not_configured"
+ WAITING = "waiting", "waiting"
+ BACKFILLING = "backfilling", "backfilling"
+ UP_TO_DATE = "up_to_date", "up_to_date"
+ NEEDS_ATTENTION = "needs_attention", "needs_attention"
+ SYNC_PAUSED = "sync_paused", "sync_paused"
+
+
+READINESS_STATE_CHOICES = list(ManagedWarehouseReadinessState.values)
WORKFLOW_TYPE_CHOICES = ["copy", "register"]
WORKFLOW_STATUS_CHOICES = ["running", "completed", "failed", "skipped", "stale"]
diff --git a/products/data_warehouse/backend/presentation/views/saved_query.py b/products/data_warehouse/backend/presentation/views/saved_query.py
index 7077f9382c39..860a45b15dbe 100644
--- a/products/data_warehouse/backend/presentation/views/saved_query.py
+++ b/products/data_warehouse/backend/presentation/views/saved_query.py
@@ -4,7 +4,7 @@ from datetime import datetime, timedelta
from typing import Any, cast
from django.conf import settings
-from django.db import transaction
+from django.db import models, transaction
from django.db.models import Count, Model, OuterRef, Prefetch, Q, Subquery, TextField
from django.db.models.functions import Cast
@@ -154,11 +154,16 @@ class SyncFrequencyBoundSerializer(serializers.Serializer):
)
+class SyncFrequencyBlockedBy(models.TextChoices):
+ SOURCE = "source", "source"
+ CONSUMER = "consumer", "consumer"
+
+
class SyncFrequencyOptionSerializer(serializers.Serializer):
cadence = serializers.ChoiceField(choices=MATERIALIZE_SYNC_FREQUENCY_CHOICES, help_text="A `sync_frequency` value.")
allowed = serializers.BooleanField(help_text="False when writing this cadence would be rejected.")
blocked_by = serializers.ChoiceField(
- choices=[("source", "source"), ("consumer", "consumer")],
+ choices=SyncFrequencyBlockedBy.choices,
allow_null=True,
help_text="Which side withholds this cadence: 'source' when no upstream source syncs that "
"often, 'consumer' when a downstream view or endpoint refreshes more often than this. "
diff --git a/products/data_warehouse/frontend/generated/api.schemas.ts b/products/data_warehouse/frontend/generated/api.schemas.ts
index 3f42b116de58..44c2c8c5da7f 100644
--- a/products/data_warehouse/frontend/generated/api.schemas.ts
+++ b/products/data_warehouse/frontend/generated/api.schemas.ts
@@ -825,9 +825,10 @@ export interface PatchedQueryTabStateApi {
* * `ai_generated` - AI generated
* * `user_edited` - User edited
*/
-export type DescriptionSourceEnumApi = (typeof DescriptionSourceEnumApi)[keyof typeof DescriptionSourceEnumApi]
+export type WarehouseColumnAnnotationDescriptionSourceEnumApi =
+ (typeof WarehouseColumnAnnotationDescriptionSourceEnumApi)[keyof typeof WarehouseColumnAnnotationDescriptionSourceEnumApi]
-export const DescriptionSourceEnumApi = {
+export const WarehouseColumnAnnotationDescriptionSourceEnumApi = {
Canonical: 'canonical',
AiGenerated: 'ai_generated',
UserEdited: 'user_edited',
@@ -854,7 +855,7 @@ export interface DataWarehouseSavedQueryColumnAnnotationApi {
* * `canonical` - Canonical
* * `ai_generated` - AI generated
* * `user_edited` - User edited */
- readonly description_source: DescriptionSourceEnumApi
+ readonly description_source: WarehouseColumnAnnotationDescriptionSourceEnumApi
/** Model used when the description was AI-generated, otherwise null. */
readonly ai_model: string
/** True once a user has edited this annotation; such rows are never overwritten. */
@@ -894,7 +895,7 @@ export interface PatchedDataWarehouseSavedQueryColumnAnnotationApi {
* * `canonical` - Canonical
* * `ai_generated` - AI generated
* * `user_edited` - User edited */
- readonly description_source?: DescriptionSourceEnumApi
+ readonly description_source?: WarehouseColumnAnnotationDescriptionSourceEnumApi
/** Model used when the description was AI-generated, otherwise null. */
readonly ai_model?: string
/** True once a user has edited this annotation; such rows are never overwritten. */
@@ -925,7 +926,7 @@ export interface WarehouseColumnAnnotationApi {
* * `canonical` - Canonical
* * `ai_generated` - AI generated
* * `user_edited` - User edited */
- readonly description_source: DescriptionSourceEnumApi
+ readonly description_source: WarehouseColumnAnnotationDescriptionSourceEnumApi
/** Model used when the description was AI-generated, otherwise null. */
readonly ai_model: string
/** True once a user has edited this annotation; such rows are never overwritten. */
@@ -965,7 +966,7 @@ export interface PatchedWarehouseColumnAnnotationApi {
* * `canonical` - Canonical
* * `ai_generated` - AI generated
* * `user_edited` - User edited */
- readonly description_source?: DescriptionSourceEnumApi
+ readonly description_source?: WarehouseColumnAnnotationDescriptionSourceEnumApi
/** Model used when the description was AI-generated, otherwise null. */
readonly ai_model?: string
/** True once a user has edited this annotation; such rows are never overwritten. */
@@ -1135,9 +1136,10 @@ export interface PaginatedDataWarehouseModelPathListApi {
* * `Failed` - Failed
* * `Running` - Running
*/
-export type SavedQueryStatusEnumApi = (typeof SavedQueryStatusEnumApi)[keyof typeof SavedQueryStatusEnumApi]
+export type DataWarehouseSavedQueryStatusEnumApi =
+ (typeof DataWarehouseSavedQueryStatusEnumApi)[keyof typeof DataWarehouseSavedQueryStatusEnumApi]
-export const SavedQueryStatusEnumApi = {
+export const DataWarehouseSavedQueryStatusEnumApi = {
Cancelled: 'Cancelled',
Modified: 'Modified',
Completed: 'Completed',
@@ -1150,9 +1152,10 @@ export const SavedQueryStatusEnumApi = {
* * `endpoint` - Endpoint
* * `managed_viewset` - Managed Viewset
*/
-export type OriginEnumApi = (typeof OriginEnumApi)[keyof typeof OriginEnumApi]
+export type DataWarehouseSavedQueryOriginEnumApi =
+ (typeof DataWarehouseSavedQueryOriginEnumApi)[keyof typeof DataWarehouseSavedQueryOriginEnumApi]
-export const OriginEnumApi = {
+export const DataWarehouseSavedQueryOriginEnumApi = {
DataWarehouse: 'data_warehouse',
Endpoint: 'endpoint',
ManagedViewset: 'managed_viewset',
@@ -1184,7 +1187,7 @@ export interface DataWarehouseSavedQueryMinimalApi {
* * `Completed` - Completed
* * `Failed` - Failed
* * `Running` - Running */
- readonly status: SavedQueryStatusEnumApi | null
+ readonly status: DataWarehouseSavedQueryStatusEnumApi | null
/** @nullable */
readonly last_run_at: string | null
/** @nullable */
@@ -1204,7 +1207,7 @@ export interface DataWarehouseSavedQueryMinimalApi {
* * `data_warehouse` - Data Warehouse
* * `endpoint` - Endpoint
* * `managed_viewset` - Managed Viewset */
- readonly origin: OriginEnumApi | null
+ readonly origin: DataWarehouseSavedQueryOriginEnumApi | null
/** Whether this view is for testing only and will auto-expire. */
readonly is_test: boolean
/**
@@ -1505,7 +1508,7 @@ export interface DataWarehouseSavedQueryApi {
* * `Completed` - Completed
* * `Failed` - Failed
* * `Running` - Running */
- readonly status: SavedQueryStatusEnumApi | null
+ readonly status: DataWarehouseSavedQueryStatusEnumApi | null
/** @nullable */
readonly last_run_at: string | null
/** @nullable */
@@ -1546,7 +1549,7 @@ export interface DataWarehouseSavedQueryApi {
* * `data_warehouse` - Data Warehouse
* * `endpoint` - Endpoint
* * `managed_viewset` - Managed Viewset */
- readonly origin: OriginEnumApi | null
+ readonly origin: DataWarehouseSavedQueryOriginEnumApi | null
/** Whether this view is for testing only and will auto-expire. */
is_test?: boolean
/**
@@ -1636,7 +1639,7 @@ export interface PatchedDataWarehouseSavedQueryApi {
* * `Completed` - Completed
* * `Failed` - Failed
* * `Running` - Running */
- readonly status?: SavedQueryStatusEnumApi | null
+ readonly status?: DataWarehouseSavedQueryStatusEnumApi | null
/** @nullable */
readonly last_run_at?: string | null
/** @nullable */
@@ -1677,7 +1680,7 @@ export interface PatchedDataWarehouseSavedQueryApi {
* * `data_warehouse` - Data Warehouse
* * `endpoint` - Endpoint
* * `managed_viewset` - Managed Viewset */
- readonly origin?: OriginEnumApi | null
+ readonly origin?: DataWarehouseSavedQueryOriginEnumApi | null
/** Whether this view is for testing only and will auto-expire. */
is_test?: boolean
/**
@@ -1869,9 +1872,10 @@ export interface PatchedDataWarehouseSavedQueryFolderApi {
* * `Delta` - Delta
* * `DeltaS3Wrapper` - DeltaS3Wrapper
*/
-export type TableFormatEnumApi = (typeof TableFormatEnumApi)[keyof typeof TableFormatEnumApi]
+export type DataWarehouseTableFormatEnumApi =
+ (typeof DataWarehouseTableFormatEnumApi)[keyof typeof DataWarehouseTableFormatEnumApi]
-export const TableFormatEnumApi = {
+export const DataWarehouseTableFormatEnumApi = {
Csv: 'CSV',
CSVWithNames: 'CSVWithNames',
Parquet: 'Parquet',
@@ -1890,9 +1894,10 @@ export const TableFormatEnumApi = {
* * `materialized_view` - materialized_view
* * `demo` - demo
*/
-export type TableCreatedViaEnumApi = (typeof TableCreatedViaEnumApi)[keyof typeof TableCreatedViaEnumApi]
+export type DataWarehouseTableCreatedViaEnumApi =
+ (typeof DataWarehouseTableCreatedViaEnumApi)[keyof typeof DataWarehouseTableCreatedViaEnumApi]
-export const TableCreatedViaEnumApi = {
+export const DataWarehouseTableCreatedViaEnumApi = {
Web: 'web',
Api: 'api',
Mcp: 'mcp',
@@ -4623,7 +4628,7 @@ export interface TableApi {
* * `JSONEachRow` - JSON
* * `Delta` - Delta
* * `DeltaS3Wrapper` - DeltaS3Wrapper */
- format: TableFormatEnumApi
+ format: DataWarehouseTableFormatEnumApi
readonly created_by: UserBasicApi
readonly created_at: string
/** Where the table came from: `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup agent, `self_driving` for a self-driving run, `source` for a table a data source syncs, `materialized_view` for the table behind a materialized view, and `demo` for a demo project's sample table. Set server-side from the request, never from the request body. Null on tables created before this was recorded.
@@ -4636,7 +4641,7 @@ export interface TableApi {
* * `source` - source
* * `materialized_view` - materialized_view
* * `demo` - demo */
- readonly created_via: TableCreatedViaEnumApi | null
+ readonly created_via: DataWarehouseTableCreatedViaEnumApi | null
/**
* HTTPS URL of the files to read, with `*` matching any part of a path segment (e.g. `https://your-bucket.s3.amazonaws.com/orders/*.parquet`). All matched files are read as one table. Must point at a bucket you control, not at PostHog's own storage.
* @maxLength 500
@@ -4702,7 +4707,7 @@ export interface PatchedTableApi {
* * `JSONEachRow` - JSON
* * `Delta` - Delta
* * `DeltaS3Wrapper` - DeltaS3Wrapper */
- format?: TableFormatEnumApi
+ format?: DataWarehouseTableFormatEnumApi
readonly created_by?: UserBasicApi
readonly created_at?: string
/** Where the table came from: `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup agent, `self_driving` for a self-driving run, `source` for a table a data source syncs, `materialized_view` for the table behind a materialized view, and `demo` for a demo project's sample table. Set server-side from the request, never from the request body. Null on tables created before this was recorded.
@@ -4715,7 +4720,7 @@ export interface PatchedTableApi {
* * `source` - source
* * `materialized_view` - materialized_view
* * `demo` - demo */
- readonly created_via?: TableCreatedViaEnumApi | null
+ readonly created_via?: DataWarehouseTableCreatedViaEnumApi | null
/**
* HTTPS URL of the files to read, with `*` matching any part of a path segment (e.g. `https://your-bucket.s3.amazonaws.com/orders/*.parquet`). All matched files are read as one table. Must point at a bucket you control, not at PostHog's own storage.
* @maxLength 500
diff --git a/products/error_tracking/backend/presentation/views/query_serializers.py b/products/error_tracking/backend/presentation/views/query_serializers.py
index 1b62b22987d2..4fa8b788def9 100644
--- a/products/error_tracking/backend/presentation/views/query_serializers.py
+++ b/products/error_tracking/backend/presentation/views/query_serializers.py
@@ -2,6 +2,8 @@ from __future__ import annotations
from typing import cast
+from django.db import models
+
from rest_framework import serializers
from posthog.api.documentation import PropertyItemSerializer, extend_schema_field
@@ -82,6 +84,14 @@ class ErrorTrackingAssigneeSerializer(serializers.Serializer):
type = serializers.ChoiceField(choices=["user", "role"], help_text="Assignee target type: user or role.")
+class ErrorTrackingIssueOrderBy(models.TextChoices):
+ LAST_SEEN = "last_seen", "last_seen"
+ FIRST_SEEN = "first_seen", "first_seen"
+ OCCURRENCES = "occurrences", "occurrences"
+ USERS = "users", "users"
+ SESSIONS = "sessions", "sessions"
+
+
class ErrorTrackingIssuesListQueryRequestSerializer(serializers.Serializer):
dateRange = ErrorTrackingDateRangeSerializer(
required=False,
@@ -115,7 +125,7 @@ class ErrorTrackingIssuesListQueryRequestSerializer(serializers.Serializer):
help_text="Advanced flat AND property filters. Prefer typed shortcut fields when they fit. HogQL filters are rejected.",
)
orderBy = serializers.ChoiceField(
- choices=["last_seen", "first_seen", "occurrences", "users", "sessions"],
+ choices=ErrorTrackingIssueOrderBy.choices,
required=False,
default="occurrences",
help_text="Field used to sort issues. Defaults to occurrences.",
diff --git a/products/event_definitions/frontend/generated/api.schemas.ts b/products/event_definitions/frontend/generated/api.schemas.ts
index 3ebb9700c5e4..2efde4990b04 100644
--- a/products/event_definitions/frontend/generated/api.schemas.ts
+++ b/products/event_definitions/frontend/generated/api.schemas.ts
@@ -68,9 +68,10 @@ export interface UserBasicApi {
* * `allow` - Allow
* * `reject` - Reject
*/
-export type EnforcementModeEnumApi = (typeof EnforcementModeEnumApi)[keyof typeof EnforcementModeEnumApi]
+export type SchemaEnforcementModeEnumApi =
+ (typeof SchemaEnforcementModeEnumApi)[keyof typeof SchemaEnforcementModeEnumApi]
-export const EnforcementModeEnumApi = {
+export const SchemaEnforcementModeEnumApi = {
Allow: 'allow',
Reject: 'reject',
} as const
@@ -100,7 +101,7 @@ export interface EnterpriseEventDefinitionApi {
readonly verified_by: UserBasicApi
/** @nullable */
hidden?: boolean | null
- enforcement_mode?: EnforcementModeEnumApi
+ enforcement_mode?: SchemaEnforcementModeEnumApi
/**
* Name of a single property on this event that PostHog UIs should display alongside the event (for example `$pathname` on `$pageview`). When set, surfaces like the session replay inspector show the property's value next to the event name without the user having to open the event.
* @maxLength 400
@@ -151,7 +152,7 @@ export interface PatchedEnterpriseEventDefinitionApi {
readonly verified_by?: UserBasicApi
/** @nullable */
hidden?: boolean | null
- enforcement_mode?: EnforcementModeEnumApi
+ enforcement_mode?: SchemaEnforcementModeEnumApi
/**
* Name of a single property on this event that PostHog UIs should display alongside the event (for example `$pathname` on `$pageview`). When set, surfaces like the session replay inspector show the property's value next to the event name without the user having to open the event.
* @maxLength 400
@@ -258,7 +259,7 @@ export interface EventDefinitionRecordApi {
last_seen_at?: string | null
readonly last_updated_at: string
tags?: unknown[]
- enforcement_mode?: EnforcementModeEnumApi
+ enforcement_mode?: SchemaEnforcementModeEnumApi
/**
* Name of a single property on this event that PostHog UIs should display alongside the event (for example `$pathname` on `$pageview`). When set, surfaces like the session replay inspector show the property's value next to the event name without the user having to open the event.
* @maxLength 400
diff --git a/products/experiments/frontend/generated/api.schemas.ts b/products/experiments/frontend/generated/api.schemas.ts
index ffcc2d8501d1..f9a0f7b61b31 100644
--- a/products/experiments/frontend/generated/api.schemas.ts
+++ b/products/experiments/frontend/generated/api.schemas.ts
@@ -2042,9 +2042,10 @@ export interface ExperimentFlagCleanupTaskApi {
* * `experiment_stop` - Experiment Stop
* * `experiment_update` - Experiment Update
*/
-export type TriggerEnumApi = (typeof TriggerEnumApi)[keyof typeof TriggerEnumApi]
+export type ExperimentMetricsRecalculationTriggerEnumApi =
+ (typeof ExperimentMetricsRecalculationTriggerEnumApi)[keyof typeof ExperimentMetricsRecalculationTriggerEnumApi]
-export const TriggerEnumApi = {
+export const ExperimentMetricsRecalculationTriggerEnumApi = {
Manual: 'manual',
AgentMcp: 'agent_mcp',
ColdRun: 'cold_run',
@@ -2075,7 +2076,7 @@ export interface RecalculateMetricsRequestApi {
* * `experiment_launch` - Experiment Launch
* * `experiment_stop` - Experiment Stop
* * `experiment_update` - Experiment Update */
- trigger?: TriggerEnumApi
+ trigger?: ExperimentMetricsRecalculationTriggerEnumApi
}
/**
@@ -2193,7 +2194,7 @@ export interface ExperimentMetricsRecalculationApi {
* * `experiment_launch` - Experiment Launch
* * `experiment_stop` - Experiment Stop
* * `experiment_update` - Experiment Update */
- readonly trigger: TriggerEnumApi
+ readonly trigger: ExperimentMetricsRecalculationTriggerEnumApi
/** When the job was created */
readonly created_at: string
/**
diff --git a/products/feature_flags/backend/api/staff_cache.py b/products/feature_flags/backend/api/staff_cache.py
index f2499de6d9e4..a795a1bd2f99 100644
--- a/products/feature_flags/backend/api/staff_cache.py
+++ b/products/feature_flags/backend/api/staff_cache.py
@@ -7,6 +7,7 @@ from typing import Any, Optional
from django.conf import settings
from django.core.cache import caches
from django.core.cache.backends.base import BaseCache
+from django.db import models
import structlog
from drf_spectacular.types import OpenApiTypes
@@ -56,8 +57,22 @@ WARM_RUN_CANCEL_CACHE_KEY = "feature_flags/warm_run/cancel"
WARM_RUN_HEARTBEAT_STALE_SECONDS = 120
WARM_RUN_CANCEL_TTL_SECONDS = 3600
-WARM_RUN_STATES = ["running", "completed", "cancelled"]
-WARM_RUN_SCOPES = ["all_teams", "teams_with_flags"]
+
+class FlagsWarmRunState(models.TextChoices):
+ RUNNING = "running", "running"
+ COMPLETED = "completed", "completed"
+ CANCELLED = "cancelled", "cancelled"
+
+
+WARM_RUN_STATES = list(FlagsWarmRunState.values)
+
+
+class FlagsWarmRunScope(models.TextChoices):
+ ALL_TEAMS = "all_teams", "all_teams"
+ TEAMS_WITH_FLAGS = "teams_with_flags", "teams_with_flags"
+
+
+WARM_RUN_SCOPES = list(FlagsWarmRunScope.values)
# Reading and mutating currently share the same choice set.
READABLE_CACHE_CHOICES = CACHE_CHOICES
@@ -76,9 +91,14 @@ class StaffCacheStatusQuerySerializer(serializers.Serializer):
)
+class StaffCacheSource(models.TextChoices):
+ REDIS = "redis", "redis"
+ MISS = "miss", "miss"
+
+
def _cache_source_field() -> serializers.ChoiceField:
return serializers.ChoiceField(
- choices=["redis", "miss"],
+ choices=StaffCacheSource.choices,
help_text="'redis' when a warm entry is cached, or 'miss' when nothing is cached in Redis.",
)
diff --git a/products/feature_flags/frontend/generated/api.schemas.ts b/products/feature_flags/frontend/generated/api.schemas.ts
index 8bc124870478..198b115e0df3 100644
--- a/products/feature_flags/frontend/generated/api.schemas.ts
+++ b/products/feature_flags/frontend/generated/api.schemas.ts
@@ -1594,9 +1594,10 @@ export interface FlagValueResponseApi {
/**
* * `FeatureFlag` - feature flag
*/
-export type ModelNameEnumApi = (typeof ModelNameEnumApi)[keyof typeof ModelNameEnumApi]
+export type ScheduledChangeAllowedModelsEnumApi =
+ (typeof ScheduledChangeAllowedModelsEnumApi)[keyof typeof ScheduledChangeAllowedModelsEnumApi]
-export const ModelNameEnumApi = {
+export const ScheduledChangeAllowedModelsEnumApi = {
FeatureFlag: 'FeatureFlag',
} as const
@@ -1665,7 +1666,7 @@ export interface ScheduledChangeApi {
/** The type of record to modify. Currently only "FeatureFlag" is supported.
*
* * `FeatureFlag` - feature flag */
- model_name: ModelNameEnumApi
+ model_name: ScheduledChangeAllowedModelsEnumApi
/** The change to apply. Must include an 'operation' key and a 'value' key. Supported operations: 'update_status' (value: true/false to enable/disable the flag), 'add_release_condition' (value: object with 'groups', 'payloads', and 'multivariate' keys), 'update_variants' (value: object with 'variants' and 'payloads' keys). */
payload: unknown
/** ISO 8601 datetime when the change should be applied (e.g. '2025-06-01T14:00:00Z'). */
@@ -1727,7 +1728,7 @@ export interface PatchedScheduledChangeApi {
/** The type of record to modify. Currently only "FeatureFlag" is supported.
*
* * `FeatureFlag` - feature flag */
- model_name?: ModelNameEnumApi
+ model_name?: ScheduledChangeAllowedModelsEnumApi
/** The change to apply. Must include an 'operation' key and a 'value' key. Supported operations: 'update_status' (value: true/false to enable/disable the flag), 'add_release_condition' (value: object with 'groups', 'payloads', and 'multivariate' keys), 'update_variants' (value: object with 'variants' and 'payloads' keys). */
payload?: unknown
/** ISO 8601 datetime when the change should be applied (e.g. '2025-06-01T14:00:00Z'). */
diff --git a/products/logs/backend/group_by_query_runner.py b/products/logs/backend/group_by_query_runner.py
index 3a14cb2c6bf2..47e69285eba9 100644
--- a/products/logs/backend/group_by_query_runner.py
+++ b/products/logs/backend/group_by_query_runner.py
@@ -2,6 +2,8 @@ from collections.abc import Sequence
from typing import TYPE_CHECKING, NamedTuple
from zoneinfo import ZoneInfo
+from django.db import models
+
from posthog.schema import CachedLogsQueryResponse, LogsQuery
from posthog.hogql import ast
@@ -42,7 +44,14 @@ GROUPABLE_COLUMNS: dict[str, str] = {
"span_id": "hex(tryBase64Decode(span_id))",
}
-GROUP_SOURCES = ("log", "resource", "column")
+
+class LogsGroupBySource(models.TextChoices):
+ LOG = "log", "log"
+ RESOURCE = "resource", "resource"
+ COLUMN = "column", "column"
+
+
+GROUP_SOURCES = tuple(LogsGroupBySource.values)
ORDER_FIELDS = ("log_count", "error_count", "last_seen")
diff --git a/products/logs/backend/presentation/views/anomalies_api.py b/products/logs/backend/presentation/views/anomalies_api.py
index 73e21b5e9204..279160fb330e 100644
--- a/products/logs/backend/presentation/views/anomalies_api.py
+++ b/products/logs/backend/presentation/views/anomalies_api.py
@@ -3,6 +3,7 @@ import datetime as dt
from typing import Any
from django.core.cache import cache
+from django.db import models
from drf_spectacular.utils import OpenApiResponse
from rest_framework import serializers, status, viewsets
@@ -30,8 +31,24 @@ from products.logs.backend.series_bands import (
SCAN_CACHE_TTL_SECONDS = 60
SERIES_BANDS_CACHE_TTL_SECONDS = 60
-_STAGE_CHOICES = ["insufficient", "cold_start", "developing", "mature"]
-_VERDICT_CHOICES = ["spike", "drop", "silence"]
+
+class LogsAnomalyBaselineStage(models.TextChoices):
+ INSUFFICIENT = "insufficient", "insufficient"
+ COLD_START = "cold_start", "cold_start"
+ DEVELOPING = "developing", "developing"
+ MATURE = "mature", "mature"
+
+
+_STAGE_CHOICES = list(LogsAnomalyBaselineStage.values)
+
+
+class LogsAnomalyVerdict(models.TextChoices):
+ SPIKE = "spike", "spike"
+ DROP = "drop", "drop"
+ SILENCE = "silence", "silence"
+
+
+_VERDICT_CHOICES = list(LogsAnomalyVerdict.values)
_TIER_CHOICES = ["a", "b", "c", "d"]
_CONSTRAINT_CHOICES = ["team_retention", "byte_budget"]
diff --git a/products/logs/backend/presentation/views/api.py b/products/logs/backend/presentation/views/api.py
index a6bdf57fdfd2..d40de3d69641 100644
--- a/products/logs/backend/presentation/views/api.py
+++ b/products/logs/backend/presentation/views/api.py
@@ -3,6 +3,7 @@ import json
import base64
import datetime as dt
+from django.db import models
from django.utils import timezone
from drf_spectacular.types import OpenApiTypes
@@ -246,6 +247,11 @@ class _LogsValuesQuerySerializer(serializers.Serializer):
)
+class OrderBy(models.TextChoices):
+ LATEST = "latest", "latest"
+ EARLIEST = "earliest", "earliest"
+
+
class _LogsQueryBodySerializer(serializers.Serializer):
dateRange = _DateRangeSerializer(
required=False,
@@ -264,7 +270,7 @@ class _LogsQueryBodySerializer(serializers.Serializer):
help_text="Filter by service names.",
)
orderBy = serializers.ChoiceField(
- choices=["latest", "earliest"],
+ choices=OrderBy.choices,
required=False,
help_text="Order results by timestamp.",
)
diff --git a/products/logs/backend/presentation/views/views_api.py b/products/logs/backend/presentation/views/views_api.py
index 84b0f094dacd..6a82fba17271 100644
--- a/products/logs/backend/presentation/views/views_api.py
+++ b/products/logs/backend/presentation/views/views_api.py
@@ -1,5 +1,7 @@
from typing import Any
+from django.db import models
+
from rest_framework import serializers, viewsets
from posthog.api.routing import TeamAndOrgViewSetMixin
@@ -9,12 +11,22 @@ from posthog.event_usage import report_user_action
from products.logs.backend.models import LogsView
+class LogsViewColumnType(models.TextChoices):
+ TIMESTAMP = "timestamp", "timestamp"
+ LEVEL = "level", "level"
+ SOURCE = "source", "source"
+ TRACE_ID = "trace_id", "trace_id"
+ SPAN_ID = "span_id", "span_id"
+ MESSAGE = "message", "message"
+ CUSTOM = "custom", "custom"
+
+
class LogsViewColumnSerializer(serializers.Serializer):
id = serializers.CharField(
help_text="Client-generated stable identity for list operations (React keys, reorder). Never interpreted by the server.",
)
type = serializers.ChoiceField(
- choices=["timestamp", "level", "source", "trace_id", "span_id", "message", "custom"],
+ choices=LogsViewColumnType.choices,
help_text="Column type. Built-in types resolve client-side from log row fields; `custom` columns are computed server-side from `expression`.",
)
# Optional keys are omitted (not null) so the stored JSON round-trips the client shape exactly
diff --git a/products/logs/frontend/components/LogsAlerting/LogsAlertEventHistory.tsx b/products/logs/frontend/components/LogsAlerting/LogsAlertEventHistory.tsx
index 0e61cc16cf3a..d13d6351f09e 100644
--- a/products/logs/frontend/components/LogsAlerting/LogsAlertEventHistory.tsx
+++ b/products/logs/frontend/components/LogsAlerting/LogsAlertEventHistory.tsx
@@ -15,7 +15,7 @@ import {
LogsAlertConfigurationApi,
LogsAlertEventApi,
LogsAlertEventKindEnumApi,
- LogsAlertThresholdOperatorEnumApi,
+ LogsAlertConfigurationThresholdOperatorEnumApi,
} from 'products/logs/frontend/generated/api.schemas'
import { LogsAlertEventHistoryLogicProps, logsAlertEventHistoryLogic } from './logsAlertEventHistoryLogic'
@@ -32,7 +32,7 @@ export function LogsAlertEventHistoryContent({ alert }: { alert: LogsAlertConfig
function getHistoryThresholds(alert: LogsAlertConfigurationApi): AlertEvaluationThreshold[] {
const thresholdValue = alert.threshold_count ?? 100
- if (alert.threshold_operator === LogsAlertThresholdOperatorEnumApi.Below) {
+ if (alert.threshold_operator === LogsAlertConfigurationThresholdOperatorEnumApi.Below) {
return [{ direction: 'lower', value: thresholdValue, label: `Below (${thresholdValue})` }]
}
return [{ direction: 'upper', value: thresholdValue, label: `Above (${thresholdValue})` }]
diff --git a/products/logs/frontend/components/LogsAlerting/LogsAlertForm.tsx b/products/logs/frontend/components/LogsAlerting/LogsAlertForm.tsx
index b87199fcf0e3..87d7fd98f648 100644
--- a/products/logs/frontend/components/LogsAlerting/LogsAlertForm.tsx
+++ b/products/logs/frontend/components/LogsAlerting/LogsAlertForm.tsx
@@ -23,7 +23,7 @@ import { AlertEditorSection } from 'products/alerts/frontend/components/AlertEdi
import { QuietHoursFields } from 'products/alerts/frontend/components/QuietHoursFields'
import { ServiceFilter } from 'products/logs/frontend/components/LogsViewer/Filters/ServiceFilter'
import { SeverityLevelsFilter } from 'products/logs/frontend/components/LogsViewer/Filters/SeverityLevelsFilter'
-import { LogsAlertThresholdOperatorEnumApi } from 'products/logs/frontend/generated/api.schemas'
+import { LogsAlertConfigurationThresholdOperatorEnumApi } from 'products/logs/frontend/generated/api.schemas'
import { logsAlertFormLogic } from './logsAlertFormLogic'
@@ -171,8 +171,8 @@ export function LogsAlertTrigger(): JSX.Element {
value={alertForm.thresholdOperator}
onChange={(value) => setAlertFormValue('thresholdOperator', value)}
options={[
- { value: LogsAlertThresholdOperatorEnumApi.Above, label: 'above' },
- { value: LogsAlertThresholdOperatorEnumApi.Below, label: 'below' },
+ { value: LogsAlertConfigurationThresholdOperatorEnumApi.Above, label: 'above' },
+ { value: LogsAlertConfigurationThresholdOperatorEnumApi.Below, label: 'below' },
]}
size="small"
/>
diff --git a/products/logs/frontend/components/LogsAlerting/LogsAlertList.tsx b/products/logs/frontend/components/LogsAlerting/LogsAlertList.tsx
index 49d8e3638c16..050135c30b74 100644
--- a/products/logs/frontend/components/LogsAlerting/LogsAlertList.tsx
+++ b/products/logs/frontend/components/LogsAlerting/LogsAlertList.tsx
@@ -32,7 +32,7 @@ import {
NotificationDestinationTypeEnumApi,
LogsAlertConfigurationApi,
LogsAlertConfigurationStateEnumApi,
- LogsAlertThresholdOperatorEnumApi,
+ LogsAlertConfigurationThresholdOperatorEnumApi,
} from 'products/logs/frontend/generated/api.schemas'
import { logsAlertingLogic } from './logsAlertingLogic'
@@ -49,7 +49,7 @@ const DESTINATION_TAGS = [
const HedgehogMagnifyingGlass = pngHoggie(magnifyingGlassPng)
function formatThreshold(alert: LogsAlertConfigurationApi): string {
- const operator = alert.threshold_operator === LogsAlertThresholdOperatorEnumApi.Below ? '<' : '>'
+ const operator = alert.threshold_operator === LogsAlertConfigurationThresholdOperatorEnumApi.Below ? '<' : '>'
return `${operator} ${alert.threshold_count} in ${alert.window_minutes}m`
}
diff --git a/products/logs/frontend/components/LogsAlerting/__tests__/logsAlertUtils.test.ts b/products/logs/frontend/components/LogsAlerting/__tests__/logsAlertUtils.test.ts
index a2a8c27ac76a..7edd38f3f6ae 100644
--- a/products/logs/frontend/components/LogsAlerting/__tests__/logsAlertUtils.test.ts
+++ b/products/logs/frontend/components/LogsAlerting/__tests__/logsAlertUtils.test.ts
@@ -1,6 +1,6 @@
import { FilterLogicalOperator, HogFunctionType, PropertyFilterType, PropertyOperator } from '~/types'
-import { LogsAlertThresholdOperatorEnumApi } from 'products/logs/frontend/generated/api.schemas'
+import { LogsAlertConfigurationThresholdOperatorEnumApi } from 'products/logs/frontend/generated/api.schemas'
import { LogsAlertFormType } from '../logsAlertFormLogic'
import { buildLogsAlertFilterConfig, groupLogsAlertDestinations, runPreEnableChecks } from '../logsAlertUtils'
@@ -10,7 +10,7 @@ const baseForm = (overrides: Partial<LogsAlertFormType> = {}): LogsAlertFormType
severityLevels: ['error'],
serviceNames: [],
filterGroup: { type: FilterLogicalOperator.And, values: [] },
- thresholdOperator: LogsAlertThresholdOperatorEnumApi.Above,
+ thresholdOperator: LogsAlertConfigurationThresholdOperatorEnumApi.Above,
thresholdCount: 1,
windowMinutes: 5,
evaluationPeriods: 1,
diff --git a/products/logs/frontend/components/LogsAlerting/logsAlertFormLogic.ts b/products/logs/frontend/components/LogsAlerting/logsAlertFormLogic.ts
index ad34126f7a9d..3cb433acf20f 100644
--- a/products/logs/frontend/components/LogsAlerting/logsAlertFormLogic.ts
+++ b/products/logs/frontend/components/LogsAlerting/logsAlertFormLogic.ts
@@ -24,7 +24,7 @@ import {
LogsAlertConfigurationApi,
LogsAlertSimulateResponseApi,
PatchedLogsAlertConfigurationApi,
- LogsAlertThresholdOperatorEnumApi,
+ LogsAlertConfigurationThresholdOperatorEnumApi,
} from 'products/logs/frontend/generated/api.schemas'
import { logsAlertingLogic } from './logsAlertingLogic'
@@ -44,7 +44,7 @@ export interface LogsAlertFormType {
severityLevels: LogMessage['severity_text'][]
serviceNames: string[]
filterGroup: UniversalFiltersGroup
- thresholdOperator: LogsAlertThresholdOperatorEnumApi
+ thresholdOperator: LogsAlertConfigurationThresholdOperatorEnumApi
thresholdCount: number
windowMinutes: number
evaluationPeriods: number
@@ -85,7 +85,7 @@ export function buildFormDefaults(alert: LogsAlertConfigurationApi | null): Logs
: DEFAULT_SEVERITY_LEVELS,
serviceNames: (filters.serviceNames as string[]) ?? [],
filterGroup: extractFilterGroup(alert),
- thresholdOperator: alert?.threshold_operator ?? LogsAlertThresholdOperatorEnumApi.Above,
+ thresholdOperator: alert?.threshold_operator ?? LogsAlertConfigurationThresholdOperatorEnumApi.Above,
thresholdCount: alert?.threshold_count ?? 100,
windowMinutes: alert?.window_minutes ?? 10,
evaluationPeriods: alert?.evaluation_periods ?? 1,
diff --git a/products/logs/frontend/components/LogsSampling/LogsSamplingForm.tsx b/products/logs/frontend/components/LogsSampling/LogsSamplingForm.tsx
index 8a8493d3f330..df5158eee687 100644
--- a/products/logs/frontend/components/LogsSampling/LogsSamplingForm.tsx
+++ b/products/logs/frontend/components/LogsSampling/LogsSamplingForm.tsx
@@ -7,7 +7,7 @@ import { LemonField } from 'lib/lemon-ui/LemonField'
import { SceneSection } from '~/layout/scenes/components/SceneSection'
import { LogsFilterVolumeSparkline } from 'products/logs/frontend/components/LogsFilterPreview/LogsFilterVolumeSparkline'
-import { RuleTypeEnumApi } from 'products/logs/frontend/generated/api.schemas'
+import { LogsExclusionRuleRuleTypeEnumApi } from 'products/logs/frontend/generated/api.schemas'
import { DropRuleFilterEditor } from './DropRuleFilterEditor'
import { RateLimitUnit, logsSamplingFormLogic, rateLimitAmountToKbPerSecond } from './logsSamplingFormLogic'
@@ -18,16 +18,16 @@ const RATE_LIMIT_UNIT_OPTIONS: { value: RateLimitUnit; label: string }[] = [
{ value: 'GB/s', label: 'GB/s' },
]
-const ACTION_OPTIONS: { value: RuleTypeEnumApi; label: string }[] = [
- { value: RuleTypeEnumApi.PathDrop, label: 'Drop' },
- { value: RuleTypeEnumApi.RateLimit, label: 'Rate limit' },
+const ACTION_OPTIONS: { value: LogsExclusionRuleRuleTypeEnumApi; label: string }[] = [
+ { value: LogsExclusionRuleRuleTypeEnumApi.PathDrop, label: 'Drop' },
+ { value: LogsExclusionRuleRuleTypeEnumApi.RateLimit, label: 'Rate limit' },
]
export function LogsSamplingForm(): JSX.Element {
const { samplingForm, samplingFormErrors } = useValues(logsSamplingFormLogic)
const { setSamplingFormValue } = useActions(logsSamplingFormLogic)
- const isRateLimit = samplingForm.rule_type === RuleTypeEnumApi.RateLimit
+ const isRateLimit = samplingForm.rule_type === LogsExclusionRuleRuleTypeEnumApi.RateLimit
const hasFilters = samplingForm.filter_group.values.length > 0
const matchDescription = isRateLimit
diff --git a/products/logs/frontend/components/LogsSampling/logsSamplingFormLogic.test.ts b/products/logs/frontend/components/LogsSampling/logsSamplingFormLogic.test.ts
index 9aec481e645f..5a312ee0e635 100644
--- a/products/logs/frontend/components/LogsSampling/logsSamplingFormLogic.test.ts
+++ b/products/logs/frontend/components/LogsSampling/logsSamplingFormLogic.test.ts
@@ -1,6 +1,6 @@
import { FilterLogicalOperator } from '~/types'
-import { LogsSamplingRuleApi, RuleTypeEnumApi } from 'products/logs/frontend/generated/api.schemas'
+import { LogsSamplingRuleApi, LogsExclusionRuleRuleTypeEnumApi } from 'products/logs/frontend/generated/api.schemas'
import {
buildSamplingConfigPayload,
@@ -12,7 +12,7 @@ import {
const rateLimitForm = (overrides: Partial<LogsSamplingFormType> = {}): LogsSamplingFormType => ({
name: 'cap smokescreen',
enabled: true,
- rule_type: RuleTypeEnumApi.RateLimit,
+ rule_type: LogsExclusionRuleRuleTypeEnumApi.RateLimit,
filter_group: { type: FilterLogicalOperator.And, values: [] },
rate_limit_amount: '1',
rate_limit_unit: 'MB/s',
@@ -27,7 +27,7 @@ describe('logsSamplingFormLogic serialization', () => {
} as LogsSamplingFormType['filter_group']
const config = buildSamplingConfigPayload(
- rateLimitForm({ rule_type: RuleTypeEnumApi.PathDrop, filter_group: innerGroup })
+ rateLimitForm({ rule_type: LogsExclusionRuleRuleTypeEnumApi.PathDrop, filter_group: innerGroup })
)
// The whole config is the wrapped filter group — the worker evaluates
@@ -70,7 +70,7 @@ describe('logsSamplingFormLogic serialization', () => {
const rule = {
name: 'cap smokescreen',
enabled: true,
- rule_type: RuleTypeEnumApi.RateLimit,
+ rule_type: LogsExclusionRuleRuleTypeEnumApi.RateLimit,
config: { kb_per_second: 1000, burst_kb: 10000, filter_group: { type: 'AND', values: [] } },
} as unknown as LogsSamplingRuleApi
@@ -83,7 +83,7 @@ describe('logsSamplingFormLogic serialization', () => {
const legacy = {
name: 'legacy cap',
enabled: true,
- rule_type: RuleTypeEnumApi.RateLimit,
+ rule_type: LogsExclusionRuleRuleTypeEnumApi.RateLimit,
config: { logs_per_second: 50, burst_logs: 500 },
} as unknown as LogsSamplingRuleApi
diff --git a/products/logs/frontend/components/LogsSampling/logsSamplingFormLogic.ts b/products/logs/frontend/components/LogsSampling/logsSamplingFormLogic.ts
index 3cc10af81708..86a6c055beaa 100644
--- a/products/logs/frontend/components/LogsSampling/logsSamplingFormLogic.ts
+++ b/products/logs/frontend/components/LogsSampling/logsSamplingFormLogic.ts
@@ -13,7 +13,7 @@ import { logsSamplingRulesCreate, logsSamplingRulesPartialUpdate } from 'product
import {
LogsSamplingRuleApi,
PatchedLogsSamplingRuleApi,
- RuleTypeEnumApi,
+ LogsExclusionRuleRuleTypeEnumApi,
} from 'products/logs/frontend/generated/api.schemas'
import { logsDropRulesSettingsUrl } from 'products/logs/frontend/logsDropRulesSettingsUrl'
@@ -41,7 +41,7 @@ export const MAX_RATE_LIMIT_KB_PER_S = 1_000_000
export interface LogsSamplingFormType {
name: string
enabled: boolean
- rule_type: RuleTypeEnumApi
+ rule_type: LogsExclusionRuleRuleTypeEnumApi
filter_group: UniversalFiltersGroup
/** User-entered amount in the chosen unit. Fractional values are allowed. */
rate_limit_amount: string
@@ -51,7 +51,7 @@ export interface LogsSamplingFormType {
const DEFAULT_FORM: LogsSamplingFormType = {
name: '',
enabled: true,
- rule_type: RuleTypeEnumApi.PathDrop,
+ rule_type: LogsExclusionRuleRuleTypeEnumApi.PathDrop,
filter_group: EMPTY_FILTER_GROUP,
rate_limit_amount: '',
rate_limit_unit: 'MB/s',
@@ -112,7 +112,10 @@ export function buildSamplingFormDefaults(rule: LogsSamplingRuleApi | null): Log
}
// Legacy SEVERITY_SAMPLING rules collapse into PathDrop — the new form unifies
// severity into the filter group, so the dedicated severity rule type is no longer surfaced.
- const rule_type = rule.rule_type === RuleTypeEnumApi.SeveritySampling ? RuleTypeEnumApi.PathDrop : rule.rule_type
+ const rule_type =
+ rule.rule_type === LogsExclusionRuleRuleTypeEnumApi.SeveritySampling
+ ? LogsExclusionRuleRuleTypeEnumApi.PathDrop
+ : rule.rule_type
const cfg = (rule.config ?? {}) as Record<string, unknown>
const form: LogsSamplingFormType = {
...DEFAULT_FORM,
@@ -121,7 +124,7 @@ export function buildSamplingFormDefaults(rule: LogsSamplingRuleApi | null): Log
rule_type,
}
form.filter_group = extractFilterGroup(cfg.filter_group)
- if (rule_type === RuleTypeEnumApi.RateLimit) {
+ if (rule_type === LogsExclusionRuleRuleTypeEnumApi.RateLimit) {
// Read the byte-rate field the ingestion worker enforces on (`kb_per_second`).
// Fall back to the legacy `logs_per_second` field for rules saved before this
// fix so they still populate the form — the stored number was always derived as
@@ -137,7 +140,7 @@ export function buildSamplingFormDefaults(rule: LogsSamplingRuleApi | null): Log
}
export function buildSamplingConfigPayload(form: LogsSamplingFormType): Record<string, unknown> {
- if (form.rule_type === RuleTypeEnumApi.RateLimit) {
+ if (form.rule_type === LogsExclusionRuleRuleTypeEnumApi.RateLimit) {
// The form expresses a byte rate (KB/s · MB/s · GB/s) and the preview plots the
// threshold in bytes — so the rule must be stored in byte mode (`kb_per_second`),
// which charges each log its own uncompressed size. Writing `logs_per_second`
@@ -240,7 +243,7 @@ export const logsSamplingFormLogic = kea<logsSamplingFormLogicType>([
defaults: buildSamplingFormDefaults(props.rule),
errors: (form: LogsSamplingFormType) => {
let rateAmountError: string | undefined
- if (form.rule_type === RuleTypeEnumApi.RateLimit) {
+ if (form.rule_type === LogsExclusionRuleRuleTypeEnumApi.RateLimit) {
if (form.rate_limit_amount.trim() === '') {
rateAmountError = 'Enter a rate limit'
} else {
diff --git a/products/logs/frontend/components/LogsSampling/ruleTypeLabel.ts b/products/logs/frontend/components/LogsSampling/ruleTypeLabel.ts
index 5507bbcf1512..17589a36b0a3 100644
--- a/products/logs/frontend/components/LogsSampling/ruleTypeLabel.ts
+++ b/products/logs/frontend/components/LogsSampling/ruleTypeLabel.ts
@@ -1,13 +1,13 @@
-import { RuleTypeEnumApi } from 'products/logs/frontend/generated/api.schemas'
+import { LogsExclusionRuleRuleTypeEnumApi } from 'products/logs/frontend/generated/api.schemas'
-/** User-visible rule type label — keep in sync anywhere `RuleTypeEnumApi` is shown. */
-export function ruleTypeLabel(ruleType: RuleTypeEnumApi): string {
+/** User-visible rule type label — keep in sync anywhere `LogsExclusionRuleRuleTypeEnumApi` is shown. */
+export function ruleTypeLabel(ruleType: LogsExclusionRuleRuleTypeEnumApi): string {
switch (ruleType) {
- case RuleTypeEnumApi.PathDrop:
+ case LogsExclusionRuleRuleTypeEnumApi.PathDrop:
return 'Drop'
- case RuleTypeEnumApi.SeveritySampling:
+ case LogsExclusionRuleRuleTypeEnumApi.SeveritySampling:
return 'Drop by severity'
- case RuleTypeEnumApi.RateLimit:
+ case LogsExclusionRuleRuleTypeEnumApi.RateLimit:
return 'Rate limit'
default: {
return String(ruleType)
diff --git a/products/logs/frontend/generated/api.schemas.ts b/products/logs/frontend/generated/api.schemas.ts
index a7408e940df7..34bf8b932f18 100644
--- a/products/logs/frontend/generated/api.schemas.ts
+++ b/products/logs/frontend/generated/api.schemas.ts
@@ -396,10 +396,10 @@ export interface LogsAlertFiltersApi {
* * `above` - Above
* * `below` - Below
*/
-export type LogsAlertThresholdOperatorEnumApi =
- (typeof LogsAlertThresholdOperatorEnumApi)[keyof typeof LogsAlertThresholdOperatorEnumApi]
+export type LogsAlertConfigurationThresholdOperatorEnumApi =
+ (typeof LogsAlertConfigurationThresholdOperatorEnumApi)[keyof typeof LogsAlertConfigurationThresholdOperatorEnumApi]
-export const LogsAlertThresholdOperatorEnumApi = {
+export const LogsAlertConfigurationThresholdOperatorEnumApi = {
Above: 'above',
Below: 'below',
} as const
@@ -546,7 +546,7 @@ export interface LogsAlertConfigurationApi {
*
* * `above` - Above
* * `below` - Below */
- threshold_operator?: LogsAlertThresholdOperatorEnumApi
+ threshold_operator?: LogsAlertConfigurationThresholdOperatorEnumApi
/** Time window in minutes over which log entries are counted. Allowed values: 5, 10, 15, 30, 60. */
window_minutes?: number
/** How often the alert is evaluated, in minutes. Server-managed. */
@@ -675,7 +675,7 @@ export interface LogsAlertConfigurationDetailApi {
*
* * `above` - Above
* * `below` - Below */
- threshold_operator?: LogsAlertThresholdOperatorEnumApi
+ threshold_operator?: LogsAlertConfigurationThresholdOperatorEnumApi
/** Time window in minutes over which log entries are counted. Allowed values: 5, 10, 15, 30, 60. */
window_minutes?: number
/** How often the alert is evaluated, in minutes. Server-managed. */
@@ -777,7 +777,7 @@ export interface PatchedLogsAlertConfigurationApi {
*
* * `above` - Above
* * `below` - Below */
- threshold_operator?: LogsAlertThresholdOperatorEnumApi
+ threshold_operator?: LogsAlertConfigurationThresholdOperatorEnumApi
/** Time window in minutes over which log entries are counted. Allowed values: 5, 10, 15, 30, 60. */
window_minutes?: number
/** How often the alert is evaluated, in minutes. Server-managed. */
@@ -944,7 +944,7 @@ export interface LogsAlertSimulateRequestApi {
*
* * `above` - Above
* * `below` - Below */
- threshold_operator: LogsAlertThresholdOperatorEnumApi
+ threshold_operator: LogsAlertConfigurationThresholdOperatorEnumApi
/** Window size in minutes — determines bucket interval. */
window_minutes: number
/**
@@ -2149,9 +2149,10 @@ export interface LogsRetentionRuleNameSuggestionApi {
* * `path_drop` - Path exclusion
* * `rate_limit` - Rate limit
*/
-export type RuleTypeEnumApi = (typeof RuleTypeEnumApi)[keyof typeof RuleTypeEnumApi]
+export type LogsExclusionRuleRuleTypeEnumApi =
+ (typeof LogsExclusionRuleRuleTypeEnumApi)[keyof typeof LogsExclusionRuleRuleTypeEnumApi]
-export const RuleTypeEnumApi = {
+export const LogsExclusionRuleRuleTypeEnumApi = {
SeveritySampling: 'severity_sampling',
PathDrop: 'path_drop',
RateLimit: 'rate_limit',
@@ -2180,7 +2181,7 @@ export interface LogsSamplingRuleApi {
* * `severity_sampling` - Severity-based reduction
* * `path_drop` - Path exclusion
* * `rate_limit` - Rate limit */
- rule_type: RuleTypeEnumApi
+ rule_type: LogsExclusionRuleRuleTypeEnumApi
/**
* Optional legacy service-name scope; new rules use `config.filter_group` for matching instead.
* @maxLength 512
@@ -2237,7 +2238,7 @@ export interface PatchedLogsSamplingRuleApi {
* * `severity_sampling` - Severity-based reduction
* * `path_drop` - Path exclusion
* * `rate_limit` - Rate limit */
- rule_type?: RuleTypeEnumApi
+ rule_type?: LogsExclusionRuleRuleTypeEnumApi
/**
* Optional legacy service-name scope; new rules use `config.filter_group` for matching instead.
* @maxLength 512
diff --git a/products/marketing_analytics/backend/api.py b/products/marketing_analytics/backend/api.py
index d401507559aa..09ad1c61eaca 100644
--- a/products/marketing_analytics/backend/api.py
+++ b/products/marketing_analytics/backend/api.py
@@ -5,7 +5,7 @@ from operator import or_
from typing import Any, Optional, cast
from django.core.cache import cache
-from django.db import transaction
+from django.db import models, transaction
import structlog
from asgiref.sync import async_to_sync
@@ -186,16 +186,22 @@ class CampaignAuditResultSerializer(serializers.Serializer):
issues = UtmIssueSerializer(many=True, help_text="List of detected UTM configuration issues")
+class SourceMatch(models.TextChoices):
+ NONE = "none", "none"
+ AUTO = "auto", "auto"
+ MAPPED = "mapped", "mapped"
+
+
class UtmEventSerializer(serializers.Serializer):
utm_campaign = serializers.CharField(help_text="UTM campaign value from pageview events")
utm_source = serializers.CharField(help_text="UTM source value from pageview events")
event_count = serializers.IntegerField(help_text="Number of pageview events with this UTM combination")
campaign_match = serializers.ChoiceField(
- choices=["none", "auto", "mapped"],
+ choices=SourceMatch.choices,
help_text="How utm_campaign matched: none, auto (direct name/id), or mapped (manual mapping)",
)
source_match = serializers.ChoiceField(
- choices=["none", "auto", "mapped"],
+ choices=SourceMatch.choices,
help_text="How utm_source matched: none, auto (default source), or mapped (custom mapping)",
)
matched_campaign = serializers.CharField(allow_null=True, help_text="Name of the matched campaign, if any")
diff --git a/products/mcp_analytics/frontend/generated/api.schemas.ts b/products/mcp_analytics/frontend/generated/api.schemas.ts
index 20c1360150ca..b164a43eb10f 100644
--- a/products/mcp_analytics/frontend/generated/api.schemas.ts
+++ b/products/mcp_analytics/frontend/generated/api.schemas.ts
@@ -74,10 +74,10 @@ export interface PaginatedMCPAnalyticsSubmissionListApi {
* * `docs` - Docs
* * `other` - Other
*/
-export type MCPFeedbackCreateCategoryEnumApi =
- (typeof MCPFeedbackCreateCategoryEnumApi)[keyof typeof MCPFeedbackCreateCategoryEnumApi]
+export type MCPAnalyticsSubmissionFeedbackCategoryEnumApi =
+ (typeof MCPAnalyticsSubmissionFeedbackCategoryEnumApi)[keyof typeof MCPAnalyticsSubmissionFeedbackCategoryEnumApi]
-export const MCPFeedbackCreateCategoryEnumApi = {
+export const MCPAnalyticsSubmissionFeedbackCategoryEnumApi = {
Results: 'results',
Usability: 'usability',
Bug: 'bug',
@@ -138,7 +138,7 @@ export interface MCPFeedbackCreateApi {
* * `bug` - Bug
* * `docs` - Docs
* * `other` - Other */
- category?: MCPFeedbackCreateCategoryEnumApi
+ category?: MCPAnalyticsSubmissionFeedbackCategoryEnumApi
}
/**
diff --git a/products/mcp_store/backend/models.py b/products/mcp_store/backend/models.py
index cf63871380c3..1352383bbb7e 100644
--- a/products/mcp_store/backend/models.py
+++ b/products/mcp_store/backend/models.py
@@ -8,28 +8,37 @@ from posthog.helpers.encrypted_fields import EncryptedJSONField
from posthog.models.scoping.root_mixin import TeamScopedRootMixin
from posthog.models.utils import CreatedMetaFields, UpdatedMetaFields, UUIDModel
-AUTH_TYPE_CHOICES = [
- ("api_key", "API Key"),
- ("oauth", "OAuth"),
-]
-APPROVAL_STATES = [
- ("approved", "Approved"),
- ("needs_approval", "Needs approval"),
- ("do_not_use", "Do not use"),
-]
+class MCPAuthType(models.TextChoices):
+ API_KEY = "api_key", "API Key"
+ OAUTH = "oauth", "OAuth"
+
+
+AUTH_TYPE_CHOICES = MCPAuthType.choices
+
+
+class MCPToolApprovalState(models.TextChoices):
+ APPROVED = "approved", "Approved"
+ NEEDS_APPROVAL = "needs_approval", "Needs approval"
+ DO_NOT_USE = "do_not_use", "Do not use"
+
+
+APPROVAL_STATES = MCPToolApprovalState.choices
+
# Catalog categories used by the marketplace UI to group templates. Pinned to a
# finite choice list so the frontend can render predictable filter chips. New
# rows default to "dev" until they're reclassified in the admin.
-CATEGORY_CHOICES = [
- ("business", "Business Operations"),
- ("data", "Data & Analytics"),
- ("design", "Design & Content"),
- ("dev", "Developer Tools & APIs"),
- ("infra", "Infrastructure"),
- ("productivity", "Productivity & Collaboration"),
-]
+class MCPServerCategory(models.TextChoices):
+ BUSINESS = "business", "Business Operations"
+ DATA = "data", "Data & Analytics"
+ DESIGN = "design", "Design & Content"
+ DEV = "dev", "Developer Tools & APIs"
+ INFRA = "infra", "Infrastructure"
+ PRODUCTIVITY = "productivity", "Productivity & Collaboration"
+
+
+CATEGORY_CHOICES = MCPServerCategory.choices
SCOPE_CHOICES = [
("personal", "Personal"),
@@ -46,19 +55,25 @@ AGENT_GRANT_SCOPE_CHOICES = [
("team", "Team"),
]
-SERVICE_ACCOUNT_STATUS_CHOICES = [
- ("active", "Active"),
- ("paused", "Paused"),
-]
+
+class MCPServiceAccountStatus(models.TextChoices):
+ ACTIVE = "active", "Active"
+ PAUSED = "paused", "Paused"
+
+
+SERVICE_ACCOUNT_STATUS_CHOICES = MCPServiceAccountStatus.choices
+
# Team-level policy baselines. They derive a default per-tool state for tools
# that have no explicit policy row (see policy.member_preset_team_state).
-POLICY_PRESET_CHOICES = [
- ("allow", "Allow all"),
- ("user", "Member decides"),
- ("ask", "Ask for destructive"),
- ("block", "Block destructive"),
-]
+class MCPPolicyPreset(models.TextChoices):
+ ALLOW = "allow", "Allow all"
+ USER = "user", "Member decides"
+ ASK = "ask", "Ask for destructive"
+ BLOCK = "block", "Block destructive"
+
+
+POLICY_PRESET_CHOICES = MCPPolicyPreset.choices
POLICY_SCOPE_TYPE_CHOICES = [
("team", "Team default"),
@@ -77,14 +92,17 @@ ORG_RULE_EFFECT_CHOICES = [
("do_not_use", "Block"),
]
+
# How the gateway decided a proxied tool call. "pending" is an agent call that
# hit a needs_approval tool and was rejected awaiting a human.
-AUDIT_DECISION_CHOICES = [
- ("auto", "Auto-approved"),
- ("approved", "Approved"),
- ("pending", "Awaiting approval"),
- ("blocked", "Blocked"),
-]
+class MCPAuditDecision(models.TextChoices):
+ AUTO = "auto", "Auto-approved"
+ APPROVED = "approved", "Approved"
+ PENDING = "pending", "Awaiting approval"
+ BLOCKED = "blocked", "Blocked"
+
+
+AUDIT_DECISION_CHOICES = MCPAuditDecision.choices
class SensitiveConfig(TypedDict, total=False):
diff --git a/products/mcp_store/backend/presentation/views.py b/products/mcp_store/backend/presentation/views.py
index f0d993db9483..ab8410324e9d 100644
--- a/products/mcp_store/backend/presentation/views.py
+++ b/products/mcp_store/backend/presentation/views.py
@@ -13,7 +13,7 @@ from urllib.parse import parse_qsl, urlencode, urlparse, urlsplit, urlunsplit
from django.conf import settings
from django.core.exceptions import ValidationError as DjangoValidationError
from django.core.validators import DomainNameValidator
-from django.db import IntegrityError, transaction
+from django.db import IntegrityError, models, transaction
from django.db.models import Count, Q, QuerySet
from django.http import HttpResponse
from django.http.response import HttpResponseBase
@@ -378,6 +378,11 @@ class MCPServerInstallationSerializer(serializers.ModelSerializer):
return request.user.id == obj.user_id
+class MCPInstallationScope(models.TextChoices):
+ PERSONAL = "personal", "personal"
+ SHARED = "shared", "shared"
+
+
class InstallCustomSerializer(serializers.Serializer):
name = serializers.CharField(max_length=200)
url = serializers.URLField(max_length=2048)
@@ -391,7 +396,7 @@ class InstallCustomSerializer(serializers.Serializer):
install_source = serializers.ChoiceField(choices=["posthog", "posthog-code"], required=False, default="posthog")
posthog_code_callback_url = serializers.CharField(required=False, allow_blank=True, default="")
scope = serializers.ChoiceField(
- choices=["personal", "shared"],
+ choices=MCPInstallationScope.choices,
required=False,
default="personal",
help_text=(
@@ -442,7 +447,7 @@ class InstallTemplateSerializer(serializers.Serializer):
install_source = serializers.ChoiceField(choices=["posthog", "posthog-code"], required=False, default="posthog")
posthog_code_callback_url = serializers.CharField(required=False, allow_blank=True, default="")
scope = serializers.ChoiceField(
- choices=["personal", "shared"],
+ choices=MCPInstallationScope.choices,
required=False,
default="personal",
help_text=(
diff --git a/products/messaging/backend/api/message_templates.py b/products/messaging/backend/api/message_templates.py
index 7eb8b2bccce7..527da2195ee1 100644
--- a/products/messaging/backend/api/message_templates.py
+++ b/products/messaging/backend/api/message_templates.py
@@ -1,7 +1,7 @@
from copy import deepcopy
from typing import Any
-from django.db import transaction
+from django.db import models, transaction
import structlog
from drf_spectacular.utils import extend_schema, extend_schema_field
@@ -178,17 +178,19 @@ class MessageTemplateSerializer(serializers.ModelSerializer):
return instance
-DESIGN_OPERATION_TYPES = [
- "update_content",
- "update_column",
- "update_row",
- "update_body",
- "add_content",
- "remove_content",
- "move_content",
- "add_row",
- "remove_row",
-]
+class EmailTemplateDesignOperation(models.TextChoices):
+ UPDATE_CONTENT = "update_content", "update_content"
+ UPDATE_COLUMN = "update_column", "update_column"
+ UPDATE_ROW = "update_row", "update_row"
+ UPDATE_BODY = "update_body", "update_body"
+ ADD_CONTENT = "add_content", "add_content"
+ REMOVE_CONTENT = "remove_content", "remove_content"
+ MOVE_CONTENT = "move_content", "move_content"
+ ADD_ROW = "add_row", "add_row"
+ REMOVE_ROW = "remove_row", "remove_row"
+
+
+DESIGN_OPERATION_TYPES = list(EmailTemplateDesignOperation.values)
# Per-op required fields, validated in DesignOperationSerializer.validate so a malformed op is rejected
# before any are applied (the whole batch is atomic).
diff --git a/products/messaging/frontend/generated/api.schemas.ts b/products/messaging/frontend/generated/api.schemas.ts
index 92851610028c..141e7fe4180d 100644
--- a/products/messaging/frontend/generated/api.schemas.ts
+++ b/products/messaging/frontend/generated/api.schemas.ts
@@ -11,9 +11,9 @@
* * `marketing` - Marketing
* * `transactional` - Transactional
*/
-export type CategoryTypeEnumApi = (typeof CategoryTypeEnumApi)[keyof typeof CategoryTypeEnumApi]
+export type MessageCategoryTypeEnumApi = (typeof MessageCategoryTypeEnumApi)[keyof typeof MessageCategoryTypeEnumApi]
-export const CategoryTypeEnumApi = {
+export const MessageCategoryTypeEnumApi = {
Marketing: 'marketing',
Transactional: 'transactional',
} as const
@@ -26,7 +26,7 @@ export interface MessageCategoryApi {
name: string
description?: string
public_description?: string
- category_type?: CategoryTypeEnumApi
+ category_type?: MessageCategoryTypeEnumApi
readonly created_at: string
readonly updated_at: string
/** @nullable */
@@ -51,7 +51,7 @@ export interface PatchedMessageCategoryApi {
name?: string
description?: string
public_description?: string
- category_type?: CategoryTypeEnumApi
+ category_type?: MessageCategoryTypeEnumApi
readonly created_at?: string
readonly updated_at?: string
/** @nullable */
@@ -174,10 +174,9 @@ export interface AddSuppressionRequestApi {
* * `MANUAL` - Manual
* * `COMPLAINT` - Complaint
*/
-export type MessageSuppressionSourceEnumApi =
- (typeof MessageSuppressionSourceEnumApi)[keyof typeof MessageSuppressionSourceEnumApi]
+export type SuppressionSourceEnumApi = (typeof SuppressionSourceEnumApi)[keyof typeof SuppressionSourceEnumApi]
-export const MessageSuppressionSourceEnumApi = {
+export const SuppressionSourceEnumApi = {
Bounce: 'BOUNCE',
Manual: 'MANUAL',
Complaint: 'COMPLAINT',
@@ -193,7 +192,7 @@ export interface MessageSuppressionApi {
* * `BOUNCE` - Bounce
* * `MANUAL` - Manual
* * `COMPLAINT` - Complaint */
- readonly source: MessageSuppressionSourceEnumApi
+ readonly source: SuppressionSourceEnumApi
/**
* Human-readable reason for the suppression (e.g. 'Auto-suppressed after 5 consecutive soft bounces').
* @nullable
diff --git a/products/metrics/backend/presentation/api.py b/products/metrics/backend/presentation/api.py
index b1a740a9ff8b..1975df6f0b13 100644
--- a/products/metrics/backend/presentation/api.py
+++ b/products/metrics/backend/presentation/api.py
@@ -8,6 +8,7 @@ import datetime as dt
from dataclasses import asdict
from typing import cast
+from django.db import models
from django.utils import timezone
from drf_spectacular.utils import extend_schema
@@ -51,13 +52,26 @@ from products.metrics.backend.facade.enums import AttributeScope, FilterOp, Metr
__all__ = ["MetricsViewSet"]
+class MetricAttributeScope(models.TextChoices):
+ RESOURCE = "resource", "resource"
+ ATTRIBUTE = "attribute", "attribute"
+ AUTO = "auto", "auto"
+
+
+class Op(models.TextChoices):
+ EQ = "eq", "eq"
+ NEQ = "neq", "neq"
+ REGEX = "regex", "regex"
+ NOT_REGEX = "not_regex", "not_regex"
+
+
class _MetricFilterSerializer(serializers.Serializer):
key = serializers.CharField(
max_length=255,
help_text="Attribute name to filter on, without any type-tag suffix (e.g. 'k8s.pod.name', 'env').",
)
op = serializers.ChoiceField(
- choices=["eq", "neq", "regex", "not_regex"],
+ choices=Op.choices,
default="eq",
help_text="Comparison operator. 'regex'/'not_regex' use RE2 syntax. Negative operators also match rows that lack the key entirely, mirroring Prometheus negative matchers.",
)
@@ -67,7 +81,7 @@ class _MetricFilterSerializer(serializers.Serializer):
help_text="Value to compare against. For regex operators this is the pattern.",
)
scope = serializers.ChoiceField(
- choices=["resource", "attribute", "auto"],
+ choices=MetricAttributeScope.choices,
default="auto",
help_text="Where the attribute lives: 'resource' = per-target resource attributes (k8s.pod.name, service.version), 'attribute' = per-datapoint attributes (http.method, path), 'auto' = resource first with per-datapoint fallback. Use 'auto' unless you know the exact scope.",
)
@@ -79,7 +93,7 @@ class _MetricGroupBySerializer(serializers.Serializer):
help_text="Attribute name to split series by (e.g. 'k8s.pod.name', 'env').",
)
scope = serializers.ChoiceField(
- choices=["resource", "attribute", "auto"],
+ choices=MetricAttributeScope.choices,
default="auto",
help_text="Where the attribute lives; same semantics as filter scope. Use 'auto' unless you know the exact scope.",
)
@@ -126,6 +140,17 @@ class _MetricClauseSerializer(serializers.Serializer):
)
+class MetricQueryInterval(models.TextChoices):
+ SECOND = "second", "second"
+ MINUTE = "minute", "minute"
+ MINUTE_5 = "minute_5", "minute_5"
+ MINUTE_15 = "minute_15", "minute_15"
+ HOUR = "hour", "hour"
+ HOUR_6 = "hour_6", "hour_6"
+ DAY = "day", "day"
+ WEEK = "week", "week"
+
+
class _MetricQueryBodySerializer(serializers.Serializer):
metricName = serializers.CharField(
max_length=255,
@@ -163,7 +188,7 @@ class _MetricQueryBodySerializer(serializers.Serializer):
help_text="Labels to split the result into separate series by. Series share one time grid and are capped at the 100 largest.",
)
interval = serializers.ChoiceField(
- choices=["second", "minute", "minute_5", "minute_15", "hour", "hour_6", "day", "week"],
+ choices=MetricQueryInterval.choices,
required=False,
allow_null=True,
help_text="Bucket size for the shared time grid. Omit to auto-pick (~60 buckets across the range).",
@@ -332,6 +357,12 @@ class _MetricAnomalyDimensionSerializer(serializers.Serializer):
)
+class MetricAnomalyDirection(models.TextChoices):
+ UP = "up", "up"
+ DOWN = "down", "down"
+ FLAT = "flat", "flat"
+
+
class _MetricAnomalyReportSerializer(serializers.Serializer):
metric_name = serializers.CharField(help_text="Metric that was characterized.")
aggregation = serializers.CharField(help_text="Aggregation used (auto-picked when not specified).")
@@ -348,7 +379,7 @@ class _MetricAnomalyReportSerializer(serializers.Serializer):
help_text="anomaly_mean / baseline_mean. A zero baseline yields anomaly_mean itself."
)
direction = serializers.ChoiceField(
- choices=["up", "down", "flat"], help_text="Which way the metric moved versus the baseline."
+ choices=MetricAnomalyDirection.choices, help_text="Which way the metric moved versus the baseline."
)
onset_time = serializers.CharField(
allow_null=True,
@@ -693,7 +724,7 @@ class _MetricExplainBodySerializer(serializers.Serializer):
help_text="Start of the bucket to explain, as returned in a query result's 'time'. ISO 8601.",
)
interval = serializers.ChoiceField(
- choices=["second", "minute", "minute_5", "minute_15", "hour", "hour_6", "day", "week"],
+ choices=MetricQueryInterval.choices,
help_text="Bucket size the point was plotted at. Must match the query that produced it, or the decomposition explains a different span.",
)
diff --git a/products/notebooks/backend/sql_v2_serializers.py b/products/notebooks/backend/sql_v2_serializers.py
index cf8c5b8445a9..47cde3a7e8ed 100644
--- a/products/notebooks/backend/sql_v2_serializers.py
+++ b/products/notebooks/backend/sql_v2_serializers.py
@@ -1,5 +1,7 @@
from typing import Any
+from django.db import models
+
from drf_spectacular.utils import extend_schema_field
from rest_framework import serializers
@@ -17,12 +19,17 @@ class LenientTimingsField(serializers.JSONField):
"""
+class NotebookSQLV2RefKind(models.TextChoices):
+ HOGQL = "hogql", "hogql"
+ LOCAL = "local", "local"
+
+
class NotebookSQLV2RefSerializer(serializers.Serializer):
node_id = serializers.CharField(help_text="ProseMirror node id of the upstream node this name points at.")
# Named `kind` on purpose (matches the kernel input spec); avoids the `type`/`format`
# enum-collision trap.
kind = serializers.ChoiceField(
- choices=["hogql", "local"],
+ choices=NotebookSQLV2RefKind.choices,
required=False,
default="hogql",
help_text=(
@@ -79,10 +86,15 @@ class NotebookVariableSerializer(serializers.Serializer):
return name
+class NotebookSQLV2NodeType(models.TextChoices):
+ HOGQL = "hogql", "hogql"
+ PYTHON = "python", "python"
+
+
class NotebookSQLV2RunRequestSerializer(serializers.Serializer):
node_id = serializers.CharField(help_text="ProseMirror node id of the SQLV2 node being run.")
node_type = serializers.ChoiceField(
- choices=["hogql", "python"],
+ choices=NotebookSQLV2NodeType.choices,
required=False,
default="hogql",
help_text=(
diff --git a/products/notebooks/frontend/generated/api.schemas.ts b/products/notebooks/frontend/generated/api.schemas.ts
index c0e01f487168..6b4e3ddad0a6 100644
--- a/products/notebooks/frontend/generated/api.schemas.ts
+++ b/products/notebooks/frontend/generated/api.schemas.ts
@@ -785,10 +785,10 @@ export interface WidgetJobApi {
* * `high` - high
* * `critical` - critical
*/
-export type WidgetSecurityReviewSeverityEnumApi =
- (typeof WidgetSecurityReviewSeverityEnumApi)[keyof typeof WidgetSecurityReviewSeverityEnumApi]
+export type GeneratedWidgetVersionSecurityReviewSeverityEnumApi =
+ (typeof GeneratedWidgetVersionSecurityReviewSeverityEnumApi)[keyof typeof GeneratedWidgetVersionSecurityReviewSeverityEnumApi]
-export const WidgetSecurityReviewSeverityEnumApi = {
+export const GeneratedWidgetVersionSecurityReviewSeverityEnumApi = {
None: 'none',
Low: 'low',
Medium: 'medium',
@@ -834,7 +834,7 @@ export interface WidgetSecurityReviewApi {
* * `medium` - medium
* * `high` - high
* * `critical` - critical */
- severity: WidgetSecurityReviewSeverityEnumApi
+ severity: GeneratedWidgetVersionSecurityReviewSeverityEnumApi
/** Concise result from the automated security review. */
summary: string
/** Potential security issues found in the source. */
@@ -915,9 +915,10 @@ export interface WidgetSourceApi {
* * `improve` - improve
* * `revert` - revert
*/
-export type VersionOperationEnumApi = (typeof VersionOperationEnumApi)[keyof typeof VersionOperationEnumApi]
+export type GeneratedWidgetVersionOperationEnumApi =
+ (typeof GeneratedWidgetVersionOperationEnumApi)[keyof typeof GeneratedWidgetVersionOperationEnumApi]
-export const VersionOperationEnumApi = {
+export const GeneratedWidgetVersionOperationEnumApi = {
Initial: 'initial',
Regenerate: 'regenerate',
Improve: 'improve',
@@ -958,7 +959,7 @@ export interface WidgetVersionApi {
* * `regenerate` - regenerate
* * `improve` - improve
* * `revert` - revert */
- version_operation: VersionOperationEnumApi
+ version_operation: GeneratedWidgetVersionOperationEnumApi
/** Instructions added by this version. */
prompt_delta: string
/** Complete instructions represented by this version. */
diff --git a/products/persons/frontend/generated/api.schemas.ts b/products/persons/frontend/generated/api.schemas.ts
index 5c5af89a30b0..7356c0bd4c39 100644
--- a/products/persons/frontend/generated/api.schemas.ts
+++ b/products/persons/frontend/generated/api.schemas.ts
@@ -7,9 +7,10 @@
* PostHog API - generated
* OpenAPI spec version: 1.0.0
*/
-export type PropertyGroupOperatorApi = (typeof PropertyGroupOperatorApi)[keyof typeof PropertyGroupOperatorApi]
+export type PropertyGroupOperatorEnumApi =
+ (typeof PropertyGroupOperatorEnumApi)[keyof typeof PropertyGroupOperatorEnumApi]
-export const PropertyGroupOperatorApi = {
+export const PropertyGroupOperatorEnumApi = {
And: 'AND',
Or: 'OR',
} as const
@@ -190,7 +191,7 @@ export interface PropertyApi {
*
* * `AND` - AND
* * `OR` - OR */
- type?: PropertyGroupOperatorApi
+ type?: PropertyGroupOperatorEnumApi
values: PropertyItemApi[]
}
diff --git a/products/platform_features/frontend/generated/api.schemas.ts b/products/platform_features/frontend/generated/api.schemas.ts
index 13c84e612ca0..66f47cde3a2a 100644
--- a/products/platform_features/frontend/generated/api.schemas.ts
+++ b/products/platform_features/frontend/generated/api.schemas.ts
@@ -27,9 +27,10 @@ export const OrganizationMembershipLevelEnumApi = {
* * `6` - install
* * `9` - root
*/
-export type PluginsAccessLevelEnumApi = (typeof PluginsAccessLevelEnumApi)[keyof typeof PluginsAccessLevelEnumApi]
+export type OrganizationPluginsAccessLevelEnumApi =
+ (typeof OrganizationPluginsAccessLevelEnumApi)[keyof typeof OrganizationPluginsAccessLevelEnumApi]
-export const PluginsAccessLevelEnumApi = {
+export const OrganizationPluginsAccessLevelEnumApi = {
Number0: 0,
Number3: 3,
Number6: 6,
@@ -40,10 +41,10 @@ export const PluginsAccessLevelEnumApi = {
* * `bayesian` - Bayesian
* * `frequentist` - Frequentist
*/
-export type DefaultExperimentStatsMethodEnumApi =
- (typeof DefaultExperimentStatsMethodEnumApi)[keyof typeof DefaultExperimentStatsMethodEnumApi]
+export type OrganizationDefaultExperimentStatsMethodEnumApi =
+ (typeof OrganizationDefaultExperimentStatsMethodEnumApi)[keyof typeof OrganizationDefaultExperimentStatsMethodEnumApi]
-export const DefaultExperimentStatsMethodEnumApi = {
+export const OrganizationDefaultExperimentStatsMethodEnumApi = {
Bayesian: 'bayesian',
Frequentist: 'frequentist',
} as const
@@ -71,7 +72,7 @@ export interface OrganizationApi {
readonly created_at: string
readonly updated_at: string
readonly membership_level: OrganizationMembershipLevelEnumApi
- readonly plugins_access_level: PluginsAccessLevelEnumApi
+ readonly plugins_access_level: OrganizationPluginsAccessLevelEnumApi
readonly teams: readonly OrganizationApiTeamsItem[]
readonly projects: readonly OrganizationApiProjectsItem[]
/** @nullable */
@@ -128,7 +129,7 @@ export interface OrganizationApi {
*
* * `bayesian` - Bayesian
* * `frequentist` - Frequentist */
- default_experiment_stats_method?: DefaultExperimentStatsMethodEnumApi | BlankEnumApi | null
+ default_experiment_stats_method?: OrganizationDefaultExperimentStatsMethodEnumApi | BlankEnumApi | null
/** Default setting for 'Discard client IP data' for new projects in this organization. */
default_anonymize_ips?: boolean
/**
@@ -179,7 +180,7 @@ export interface PatchedOrganizationApi {
readonly created_at?: string
readonly updated_at?: string
readonly membership_level?: OrganizationMembershipLevelEnumApi
- readonly plugins_access_level?: PluginsAccessLevelEnumApi
+ readonly plugins_access_level?: OrganizationPluginsAccessLevelEnumApi
readonly teams?: readonly PatchedOrganizationApiTeamsItem[]
readonly projects?: readonly PatchedOrganizationApiProjectsItem[]
/** @nullable */
@@ -236,7 +237,7 @@ export interface PatchedOrganizationApi {
*
* * `bayesian` - Bayesian
* * `frequentist` - Frequentist */
- default_experiment_stats_method?: DefaultExperimentStatsMethodEnumApi | BlankEnumApi | null
+ default_experiment_stats_method?: OrganizationDefaultExperimentStatsMethodEnumApi | BlankEnumApi | null
/** Default setting for 'Discard client IP data' for new projects in this organization. */
default_anonymize_ips?: boolean
/**
diff --git a/products/posthog_ai/frontend/components/ReadonlyRunSurfaceImpl.test.tsx b/products/posthog_ai/frontend/components/ReadonlyRunSurfaceImpl.test.tsx
index 7c2f6fb0260a..4fd2cd1c40c3 100644
--- a/products/posthog_ai/frontend/components/ReadonlyRunSurfaceImpl.test.tsx
+++ b/products/posthog_ai/frontend/components/ReadonlyRunSurfaceImpl.test.tsx
@@ -3,7 +3,7 @@ import '@testing-library/jest-dom'
import { cleanup, render, screen } from '@testing-library/react'
import { useActions, useValues } from 'kea'
-import { RuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
+import { TaskRuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
import type { PermissionRequestRecord } from '../types/streamTypes'
import ReadonlyRunSurfaceImpl from './ReadonlyRunSurfaceImpl'
@@ -36,7 +36,7 @@ function setValues(overrides: Partial<{ pendingPermissionRequest: PermissionRequ
threadItems: [{ id: 'x' }],
pendingPermissionRequest: null,
currentRunStatus: 'in_progress',
- task: { origin_product: 'user_created', runtime: RuntimeEnumApi.Acp },
+ task: { origin_product: 'user_created', runtime: TaskRuntimeEnumApi.Acp },
taskLoading: false,
taskError: null,
taskNotFound: false,
diff --git a/products/posthog_ai/frontend/components/RunSurfaceImpl.test.tsx b/products/posthog_ai/frontend/components/RunSurfaceImpl.test.tsx
index b83f65035982..040b0eac3404 100644
--- a/products/posthog_ai/frontend/components/RunSurfaceImpl.test.tsx
+++ b/products/posthog_ai/frontend/components/RunSurfaceImpl.test.tsx
@@ -3,7 +3,7 @@ import '@testing-library/jest-dom'
import { cleanup, render, screen } from '@testing-library/react'
import { useActions, useValues } from 'kea'
-import { RuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
+import { TaskRuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
import type { RunStatus } from '../logics/runStreamLogic'
import type { PermissionRequestRecord } from '../types/streamTypes'
@@ -37,7 +37,7 @@ function setValues(
pendingPermissionRequest: PermissionRequestRecord | null
bootstrapLoading: boolean
threadItems: unknown[]
- task: { origin_product: string; runtime?: RuntimeEnumApi } | null
+ task: { origin_product: string; runtime?: TaskRuntimeEnumApi } | null
}>
): void {
;(useValues as jest.Mock).mockReturnValue({
@@ -45,7 +45,7 @@ function setValues(
threadItems: [],
pendingPermissionRequest: null,
currentRunStatus: 'in_progress',
- task: { origin_product: 'user_created', runtime: RuntimeEnumApi.Acp },
+ task: { origin_product: 'user_created', runtime: TaskRuntimeEnumApi.Acp },
taskLoading: false,
taskError: null,
taskNotFound: false,
@@ -82,7 +82,7 @@ describe('RunSurface', () => {
})
it('does not mount the ACP run surface for a Pi task', () => {
- setValues({ task: { origin_product: 'user_created', runtime: RuntimeEnumApi.Pi } })
+ setValues({ task: { origin_product: 'user_created', runtime: TaskRuntimeEnumApi.Pi } })
render(
<RunSurface.Root taskId="task-1" runId="run-1" interaction="live">
diff --git a/products/posthog_ai/frontend/generated/api.schemas.ts b/products/posthog_ai/frontend/generated/api.schemas.ts
index 2dc84df013fc..f0ad929c37d9 100644
--- a/products/posthog_ai/frontend/generated/api.schemas.ts
+++ b/products/posthog_ai/frontend/generated/api.schemas.ts
@@ -12,9 +12,9 @@
* * `in_progress` - In progress
* * `canceling` - Canceling
*/
-export type ConversationStatusApi = (typeof ConversationStatusApi)[keyof typeof ConversationStatusApi]
+export type ConversationStatusEnumApi = (typeof ConversationStatusEnumApi)[keyof typeof ConversationStatusEnumApi]
-export const ConversationStatusApi = {
+export const ConversationStatusEnumApi = {
Idle: 'idle',
InProgress: 'in_progress',
Canceling: 'canceling',
@@ -31,9 +31,9 @@ export const ConversationStatusApi = {
* * `data_warehouse` - Data warehouse
* * `other` - Other
*/
-export type TopicEnumApi = (typeof TopicEnumApi)[keyof typeof TopicEnumApi]
+export type ConversationTopicEnumApi = (typeof ConversationTopicEnumApi)[keyof typeof ConversationTopicEnumApi]
-export const TopicEnumApi = {
+export const ConversationTopicEnumApi = {
WebAnalytics: 'web_analytics',
ProductAnalytics: 'product_analytics',
SessionReplay: 'session_replay',
@@ -108,9 +108,9 @@ export interface UserBasicApi {
* * `deep_research` - Deep research
* * `slack` - Slack
*/
-export type ConversationTypeApi = (typeof ConversationTypeApi)[keyof typeof ConversationTypeApi]
+export type ConversationTypeEnumApi = (typeof ConversationTypeEnumApi)[keyof typeof ConversationTypeEnumApi]
-export const ConversationTypeApi = {
+export const ConversationTypeEnumApi = {
Assistant: 'assistant',
ToolCall: 'tool_call',
DeepResearch: 'deep_research',
@@ -121,9 +121,9 @@ export const ConversationTypeApi = {
* * `acp` - ACP
* * `pi` - Pi
*/
-export type RuntimeEnumApi = (typeof RuntimeEnumApi)[keyof typeof RuntimeEnumApi]
+export type TaskRuntimeEnumApi = (typeof TaskRuntimeEnumApi)[keyof typeof TaskRuntimeEnumApi]
-export const RuntimeEnumApi = {
+export const TaskRuntimeEnumApi = {
Acp: 'acp',
Pi: 'pi',
} as const
@@ -174,7 +174,7 @@ export interface ConversationTaskApi {
*
* * `acp` - ACP
* * `pi` - Pi */
- readonly runtime: RuntimeEnumApi
+ readonly runtime: TaskRuntimeEnumApi
/** @nullable */
repository: string | null
/** @nullable */
@@ -205,7 +205,7 @@ export interface ConversationTaskApi {
export interface ConversationMinimalApi {
readonly id: string
- readonly status: ConversationStatusApi
+ readonly status: ConversationStatusEnumApi
/**
* Title of the conversation.
* @nullable
@@ -222,13 +222,13 @@ export interface ConversationMinimalApi {
* * `error_tracking` - Error tracking
* * `data_warehouse` - Data warehouse
* * `other` - Other */
- readonly topic: TopicEnumApi | null
+ readonly topic: ConversationTopicEnumApi | null
readonly user: UserBasicApi
/** @nullable */
readonly created_at: string | null
/** @nullable */
readonly updated_at: string | null
- readonly type: ConversationTypeApi
+ readonly type: ConversationTypeEnumApi
/**
* Whether this conversation was created during an impersonated session (e.g., by support agents). Internal conversations are hidden from customers.
* @nullable
@@ -319,16 +319,17 @@ export type ConversationApiPendingApprovalsItem = { [key: string]: unknown }
* * `langgraph` - LangGraph
* * `sandbox` - Sandbox
*/
-export type AgentRuntimeEnumApi = (typeof AgentRuntimeEnumApi)[keyof typeof AgentRuntimeEnumApi]
+export type ConversationAgentRuntimeEnumApi =
+ (typeof ConversationAgentRuntimeEnumApi)[keyof typeof ConversationAgentRuntimeEnumApi]
-export const AgentRuntimeEnumApi = {
+export const ConversationAgentRuntimeEnumApi = {
Langgraph: 'langgraph',
Sandbox: 'sandbox',
} as const
export interface ConversationApi {
readonly id: string
- readonly status: ConversationStatusApi
+ readonly status: ConversationStatusEnumApi
/**
* Title of the conversation.
* @nullable
@@ -345,13 +346,13 @@ export interface ConversationApi {
* * `error_tracking` - Error tracking
* * `data_warehouse` - Data warehouse
* * `other` - Other */
- readonly topic: TopicEnumApi | null
+ readonly topic: ConversationTopicEnumApi | null
readonly user: UserBasicApi
/** @nullable */
readonly created_at: string | null
/** @nullable */
readonly updated_at: string | null
- readonly type: ConversationTypeApi
+ readonly type: ConversationTypeEnumApi
/**
* Whether this conversation was created during an impersonated session (e.g., by support agents). Internal conversations are hidden from customers.
* @nullable
@@ -375,7 +376,7 @@ export interface ConversationApi {
*
* * `langgraph` - LangGraph
* * `sandbox` - Sandbox */
- readonly agent_runtime: AgentRuntimeEnumApi
+ readonly agent_runtime: ConversationAgentRuntimeEnumApi
readonly is_sandbox: boolean
/** Return pending approval cards as structured data.
*
@@ -399,7 +400,7 @@ export type PatchedConversationApiPendingApprovalsItem = { [key: string]: unknow
export interface PatchedConversationApi {
readonly id?: string
- readonly status?: ConversationStatusApi
+ readonly status?: ConversationStatusEnumApi
/**
* Title of the conversation.
* @nullable
@@ -416,13 +417,13 @@ export interface PatchedConversationApi {
* * `error_tracking` - Error tracking
* * `data_warehouse` - Data warehouse
* * `other` - Other */
- readonly topic?: TopicEnumApi | null
+ readonly topic?: ConversationTopicEnumApi | null
readonly user?: UserBasicApi
/** @nullable */
readonly created_at?: string | null
/** @nullable */
readonly updated_at?: string | null
- readonly type?: ConversationTypeApi
+ readonly type?: ConversationTypeEnumApi
/**
* Whether this conversation was created during an impersonated session (e.g., by support agents). Internal conversations are hidden from customers.
* @nullable
@@ -446,7 +447,7 @@ export interface PatchedConversationApi {
*
* * `langgraph` - LangGraph
* * `sandbox` - Sandbox */
- readonly agent_runtime?: AgentRuntimeEnumApi
+ readonly agent_runtime?: ConversationAgentRuntimeEnumApi
readonly is_sandbox?: boolean
/** Return pending approval cards as structured data.
*
diff --git a/products/posthog_ai/frontend/logics/taskLogic.test.ts b/products/posthog_ai/frontend/logics/taskLogic.test.ts
index f2fc44aa92c5..1c2bd7a5b1e2 100644
--- a/products/posthog_ai/frontend/logics/taskLogic.test.ts
+++ b/products/posthog_ai/frontend/logics/taskLogic.test.ts
@@ -9,7 +9,7 @@ import { userLogic } from 'scenes/userLogic'
import { initKeaTests } from '~/test/init'
-import { RuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
+import { TaskRuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
import { OriginProduct, Task, TaskRunEnvironment, TaskRunStatus } from '../types/taskTypes'
import { taskLogic } from './taskLogic'
@@ -22,7 +22,7 @@ const createMockTask = (id: string): Task => ({
title: `Task ${id}`,
description: 'A test task',
origin_product: OriginProduct.USER_CREATED,
- runtime: RuntimeEnumApi.Acp,
+ runtime: TaskRuntimeEnumApi.Acp,
repository: 'test/repo',
github_integration: null,
signal_report: null,
diff --git a/products/posthog_ai/frontend/logics/tasksLogic.test.ts b/products/posthog_ai/frontend/logics/tasksLogic.test.ts
index bc6e67bcaeee..0cb6ba087517 100644
--- a/products/posthog_ai/frontend/logics/tasksLogic.test.ts
+++ b/products/posthog_ai/frontend/logics/tasksLogic.test.ts
@@ -8,7 +8,7 @@ import { resumeKeaLoadersErrors, silenceKeaLoadersErrors } from '~/initKea'
import { useMocks } from '~/mocks/jest'
import { initKeaTests } from '~/test/init'
-import { RuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
+import { TaskRuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
import { OriginProduct, Task } from '../types/taskTypes'
import { tasksLogic } from './tasksLogic'
@@ -20,7 +20,7 @@ const createMockTask = (id: string): Task => ({
title: `Task ${id}`,
description: 'A test task',
origin_product: OriginProduct.USER_CREATED,
- runtime: RuntimeEnumApi.Acp,
+ runtime: TaskRuntimeEnumApi.Acp,
repository: 'test/repo',
github_integration: null,
signal_report: null,
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/TaskTracker.stories.tsx b/products/posthog_ai/frontend/scenes/TaskTracker/TaskTracker.stories.tsx
index d6d6fc9f98d3..09c2592c81cf 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/TaskTracker.stories.tsx
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/TaskTracker.stories.tsx
@@ -6,7 +6,7 @@ import { App } from 'scenes/App'
import { mswDecorator } from '~/mocks/browser'
-import { RuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
+import { TaskRuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
import { OriginProduct, Task, TaskRun, TaskRunEnvironment, TaskRunStatus } from '../../types/taskTypes'
@@ -53,7 +53,7 @@ const TASKS: Task[] = [
title: 'Add retention graph export',
description: 'Let users download the retention graph as a CSV from the insight menu.',
origin_product: OriginProduct.USER_CREATED,
- runtime: RuntimeEnumApi.Acp,
+ runtime: TaskRuntimeEnumApi.Acp,
repository: 'PostHog/posthog',
github_integration: 1,
signal_report: null,
@@ -71,7 +71,7 @@ const TASKS: Task[] = [
title: 'Fix cohort empty state in query builder',
description: 'Handle an empty cohort gracefully instead of throwing in the query builder.',
origin_product: OriginProduct.USER_CREATED,
- runtime: RuntimeEnumApi.Acp,
+ runtime: TaskRuntimeEnumApi.Acp,
repository: 'PostHog/posthog',
github_integration: 1,
signal_report: null,
@@ -89,7 +89,7 @@ const TASKS: Task[] = [
title: 'Investigate slow dashboard load',
description: 'Profile the dashboard scene and find the slowest tiles on first paint.',
origin_product: OriginProduct.USER_CREATED,
- runtime: RuntimeEnumApi.Acp,
+ runtime: TaskRuntimeEnumApi.Acp,
repository: 'PostHog/posthog',
github_integration: 1,
signal_report: null,
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/taskDetailSceneLogic.test.ts b/products/posthog_ai/frontend/scenes/TaskTracker/taskDetailSceneLogic.test.ts
index 6c5769002704..57abb7f97a2a 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/taskDetailSceneLogic.test.ts
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/taskDetailSceneLogic.test.ts
@@ -5,7 +5,7 @@ import { ApiError } from 'lib/api'
import { initKeaTests } from '~/test/init'
-import { RuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
+import { TaskRuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
import { tasksLogic } from '../../logics/tasksLogic'
import { OriginProduct, Task, TaskRun, TaskRunEnvironment, TaskRunStatus } from '../../types/taskTypes'
@@ -18,7 +18,7 @@ const createMockTask = (id: string): Task => ({
title: `Task ${id}`,
description: 'A test task',
origin_product: OriginProduct.USER_CREATED,
- runtime: RuntimeEnumApi.Acp,
+ runtime: TaskRuntimeEnumApi.Acp,
repository: 'test/repo',
github_integration: null,
signal_report: null,
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.test.ts b/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.test.ts
index 7b12938e2201..362eb6b61a1a 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.test.ts
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.test.ts
@@ -6,7 +6,7 @@ import { aiConsentLogic } from 'scenes/settings/organization/aiConsentLogic'
import { useMocks } from '~/mocks/jest'
import { initKeaTests } from '~/test/init'
-import { RuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
+import { TaskRuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
import { attachedContextLogic } from '../../api/logics'
import { composerSeedLogic } from '../../logics/composerSeedLogic'
@@ -21,7 +21,7 @@ const buildTask = (overrides: Partial<Task> = {}): Task => ({
title: 'Some task',
description: 'do the thing',
origin_product: OriginProduct.POSTHOG_AI,
- runtime: RuntimeEnumApi.Acp,
+ runtime: TaskRuntimeEnumApi.Acp,
repository: null,
github_integration: null,
signal_report: null,
diff --git a/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.ts b/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.ts
index b1d3062359e2..49419db64fad 100644
--- a/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.ts
+++ b/products/posthog_ai/frontend/scenes/TaskTracker/taskTrackerSceneLogic.ts
@@ -13,7 +13,7 @@ import { codeInvitesCheckAccessRetrieve, tasksCreate, tasksRunCreate } from 'pro
import {
type LegacyDesktopAccessResponseApi,
type ModelChoiceApi,
- OriginProductEnumApi,
+ TaskOriginProductEnumApi,
ReasoningEffortEnumApi,
type TaskWriteApi,
TaskExecutionModeEnumApi,
@@ -662,7 +662,7 @@ export const taskTrackerSceneLogic = kea<taskTrackerSceneLogicType>([
const taskData: TaskWriteApi = {
title: '',
description,
- origin_product: OriginProductEnumApi.PosthogAi,
+ origin_product: TaskOriginProductEnumApi.PosthogAi,
// PostHog AI can run without a repo; null means the task is not scoped to any repository.
repository: repositoryConfig.repository ?? null,
github_integration: repositoryConfig.integrationId ?? null,
diff --git a/products/posthog_ai/frontend/types/taskTypes.ts b/products/posthog_ai/frontend/types/taskTypes.ts
index b1a3a5ab5251..1f5f36bb12eb 100644
--- a/products/posthog_ai/frontend/types/taskTypes.ts
+++ b/products/posthog_ai/frontend/types/taskTypes.ts
@@ -1,9 +1,9 @@
import { Optional } from 'lib/utils/types'
-import { RuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
+import { TaskRuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
-export function isPiTaskRuntime(runtime: RuntimeEnumApi | undefined): boolean {
- return runtime === RuntimeEnumApi.Pi
+export function isPiTaskRuntime(runtime: TaskRuntimeEnumApi | undefined): boolean {
+ return runtime === TaskRuntimeEnumApi.Pi
}
export interface RepositoryConfig {
@@ -88,7 +88,7 @@ export interface Task {
title: string
description: string
origin_product: OriginProduct
- runtime: RuntimeEnumApi
+ runtime: TaskRuntimeEnumApi
repository: string | null
github_integration: number | null
/** For signal-report-origin tasks: the inbox `SignalReport` this task ran for (set-once at creation). */
diff --git a/products/product_analytics/frontend/generated/api.schemas.ts b/products/product_analytics/frontend/generated/api.schemas.ts
index ec3ae579b084..1938292befa0 100644
--- a/products/product_analytics/frontend/generated/api.schemas.ts
+++ b/products/product_analytics/frontend/generated/api.schemas.ts
@@ -8212,10 +8212,9 @@ export const RestrictionLevelEnumApi = {
* * `21` - Can view dashboard
* * `37` - Can edit dashboard
*/
-export type EffectivePrivilegeLevelEnumApi =
- (typeof EffectivePrivilegeLevelEnumApi)[keyof typeof EffectivePrivilegeLevelEnumApi]
+export type PrivilegeLevelEnumApi = (typeof PrivilegeLevelEnumApi)[keyof typeof PrivilegeLevelEnumApi]
-export const EffectivePrivilegeLevelEnumApi = {
+export const PrivilegeLevelEnumApi = {
Number21: 21,
Number37: 37,
} as const
@@ -8404,7 +8403,7 @@ export interface InsightApi {
readonly last_modified_by: UserBasicApi
readonly is_sample: boolean
readonly effective_restriction_level: RestrictionLevelEnumApi
- readonly effective_privilege_level: EffectivePrivilegeLevelEnumApi
+ readonly effective_privilege_level: PrivilegeLevelEnumApi
/**
* The effective access level the user has for this object
* @nullable
@@ -8532,7 +8531,7 @@ export interface PatchedInsightApi {
readonly last_modified_by?: UserBasicApi
readonly is_sample?: boolean
readonly effective_restriction_level?: RestrictionLevelEnumApi
- readonly effective_privilege_level?: EffectivePrivilegeLevelEnumApi
+ readonly effective_privilege_level?: PrivilegeLevelEnumApi
/**
* The effective access level the user has for this object
* @nullable
diff --git a/products/replay/frontend/generated/api.schemas.ts b/products/replay/frontend/generated/api.schemas.ts
index 9e0e2228d42e..40ca61c2e0f1 100644
--- a/products/replay/frontend/generated/api.schemas.ts
+++ b/products/replay/frontend/generated/api.schemas.ts
@@ -68,10 +68,10 @@ export interface UserBasicApi {
* * `collection` - Collection
* * `filters` - Filters
*/
-export type SessionRecordingPlaylistTypeEnumApi =
- (typeof SessionRecordingPlaylistTypeEnumApi)[keyof typeof SessionRecordingPlaylistTypeEnumApi]
+export type SessionRecordingPlaylistPlaylistTypeEnumApi =
+ (typeof SessionRecordingPlaylistPlaylistTypeEnumApi)[keyof typeof SessionRecordingPlaylistPlaylistTypeEnumApi]
-export const SessionRecordingPlaylistTypeEnumApi = {
+export const SessionRecordingPlaylistPlaylistTypeEnumApi = {
Collection: 'collection',
Filters: 'filters',
} as const
@@ -109,7 +109,7 @@ export interface SessionRecordingPlaylistApi {
*
* * `collection` - Collection
* * `filters` - Filters */
- type?: SessionRecordingPlaylistTypeEnumApi | null
+ type?: SessionRecordingPlaylistPlaylistTypeEnumApi | null
/** Return whether this is a synthetic playlist */
readonly is_synthetic: boolean
_create_in_folder?: string
@@ -159,7 +159,7 @@ export interface PatchedSessionRecordingPlaylistApi {
*
* * `collection` - Collection
* * `filters` - Filters */
- type?: SessionRecordingPlaylistTypeEnumApi | null
+ type?: SessionRecordingPlaylistPlaylistTypeEnumApi | null
/** Return whether this is a synthetic playlist */
readonly is_synthetic?: boolean
_create_in_folder?: string
diff --git a/products/replay_vision/backend/api/prompt_suggestions.py b/products/replay_vision/backend/api/prompt_suggestions.py
index 8b7e3ed0c7c8..15ce692a905e 100644
--- a/products/replay_vision/backend/api/prompt_suggestions.py
+++ b/products/replay_vision/backend/api/prompt_suggestions.py
@@ -29,8 +29,8 @@ from products.replay_vision.backend.billing import observation_credits_for_model
from products.replay_vision.backend.models.replay_observation import ObservationStatus, ReplayObservation
from products.replay_vision.backend.models.replay_scanner import ReplayScanner, ScannerType
from products.replay_vision.backend.models.replay_scanner_prompt_suggestion import (
+ PromptSuggestionStatus,
ReplayScannerPromptSuggestion,
- SuggestionStatus,
)
from products.replay_vision.backend.prompt_evaluation import (
EVALUATE_PROMPT_SUGGESTION_EXECUTION_TIMEOUT,
@@ -352,7 +352,7 @@ class ReplayScannerPromptSuggestionViewSet(
team_id=self.team_id, id=suggestion.id
)
# A stale tab can submit an old or dismissed suggestion id, silently rolling the prompt back.
- if suggestion.status != SuggestionStatus.PENDING:
+ if suggestion.status != PromptSuggestionStatus.PENDING:
raise ValidationError("Only the current recommendation can be applied.")
if suggestion.scanner_version != scanner.scanner_version:
raise ValidationError("The scanner prompt changed since this was generated. Generate a fresh one.")
@@ -371,7 +371,7 @@ class ReplayScannerPromptSuggestionViewSet(
raise ValidationError(f"This recommendation can't be applied: {message}")
scanner.scanner_config = config
scanner.save(update_fields=["scanner_config"])
- suggestion.status = SuggestionStatus.APPLIED
+ suggestion.status = PromptSuggestionStatus.APPLIED
suggestion.applied_at = timezone.now()
suggestion.applied_by = cast(User, request.user)
suggestion.save(update_fields=["status", "applied_at", "applied_by"])
@@ -425,7 +425,7 @@ class ReplayScannerPromptSuggestionViewSet(
suggestion = ReplayScannerPromptSuggestion.objects.select_for_update().get(
team_id=self.team_id, id=suggestion.id
)
- if suggestion.status != SuggestionStatus.PENDING:
+ if suggestion.status != PromptSuggestionStatus.PENDING:
raise ValidationError("Only the current pending suggestion can be tested.")
# A test already in flight keeps reporting its state even if quota ran out meanwhile.
if evaluation_in_flight(suggestion.evaluation):
@@ -512,8 +512,8 @@ class ReplayScannerPromptSuggestionViewSet(
team_id=self.team_id, id=suggestion.id
)
# Dismissing an applied suggestion would mark the scanner's live prompt as rejected.
- if suggestion.status != SuggestionStatus.PENDING:
+ if suggestion.status != PromptSuggestionStatus.PENDING:
raise ValidationError("Only the current recommendation can be dismissed.")
- suggestion.status = SuggestionStatus.DISMISSED
+ suggestion.status = PromptSuggestionStatus.DISMISSED
suggestion.save(update_fields=["status"])
return Response(ReplayScannerPromptSuggestionSerializer(suggestion).data)
diff --git a/products/replay_vision/backend/models/replay_scanner_prompt_suggestion.py b/products/replay_vision/backend/models/replay_scanner_prompt_suggestion.py
index cb7352b7c333..130e69ad06aa 100644
--- a/products/replay_vision/backend/models/replay_scanner_prompt_suggestion.py
+++ b/products/replay_vision/backend/models/replay_scanner_prompt_suggestion.py
@@ -3,7 +3,7 @@ from django.db import models
from posthog.models.utils import UUIDModel
-class SuggestionStatus(models.TextChoices):
+class PromptSuggestionStatus(models.TextChoices):
PENDING = "pending", "Pending"
APPLIED = "applied", "Applied"
DISMISSED = "dismissed", "Dismissed"
@@ -41,7 +41,9 @@ class ReplayScannerPromptSuggestion(UUIDModel):
changes = models.JSONField(
default=list, blank=True, help_text="Typed per-field diff entries: field, kind, op, before, after, rationale."
)
- status = models.CharField(max_length=16, choices=SuggestionStatus.choices, default=SuggestionStatus.PENDING)
+ status = models.CharField(
+ max_length=16, choices=PromptSuggestionStatus.choices, default=PromptSuggestionStatus.PENDING
+ )
based_on_up = models.PositiveIntegerField(default=0, help_text="Thumbs-up ratings the suggestion was based on.")
based_on_down = models.PositiveIntegerField(default=0, help_text="Thumbs-down ratings the suggestion was based on.")
# Hash of the rated set at generation time; a different current fingerprint means the suggestion is stale.
diff --git a/products/replay_vision/backend/models/vision_action.py b/products/replay_vision/backend/models/vision_action.py
index d76400116a0c..371179388663 100644
--- a/products/replay_vision/backend/models/vision_action.py
+++ b/products/replay_vision/backend/models/vision_action.py
@@ -34,11 +34,17 @@ class AlertFrequency(models.TextChoices):
ON_BREACH = "on_breach", "When a threshold is crossed"
-class AlertMetric(models.TextChoices):
+class VisionActionAlertMetric(models.TextChoices):
COUNT = "count", "Count of matching observations"
AVG_SCORE = "avg_score", "Average score" # scorer scanners only
+# The class name feeds the derived OpenAPI component name and must not collide
+# with vision_alert's VisionAlertMetric, which holds the same values under
+# different labels. AlertMetric is an alias for callers of the short name.
+AlertMetric = VisionActionAlertMetric
+
+
class AlertDirection(models.TextChoices):
# Which side of the threshold breaches. Both bounds are inclusive.
ABOVE = "above", "At or above"
diff --git a/products/replay_vision/backend/prompt_suggestions.py b/products/replay_vision/backend/prompt_suggestions.py
index 521be831b732..3991343f6cc0 100644
--- a/products/replay_vision/backend/prompt_suggestions.py
+++ b/products/replay_vision/backend/prompt_suggestions.py
@@ -34,8 +34,8 @@ from products.replay_vision.backend.models.replay_observation import Observation
from products.replay_vision.backend.models.replay_observation_label import ReplayObservationLabel
from products.replay_vision.backend.models.replay_scanner import ReplayScanner
from products.replay_vision.backend.models.replay_scanner_prompt_suggestion import (
+ PromptSuggestionStatus,
ReplayScannerPromptSuggestion,
- SuggestionStatus,
)
from products.replay_vision.backend.proposers import get_proposer
@@ -184,7 +184,7 @@ def _dismissed_lines(scanner: ReplayScanner) -> list[str]:
"""Rewrites the team explicitly rejected, so the model doesn't re-propose them."""
dismissed = list(
ReplayScannerPromptSuggestion.objects.filter(
- scanner=scanner, team_id=scanner.team_id, status=SuggestionStatus.DISMISSED
+ scanner=scanner, team_id=scanner.team_id, status=PromptSuggestionStatus.DISMISSED
).order_by("-created_at")[:_MAX_DISMISSED_EXAMPLES]
)
if not dismissed:
@@ -528,7 +528,7 @@ def generate_prompt_suggestion(
changes = proposer.to_changes(base_config, suggested_config, llm_output)
# The change list is the source of truth for "did anything meaningful change": dict equality trips on
# keys a proposer always injects (e.g. a defaulted allow_inconclusive) that the stored config never had.
- status = SuggestionStatus.NO_CHANGE if not changes else SuggestionStatus.PENDING
+ status = PromptSuggestionStatus.NO_CHANGE if not changes else PromptSuggestionStatus.PENDING
# Count the full rated set, not the capped briefing slice: the agent can page through every rated
# session via its tools, and the UI shows these next to chart totals computed over all ratings.
label_counts = ReplayObservation.objects.filter(
@@ -543,8 +543,8 @@ def generate_prompt_suggestion(
# Serialize per scanner: a manual generate racing the sweep refresh must not leave two pending rows.
ReplayScanner.objects.select_for_update().filter(team_id=scanner.team_id, pk=scanner.pk).first()
ReplayScannerPromptSuggestion.objects.filter(
- scanner=scanner, team_id=scanner.team_id, status=SuggestionStatus.PENDING
- ).update(status=SuggestionStatus.SUPERSEDED)
+ scanner=scanner, team_id=scanner.team_id, status=PromptSuggestionStatus.PENDING
+ ).update(status=PromptSuggestionStatus.SUPERSEDED)
return ReplayScannerPromptSuggestion.objects.create(
scanner=scanner,
team_id=scanner.team_id,
diff --git a/products/replay_vision/backend/temporal/activities/evaluate_prompt_suggestion.py b/products/replay_vision/backend/temporal/activities/evaluate_prompt_suggestion.py
index 08dca819c4d9..5f1782781b04 100644
--- a/products/replay_vision/backend/temporal/activities/evaluate_prompt_suggestion.py
+++ b/products/replay_vision/backend/temporal/activities/evaluate_prompt_suggestion.py
@@ -12,8 +12,8 @@ from temporalio.exceptions import ApplicationError
from products.replay_vision.backend.billing import observation_credits_for_model
from products.replay_vision.backend.models.replay_observation_usage import ReplayObservationUsage
from products.replay_vision.backend.models.replay_scanner_prompt_suggestion import (
+ PromptSuggestionStatus,
ReplayScannerPromptSuggestion,
- SuggestionStatus,
)
from products.replay_vision.backend.prompt_evaluation import (
EvaluationOutcome,
@@ -56,7 +56,7 @@ def select_evaluation_sessions_activity(inputs: SelectEvaluationSessionsInputs)
scanner = suggestion.scanner
if not evaluation_supported(scanner):
raise ApplicationError(f"Scanner type {scanner.scanner_type} does not support evaluation", non_retryable=True)
- if suggestion.status != SuggestionStatus.PENDING:
+ if suggestion.status != PromptSuggestionStatus.PENDING:
raise ApplicationError(f"Suggestion is {suggestion.status}, not pending", non_retryable=True)
observations = select_evaluation_observations(scanner, session_limit=inputs.session_limit)
diff --git a/products/replay_vision/backend/tests/test_prompt_evaluation.py b/products/replay_vision/backend/tests/test_prompt_evaluation.py
index e3034e23905a..d3e1564d1553 100644
--- a/products/replay_vision/backend/tests/test_prompt_evaluation.py
+++ b/products/replay_vision/backend/tests/test_prompt_evaluation.py
@@ -16,8 +16,8 @@ from products.replay_vision.backend.models.replay_observation_label import Repla
from products.replay_vision.backend.models.replay_observation_usage import ReplayObservationUsage
from products.replay_vision.backend.models.replay_scanner import ReplayScanner, ScannerModel, ScannerType
from products.replay_vision.backend.models.replay_scanner_prompt_suggestion import (
+ PromptSuggestionStatus,
ReplayScannerPromptSuggestion,
- SuggestionStatus,
)
from products.replay_vision.backend.prompt_evaluation import (
EVALUATE_PROMPT_SUGGESTION_EXECUTION_TIMEOUT,
@@ -81,7 +81,7 @@ class TestPromptEvaluation(_VisionAPITestCase):
"team": self.team,
"suggested_prompt": "Did the user place an order? Only answer yes on a confirmation page.",
"base_prompt": "did the user check out?",
- "status": SuggestionStatus.PENDING,
+ "status": PromptSuggestionStatus.PENDING,
"scanner_version": 1,
}
defaults.update(overrides)
@@ -398,7 +398,7 @@ class TestPromptEvaluationApi(_VisionAPITestCase):
"scanner": self.scanner,
"team": self.team,
"suggested_prompt": "new prompt",
- "status": SuggestionStatus.PENDING,
+ "status": PromptSuggestionStatus.PENDING,
"scanner_version": 1,
}
defaults.update(overrides)
@@ -586,7 +586,7 @@ class TestPromptEvaluationApi(_VisionAPITestCase):
scanner=other_scanner,
team=self.team,
suggested_prompt="p",
- status=SuggestionStatus.PENDING,
+ status=PromptSuggestionStatus.PENDING,
scanner_version=1,
evaluation={
"status": "running",
@@ -611,7 +611,7 @@ class TestPromptEvaluationApi(_VisionAPITestCase):
scanner=scanner,
team=self.team,
suggested_prompt="p",
- status=SuggestionStatus.PENDING,
+ status=PromptSuggestionStatus.PENDING,
scanner_version=1,
evaluation=build_running_evaluation(total=3, labels_fingerprint="", model=expensive),
)
@@ -630,7 +630,7 @@ class TestPromptEvaluationApi(_VisionAPITestCase):
scanner=scanner,
team=self.team,
suggested_prompt="p",
- status=SuggestionStatus.PENDING,
+ status=PromptSuggestionStatus.PENDING,
scanner_version=1,
evaluation=build_running_evaluation(total=3, labels_fingerprint="", model=expensive),
)
@@ -654,7 +654,7 @@ class TestPromptEvaluationApi(_VisionAPITestCase):
@parameterized.expand(
[
- ("not_pending", {"status": SuggestionStatus.DISMISSED}, ScannerType.MONITOR, True),
+ ("not_pending", {"status": PromptSuggestionStatus.DISMISSED}, ScannerType.MONITOR, True),
("no_ratings", {}, ScannerType.MONITOR, False),
]
)
diff --git a/products/replay_vision/backend/tests/test_prompt_suggestions_api.py b/products/replay_vision/backend/tests/test_prompt_suggestions_api.py
index 75a29ba1cbe2..fa4289e274cd 100644
--- a/products/replay_vision/backend/tests/test_prompt_suggestions_api.py
+++ b/products/replay_vision/backend/tests/test_prompt_suggestions_api.py
@@ -15,8 +15,8 @@ from products.replay_vision.backend.models.replay_observation import (
from products.replay_vision.backend.models.replay_observation_label import ReplayObservationLabel
from products.replay_vision.backend.models.replay_scanner import ReplayScanner
from products.replay_vision.backend.models.replay_scanner_prompt_suggestion import (
+ PromptSuggestionStatus,
ReplayScannerPromptSuggestion,
- SuggestionStatus,
)
from products.replay_vision.backend.prompt_suggestions import (
generate_prompt_suggestion,
@@ -92,8 +92,8 @@ class TestPromptSuggestions(_VisionAPITestCase):
self.assertEqual(second.status_code, 200)
statuses = {str(s.id): s.status for s in ReplayScannerPromptSuggestion.objects.all()}
- self.assertEqual(statuses[first.json()["id"]], SuggestionStatus.SUPERSEDED)
- self.assertEqual(statuses[second.json()["id"]], SuggestionStatus.PENDING)
+ self.assertEqual(statuses[first.json()["id"]], PromptSuggestionStatus.SUPERSEDED)
+ self.assertEqual(statuses[second.json()["id"]], PromptSuggestionStatus.PENDING)
def test_generate_requires_rated_observations(self) -> None:
resp = self.client.post(self._suggestions_url("generate/"))
@@ -223,7 +223,7 @@ class TestPromptSuggestions(_VisionAPITestCase):
base_config={"prompt": "p", "tags": ["a"]},
suggested_config={"prompt": "p", "tags": ["a", "b"]},
changes=[{"field": "tags", "kind": "tags", "op": "add", "before": None, "after": "b", "rationale": ""}],
- status=SuggestionStatus.PENDING,
+ status=PromptSuggestionStatus.PENDING,
scanner_version=version_before,
)
@@ -247,7 +247,7 @@ class TestPromptSuggestions(_VisionAPITestCase):
base_config={"prompt": "p", "tags": ["a", "b"]},
suggested_config={"prompt": "new", "tags": ["a", "b", "c"]},
changes=[{"field": "tags", "kind": "tags", "op": "add", "before": None, "after": "c", "rationale": ""}],
- status=SuggestionStatus.PENDING,
+ status=PromptSuggestionStatus.PENDING,
scanner_version=scanner.scanner_version,
)
edited = {"prompt": "user edited", "tags": ["a", "c"]}
@@ -259,7 +259,7 @@ class TestPromptSuggestions(_VisionAPITestCase):
scanner.refresh_from_db()
self.assertEqual(scanner.scanner_config, edited)
suggestion.refresh_from_db()
- self.assertEqual(suggestion.status, SuggestionStatus.APPLIED)
+ self.assertEqual(suggestion.status, PromptSuggestionStatus.APPLIED)
def test_apply_rejects_invalid_edited_config(self) -> None:
scanner = self._create_scanner(
@@ -273,7 +273,7 @@ class TestPromptSuggestions(_VisionAPITestCase):
base_config={"prompt": "keep me"},
suggested_config={"prompt": "new"},
changes=[{"field": "prompt", "kind": "prompt", "op": "set", "before": "keep me", "after": "new"}],
- status=SuggestionStatus.PENDING,
+ status=PromptSuggestionStatus.PENDING,
scanner_version=scanner.scanner_version,
)
@@ -294,7 +294,7 @@ class TestPromptSuggestions(_VisionAPITestCase):
base_prompt="old",
base_config=None,
suggested_config=None,
- status=SuggestionStatus.PENDING,
+ status=PromptSuggestionStatus.PENDING,
scanner_version=scanner.scanner_version,
)
@@ -361,7 +361,7 @@ class TestPromptSuggestions(_VisionAPITestCase):
base_config=base_config,
suggested_config=suggested_config,
changes=changes,
- status=SuggestionStatus.PENDING,
+ status=PromptSuggestionStatus.PENDING,
scanner_version=scanner.scanner_version,
)
@@ -381,7 +381,7 @@ class TestPromptSuggestions(_VisionAPITestCase):
resp = self.client.post(self._suggestions_url(f"{suggestion_id}/dismiss/"))
self.assertEqual(resp.status_code, 400)
suggestion = ReplayScannerPromptSuggestion.objects.get(id=suggestion_id)
- self.assertEqual(suggestion.status, SuggestionStatus.APPLIED)
+ self.assertEqual(suggestion.status, PromptSuggestionStatus.APPLIED)
def test_generate_marks_no_change_when_model_returns_current_prompt(self) -> None:
# self.scanner's config has no allow_inconclusive key, so to_config_patch injects a defaulted one.
diff --git a/products/replay_vision/backend/tests/test_reconciler.py b/products/replay_vision/backend/tests/test_reconciler.py
index da669ecc4bba..e1e04e33612b 100644
--- a/products/replay_vision/backend/tests/test_reconciler.py
+++ b/products/replay_vision/backend/tests/test_reconciler.py
@@ -28,8 +28,8 @@ from products.replay_vision.backend.models.replay_observation import (
)
from products.replay_vision.backend.models.replay_scanner import ReplayScanner, ScannerModel, ScannerOrigin, ScannerType
from products.replay_vision.backend.models.replay_scanner_prompt_suggestion import (
+ PromptSuggestionStatus,
ReplayScannerPromptSuggestion,
- SuggestionStatus,
)
from products.replay_vision.backend.models.vision_action import VisionAction, VisionActionRun, VisionActionRunStatus
from products.replay_vision.backend.prompt_evaluation import EVALUATE_PROMPT_SUGGESTION_EXECUTION_TIMEOUT
@@ -595,7 +595,7 @@ async def test_reap_settles_stuck_prompt_suggestion_evaluations(org_team) -> Non
scanner=scanner,
team=team,
suggested_prompt=f"p-{key}",
- status=SuggestionStatus.PENDING,
+ status=PromptSuggestionStatus.PENDING,
scanner_version=1,
evaluation={
"status": "running",
diff --git a/products/replay_vision/frontend/generated/api.schemas.ts b/products/replay_vision/frontend/generated/api.schemas.ts
index bd7c78b66ee0..0088e4aee715 100644
--- a/products/replay_vision/frontend/generated/api.schemas.ts
+++ b/products/replay_vision/frontend/generated/api.schemas.ts
@@ -11,10 +11,9 @@
* * `schedule` - Schedule
* * `threshold` - Threshold
*/
-export type VisionActionTriggerTypeEnumApi =
- (typeof VisionActionTriggerTypeEnumApi)[keyof typeof VisionActionTriggerTypeEnumApi]
+export type TriggerTypeEnumApi = (typeof TriggerTypeEnumApi)[keyof typeof TriggerTypeEnumApi]
-export const VisionActionTriggerTypeEnumApi = {
+export const TriggerTypeEnumApi = {
Schedule: 'schedule',
Threshold: 'threshold',
} as const
@@ -24,9 +23,9 @@ export const VisionActionTriggerTypeEnumApi = {
* * `alert` - Alert
* * `per_observation` - Per observation
*/
-export type VisionActionModeEnumApi = (typeof VisionActionModeEnumApi)[keyof typeof VisionActionModeEnumApi]
+export type ActionModeEnumApi = (typeof ActionModeEnumApi)[keyof typeof ActionModeEnumApi]
-export const VisionActionModeEnumApi = {
+export const ActionModeEnumApi = {
GroupSummary: 'group_summary',
Alert: 'alert',
PerObservation: 'per_observation',
@@ -87,9 +86,9 @@ export interface SynthesisConfigApi {
* * `every_match` - Every new match
* * `on_breach` - When a threshold is crossed
*/
-export type AlertConfigFrequencyEnumApi = (typeof AlertConfigFrequencyEnumApi)[keyof typeof AlertConfigFrequencyEnumApi]
+export type AlertFrequencyEnumApi = (typeof AlertFrequencyEnumApi)[keyof typeof AlertFrequencyEnumApi]
-export const AlertConfigFrequencyEnumApi = {
+export const AlertFrequencyEnumApi = {
EveryMatch: 'every_match',
OnBreach: 'on_breach',
} as const
@@ -98,9 +97,10 @@ export const AlertConfigFrequencyEnumApi = {
* * `count` - Count of matching observations
* * `avg_score` - Average score
*/
-export type VisionAlertMetricEnumApi = (typeof VisionAlertMetricEnumApi)[keyof typeof VisionAlertMetricEnumApi]
+export type VisionActionAlertMetricEnumApi =
+ (typeof VisionActionAlertMetricEnumApi)[keyof typeof VisionActionAlertMetricEnumApi]
-export const VisionAlertMetricEnumApi = {
+export const VisionActionAlertMetricEnumApi = {
Count: 'count',
AvgScore: 'avg_score',
} as const
@@ -143,12 +143,12 @@ export interface AlertConfigApi {
*
* * `every_match` - Every new match
* * `on_breach` - When a threshold is crossed */
- frequency?: AlertConfigFrequencyEnumApi
+ frequency?: AlertFrequencyEnumApi
/** What to measure over the window: 'count' of targeted observations, or 'avg_score' (the mean scorer score; scorer scanners only). every_match supports 'count' only.
*
* * `count` - Count of matching observations
* * `avg_score` - Average score */
- metric?: VisionAlertMetricEnumApi
+ metric?: VisionActionAlertMetricEnumApi
/** The alert fires when the metric is at or above ('above') or at or below ('below') this value, per 'direction'. Required for on_breach; ignored for every_match. */
threshold?: number
/** Which side of the threshold breaches: 'above' fires when the metric is at or above it, 'below' when at or below (e.g. an average score dropping under a floor). Both inclusive. Defaults to 'above'; ignored for every_match.
@@ -273,13 +273,13 @@ export interface VisionActionApi {
*
* * `schedule` - Schedule
* * `threshold` - Threshold */
- trigger_type?: VisionActionTriggerTypeEnumApi
+ trigger_type?: TriggerTypeEnumApi
/** What the action produces. MVP supports 'group_summary' only.
*
* * `group_summary` - Group summary
* * `alert` - Alert
* * `per_observation` - Per observation */
- mode?: VisionActionModeEnumApi
+ mode?: ActionModeEnumApi
/** Trigger parameters. For schedule triggers: {rrule, timezone}. */
trigger_config?: TriggerConfigApi
/** Targeting predicate: which of the scanner's observations this action runs on. */
@@ -340,13 +340,13 @@ export interface PatchedVisionActionApi {
*
* * `schedule` - Schedule
* * `threshold` - Threshold */
- trigger_type?: VisionActionTriggerTypeEnumApi
+ trigger_type?: TriggerTypeEnumApi
/** What the action produces. MVP supports 'group_summary' only.
*
* * `group_summary` - Group summary
* * `alert` - Alert
* * `per_observation` - Per observation */
- mode?: VisionActionModeEnumApi
+ mode?: ActionModeEnumApi
/** Trigger parameters. For schedule triggers: {rrule, timezone}. */
trigger_config?: TriggerConfigApi
/** Targeting predicate: which of the scanner's observations this action runs on. */
@@ -513,10 +513,9 @@ export interface VisionActionRunApi {
* * `metric` - Metric
* * `match` - Match
*/
-export type VisionAlertConfigurationKindEnumApi =
- (typeof VisionAlertConfigurationKindEnumApi)[keyof typeof VisionAlertConfigurationKindEnumApi]
+export type VisionAlertKindEnumApi = (typeof VisionAlertKindEnumApi)[keyof typeof VisionAlertKindEnumApi]
-export const VisionAlertConfigurationKindEnumApi = {
+export const VisionAlertKindEnumApi = {
Metric: 'metric',
Match: 'match',
} as const
@@ -544,10 +543,9 @@ export interface VisionAlertSelectionApi {
* * `count` - Count matching observations
* * `avg_score` - Average score
*/
-export type VisionAlertConfigurationMetricEnumApi =
- (typeof VisionAlertConfigurationMetricEnumApi)[keyof typeof VisionAlertConfigurationMetricEnumApi]
+export type VisionAlertMetricEnumApi = (typeof VisionAlertMetricEnumApi)[keyof typeof VisionAlertMetricEnumApi]
-export const VisionAlertConfigurationMetricEnumApi = {
+export const VisionAlertMetricEnumApi = {
Count: 'count',
AvgScore: 'avg_score',
} as const
@@ -600,14 +598,14 @@ export interface VisionAlertConfigurationApi {
*
* * `metric` - Metric
* * `match` - Match */
- kind: VisionAlertConfigurationKindEnumApi
+ kind: VisionAlertKindEnumApi
/** Which observations count. Empty matches every observation of the scanner. */
selection?: VisionAlertSelectionApi
/** Metric alerts only: what to measure over the window. 'avg_score' requires a scorer scanner.
*
* * `count` - Count matching observations
* * `avg_score` - Average score */
- metric?: VisionAlertConfigurationMetricEnumApi
+ metric?: VisionAlertMetricEnumApi
/** Metric alerts only: whether the alert fires at or above, or at or below, the threshold.
*
* * `above` - At or above
@@ -715,14 +713,14 @@ export interface PatchedVisionAlertConfigurationApi {
*
* * `metric` - Metric
* * `match` - Match */
- kind?: VisionAlertConfigurationKindEnumApi
+ kind?: VisionAlertKindEnumApi
/** Which observations count. Empty matches every observation of the scanner. */
selection?: VisionAlertSelectionApi
/** Metric alerts only: what to measure over the window. 'avg_score' requires a scorer scanner.
*
* * `count` - Count matching observations
* * `avg_score` - Average score */
- metric?: VisionAlertConfigurationMetricEnumApi
+ metric?: VisionAlertMetricEnumApi
/** Metric alerts only: whether the alert fires at or above, or at or below, the threshold.
*
* * `above` - At or above
@@ -1873,10 +1871,10 @@ export interface ObservationStatsApi {
* * `superseded` - Superseded
* * `no_change` - No change
*/
-export type ReplayScannerPromptSuggestionStatusEnumApi =
- (typeof ReplayScannerPromptSuggestionStatusEnumApi)[keyof typeof ReplayScannerPromptSuggestionStatusEnumApi]
+export type PromptSuggestionStatusEnumApi =
+ (typeof PromptSuggestionStatusEnumApi)[keyof typeof PromptSuggestionStatusEnumApi]
-export const ReplayScannerPromptSuggestionStatusEnumApi = {
+export const PromptSuggestionStatusEnumApi = {
Pending: 'pending',
Applied: 'applied',
Dismissed: 'dismissed',
@@ -1952,7 +1950,7 @@ export interface ReplayScannerPromptSuggestionApi {
* * `dismissed` - Dismissed
* * `superseded` - Superseded
* * `no_change` - No change */
- readonly status: ReplayScannerPromptSuggestionStatusEnumApi
+ readonly status: PromptSuggestionStatusEnumApi
/** The full rewritten prompt, ready to apply to the scanner. */
readonly suggested_prompt: string
/** The scanner prompt this suggestion was generated against, for diffing. */
@@ -2121,10 +2119,10 @@ export interface SignalScoutOutputDestinationsApi {
* * `trusted` - Trusted domains only
* * `full` - Full
*/
-export type ScoutConfigNetworkAccessEnumApi =
- (typeof ScoutConfigNetworkAccessEnumApi)[keyof typeof ScoutConfigNetworkAccessEnumApi]
+export type SignalScoutConfigNetworkAccessEnumApi =
+ (typeof SignalScoutConfigNetworkAccessEnumApi)[keyof typeof SignalScoutConfigNetworkAccessEnumApi]
-export const ScoutConfigNetworkAccessEnumApi = {
+export const SignalScoutConfigNetworkAccessEnumApi = {
Trusted: 'trusted',
Full: 'full',
} as const
@@ -2155,7 +2153,7 @@ export interface SignalScoutConfigOptionsApi {
*
* * `trusted` - Trusted domains only
* * `full` - Full */
- network_access?: ScoutConfigNetworkAccessEnumApi
+ network_access?: SignalScoutConfigNetworkAccessEnumApi
/** Exempt this scout from the inactivity pause, which otherwise switches off a scout that goes a fortnight without surfacing anything anyone engages with. Set it on watchdog scouts whose value is staying quiet. Defaults to false. */
auto_pause_exempt?: boolean
/**
@@ -2228,9 +2226,10 @@ export const ScoutOriginEnumApi = {
* * `paused_by_system` - Paused by system
* * `paused_by_user` - Paused by user
*/
-export type ScoutConfigStatusEnumApi = (typeof ScoutConfigStatusEnumApi)[keyof typeof ScoutConfigStatusEnumApi]
+export type SignalScoutConfigStatusEnumApi =
+ (typeof SignalScoutConfigStatusEnumApi)[keyof typeof SignalScoutConfigStatusEnumApi]
-export const ScoutConfigStatusEnumApi = {
+export const SignalScoutConfigStatusEnumApi = {
Active: 'active',
PendingPause: 'pending_pause',
PausedBySystem: 'paused_by_system',
@@ -2242,10 +2241,10 @@ export const ScoutConfigStatusEnumApi = {
* * `ignored` - Ignored
* * `repeated_failures` - Repeated failures
*/
-export type ScoutConfigPauseReasonEnumApi =
- (typeof ScoutConfigPauseReasonEnumApi)[keyof typeof ScoutConfigPauseReasonEnumApi]
+export type SignalScoutConfigPauseReasonEnumApi =
+ (typeof SignalScoutConfigPauseReasonEnumApi)[keyof typeof SignalScoutConfigPauseReasonEnumApi]
-export const ScoutConfigPauseReasonEnumApi = {
+export const SignalScoutConfigPauseReasonEnumApi = {
NoOutput: 'no_output',
Ignored: 'ignored',
RepeatedFailures: 'repeated_failures',
@@ -2281,13 +2280,13 @@ export interface SignalScoutConfigApi {
* * `pending_pause` - Pending pause
* * `paused_by_system` - Paused by system
* * `paused_by_user` - Paused by user */
- readonly status: ScoutConfigStatusEnumApi
+ readonly status: SignalScoutConfigStatusEnumApi
/** Why the system paused (or warned) this scout: `no_output` (it emitted nothing over the evaluation window), `ignored` (no person engaged with its reports — no view, rating, note, dismissal, or resolution), or `repeated_failures` (consecutive failed runs). Null unless `status` is `pending_pause` or `paused_by_system`.
*
* * `no_output` - No output
* * `ignored` - Ignored
* * `repeated_failures` - Repeated failures */
- readonly pause_reason: ScoutConfigPauseReasonEnumApi | null
+ readonly pause_reason: SignalScoutConfigPauseReasonEnumApi | null
/** Whether the scout writes findings to the inbox. False = dry-run: it runs and logs but emits nothing. */
readonly emit: boolean
/**
@@ -2312,7 +2311,7 @@ export interface SignalScoutConfigApi {
*
* * `trusted` - Trusted domains only
* * `full` - Full */
- readonly network_access: ScoutConfigNetworkAccessEnumApi
+ readonly network_access: SignalScoutConfigNetworkAccessEnumApi
/**
* Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it.
* @nullable
diff --git a/products/replay_vision/frontend/replay_scanners/ActionEditorScene.tsx b/products/replay_vision/frontend/replay_scanners/ActionEditorScene.tsx
index cfe8ed5ebdeb..22cfa879aee5 100644
--- a/products/replay_vision/frontend/replay_scanners/ActionEditorScene.tsx
+++ b/products/replay_vision/frontend/replay_scanners/ActionEditorScene.tsx
@@ -30,11 +30,11 @@ import { ProductKey } from '~/queries/schema/schema-general'
import { VisionDocsLink } from '../components/DocsLink'
import { ReplayVisionFeedbackButton } from '../components/ReplayVisionFeedbackButton'
import {
- AlertConfigFrequencyEnumApi,
+ AlertFrequencyEnumApi,
DeliveryTargetTypeEnumApi,
- VisionActionModeEnumApi,
+ ActionModeEnumApi,
VisionAlertDirectionEnumApi,
- VisionAlertMetricEnumApi,
+ VisionActionAlertMetricEnumApi,
} from '../generated/api.schemas'
import { getReplayVisionEditDisabledReason } from '../utils/accessControl'
import { actionEditorSceneLogic } from './actionEditorSceneLogic'
@@ -365,7 +365,7 @@ function AlertMatchLine({ scannerId }: { scannerId: string }): JSX.Element | nul
break
}
case 'scorer': {
- if (actionForm.alert_metric === VisionAlertMetricEnumApi.AvgScore) {
+ if (actionForm.alert_metric === VisionActionAlertMetricEnumApi.AvgScore) {
return null
}
const scale = scanner.scanner_config?.scale
@@ -414,12 +414,12 @@ function ConditionSection({ scannerId }: { scannerId: string }): JSX.Element {
const { setActionFormValue } = useActions(actionEditorSceneLogic)
const { scanner } = useValues(replayScannerLogic({ id: scannerId }))
- const everyMatch = actionForm.alert_frequency === AlertConfigFrequencyEnumApi.EveryMatch
+ const everyMatch = actionForm.alert_frequency === AlertFrequencyEnumApi.EveryMatch
const isScorer = scanner?.scanner_type === 'scorer'
// Direction is only offered for the average score ("below a floor" is the natural quality alarm).
// A count threshold is always "at least" — "at most N matches" reads backwards from intent and is
// really a went-quiet alarm, so we don't expose it for counts (buildActionBody pins it to above).
- const isAvg = actionForm.alert_metric === VisionAlertMetricEnumApi.AvgScore
+ const isAvg = actionForm.alert_metric === VisionActionAlertMetricEnumApi.AvgScore
// Summarizer observations have no verdict/tags/score to threshold on, so the only sensible
// alert is "every new summary" — no controls to show. The logic normalizes the form to
@@ -445,14 +445,14 @@ function ConditionSection({ scannerId }: { scannerId: string }): JSX.Element {
value={actionForm.alert_frequency}
onChange={(value) => {
setActionFormValue('alert_frequency', value)
- if (value === AlertConfigFrequencyEnumApi.EveryMatch) {
+ if (value === AlertFrequencyEnumApi.EveryMatch) {
// every_match counts new matches; an average makes no sense there.
- setActionFormValue('alert_metric', VisionAlertMetricEnumApi.Count)
+ setActionFormValue('alert_metric', VisionActionAlertMetricEnumApi.Count)
}
}}
options={[
- { value: AlertConfigFrequencyEnumApi.EveryMatch, label: 'Notify me on every match' },
- { value: AlertConfigFrequencyEnumApi.OnBreach, label: 'Notify me on a threshold' },
+ { value: AlertFrequencyEnumApi.EveryMatch, label: 'Notify me on every match' },
+ { value: AlertFrequencyEnumApi.OnBreach, label: 'Notify me on a threshold' },
]}
data-attr="vision-action-alert-frequency"
/>
@@ -472,13 +472,13 @@ function ConditionSection({ scannerId }: { scannerId: string }): JSX.Element {
setActionFormValue('alert_metric', value)
// Count thresholds are always "at least" (the direction control is
// hidden for them), so switching back to count clears any "at most".
- if (value === VisionAlertMetricEnumApi.Count) {
+ if (value === VisionActionAlertMetricEnumApi.Count) {
setActionFormValue('alert_direction', VisionAlertDirectionEnumApi.Above)
}
}}
options={[
- { value: VisionAlertMetricEnumApi.Count, label: 'number of matches' },
- { value: VisionAlertMetricEnumApi.AvgScore, label: 'average score' },
+ { value: VisionActionAlertMetricEnumApi.Count, label: 'number of matches' },
+ { value: VisionActionAlertMetricEnumApi.AvgScore, label: 'average score' },
]}
data-attr="vision-action-alert-metric"
/>
@@ -547,7 +547,7 @@ function ConditionSection({ scannerId }: { scannerId: string }): JSX.Element {
function DeliverySection(): JSX.Element {
const { actionForm } = useValues(actionEditorSceneLogic)
const { setActionFormValue } = useActions(actionEditorSceneLogic)
- const noun = actionForm.mode === VisionActionModeEnumApi.Alert ? 'alert' : 'digest'
+ const noun = actionForm.mode === ActionModeEnumApi.Alert ? 'alert' : 'digest'
return (
<div className="flex flex-col gap-2">
@@ -672,7 +672,7 @@ export function ActionEditorSceneComponent(): JSX.Element {
)
}
- const isAlert = actionForm.mode === VisionActionModeEnumApi.Alert
+ const isAlert = actionForm.mode === ActionModeEnumApi.Alert
const noun = isAlert ? 'alert' : 'digest'
const title = isNew
? scannerName
diff --git a/products/replay_vision/frontend/replay_scanners/VisionActionScene.tsx b/products/replay_vision/frontend/replay_scanners/VisionActionScene.tsx
index 58d0c65f9cb0..16ded10378cd 100644
--- a/products/replay_vision/frontend/replay_scanners/VisionActionScene.tsx
+++ b/products/replay_vision/frontend/replay_scanners/VisionActionScene.tsx
@@ -13,7 +13,7 @@ import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'
import { ProductKey } from '~/queries/schema/schema-general'
import type { VisionActionApi } from '../generated/api.schemas'
-import { DeliveryTargetTypeEnumApi, VisionActionModeEnumApi } from '../generated/api.schemas'
+import { DeliveryTargetTypeEnumApi, ActionModeEnumApi } from '../generated/api.schemas'
import { getReplayVisionEditDisabledReason } from '../utils/accessControl'
import { humanizeCadence, parseRruleToCadence } from './cadence'
import { VisionActionRuns } from './components/VisionActionRuns'
@@ -66,7 +66,7 @@ function ConfigCard({
scheduleLabel: string | null
noun: string
}): JSX.Element {
- const isAlert = action.mode === VisionActionModeEnumApi.Alert
+ const isAlert = action.mode === ActionModeEnumApi.Alert
const guidance = action.synthesis_config?.prompt_guide?.trim()
return (
@@ -106,7 +106,7 @@ function ActionOverview({
action: VisionActionApi
scheduleLabel: string | null
}): JSX.Element {
- const isAlert = action.mode === VisionActionModeEnumApi.Alert
+ const isAlert = action.mode === ActionModeEnumApi.Alert
// `action.scanner` is only the id — the action's own user_access_level would just reflect the
// replay_scanner resource default, not a per-scanner object grant, so load the scanner itself.
const { scanner } = useValues(replayScannerLogic({ id: action.scanner }))
diff --git a/products/replay_vision/frontend/replay_scanners/actionEditorSceneLogic.ts b/products/replay_vision/frontend/replay_scanners/actionEditorSceneLogic.ts
index 6359f7181baf..f658c055904c 100644
--- a/products/replay_vision/frontend/replay_scanners/actionEditorSceneLogic.ts
+++ b/products/replay_vision/frontend/replay_scanners/actionEditorSceneLogic.ts
@@ -17,11 +17,11 @@ import {
visionScannersRetrieve,
} from '../generated/api'
import {
- AlertConfigFrequencyEnumApi,
+ AlertFrequencyEnumApi,
DeliveryTargetTypeEnumApi,
- VisionActionModeEnumApi,
+ ActionModeEnumApi,
VisionAlertDirectionEnumApi,
- VisionAlertMetricEnumApi,
+ VisionActionAlertMetricEnumApi,
} from '../generated/api.schemas'
import type { VisionActionApi } from '../generated/api.schemas'
import { VISION_ROOT_BREADCRUMB, scannerBreadcrumb } from '../utils/breadcrumbs'
@@ -240,8 +240,7 @@ export const actionEditorSceneLogic = kea<actionEditorSceneLogicType>([
{
key: `action-${actionId}`,
name:
- loadedAction?.name ||
- (loadedAction?.mode === VisionActionModeEnumApi.Alert ? 'Alert' : 'Digest'),
+ loadedAction?.name || (loadedAction?.mode === ActionModeEnumApi.Alert ? 'Alert' : 'Digest'),
path: urls.replayVisionAction(actionId),
},
{ key: `action-${actionId}-edit`, name: 'Edit' }
@@ -264,7 +263,7 @@ export const actionEditorSceneLogic = kea<actionEditorSceneLogicType>([
alert_threshold,
}: VisionActionForm) => ({
name: !name?.trim()
- ? mode === VisionActionModeEnumApi.Alert
+ ? mode === ActionModeEnumApi.Alert
? 'Give this alert a name'
: 'Give this digest a name'
: undefined,
@@ -272,7 +271,7 @@ export const actionEditorSceneLogic = kea<actionEditorSceneLogicType>([
// mark the form invalid and block Enter-to-submit; the visible copy is the inline text.
// Alerts have no schedule UI (checked continuously on every sweep), so weekdays don't apply.
cadence:
- mode !== VisionActionModeEnumApi.Alert && cadence.weekdays.length === 0
+ mode !== ActionModeEnumApi.Alert && cadence.weekdays.length === 0
? { hour: 'Pick at least one day' }
: undefined,
min_score:
@@ -280,8 +279,8 @@ export const actionEditorSceneLogic = kea<actionEditorSceneLogicType>([
? "Min score can't exceed max score"
: undefined,
alert_threshold:
- mode === VisionActionModeEnumApi.Alert &&
- alert_frequency === AlertConfigFrequencyEnumApi.OnBreach &&
+ mode === ActionModeEnumApi.Alert &&
+ alert_frequency === AlertFrequencyEnumApi.OnBreach &&
alert_threshold == null
? 'Set a threshold'
: undefined,
@@ -298,13 +297,13 @@ export const actionEditorSceneLogic = kea<actionEditorSceneLogicType>([
const body = buildActionBody(form, scannerId)
if (values.isNew) {
const created = await visionActionsCreate(String(teamId), body)
- lemonToast.success(form.mode === VisionActionModeEnumApi.Alert ? 'Alert created' : 'Digest created')
+ lemonToast.success(form.mode === ActionModeEnumApi.Alert ? 'Alert created' : 'Digest created')
visionActionsLogic.findMounted({ scannerId })?.actions.loadActions()
router.actions.push(urls.replayVisionAction(created.id))
return
}
const updated = await visionActionsPartialUpdate(String(teamId), values.actionId, body)
- lemonToast.success(form.mode === VisionActionModeEnumApi.Alert ? 'Alert updated' : 'Digest updated')
+ lemonToast.success(form.mode === ActionModeEnumApi.Alert ? 'Alert updated' : 'Digest updated')
visionActionsLogic.findMounted({ scannerId })?.actions.loadActions()
const runsLogic = visionActionRunsLogic.findMounted({ actionId: updated.id })
runsLogic?.actions.loadAction()
@@ -345,10 +344,10 @@ export const actionEditorSceneLogic = kea<actionEditorSceneLogicType>([
// keeps validation and the submitted alert_config consistent with what the editor shows.
// The mode is fixed once the editor opens, so this only has to fire on init/load, not on a
// mode toggle.
- if (scannerType === 'summarizer' && values.actionForm.mode === VisionActionModeEnumApi.Alert) {
+ if (scannerType === 'summarizer' && values.actionForm.mode === ActionModeEnumApi.Alert) {
actions.setActionFormValues({
- alert_frequency: AlertConfigFrequencyEnumApi.EveryMatch,
- alert_metric: VisionAlertMetricEnumApi.Count,
+ alert_frequency: AlertFrequencyEnumApi.EveryMatch,
+ alert_metric: VisionActionAlertMetricEnumApi.Count,
})
}
},
@@ -386,10 +385,10 @@ export const actionEditorSceneLogic = kea<actionEditorSceneLogicType>([
// else gets the fresh-form default so flipping a digest to an alert starts at every_match.
const alertFrequency =
action.alert_config?.frequency ??
- (action.mode === VisionActionModeEnumApi.Alert
- ? AlertConfigFrequencyEnumApi.OnBreach
- : AlertConfigFrequencyEnumApi.EveryMatch)
- const alertMetric = action.alert_config?.metric ?? VisionAlertMetricEnumApi.Count
+ (action.mode === ActionModeEnumApi.Alert
+ ? AlertFrequencyEnumApi.OnBreach
+ : AlertFrequencyEnumApi.EveryMatch)
+ const alertMetric = action.alert_config?.metric ?? VisionActionAlertMetricEnumApi.Count
const alertDirection = action.alert_config?.direction ?? VisionAlertDirectionEnumApi.Above
actions.setActionFormValues({
name: action.name,
@@ -400,7 +399,7 @@ export const actionEditorSceneLogic = kea<actionEditorSceneLogicType>([
integration_id: action.delivery_config?.[0]?.integration_id ?? null,
channel: action.delivery_config?.[0]?.channel ?? '',
webhook_url: action.delivery_config?.[0]?.url ?? '',
- mode: action.mode ?? VisionActionModeEnumApi.GroupSummary,
+ mode: action.mode ?? ActionModeEnumApi.GroupSummary,
alert_frequency: alertFrequency,
alert_metric: alertMetric,
alert_threshold: action.alert_config?.threshold ?? 1,
@@ -415,7 +414,7 @@ export const actionEditorSceneLogic = kea<actionEditorSceneLogicType>([
},
submitActionFormFailure: ({ error }: { error?: Error & { detail?: string } }) => {
- const noun = values.actionForm.mode === VisionActionModeEnumApi.Alert ? 'alert' : 'digest'
+ const noun = values.actionForm.mode === ActionModeEnumApi.Alert ? 'alert' : 'digest'
lemonToast.error(`Failed to save ${noun}${error?.detail ? `: ${error.detail}` : ''}`)
},
})),
@@ -427,9 +426,7 @@ export const actionEditorSceneLogic = kea<actionEditorSceneLogicType>([
// Mode is picked before opening the editor (the "New digest" / "New alert" buttons), so the
// form opens committed to one shape rather than showing a type toggle.
const startMode =
- mode === VisionActionModeEnumApi.Alert
- ? VisionActionModeEnumApi.Alert
- : VisionActionModeEnumApi.GroupSummary
+ mode === ActionModeEnumApi.Alert ? ActionModeEnumApi.Alert : ActionModeEnumApi.GroupSummary
actions.resetActionForm({ ...NEW_ACTION_FORM(), mode: startMode }) // clear values left from a previous edit
},
[urls.replayVisionActionEdit(':actionId')]: ({ actionId }) => {
diff --git a/products/replay_vision/frontend/replay_scanners/components/VisionActionRuns.tsx b/products/replay_vision/frontend/replay_scanners/components/VisionActionRuns.tsx
index 936b66c2b2e1..add02395a488 100644
--- a/products/replay_vision/frontend/replay_scanners/components/VisionActionRuns.tsx
+++ b/products/replay_vision/frontend/replay_scanners/components/VisionActionRuns.tsx
@@ -10,7 +10,7 @@ import { humanFriendlyNumber } from 'lib/utils/numbers'
import { urls } from 'scenes/urls'
import type { VisionActionRunListApi } from '../../generated/api.schemas'
-import { VisionActionModeEnumApi } from '../../generated/api.schemas'
+import { ActionModeEnumApi } from '../../generated/api.schemas'
import { visionActionRunsLogic } from '../visionActionRunsLogic'
import { RunStatusTag } from '../visionActionRunStatus'
import { visionActionSceneLogic } from '../visionActionSceneLogic'
@@ -38,7 +38,7 @@ function RunStats(): JSX.Element {
const disabled = action?.enabled === false
// Quiet alert checks (condition not met) don't appear in the run list, so for alerts the time
// cells speak in terms of checks: "last checked" can be much more recent than the newest row.
- const isAlert = action?.mode === VisionActionModeEnumApi.Alert
+ const isAlert = action?.mode === ActionModeEnumApi.Alert
// every_match rides each scanner sweep; on_breach thresholds are re-checked hourly.
const everyMatch = action?.alert_config?.frequency === 'every_match'
// Show run times in the schedule's own timezone so "Next run" lines up with the "Runs daily
@@ -97,7 +97,7 @@ function RunStats(): JSX.Element {
function EmptyRuns(): JSX.Element {
const { action } = useValues(visionActionRunsLogic)
- const isAlert = action?.mode === VisionActionModeEnumApi.Alert
+ const isAlert = action?.mode === ActionModeEnumApi.Alert
const everyMatch = action?.alert_config?.frequency === 'every_match'
return (
<div className="flex flex-col items-center text-center gap-3 py-10">
diff --git a/products/replay_vision/frontend/replay_scanners/visionActionsLogic.ts b/products/replay_vision/frontend/replay_scanners/visionActionsLogic.ts
index 05df188402cf..5dd7f56cf8a1 100644
--- a/products/replay_vision/frontend/replay_scanners/visionActionsLogic.ts
+++ b/products/replay_vision/frontend/replay_scanners/visionActionsLogic.ts
@@ -11,11 +11,11 @@ import {
visionActionsPartialUpdate,
} from '../generated/api'
import {
- AlertConfigFrequencyEnumApi,
+ AlertFrequencyEnumApi,
DeliveryTargetTypeEnumApi,
- VisionActionModeEnumApi,
+ ActionModeEnumApi,
VisionAlertDirectionEnumApi,
- VisionAlertMetricEnumApi,
+ VisionActionAlertMetricEnumApi,
WindowDaysEnumApi,
} from '../generated/api.schemas'
import type { VerdictEnumApi, VisionActionApi } from '../generated/api.schemas'
@@ -42,9 +42,9 @@ export interface VisionActionForm {
min_score: number | null
max_score: number | null
// What the action produces; alerts carry a condition instead of synthesizing a summary.
- mode: VisionActionModeEnumApi
- alert_frequency: AlertConfigFrequencyEnumApi
- alert_metric: VisionAlertMetricEnumApi
+ mode: ActionModeEnumApi
+ alert_frequency: AlertFrequencyEnumApi
+ alert_metric: VisionActionAlertMetricEnumApi
alert_threshold: number | null
alert_direction: VisionAlertDirectionEnumApi
alert_window_days: WindowDaysEnumApi
@@ -65,10 +65,10 @@ export const NEW_ACTION_FORM = (): VisionActionForm => ({
tags: [],
min_score: null,
max_score: null,
- mode: VisionActionModeEnumApi.GroupSummary,
+ mode: ActionModeEnumApi.GroupSummary,
// Default alert flavor: notify about every new match ("every time the result is X, tell me").
- alert_frequency: AlertConfigFrequencyEnumApi.EveryMatch,
- alert_metric: VisionAlertMetricEnumApi.Count,
+ alert_frequency: AlertFrequencyEnumApi.EveryMatch,
+ alert_metric: VisionActionAlertMetricEnumApi.Count,
alert_threshold: 1,
alert_direction: VisionAlertDirectionEnumApi.Above,
alert_window_days: 1,
@@ -94,7 +94,7 @@ export function buildActionBody(form: VisionActionForm, scannerId: string): Para
if (form.max_score != null) {
selection.max_score = form.max_score
}
- const isAlert = form.mode === VisionActionModeEnumApi.Alert
+ const isAlert = form.mode === ActionModeEnumApi.Alert
return {
name: form.name.trim(),
scanner: scannerId,
@@ -109,10 +109,10 @@ export function buildActionBody(form: VisionActionForm, scannerId: string): Para
...(isAlert
? {
alert_config:
- form.alert_frequency === AlertConfigFrequencyEnumApi.EveryMatch
+ form.alert_frequency === AlertFrequencyEnumApi.EveryMatch
? {
frequency: form.alert_frequency,
- metric: VisionAlertMetricEnumApi.Count,
+ metric: VisionActionAlertMetricEnumApi.Count,
include_reasoning: form.alert_include_reasoning,
}
: {
@@ -124,7 +124,7 @@ export function buildActionBody(form: VisionActionForm, scannerId: string): Para
// "at most N matches" is a confusing quiet-window alarm — so pin it,
// ignoring any stale below a loaded config might carry.
direction:
- form.alert_metric === VisionAlertMetricEnumApi.AvgScore
+ form.alert_metric === VisionActionAlertMetricEnumApi.AvgScore
? form.alert_direction
: VisionAlertDirectionEnumApi.Above,
window_days: form.alert_window_days,
@@ -288,7 +288,7 @@ export const visionActionsLogic = kea<visionActionsLogicType>([
actions.toggleActionEnabledDone(id)
} catch (error: any) {
const verb = action.enabled ? 'enable' : 'disable'
- const noun = action.mode === VisionActionModeEnumApi.Alert ? 'alert' : 'digest'
+ const noun = action.mode === ActionModeEnumApi.Alert ? 'alert' : 'digest'
lemonToast.error(`Failed to ${verb} ${noun}${error.detail ? `: ${error.detail}` : ''}`)
actions.revertActionEnabled(id)
}
@@ -300,9 +300,7 @@ export const visionActionsLogic = kea<visionActionsLogicType>([
return
}
const noun =
- values.visionActions.find((a) => a.id === id)?.mode === VisionActionModeEnumApi.Alert
- ? 'alert'
- : 'digest'
+ values.visionActions.find((a) => a.id === id)?.mode === ActionModeEnumApi.Alert ? 'alert' : 'digest'
try {
await visionActionsDestroy(String(teamId), id)
actions.deleteActionSuccess(id)
diff --git a/products/review_hog/frontend/CodeReviewScene.tsx b/products/review_hog/frontend/CodeReviewScene.tsx
index 076f14712cab..77124c9f451b 100644
--- a/products/review_hog/frontend/CodeReviewScene.tsx
+++ b/products/review_hog/frontend/CodeReviewScene.tsx
@@ -54,7 +54,7 @@ import type {
ReviewPerspectiveStatItemApi,
ReviewRecentReviewApi,
ReviewResolutionStatusApi,
- UrgencyThresholdEnumApi,
+ ReviewUserSettingsUrgencyThresholdEnumApi,
} from 'products/review_hog/frontend/generated/api.schemas'
import {
ReviewHogReviewsListScope,
@@ -132,7 +132,7 @@ const PIPELINE_PHASES: { name: string; hint: string; steps: { number: string; ti
},
]
-const URGENCY_STOPS: { key: UrgencyThresholdEnumApi; label: string; description: string }[] = [
+const URGENCY_STOPS: { key: ReviewUserSettingsUrgencyThresholdEnumApi; label: string; description: string }[] = [
{
key: 'consider',
label: 'All issues',
diff --git a/products/review_hog/frontend/generated/api.schemas.ts b/products/review_hog/frontend/generated/api.schemas.ts
index 0c088b5e79e0..82ec6c23753f 100644
--- a/products/review_hog/frontend/generated/api.schemas.ts
+++ b/products/review_hog/frontend/generated/api.schemas.ts
@@ -511,9 +511,10 @@ export interface ReviewTriggerErrorApi {
* * `should_fix` - Should Fix
* * `must_fix` - Must Fix
*/
-export type UrgencyThresholdEnumApi = (typeof UrgencyThresholdEnumApi)[keyof typeof UrgencyThresholdEnumApi]
+export type ReviewUserSettingsUrgencyThresholdEnumApi =
+ (typeof ReviewUserSettingsUrgencyThresholdEnumApi)[keyof typeof ReviewUserSettingsUrgencyThresholdEnumApi]
-export const UrgencyThresholdEnumApi = {
+export const ReviewUserSettingsUrgencyThresholdEnumApi = {
Consider: 'consider',
ShouldFix: 'should_fix',
MustFix: 'must_fix',
@@ -533,7 +534,7 @@ export interface ReviewUserSettingsApi {
* * `consider` - Consider
* * `should_fix` - Should Fix
* * `must_fix` - Must Fix */
- urgency_threshold?: UrgencyThresholdEnumApi
+ urgency_threshold?: ReviewUserSettingsUrgencyThresholdEnumApi
/** Whether reviews can be started from this project's Code review page (the UI trigger is limited to the designated ReviewHog teams while the product is in alpha). */
readonly can_trigger_reviews: boolean
/** Whether this project has at least one synced, enabled Stamphog repository. When false, the stamphog_review_inbox_prs toggle has nothing to act on and the UI renders it disabled with a pointer to connect the Stamphog GitHub App. */
@@ -554,7 +555,7 @@ export interface PatchedReviewUserSettingsApi {
* * `consider` - Consider
* * `should_fix` - Should Fix
* * `must_fix` - Must Fix */
- urgency_threshold?: UrgencyThresholdEnumApi
+ urgency_threshold?: ReviewUserSettingsUrgencyThresholdEnumApi
/** Whether reviews can be started from this project's Code review page (the UI trigger is limited to the designated ReviewHog teams while the product is in alpha). */
readonly can_trigger_reviews?: boolean
/** Whether this project has at least one synced, enabled Stamphog repository. When false, the stamphog_review_inbox_prs toggle has nothing to act on and the UI renders it disabled with a pointer to connect the Stamphog GitHub App. */
diff --git a/products/signals/backend/scout_harness/serializers.py b/products/signals/backend/scout_harness/serializers.py
index 3faf8d41922c..a6c1b4113f11 100644
--- a/products/signals/backend/scout_harness/serializers.py
+++ b/products/signals/backend/scout_harness/serializers.py
@@ -14,6 +14,7 @@ from datetime import datetime
from typing import Any
from uuid import UUID
+from django.db import models
from django.utils import timezone
import structlog
@@ -2372,6 +2373,11 @@ def _normalize_mcp_gateway_server_ids(value: list[UUID]) -> list[str]:
return [str(server_id) for server_id in value]
+class ScoutOrigin(models.TextChoices):
+ CANONICAL = "canonical", "canonical"
+ CUSTOM = "custom", "custom"
+
+
class SignalScoutConfigSerializer(serializers.ModelSerializer):
"""Read shape for a per-(team, skill) scout config.
@@ -2545,7 +2551,7 @@ class SignalScoutConfigSerializer(serializers.ModelSerializer):
info = (self.context.get("skill_info") or {}).get(obj.skill_name)
return info.description if info else ""
- @extend_schema_field(serializers.ChoiceField(choices=["canonical", "custom"]))
+ @extend_schema_field(serializers.ChoiceField(choices=ScoutOrigin.choices))
def get_scout_origin(self, obj: SignalScoutConfig) -> str:
# Same single-query `skill_info` map as `get_description`. Falls back to `custom` when
# the skill row is absent — a config with no skill row isn't a canonical scout.
diff --git a/products/signals/backend/views.py b/products/signals/backend/views.py
index a2ac2738990d..40518a2322cb 100644
--- a/products/signals/backend/views.py
+++ b/products/signals/backend/views.py
@@ -516,9 +516,15 @@ _RESOLVABLE_STATUSES_BEFORE_SUPPRESSION = frozenset(
)
+class SignalReportState(models.TextChoices):
+ SUPPRESSED = "suppressed", "suppressed"
+ POTENTIAL = "potential", "potential"
+ RESOLVED = "resolved", "resolved"
+
+
class SignalReportStateRequestSerializer(serializers.Serializer):
state = serializers.ChoiceField(
- choices=[("suppressed", "suppressed"), ("potential", "potential"), ("resolved", "resolved")],
+ choices=SignalReportState.choices,
help_text=(
"Target state for the report. Use 'suppressed' to dismiss the report from the inbox, "
"'potential' to snooze/reopen it for later review, or 'resolved' when the work this report "
diff --git a/products/signals/frontend/generated/api.schemas.ts b/products/signals/frontend/generated/api.schemas.ts
index f76a7774974a..e4da92491653 100644
--- a/products/signals/frontend/generated/api.schemas.ts
+++ b/products/signals/frontend/generated/api.schemas.ts
@@ -124,9 +124,10 @@ export const SignalReportRefundReasonEnumApi = {
* * `excluded` - Excluded
* * `credited` - Credited
*/
-export type BillingPathEnumApi = (typeof BillingPathEnumApi)[keyof typeof BillingPathEnumApi]
+export type SignalReportRefundBillingPathEnumApi =
+ (typeof SignalReportRefundBillingPathEnumApi)[keyof typeof SignalReportRefundBillingPathEnumApi]
-export const BillingPathEnumApi = {
+export const SignalReportRefundBillingPathEnumApi = {
Excluded: 'excluded',
Credited: 'credited',
} as const
@@ -146,7 +147,7 @@ export interface SignalReportRefundApi {
*
* * `excluded` - Excluded
* * `credited` - Credited */
- readonly billing_path: BillingPathEnumApi
+ readonly billing_path: SignalReportRefundBillingPathEnumApi
/** Signals credits refunded (flat per-PR charge snapshot; 1 credit = $0.01). */
readonly credits: number
/** The refunded implementation PR's GitHub URL, snapshotted at refund time. */
@@ -180,9 +181,10 @@ export const RefundIneligibilityReasonEnumApi = {
* * `posthog_onboarding` - PostHog onboarding
* * `posthog_system` - PostHog system
*/
-export type BillingExemptReasonEnumApi = (typeof BillingExemptReasonEnumApi)[keyof typeof BillingExemptReasonEnumApi]
+export type SignalReportBillingExemptReasonEnumApi =
+ (typeof SignalReportBillingExemptReasonEnumApi)[keyof typeof SignalReportBillingExemptReasonEnumApi]
-export const BillingExemptReasonEnumApi = {
+export const SignalReportBillingExemptReasonEnumApi = {
PosthogHealthCheck: 'posthog_health_check',
PosthogOnboarding: 'posthog_onboarding',
PosthogSystem: 'posthog_system',
@@ -254,7 +256,7 @@ export interface SignalReportApi {
* * `posthog_health_check` - PostHog health check
* * `posthog_onboarding` - PostHog onboarding
* * `posthog_system` - PostHog system */
- readonly billing_exempt_reason: BillingExemptReasonEnumApi | null
+ readonly billing_exempt_reason: SignalReportBillingExemptReasonEnumApi | null
/**
* The space (task channel) this report is assigned to, or null when unassigned. The general view lists every report regardless of this value.
* @nullable
@@ -600,7 +602,7 @@ export interface SignalReportRefundResponseApi {
*
* * `excluded` - Excluded
* * `credited` - Credited */
- readonly billing_path: BillingPathEnumApi
+ readonly billing_path: SignalReportRefundBillingPathEnumApi
/** Signals credits refunded (flat per-PR charge snapshot; 1 credit = $0.01). */
readonly credits: number
/** The refunded implementation PR's GitHub URL, snapshotted at refund time. */
@@ -1639,10 +1641,10 @@ export interface SignalReportStateRequestApi {
* * `code_review` - Code Review
* * `related_to` - Related To
*/
-export type SignalReportArtefactTypeEnumApi =
- (typeof SignalReportArtefactTypeEnumApi)[keyof typeof SignalReportArtefactTypeEnumApi]
+export type SignalReportArtefactArtefactTypeEnumApi =
+ (typeof SignalReportArtefactArtefactTypeEnumApi)[keyof typeof SignalReportArtefactArtefactTypeEnumApi]
-export const SignalReportArtefactTypeEnumApi = {
+export const SignalReportArtefactArtefactTypeEnumApi = {
VideoSegment: 'video_segment',
SafetyJudgment: 'safety_judgment',
ActionabilityJudgment: 'actionability_judgment',
@@ -1674,7 +1676,7 @@ export type SignalReportArtefactApiContent = { [key: string]: unknown } | unknow
export interface SignalReportArtefactApi {
readonly id: string
- readonly type: SignalReportArtefactTypeEnumApi
+ readonly type: SignalReportArtefactArtefactTypeEnumApi
readonly content: SignalReportArtefactApiContent
readonly created_at: string
/** @nullable */
@@ -1898,10 +1900,10 @@ export interface SignalScoutOutputDestinationsApi {
* * `trusted` - Trusted domains only
* * `full` - Full
*/
-export type ScoutConfigNetworkAccessEnumApi =
- (typeof ScoutConfigNetworkAccessEnumApi)[keyof typeof ScoutConfigNetworkAccessEnumApi]
+export type SignalScoutConfigNetworkAccessEnumApi =
+ (typeof SignalScoutConfigNetworkAccessEnumApi)[keyof typeof SignalScoutConfigNetworkAccessEnumApi]
-export const ScoutConfigNetworkAccessEnumApi = {
+export const SignalScoutConfigNetworkAccessEnumApi = {
Trusted: 'trusted',
Full: 'full',
} as const
@@ -1932,7 +1934,7 @@ export interface SignalScoutConfigOptionsApi {
*
* * `trusted` - Trusted domains only
* * `full` - Full */
- network_access?: ScoutConfigNetworkAccessEnumApi
+ network_access?: SignalScoutConfigNetworkAccessEnumApi
/** Exempt this scout from the inactivity pause, which otherwise switches off a scout that goes a fortnight without surfacing anything anyone engages with. Set it on watchdog scouts whose value is staying quiet. Defaults to false. */
auto_pause_exempt?: boolean
/**
@@ -2069,9 +2071,10 @@ export interface UserBasicApi {
* * `paused_by_system` - Paused by system
* * `paused_by_user` - Paused by user
*/
-export type ScoutConfigStatusEnumApi = (typeof ScoutConfigStatusEnumApi)[keyof typeof ScoutConfigStatusEnumApi]
+export type SignalScoutConfigStatusEnumApi =
+ (typeof SignalScoutConfigStatusEnumApi)[keyof typeof SignalScoutConfigStatusEnumApi]
-export const ScoutConfigStatusEnumApi = {
+export const SignalScoutConfigStatusEnumApi = {
Active: 'active',
PendingPause: 'pending_pause',
PausedBySystem: 'paused_by_system',
@@ -2083,10 +2086,10 @@ export const ScoutConfigStatusEnumApi = {
* * `ignored` - Ignored
* * `repeated_failures` - Repeated failures
*/
-export type ScoutConfigPauseReasonEnumApi =
- (typeof ScoutConfigPauseReasonEnumApi)[keyof typeof ScoutConfigPauseReasonEnumApi]
+export type SignalScoutConfigPauseReasonEnumApi =
+ (typeof SignalScoutConfigPauseReasonEnumApi)[keyof typeof SignalScoutConfigPauseReasonEnumApi]
-export const ScoutConfigPauseReasonEnumApi = {
+export const SignalScoutConfigPauseReasonEnumApi = {
NoOutput: 'no_output',
Ignored: 'ignored',
RepeatedFailures: 'repeated_failures',
@@ -2122,13 +2125,13 @@ export interface SignalScoutConfigApi {
* * `pending_pause` - Pending pause
* * `paused_by_system` - Paused by system
* * `paused_by_user` - Paused by user */
- readonly status: ScoutConfigStatusEnumApi
+ readonly status: SignalScoutConfigStatusEnumApi
/** Why the system paused (or warned) this scout: `no_output` (it emitted nothing over the evaluation window), `ignored` (no person engaged with its reports — no view, rating, note, dismissal, or resolution), or `repeated_failures` (consecutive failed runs). Null unless `status` is `pending_pause` or `paused_by_system`.
*
* * `no_output` - No output
* * `ignored` - Ignored
* * `repeated_failures` - Repeated failures */
- readonly pause_reason: ScoutConfigPauseReasonEnumApi | null
+ readonly pause_reason: SignalScoutConfigPauseReasonEnumApi | null
/** Whether the scout writes findings to the inbox. False = dry-run: it runs and logs but emits nothing. */
readonly emit: boolean
/**
@@ -2153,7 +2156,7 @@ export interface SignalScoutConfigApi {
*
* * `trusted` - Trusted domains only
* * `full` - Full */
- readonly network_access: ScoutConfigNetworkAccessEnumApi
+ readonly network_access: SignalScoutConfigNetworkAccessEnumApi
/**
* Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it.
* @nullable
@@ -2256,7 +2259,7 @@ export interface SignalScoutConfigCreateApi {
*
* * `trusted` - Trusted domains only
* * `full` - Full */
- network_access?: ScoutConfigNetworkAccessEnumApi
+ network_access?: SignalScoutConfigNetworkAccessEnumApi
/** Exempt this scout from the inactivity pause, which otherwise switches off a scout that goes a fortnight without surfacing anything anyone engages with. Set it on watchdog scouts whose value is staying quiet. Defaults to false. */
auto_pause_exempt?: boolean
/**
@@ -2330,7 +2333,7 @@ export interface PatchedSignalScoutConfigUpdateApi {
*
* * `trusted` - Trusted domains only
* * `full` - Full */
- network_access?: ScoutConfigNetworkAccessEnumApi
+ network_access?: SignalScoutConfigNetworkAccessEnumApi
/**
* Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it.
* @maxLength 200
@@ -3911,10 +3914,10 @@ export interface ForgetResponseApi {
* * `failed` - Failed
* * `empty` - Empty
*/
-export type ScoutSuggestionSetStatusEnumApi =
- (typeof ScoutSuggestionSetStatusEnumApi)[keyof typeof ScoutSuggestionSetStatusEnumApi]
+export type SignalScoutSuggestionSetStatusEnumApi =
+ (typeof SignalScoutSuggestionSetStatusEnumApi)[keyof typeof SignalScoutSuggestionSetStatusEnumApi]
-export const ScoutSuggestionSetStatusEnumApi = {
+export const SignalScoutSuggestionSetStatusEnumApi = {
Fresh: 'fresh',
Stale: 'stale',
Failed: 'failed',
@@ -3986,7 +3989,7 @@ export interface ScoutSuggestionSetApi {
* * `stale` - Stale
* * `failed` - Failed
* * `empty` - Empty */
- status: ScoutSuggestionSetStatusEnumApi
+ status: SignalScoutSuggestionSetStatusEnumApi
/**
* When the current batch was generated; null before the first run.
* @nullable
diff --git a/products/signals/frontend/inbox/components/badges/SignalReportBillingBadge.tsx b/products/signals/frontend/inbox/components/badges/SignalReportBillingBadge.tsx
index da70661e6fd8..f43971618e05 100644
--- a/products/signals/frontend/inbox/components/badges/SignalReportBillingBadge.tsx
+++ b/products/signals/frontend/inbox/components/badges/SignalReportBillingBadge.tsx
@@ -1,15 +1,15 @@
import { LemonTag, Tooltip } from '@posthog/lemon-ui'
-import { BillingExemptReasonEnumApi } from 'products/signals/frontend/generated/api.schemas'
+import { SignalReportBillingExemptReasonEnumApi } from 'products/signals/frontend/generated/api.schemas'
import { SignalReport } from '../../types'
-const EXEMPT_TOOLTIPS: Record<BillingExemptReasonEnumApi, string> = {
- [BillingExemptReasonEnumApi.PosthogHealthCheck]:
+const EXEMPT_TOOLTIPS: Record<SignalReportBillingExemptReasonEnumApi, string> = {
+ [SignalReportBillingExemptReasonEnumApi.PosthogHealthCheck]:
'This report came from a PostHog health check, so creating a pull request for it is free.',
- [BillingExemptReasonEnumApi.PosthogOnboarding]:
+ [SignalReportBillingExemptReasonEnumApi.PosthogOnboarding]:
'This report was created during onboarding, so creating a pull request for it is free.',
- [BillingExemptReasonEnumApi.PosthogSystem]:
+ [SignalReportBillingExemptReasonEnumApi.PosthogSystem]:
'This report came from a PostHog-managed signal, so creating a pull request for it is free.',
}
@@ -43,7 +43,8 @@ export function SignalReportBillingBadge({ report }: { report: SignalReport }):
}
if (report.billing_exempt_reason) {
const tooltip =
- EXEMPT_TOOLTIPS[report.billing_exempt_reason as BillingExemptReasonEnumApi] ?? EXEMPT_TOOLTIP_DEFAULT
+ EXEMPT_TOOLTIPS[report.billing_exempt_reason as SignalReportBillingExemptReasonEnumApi] ??
+ EXEMPT_TOOLTIP_DEFAULT
return (
<Tooltip title={tooltip}>
<LemonTag size="small" type="success">
diff --git a/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.tsx b/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.tsx
index aa27041a3ff4..4e8ebfcd82ef 100644
--- a/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.tsx
+++ b/products/signals/frontend/inbox/components/config/scouts/ScoutConfigControls.tsx
@@ -11,7 +11,7 @@ import type {
PatchedSignalScoutConfigUpdateApi as SignalScoutConfigUpdate,
SignalScoutConfigApi as SignalScoutConfig,
} from 'products/signals/frontend/generated/api.schemas'
-import { ScoutConfigNetworkAccessEnumApi } from 'products/signals/frontend/generated/api.schemas'
+import { SignalScoutConfigNetworkAccessEnumApi } from 'products/signals/frontend/generated/api.schemas'
import {
dailyCronToTime,
@@ -181,8 +181,8 @@ export function ScoutConfigForm({
size="small"
value={config.network_access}
options={[
- { value: ScoutConfigNetworkAccessEnumApi.Trusted, label: 'Trusted domains' },
- { value: ScoutConfigNetworkAccessEnumApi.Full, label: 'Full access' },
+ { value: SignalScoutConfigNetworkAccessEnumApi.Trusted, label: 'Trusted domains' },
+ { value: SignalScoutConfigNetworkAccessEnumApi.Full, label: 'Full access' },
]}
// Editable while the scout is disabled, unlike the schedule controls: a newly
// enabled scout with no prior run is immediately due, so network access must be
diff --git a/products/signals/frontend/inbox/components/detail/AgentRunDetail.tsx b/products/signals/frontend/inbox/components/detail/AgentRunDetail.tsx
index 177544fab8ef..d975fa9e806c 100644
--- a/products/signals/frontend/inbox/components/detail/AgentRunDetail.tsx
+++ b/products/signals/frontend/inbox/components/detail/AgentRunDetail.tsx
@@ -23,7 +23,7 @@ import { urls } from 'scenes/urls'
import { isTerminalRunStatus } from 'products/posthog_ai/frontend/api/logics'
import { ReadonlyRunSurface } from 'products/posthog_ai/frontend/api/readableRun'
import { isPiTaskRuntime, Task, TaskRunStatus } from 'products/posthog_ai/frontend/types/taskTypes'
-import type { RuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
+import type { TaskRuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
import { inboxReportDetailLogic } from '../../logics/inboxReportDetailLogic'
import { SignalCard } from '../../SignalCard'
@@ -221,7 +221,7 @@ export function OpenTaskButton({
}: {
taskId: string
runStatus?: TaskRunStatus
- runtime: RuntimeEnumApi
+ runtime: TaskRuntimeEnumApi
}): JSX.Element | null {
const { openSidePanelMaxWithTaskBind } = useActions(maxGlobalLogic)
const isTerminal = isTerminalRunStatus(runStatus)
diff --git a/products/signals/frontend/inbox/inboxSceneLogic.test.ts b/products/signals/frontend/inbox/inboxSceneLogic.test.ts
index d8a2b384e2ca..db153ee996b4 100644
--- a/products/signals/frontend/inbox/inboxSceneLogic.test.ts
+++ b/products/signals/frontend/inbox/inboxSceneLogic.test.ts
@@ -10,7 +10,7 @@ import { useMocks } from '~/mocks/jest'
import { initKeaTests } from '~/test/init'
import { OriginProduct, Task, TaskRun, TaskRunStatus } from 'products/posthog_ai/frontend/types/taskTypes'
-import { RuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
+import { TaskRuntimeEnumApi } from 'products/tasks/frontend/generated/api.schemas'
import { inboxSceneLogic, mergeSignalRuns } from './inboxSceneLogic'
import { SignalScoutRunSummary } from './types'
@@ -43,7 +43,7 @@ function signalTask(overrides: Partial<Task> = {}): Task {
title: 'Crash on login',
description: '',
origin_product: OriginProduct.SIGNAL_REPORT,
- runtime: RuntimeEnumApi.Acp,
+ runtime: TaskRuntimeEnumApi.Acp,
repository: null,
github_integration: null,
signal_report: 'report-1',
diff --git a/products/skills/frontend/CommunitySkillsScene.tsx b/products/skills/frontend/CommunitySkillsScene.tsx
index 57efa3930897..9a12aa04b40b 100644
--- a/products/skills/frontend/CommunitySkillsScene.tsx
+++ b/products/skills/frontend/CommunitySkillsScene.tsx
@@ -17,7 +17,7 @@ import { SceneExport } from 'scenes/sceneTypes'
import { ProductKey } from '~/queries/schema/schema-general'
import { communitySkillsLogic } from './communitySkillsLogic'
-import { TrustTierEnumApi } from './generated/api.schemas'
+import { CommunitySkillTrustTierEnumApi } from './generated/api.schemas'
import type { CommunitySkillListApi, CommunitySkillTemplateVariableApi } from './generated/api.schemas'
import { COMMUNITY_SKILLS_TAB_DESCRIPTION, COMMUNITY_SKILLS_TAB_KEY, SkillsSceneShell } from './SkillsSceneShell'
@@ -29,7 +29,7 @@ export const scene: SceneExport = {
const SKILL_GRID_CLASSES = 'grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4'
-const TRUST_TIER_TAG: Record<TrustTierEnumApi, { label: string; type: LemonTagType }> = {
+const TRUST_TIER_TAG: Record<CommunitySkillTrustTierEnumApi, { label: string; type: LemonTagType }> = {
official: { label: 'Official', type: 'success' },
verified: { label: 'Verified', type: 'completion' },
community: { label: 'Community', type: 'default' },
@@ -49,7 +49,7 @@ function githubSourceUrl(url: string): string | null {
}
}
-function TrustTierBadge({ tier }: { tier: TrustTierEnumApi }): JSX.Element {
+function TrustTierBadge({ tier }: { tier: CommunitySkillTrustTierEnumApi }): JSX.Element {
const config = TRUST_TIER_TAG[tier] ?? TRUST_TIER_TAG.community
return <LemonTag type={config.type}>{config.label}</LemonTag>
}
@@ -213,7 +213,7 @@ function CommunitySkillsContent(): JSX.Element {
onChange={(search) => setFilters({ search })}
className="grow max-w-100"
/>
- <LemonSelect<TrustTierEnumApi | ''>
+ <LemonSelect<CommunitySkillTrustTierEnumApi | ''>
value={filters.trust_tier}
onChange={(trust_tier) => setFilters({ trust_tier })}
options={[
diff --git a/products/skills/frontend/communitySkillsLogic.ts b/products/skills/frontend/communitySkillsLogic.ts
index 8d2fb7c0d056..b736ee43f919 100644
--- a/products/skills/frontend/communitySkillsLogic.ts
+++ b/products/skills/frontend/communitySkillsLogic.ts
@@ -11,23 +11,23 @@ import { trackedActionToUrl } from '~/lib/logic/scenes/trackedActionToUrl'
import { urls } from '~/scenes/urls'
import { communitySkillsInstallCreate, communitySkillsList, communitySkillsVoteCreate } from './generated/api'
-import { TrustTierEnumApi } from './generated/api.schemas'
+import { CommunitySkillTrustTierEnumApi } from './generated/api.schemas'
import type { CommunitySkillListApi, PaginatedCommunitySkillListListApi } from './generated/api.schemas'
export const COMMUNITY_SKILLS_PER_PAGE = 30
-const TRUST_TIERS = Object.values(TrustTierEnumApi)
+const TRUST_TIERS = Object.values(CommunitySkillTrustTierEnumApi)
export interface CommunitySkillFilters {
page: number
search: string
order_by: string
tag: string
- trust_tier: TrustTierEnumApi | ''
+ trust_tier: CommunitySkillTrustTierEnumApi | ''
}
// Filters can arrive from the URL, so anything that isn't a known tier falls back to "all tiers".
-function cleanTrustTier(value: unknown): TrustTierEnumApi | '' {
+function cleanTrustTier(value: unknown): CommunitySkillTrustTierEnumApi | '' {
return TRUST_TIERS.find((tier) => tier === value) ?? ''
}
diff --git a/products/skills/frontend/generated/api.schemas.ts b/products/skills/frontend/generated/api.schemas.ts
index 7a15adaf74b6..b2f7bf39011c 100644
--- a/products/skills/frontend/generated/api.schemas.ts
+++ b/products/skills/frontend/generated/api.schemas.ts
@@ -12,9 +12,10 @@
* * `verified` - Verified
* * `community` - Community
*/
-export type TrustTierEnumApi = (typeof TrustTierEnumApi)[keyof typeof TrustTierEnumApi]
+export type CommunitySkillTrustTierEnumApi =
+ (typeof CommunitySkillTrustTierEnumApi)[keyof typeof CommunitySkillTrustTierEnumApi]
-export const TrustTierEnumApi = {
+export const CommunitySkillTrustTierEnumApi = {
Official: 'official',
Verified: 'verified',
Community: 'community',
@@ -65,7 +66,7 @@ export interface CommunitySkillListApi {
* * `official` - Official
* * `verified` - Verified
* * `community` - Community */
- trust_tier: TrustTierEnumApi
+ trust_tier: CommunitySkillTrustTierEnumApi
/** GitHub handle (or name) of the contributor who published the skill. */
readonly author_handle: string
/** Link to the skill's source directory on GitHub. */
@@ -133,7 +134,7 @@ export interface CommunitySkillApi {
* * `official` - Official
* * `verified` - Verified
* * `community` - Community */
- trust_tier: TrustTierEnumApi
+ trust_tier: CommunitySkillTrustTierEnumApi
/** GitHub handle (or name) of the contributor who published the skill. */
readonly author_handle: string
/** Link to the skill's source directory on GitHub. */
diff --git a/products/subscriptions/frontend/components/Subscriptions/subscriptionLogic.ts b/products/subscriptions/frontend/components/Subscriptions/subscriptionLogic.ts
index 4e281245f4e6..20463e82849c 100644
--- a/products/subscriptions/frontend/components/Subscriptions/subscriptionLogic.ts
+++ b/products/subscriptions/frontend/components/Subscriptions/subscriptionLogic.ts
@@ -29,7 +29,7 @@ import type { AIWindowConfigApi, SubscriptionDeliveryApi } from 'products/subscr
import type { SubscriptionResourceType, UserBasicType, WeekdayType } from '../../../../../frontend/src/types'
import type { OrganizationType, UserType } from '../../../../../frontend/src/types'
import type { AIPromptConfigApi } from '../../generated/api.schemas'
-import type { AIWindowConfigModeEnumApi } from '../../generated/api.schemas'
+import type { SubscriptionAIWindowModeEnumApi } from '../../generated/api.schemas'
import type { DeliveryConfigApi } from '../../generated/api.schemas'
import { runSubscriptionTestDelivery } from './runSubscriptionTestDelivery'
import { SUBSCRIPTION_PREFILL_PARAMS } from './subscriptionNudge'
@@ -352,7 +352,7 @@ export interface subscriptionLogicActions {
values?: SubscriptionType
}
selectAiAnalysisWindow: (mode: AIWindowConfigApi['mode']) => {
- mode: AIWindowConfigModeEnumApi | undefined
+ mode: SubscriptionAIWindowModeEnumApi | undefined
}
selectAiExamplePrompt: (
prompt: string,
diff --git a/products/subscriptions/frontend/generated/api.schemas.ts b/products/subscriptions/frontend/generated/api.schemas.ts
index 7c426798fd35..baa1b074a2f8 100644
--- a/products/subscriptions/frontend/generated/api.schemas.ts
+++ b/products/subscriptions/frontend/generated/api.schemas.ts
@@ -12,9 +12,10 @@
* * `dashboard` - Dashboard
* * `ai_prompt` - AI prompt
*/
-export type ResourceTypeEnumApi = (typeof ResourceTypeEnumApi)[keyof typeof ResourceTypeEnumApi]
+export type SubscriptionResourceTypeEnumApi =
+ (typeof SubscriptionResourceTypeEnumApi)[keyof typeof SubscriptionResourceTypeEnumApi]
-export const ResourceTypeEnumApi = {
+export const SubscriptionResourceTypeEnumApi = {
Insight: 'insight',
Dashboard: 'dashboard',
AiPrompt: 'ai_prompt',
@@ -25,9 +26,10 @@ export const ResourceTypeEnumApi = {
* * `last_n_days` - Last N days
* * `days_ago_range` - Between X and Y days ago
*/
-export type AIWindowConfigModeEnumApi = (typeof AIWindowConfigModeEnumApi)[keyof typeof AIWindowConfigModeEnumApi]
+export type SubscriptionAIWindowModeEnumApi =
+ (typeof SubscriptionAIWindowModeEnumApi)[keyof typeof SubscriptionAIWindowModeEnumApi]
-export const AIWindowConfigModeEnumApi = {
+export const SubscriptionAIWindowModeEnumApi = {
SinceLastSent: 'since_last_sent',
LastNDays: 'last_n_days',
DaysAgoRange: 'days_ago_range',
@@ -42,7 +44,7 @@ export interface AIWindowConfigApi {
* * `since_last_sent` - Since last report
* * `last_n_days` - Last N days
* * `days_ago_range` - Between X and Y days ago */
- mode?: AIWindowConfigModeEnumApi
+ mode?: SubscriptionAIWindowModeEnumApi
/**
* Lower bound of the analysis window, in days before the run. Required for 'last_n_days' (the N) and 'days_ago_range'; ignored for 'since_last_sent'. 1-365.
* @minimum 1
@@ -68,9 +70,9 @@ export interface AIPromptConfigApi {
* * `email` - Email
* * `slack` - Slack
*/
-export type TargetTypeEnumApi = (typeof TargetTypeEnumApi)[keyof typeof TargetTypeEnumApi]
+export type SubscriptionTargetEnumApi = (typeof SubscriptionTargetEnumApi)[keyof typeof SubscriptionTargetEnumApi]
-export const TargetTypeEnumApi = {
+export const SubscriptionTargetEnumApi = {
Email: 'email',
Slack: 'slack',
} as const
@@ -187,7 +189,7 @@ export interface SubscriptionApi {
* * `insight` - Insight
* * `dashboard` - Dashboard
* * `ai_prompt` - AI prompt */
- readonly resource_type: ResourceTypeEnumApi
+ readonly resource_type: SubscriptionResourceTypeEnumApi
/**
* Dashboard ID to subscribe to (mutually exclusive with insight on create).
* @nullable
@@ -215,7 +217,7 @@ export interface SubscriptionApi {
*
* * `email` - Email
* * `slack` - Slack */
- target_type: TargetTypeEnumApi
+ target_type: SubscriptionTargetEnumApi
/** Recipient(s): comma-separated email addresses for email, or Slack channel name/ID for slack. */
target_value: string
/** How often to deliver: daily, weekly, monthly, or yearly.
@@ -337,7 +339,7 @@ export interface PatchedSubscriptionApi {
* * `insight` - Insight
* * `dashboard` - Dashboard
* * `ai_prompt` - AI prompt */
- readonly resource_type?: ResourceTypeEnumApi
+ readonly resource_type?: SubscriptionResourceTypeEnumApi
/**
* Dashboard ID to subscribe to (mutually exclusive with insight on create).
* @nullable
@@ -365,7 +367,7 @@ export interface PatchedSubscriptionApi {
*
* * `email` - Email
* * `slack` - Slack */
- target_type?: TargetTypeEnumApi
+ target_type?: SubscriptionTargetEnumApi
/** Recipient(s): comma-separated email addresses for email, or Slack channel name/ID for slack. */
target_value?: string
/** How often to deliver: daily, weekly, monthly, or yearly.
diff --git a/products/subscriptions/frontend/scenes/SubscriptionScene.tsx b/products/subscriptions/frontend/scenes/SubscriptionScene.tsx
index 7150017be171..cd831ae76bea 100644
--- a/products/subscriptions/frontend/scenes/SubscriptionScene.tsx
+++ b/products/subscriptions/frontend/scenes/SubscriptionScene.tsx
@@ -15,7 +15,7 @@ import { SceneContent } from '~/layout/scenes/components/SceneContent'
import { SceneTitleSection } from '~/layout/scenes/components/SceneTitleSection'
import type { SubscriptionApi } from 'products/subscriptions/frontend/generated/api.schemas'
-import { ResourceTypeEnumApi } from 'products/subscriptions/frontend/generated/api.schemas'
+import { SubscriptionResourceTypeEnumApi } from 'products/subscriptions/frontend/generated/api.schemas'
import { SubscriptionDeliveryHistory } from './components/SubscriptionDeliveryHistory'
import { isSubscriptionEnabled, subscriptionEditHref, subscriptionName } from './components/SubscriptionsTable'
@@ -131,7 +131,7 @@ export function SubscriptionScene(): JSX.Element {
onTestDelivery={subscription ? () => deliverSubscription(subscription.id) : undefined}
testDeliveryLoading={Boolean(subscription && deliveringSubscriptionId === subscription.id)}
onDeliveryFeedback={
- subscription?.resource_type === ResourceTypeEnumApi.AiPrompt
+ subscription?.resource_type === SubscriptionResourceTypeEnumApi.AiPrompt
? (deliveryId, feedback) => submitDeliveryFeedback(deliveryId, feedback, 'in_app')
: undefined
}
diff --git a/products/subscriptions/frontend/scenes/components/SubscriptionDestinationCell.tsx b/products/subscriptions/frontend/scenes/components/SubscriptionDestinationCell.tsx
index 1ab48c289cce..314bf78dc5e6 100644
--- a/products/subscriptions/frontend/scenes/components/SubscriptionDestinationCell.tsx
+++ b/products/subscriptions/frontend/scenes/components/SubscriptionDestinationCell.tsx
@@ -5,7 +5,7 @@ import { CopyToClipboardInline } from 'lib/components/CopyToClipboard'
import { copyToClipboard } from 'lib/utils/copyToClipboard'
import { parseCommaSeparatedSlackTargetDisplayLabels } from 'lib/utils/slackChannelValue'
-import { TargetTypeEnumApi, type SubscriptionApi } from 'products/subscriptions/frontend/generated/api.schemas'
+import { SubscriptionTargetEnumApi, type SubscriptionApi } from 'products/subscriptions/frontend/generated/api.schemas'
function parseEmailRecipients(targetValue: string): string[] {
return targetValue
@@ -69,12 +69,12 @@ function DestinationListCell({ parts, copyDescription }: { parts: string[]; copy
}
export function SubscriptionDestinationCell({ sub }: { sub: SubscriptionApi }): JSX.Element {
- if (sub.target_type === TargetTypeEnumApi.Email) {
+ if (sub.target_type === SubscriptionTargetEnumApi.Email) {
const emails = parseEmailRecipients(sub.target_value)
return <DestinationListCell parts={emails} copyDescription="email recipient" />
}
- if (sub.target_type === TargetTypeEnumApi.Slack) {
+ if (sub.target_type === SubscriptionTargetEnumApi.Slack) {
const parts = parseCommaSeparatedSlackTargetDisplayLabels(sub.target_value)
return <DestinationListCell parts={parts} copyDescription="Slack destination" />
}
@@ -96,10 +96,10 @@ export function SubscriptionDeliveryDestinationCell({
targetValue: string
}): JSX.Element {
const kind = targetType.toLowerCase()
- if (kind === TargetTypeEnumApi.Email) {
+ if (kind === SubscriptionTargetEnumApi.Email) {
return <DestinationListCell parts={parseEmailRecipients(targetValue)} copyDescription="email recipient" />
}
- if (kind === TargetTypeEnumApi.Slack) {
+ if (kind === SubscriptionTargetEnumApi.Slack) {
return (
<DestinationListCell
parts={parseCommaSeparatedSlackTargetDisplayLabels(targetValue)}
diff --git a/products/subscriptions/frontend/scenes/components/SubscriptionsFiltersBar.tsx b/products/subscriptions/frontend/scenes/components/SubscriptionsFiltersBar.tsx
index e49d77771471..cdff1d22609e 100644
--- a/products/subscriptions/frontend/scenes/components/SubscriptionsFiltersBar.tsx
+++ b/products/subscriptions/frontend/scenes/components/SubscriptionsFiltersBar.tsx
@@ -5,7 +5,7 @@ import { LemonInput, LemonSelect } from '@posthog/lemon-ui'
import { MemberSelect } from 'lib/components/MemberSelect'
import {
- TargetTypeEnumApi,
+ SubscriptionTargetEnumApi,
type SubscriptionsListTargetType,
} from 'products/subscriptions/frontend/generated/api.schemas'
@@ -13,8 +13,8 @@ import { SubscriptionsTab, subscriptionsSceneLogic } from '../subscriptionsScene
const CHANNEL_FILTER_OPTIONS: { label: string; value: SubscriptionsListTargetType | null }[] = [
{ label: 'All channels', value: null },
- { label: 'Email', value: TargetTypeEnumApi.Email },
- { label: 'Slack', value: TargetTypeEnumApi.Slack },
+ { label: 'Email', value: SubscriptionTargetEnumApi.Email },
+ { label: 'Slack', value: SubscriptionTargetEnumApi.Slack },
]
export function SubscriptionsFiltersBar(): JSX.Element {
diff --git a/products/subscriptions/frontend/scenes/components/SubscriptionsTable.stories.tsx b/products/subscriptions/frontend/scenes/components/SubscriptionsTable.stories.tsx
index 575e1033a8c6..382af87c2290 100644
--- a/products/subscriptions/frontend/scenes/components/SubscriptionsTable.stories.tsx
+++ b/products/subscriptions/frontend/scenes/components/SubscriptionsTable.stories.tsx
@@ -8,8 +8,8 @@ import type { PaginationManual } from '@posthog/lemon-ui'
import type { SubscriptionApi } from 'products/subscriptions/frontend/generated/api.schemas'
import {
RecurrenceIntervalEnumApi,
- ResourceTypeEnumApi,
- TargetTypeEnumApi,
+ SubscriptionResourceTypeEnumApi,
+ SubscriptionTargetEnumApi,
} from 'products/subscriptions/frontend/generated/api.schemas'
import { SubscriptionsTable } from './SubscriptionsTable'
@@ -26,14 +26,14 @@ const MOCK_USER = {
const MOCK_SUBSCRIPTIONS: SubscriptionApi[] = [
{
id: 1,
- resource_type: ResourceTypeEnumApi.Insight,
+ resource_type: SubscriptionResourceTypeEnumApi.Insight,
insight: 101,
dashboard: null,
insight_short_id: 'abc123',
resource_name: 'North star metric',
title: 'This is a really long subscription name that does something important for the team every week',
dashboard_export_insights: [],
- target_type: TargetTypeEnumApi.Email,
+ target_type: SubscriptionTargetEnumApi.Email,
target_value:
frequency: RecurrenceIntervalEnumApi.Weekly,
@@ -48,14 +48,14 @@ const MOCK_SUBSCRIPTIONS: SubscriptionApi[] = [
},
{
id: 2,
- resource_type: ResourceTypeEnumApi.Dashboard,
+ resource_type: SubscriptionResourceTypeEnumApi.Dashboard,
insight: null,
dashboard: 501,
insight_short_id: null,
resource_name: 'Company overview',
title: 'Some slack notification that does something',
dashboard_export_insights: [101, 102],
- target_type: TargetTypeEnumApi.Slack,
+ target_type: SubscriptionTargetEnumApi.Slack,
target_value: 'C12345|#alerts-analytics-platform',
frequency: RecurrenceIntervalEnumApi.Daily,
interval: 1,
@@ -70,14 +70,14 @@ const MOCK_SUBSCRIPTIONS: SubscriptionApi[] = [
},
{
id: 3,
- resource_type: ResourceTypeEnumApi.Insight,
+ resource_type: SubscriptionResourceTypeEnumApi.Insight,
insight: 103,
dashboard: null,
insight_short_id: 'ghi789',
resource_name: 'Weekly KPIs',
title: 'Some test on an insight',
dashboard_export_insights: [],
- target_type: TargetTypeEnumApi.Email,
+ target_type: SubscriptionTargetEnumApi.Email,
target_value: '[email protected]',
frequency: RecurrenceIntervalEnumApi.Monthly,
interval: 1,
@@ -91,14 +91,14 @@ const MOCK_SUBSCRIPTIONS: SubscriptionApi[] = [
},
{
id: 4,
- resource_type: ResourceTypeEnumApi.Insight,
+ resource_type: SubscriptionResourceTypeEnumApi.Insight,
insight: 104,
dashboard: null,
insight_short_id: 'activation-insight',
resource_name: 'Activation funnel',
title: 'Slack delivery to internal automation',
dashboard_export_insights: [],
- target_type: TargetTypeEnumApi.Slack,
+ target_type: SubscriptionTargetEnumApi.Slack,
target_value: 'C1234567890|#automation-alerts',
frequency: RecurrenceIntervalEnumApi.Weekly,
interval: 1,
@@ -112,14 +112,14 @@ const MOCK_SUBSCRIPTIONS: SubscriptionApi[] = [
},
{
id: 5,
- resource_type: ResourceTypeEnumApi.Insight,
+ resource_type: SubscriptionResourceTypeEnumApi.Insight,
insight: 105,
dashboard: null,
insight_short_id: 'disabled-insight',
resource_name: 'Activation funnel',
title: 'Auto-paused after integration broke',
dashboard_export_insights: [],
- target_type: TargetTypeEnumApi.Slack,
+ target_type: SubscriptionTargetEnumApi.Slack,
target_value: 'C99999|#archived-channel',
frequency: RecurrenceIntervalEnumApi.Weekly,
interval: 1,
@@ -134,7 +134,7 @@ const MOCK_SUBSCRIPTIONS: SubscriptionApi[] = [
},
{
id: 6,
- resource_type: ResourceTypeEnumApi.AiPrompt,
+ resource_type: SubscriptionResourceTypeEnumApi.AiPrompt,
insight: null,
dashboard: null,
insight_short_id: null,
@@ -142,7 +142,7 @@ const MOCK_SUBSCRIPTIONS: SubscriptionApi[] = [
prompt: 'Summarize weekly signups and flag any anomalies worth a closer look',
title: 'AI weekly digest',
dashboard_export_insights: [],
- target_type: TargetTypeEnumApi.Email,
+ target_type: SubscriptionTargetEnumApi.Email,
target_value: '[email protected]',
frequency: RecurrenceIntervalEnumApi.Weekly,
interval: 1,
@@ -175,14 +175,16 @@ function buildMockSubscriptions(total: number): SubscriptionApi[] {
const isSlack = i % 3 === 0
return {
id: n,
- resource_type: isInsight ? ResourceTypeEnumApi.Insight : ResourceTypeEnumApi.Dashboard,
+ resource_type: isInsight
+ ? SubscriptionResourceTypeEnumApi.Insight
+ : SubscriptionResourceTypeEnumApi.Dashboard,
insight: isInsight ? 1000 + n : null,
dashboard: isInsight ? null : 2000 + n,
insight_short_id: isInsight ? `short${n}` : null,
resource_name: `Quarterly metrics ${n}`,
title: `Digest ${n}`,
dashboard_export_insights: [],
- target_type: isSlack ? TargetTypeEnumApi.Slack : TargetTypeEnumApi.Email,
+ target_type: isSlack ? SubscriptionTargetEnumApi.Slack : SubscriptionTargetEnumApi.Email,
target_value: isSlack ? `C${n}|#channel-${n}` : `analyst${n}@posthog.com`,
frequency: RecurrenceIntervalEnumApi.Weekly,
interval: 1,
diff --git a/products/subscriptions/frontend/scenes/components/subscriptionLabels.ts b/products/subscriptions/frontend/scenes/components/subscriptionLabels.ts
index 96b2508ec94c..297688b583e6 100644
--- a/products/subscriptions/frontend/scenes/components/subscriptionLabels.ts
+++ b/products/subscriptions/frontend/scenes/components/subscriptionLabels.ts
@@ -1,7 +1,7 @@
import type { SubscriptionApi } from 'products/subscriptions/frontend/generated/api.schemas'
-import { TargetTypeEnumApi } from 'products/subscriptions/frontend/generated/api.schemas'
+import { SubscriptionTargetEnumApi } from 'products/subscriptions/frontend/generated/api.schemas'
export const TARGET_TYPE_LABEL: Record<SubscriptionApi['target_type'], string> = {
- [TargetTypeEnumApi.Email]: 'Email',
- [TargetTypeEnumApi.Slack]: 'Slack',
+ [SubscriptionTargetEnumApi.Email]: 'Email',
+ [SubscriptionTargetEnumApi.Slack]: 'Slack',
}
diff --git a/products/subscriptions/frontend/scenes/components/subscriptionStoryFixtures.ts b/products/subscriptions/frontend/scenes/components/subscriptionStoryFixtures.ts
index 8e4039d5b15b..04be43358ba6 100644
--- a/products/subscriptions/frontend/scenes/components/subscriptionStoryFixtures.ts
+++ b/products/subscriptions/frontend/scenes/components/subscriptionStoryFixtures.ts
@@ -1,8 +1,8 @@
import {
RecurrenceIntervalEnumApi,
- ResourceTypeEnumApi,
+ SubscriptionResourceTypeEnumApi,
SubscriptionDeliveryStatusEnumApi,
- TargetTypeEnumApi,
+ SubscriptionTargetEnumApi,
type SubscriptionApi,
type SubscriptionDeliveryApi,
} from 'products/subscriptions/frontend/generated/api.schemas'
@@ -18,14 +18,14 @@ export const MOCK_SUBSCRIPTION_USER = {
export const MOCK_SUBSCRIPTION_INSIGHT: SubscriptionApi = {
id: 1,
- resource_type: ResourceTypeEnumApi.Insight,
+ resource_type: SubscriptionResourceTypeEnumApi.Insight,
insight: 101,
dashboard: null,
insight_short_id: 'abc123',
resource_name: 'North star metric',
title: 'Weekly rollup',
dashboard_export_insights: [],
- target_type: TargetTypeEnumApi.Email,
+ target_type: SubscriptionTargetEnumApi.Email,
target_value: '[email protected]',
frequency: RecurrenceIntervalEnumApi.Weekly,
interval: 1,
@@ -49,14 +49,14 @@ export const MOCK_SUBSCRIPTION_INSIGHT_MANY_DESTINATIONS: SubscriptionApi = {
export const MOCK_SUBSCRIPTION_DASHBOARD: SubscriptionApi = {
id: 2,
- resource_type: ResourceTypeEnumApi.Dashboard,
+ resource_type: SubscriptionResourceTypeEnumApi.Dashboard,
insight: null,
dashboard: 501,
insight_short_id: null,
resource_name: 'Company overview',
title: 'Dashboard digest',
dashboard_export_insights: [101],
- target_type: TargetTypeEnumApi.Slack,
+ target_type: SubscriptionTargetEnumApi.Slack,
target_value: 'C12345|#alerts-analytics-platform',
frequency: RecurrenceIntervalEnumApi.Daily,
interval: 1,
diff --git a/products/subscriptions/frontend/scenes/subscriptionSceneLogic.test.ts b/products/subscriptions/frontend/scenes/subscriptionSceneLogic.test.ts
index 03b465917dc2..7a7d0d42a70c 100644
--- a/products/subscriptions/frontend/scenes/subscriptionSceneLogic.test.ts
+++ b/products/subscriptions/frontend/scenes/subscriptionSceneLogic.test.ts
@@ -9,9 +9,9 @@ import { initKeaTests } from '~/test/init'
import {
RecurrenceIntervalEnumApi,
- ResourceTypeEnumApi,
+ SubscriptionResourceTypeEnumApi,
SubscriptionsDeliveriesListStatus,
- TargetTypeEnumApi,
+ SubscriptionTargetEnumApi,
} from 'products/subscriptions/frontend/generated/api.schemas'
import type { SubscriptionApi } from 'products/subscriptions/frontend/generated/api.schemas'
@@ -28,14 +28,14 @@ const MOCK_USER = {
const MOCK_SUBSCRIPTION: SubscriptionApi = {
id: 1,
- resource_type: ResourceTypeEnumApi.Insight,
+ resource_type: SubscriptionResourceTypeEnumApi.Insight,
insight: 101,
dashboard: null,
insight_short_id: 'abc123',
resource_name: 'North star metric',
title: 'Weekly rollup',
dashboard_export_insights: [],
- target_type: TargetTypeEnumApi.Email,
+ target_type: SubscriptionTargetEnumApi.Email,
target_value: '[email protected]',
frequency: RecurrenceIntervalEnumApi.Weekly,
interval: 1,
@@ -49,7 +49,7 @@ const MOCK_SUBSCRIPTION: SubscriptionApi = {
const MOCK_AI_SUBSCRIPTION: SubscriptionApi = {
id: 2,
- resource_type: ResourceTypeEnumApi.AiPrompt,
+ resource_type: SubscriptionResourceTypeEnumApi.AiPrompt,
insight: null,
dashboard: null,
insight_short_id: null,
@@ -57,7 +57,7 @@ const MOCK_AI_SUBSCRIPTION: SubscriptionApi = {
prompt: 'Summarize weekly signups and flag any anomalies',
title: 'Weekly AI digest',
dashboard_export_insights: [],
- target_type: TargetTypeEnumApi.Email,
+ target_type: SubscriptionTargetEnumApi.Email,
target_value: '[email protected]',
frequency: RecurrenceIntervalEnumApi.Weekly,
interval: 1,
@@ -206,7 +206,7 @@ describe('subscriptionSceneLogic', () => {
logic.mount()
await expectLogic(logic).toFinishAllListeners()
- expect(logic.values.subscription?.resource_type).toEqual(ResourceTypeEnumApi.AiPrompt)
+ expect(logic.values.subscription?.resource_type).toEqual(SubscriptionResourceTypeEnumApi.AiPrompt)
expect(logic.values.subscription?.prompt).toBeTruthy()
expect(deliveriesRequestUrls).toHaveLength(1)
logic.unmount()
diff --git a/products/subscriptions/frontend/scenes/subscriptionsSceneLogic.test.ts b/products/subscriptions/frontend/scenes/subscriptionsSceneLogic.test.ts
index 2dfbcb4277f9..2592c121e4c2 100644
--- a/products/subscriptions/frontend/scenes/subscriptionsSceneLogic.test.ts
+++ b/products/subscriptions/frontend/scenes/subscriptionsSceneLogic.test.ts
@@ -14,7 +14,7 @@ import { userLogic } from 'scenes/userLogic'
import { useMocks } from '~/mocks/jest'
import { initKeaTests } from '~/test/init'
-import { TargetTypeEnumApi } from 'products/subscriptions/frontend/generated/api.schemas'
+import { SubscriptionTargetEnumApi } from 'products/subscriptions/frontend/generated/api.schemas'
import { subscriptionsSceneLogic, SubscriptionsTab } from './subscriptionsSceneLogic'
@@ -208,7 +208,7 @@ describe('subscriptionsSceneLogic', () => {
subscriptionRequestUrls.length = 0
await expectLogic(logic, () => {
- logic.actions.setTargetTypeFilter(TargetTypeEnumApi.Slack)
+ logic.actions.setTargetTypeFilter(SubscriptionTargetEnumApi.Slack)
}).toDispatchActions(['setTargetTypeFilter', 'loadSubscriptions', 'loadSubscriptionsSuccess'])
expect(subscriptionRequestUrls).toHaveLength(1)
diff --git a/products/subscriptions/frontend/scenes/subscriptionsSceneLogic.tsx b/products/subscriptions/frontend/scenes/subscriptionsSceneLogic.tsx
index 2a2b5a22873f..de5d1e759125 100644
--- a/products/subscriptions/frontend/scenes/subscriptionsSceneLogic.tsx
+++ b/products/subscriptions/frontend/scenes/subscriptionsSceneLogic.tsx
@@ -19,7 +19,7 @@ import { Breadcrumb } from '~/types'
import { subscriptionsList, subscriptionsTestDeliveryCreate } from 'products/subscriptions/frontend/generated/api'
import {
SubscriptionsListResourceType,
- TargetTypeEnumApi,
+ SubscriptionTargetEnumApi,
type PaginatedSubscriptionListApi,
type SubscriptionsListTargetType,
} from 'products/subscriptions/frontend/generated/api.schemas'
@@ -76,7 +76,7 @@ function parseSubscriptionsSearchParams(searchParams: Record<string, unknown>):
const ttRaw = searchParams['target_type']
const targetTypeFilter: SubscriptionsListTargetType | null =
- ttRaw === TargetTypeEnumApi.Email || ttRaw === TargetTypeEnumApi.Slack ? ttRaw : null
+ ttRaw === SubscriptionTargetEnumApi.Email || ttRaw === SubscriptionTargetEnumApi.Slack ? ttRaw : null
let page = 1
const pageRaw = searchParams['page']
diff --git a/products/surveys/backend/api/survey.py b/products/surveys/backend/api/survey.py
index 4483cfaee129..5b2fa0157f25 100644
--- a/products/surveys/backend/api/survey.py
+++ b/products/surveys/backend/api/survey.py
@@ -8,7 +8,7 @@ from uuid import UUID
from django.conf import settings
from django.core.cache import cache
-from django.db import transaction
+from django.db import models, transaction
from django.db.models import QuerySet
from django.http import HttpRequest, HttpResponse
from django.shortcuts import render
@@ -400,6 +400,11 @@ class SurveyQuestionValidationRuleSerializer(serializers.Serializer):
)
+class DescriptionContentType(models.TextChoices):
+ TEXT = "text", "text"
+ HTML = "html", "html"
+
+
class SurveyBaseQuestionSchemaSerializer(serializers.Serializer):
id = serializers.CharField(
required=False,
@@ -417,7 +422,7 @@ class SurveyBaseQuestionSchemaSerializer(serializers.Serializer):
question = serializers.CharField(required=True, help_text="Question text shown to respondents.")
description = serializers.CharField(required=False, allow_blank=True, help_text="Optional helper text.")
descriptionContentType = serializers.ChoiceField(
- choices=["text", "html"],
+ choices=DescriptionContentType.choices,
required=False,
help_text="Format for the description field.",
)
@@ -516,7 +521,16 @@ class SurveyQuestionsSchemaField(serializers.ListField):
pass
-SURVEY_MATCH_TYPE_CHOICES = ["regex", "not_regex", "exact", "is_not", "icontains", "not_icontains"]
+class SurveyMatchType(models.TextChoices):
+ REGEX = "regex", "regex"
+ NOT_REGEX = "not_regex", "not_regex"
+ EXACT = "exact", "exact"
+ IS_NOT = "is_not", "is_not"
+ ICONTAINS = "icontains", "icontains"
+ NOT_ICONTAINS = "not_icontains", "not_icontains"
+
+
+SURVEY_MATCH_TYPE_CHOICES = list(SurveyMatchType.values)
class SurveyAppearanceSchemaSerializer(serializers.Serializer):
diff --git a/products/surveys/frontend/generated/api.schemas.ts b/products/surveys/frontend/generated/api.schemas.ts
index 67e1b38a5c13..76fe62f81b2c 100644
--- a/products/surveys/frontend/generated/api.schemas.ts
+++ b/products/surveys/frontend/generated/api.schemas.ts
@@ -13,9 +13,9 @@
* * `external_survey` - external survey
* * `api` - api
*/
-export type SurveyTypeApi = (typeof SurveyTypeApi)[keyof typeof SurveyTypeApi]
+export type SurveyTypeEnumApi = (typeof SurveyTypeEnumApi)[keyof typeof SurveyTypeEnumApi]
-export const SurveyTypeApi = {
+export const SurveyTypeEnumApi = {
Popover: 'popover',
Widget: 'widget',
ExternalSurvey: 'external_survey',
@@ -141,10 +141,10 @@ export interface UserBasicApi {
* * `week` - week
* * `month` - month
*/
-export type ResponseSamplingIntervalTypeEnumApi =
- (typeof ResponseSamplingIntervalTypeEnumApi)[keyof typeof ResponseSamplingIntervalTypeEnumApi]
+export type SurveySamplingIntervalTypeEnumApi =
+ (typeof SurveySamplingIntervalTypeEnumApi)[keyof typeof SurveySamplingIntervalTypeEnumApi]
-export const ResponseSamplingIntervalTypeEnumApi = {
+export const SurveySamplingIntervalTypeEnumApi = {
Day: 'day',
Week: 'week',
Month: 'month',
@@ -172,7 +172,7 @@ export interface SurveyApi {
/** @maxLength 400 */
name: string
description?: string
- type: SurveyTypeApi
+ type: SurveyTypeEnumApi
/** @nullable */
schedule?: string | null
readonly linked_flag: MinimalFeatureFlagApi
@@ -336,7 +336,7 @@ export interface SurveyApi {
current_iteration_start_date?: string | null
/** @nullable */
response_sampling_start_date?: string | null
- response_sampling_interval_type?: ResponseSamplingIntervalTypeEnumApi | BlankEnumApi | null
+ response_sampling_interval_type?: SurveySamplingIntervalTypeEnumApi | BlankEnumApi | null
/**
* @minimum 0
* @maximum 2147483647
@@ -384,9 +384,9 @@ export interface PaginatedSurveyListApi {
* * `recurring` - recurring
* * `always` - always
*/
-export type ScheduleEnumApi = (typeof ScheduleEnumApi)[keyof typeof ScheduleEnumApi]
+export type SurveyScheduleEnumApi = (typeof SurveyScheduleEnumApi)[keyof typeof SurveyScheduleEnumApi]
-export const ScheduleEnumApi = {
+export const SurveyScheduleEnumApi = {
Once: 'once',
Recurring: 'recurring',
Always: 'always',
@@ -1264,13 +1264,13 @@ export interface SurveySerializerCreateUpdateOnlySchemaApi {
* * `widget` - widget
* * `external_survey` - external survey
* * `api` - api */
- type: SurveyTypeApi
+ type: SurveyTypeEnumApi
/** Survey scheduling behavior: 'once' = show once per user (default), 'recurring' = repeat based on iteration_count and iteration_frequency_days settings, 'always' = show every time conditions are met (mainly for widget surveys)
*
* * `once` - once
* * `recurring` - recurring
* * `always` - always */
- schedule?: ScheduleEnumApi | null
+ schedule?: SurveyScheduleEnumApi | null
readonly linked_flag: MinimalFeatureFlagApi
/**
* The feature flag linked to this survey.
@@ -1455,7 +1455,7 @@ export interface SurveySerializerCreateUpdateOnlySchemaApi {
current_iteration_start_date?: string | null
/** @nullable */
response_sampling_start_date?: string | null
- response_sampling_interval_type?: ResponseSamplingIntervalTypeEnumApi | BlankEnumApi | null
+ response_sampling_interval_type?: SurveySamplingIntervalTypeEnumApi | BlankEnumApi | null
/**
* @minimum 0
* @maximum 2147483647
@@ -1491,7 +1491,7 @@ export interface SurveySerializerCreateUpdateOnlyApi {
/** @maxLength 400 */
name: string
description?: string
- type: SurveyTypeApi
+ type: SurveyTypeEnumApi
/** @nullable */
schedule?: string | null
readonly linked_flag: MinimalFeatureFlagApi
@@ -1657,7 +1657,7 @@ export interface SurveySerializerCreateUpdateOnlyApi {
current_iteration_start_date?: string | null
/** @nullable */
response_sampling_start_date?: string | null
- response_sampling_interval_type?: ResponseSamplingIntervalTypeEnumApi | BlankEnumApi | null
+ response_sampling_interval_type?: SurveySamplingIntervalTypeEnumApi | BlankEnumApi | null
/**
* @minimum 0
* @maximum 2147483647
@@ -1701,13 +1701,13 @@ export interface PatchedSurveySerializerCreateUpdateOnlySchemaApi {
* * `widget` - widget
* * `external_survey` - external survey
* * `api` - api */
- type?: SurveyTypeApi
+ type?: SurveyTypeEnumApi
/** Survey scheduling behavior: 'once' = show once per user (default), 'recurring' = repeat based on iteration_count and iteration_frequency_days settings, 'always' = show every time conditions are met (mainly for widget surveys)
*
* * `once` - once
* * `recurring` - recurring
* * `always` - always */
- schedule?: ScheduleEnumApi | null
+ schedule?: SurveyScheduleEnumApi | null
readonly linked_flag?: MinimalFeatureFlagApi
/**
* The feature flag linked to this survey.
@@ -1892,7 +1892,7 @@ export interface PatchedSurveySerializerCreateUpdateOnlySchemaApi {
current_iteration_start_date?: string | null
/** @nullable */
response_sampling_start_date?: string | null
- response_sampling_interval_type?: ResponseSamplingIntervalTypeEnumApi | BlankEnumApi | null
+ response_sampling_interval_type?: SurveySamplingIntervalTypeEnumApi | BlankEnumApi | null
/**
* @minimum 0
* @maximum 2147483647
diff --git a/products/tasks/backend/presentation/serializers.py b/products/tasks/backend/presentation/serializers.py
index 01e3cb8f245d..ae72bb1c07ae 100644
--- a/products/tasks/backend/presentation/serializers.py
+++ b/products/tasks/backend/presentation/serializers.py
@@ -7,6 +7,7 @@ from datetime import datetime, timedelta
from typing import Any, cast
from django.conf import settings
+from django.db import models
from django.utils import timezone as django_timezone
import posthoganalytics
@@ -2913,6 +2914,11 @@ def get_relayed_imported_mcp_name_collision_error(attrs: dict) -> str | None:
return None
+class TaskExecutionMode(models.TextChoices):
+ INTERACTIVE = "interactive", "interactive"
+ BACKGROUND = "background", "background"
+
+
class TaskRunCreateRequestSerializer(ImportedMcpServersFieldMixin, RelayedMcpServersFieldMixin, serializers.Serializer):
"""Request body for creating a new task run"""
@@ -2922,7 +2928,7 @@ class TaskRunCreateRequestSerializer(ImportedMcpServersFieldMixin, RelayedMcpSer
REASONING_EFFORT_CHOICES = [effort.value for effort in PUBLIC_REASONING_EFFORTS]
mode = serializers.ChoiceField(
- choices=["interactive", "background"],
+ choices=TaskExecutionMode.choices,
required=False,
default="background",
help_text="Execution mode: 'interactive' for user-connected runs, 'background' for autonomous runs",
@@ -3134,7 +3140,7 @@ class TaskRunBootstrapCreateRequestSerializer(
help_text="Execution environment for the new run. Use 'cloud' for remote sandbox runs and 'local' for desktop sessions.",
)
mode = serializers.ChoiceField(
- choices=["interactive", "background"],
+ choices=TaskExecutionMode.choices,
required=False,
default="background",
help_text="Execution mode: 'interactive' for user-connected runs, 'background' for autonomous runs",
@@ -3629,7 +3635,7 @@ class CodexTaskRunCreateSchemaSerializer(TaskRunCreateRequestSerializer):
class TaskRunResumeRequestSchemaSerializer(serializers.Serializer):
mode = serializers.ChoiceField(
- choices=["interactive", "background"],
+ choices=TaskExecutionMode.choices,
required=False,
default="background",
help_text="Execution mode: 'interactive' for user-connected runs, 'background' for autonomous runs",
diff --git a/products/tasks/frontend/generated/api.schemas.ts b/products/tasks/frontend/generated/api.schemas.ts
index c5a30d264fa0..6562ab7939d3 100644
--- a/products/tasks/frontend/generated/api.schemas.ts
+++ b/products/tasks/frontend/generated/api.schemas.ts
@@ -887,9 +887,10 @@ export interface PaginatedSandboxEnvironmentDTOListApi {
* * `full` - Full
* * `custom` - Custom
*/
-export type NetworkAccessLevelEnumApi = (typeof NetworkAccessLevelEnumApi)[keyof typeof NetworkAccessLevelEnumApi]
+export type SandboxEnvironmentNetworkAccessLevelEnumApi =
+ (typeof SandboxEnvironmentNetworkAccessLevelEnumApi)[keyof typeof SandboxEnvironmentNetworkAccessLevelEnumApi]
-export const NetworkAccessLevelEnumApi = {
+export const SandboxEnvironmentNetworkAccessLevelEnumApi = {
Trusted: 'trusted',
Full: 'full',
Custom: 'custom',
@@ -909,7 +910,7 @@ export interface SandboxEnvironmentWriteApi {
* * `trusted` - Trusted
* * `full` - Full
* * `custom` - Custom */
- network_access_level?: NetworkAccessLevelEnumApi
+ network_access_level?: SandboxEnvironmentNetworkAccessLevelEnumApi
/**
* Allowed domains for custom network access.
* @maxItems 100
@@ -948,7 +949,7 @@ export interface PatchedSandboxEnvironmentWriteApi {
* * `trusted` - Trusted
* * `full` - Full
* * `custom` - Custom */
- network_access_level?: NetworkAccessLevelEnumApi
+ network_access_level?: SandboxEnvironmentNetworkAccessLevelEnumApi
/**
* Allowed domains for custom network access.
* @maxItems 100
@@ -1086,9 +1087,9 @@ export interface TaskActivityMarkReadResponseApi {
* * `personal` - Personal
* * `general` - General
*/
-export type SystemRoleEnumApi = (typeof SystemRoleEnumApi)[keyof typeof SystemRoleEnumApi]
+export type ChannelSystemRoleEnumApi = (typeof ChannelSystemRoleEnumApi)[keyof typeof ChannelSystemRoleEnumApi]
-export const SystemRoleEnumApi = {
+export const ChannelSystemRoleEnumApi = {
Personal: 'personal',
General: 'general',
} as const
@@ -1112,7 +1113,7 @@ export interface ChannelDTOApi {
*
* * `personal` - Personal
* * `general` - General */
- readonly system_role: SystemRoleEnumApi | null
+ readonly system_role: ChannelSystemRoleEnumApi | null
}
export interface PaginatedChannelDTOListApi {
@@ -1394,9 +1395,9 @@ export interface PaginatedTaskMentionDTOListApi {
* * `acp` - ACP
* * `pi` - Pi
*/
-export type RuntimeEnumApi = (typeof RuntimeEnumApi)[keyof typeof RuntimeEnumApi]
+export type TaskRuntimeEnumApi = (typeof TaskRuntimeEnumApi)[keyof typeof TaskRuntimeEnumApi]
-export const RuntimeEnumApi = {
+export const TaskRuntimeEnumApi = {
Acp: 'acp',
Pi: 'pi',
} as const
@@ -1702,7 +1703,7 @@ export interface TaskDetailDTOApi {
*
* * `acp` - ACP
* * `pi` - Pi */
- runtime: RuntimeEnumApi
+ runtime: TaskRuntimeEnumApi
/** @nullable */
repository: string | null
repositories: string[]
@@ -1771,9 +1772,9 @@ export interface PaginatedTaskDetailDTOListApi {
* * `task_analysis` - Task Analysis
* * `workflow` - Workflow
*/
-export type OriginProductEnumApi = (typeof OriginProductEnumApi)[keyof typeof OriginProductEnumApi]
+export type TaskOriginProductEnumApi = (typeof TaskOriginProductEnumApi)[keyof typeof TaskOriginProductEnumApi]
-export const OriginProductEnumApi = {
+export const TaskOriginProductEnumApi = {
Onboarding: 'onboarding',
ErrorTracking: 'error_tracking',
EvalClusters: 'eval_clusters',
@@ -1859,7 +1860,7 @@ export interface TaskCreateApi {
* * `signals_chat` - Signals Chat
* * `task_analysis` - Task Analysis
* * `workflow` - Workflow */
- origin_product?: OriginProductEnumApi
+ origin_product?: TaskOriginProductEnumApi
/**
* Target GitHub repository in `organization/repo` format (e.g. `posthog/posthog-js`).
* @maxLength 255
@@ -1972,7 +1973,7 @@ export interface TaskCreateApi {
*
* * `acp` - ACP
* * `pi` - Pi */
- runtime?: RuntimeEnumApi
+ runtime?: TaskRuntimeEnumApi
}
/**
@@ -2015,7 +2016,7 @@ export interface TaskWriteApi {
* * `signals_chat` - Signals Chat
* * `task_analysis` - Task Analysis
* * `workflow` - Workflow */
- origin_product?: OriginProductEnumApi
+ origin_product?: TaskOriginProductEnumApi
/**
* Target GitHub repository in `organization/repo` format (e.g. `posthog/posthog-js`).
* @maxLength 255
@@ -2154,7 +2155,7 @@ export interface PatchedTaskWriteApi {
* * `signals_chat` - Signals Chat
* * `task_analysis` - Task Analysis
* * `workflow` - Workflow */
- origin_product?: OriginProductEnumApi
+ origin_product?: TaskOriginProductEnumApi
/**
* Target GitHub repository in `organization/repo` format (e.g. `posthog/posthog-js`).
* @maxLength 255
diff --git a/products/tracing/backend/presentation/views.py b/products/tracing/backend/presentation/views.py
index 4591bd61337e..a87629064ac0 100644
--- a/products/tracing/backend/presentation/views.py
+++ b/products/tracing/backend/presentation/views.py
@@ -13,6 +13,8 @@ No business logic here - that belongs in logic.py via the facade.
import json
import base64
+from django.db import models
+
from drf_spectacular.utils import extend_schema
from pydantic import ValidationError
from rest_framework import serializers, status, viewsets
@@ -364,10 +366,16 @@ class _TracingAttributesResponseSerializer(serializers.Serializer):
count = serializers.IntegerField(help_text="Total attribute keys matched (lower bound when searching values).")
+class SpanPropertyType(models.TextChoices):
+ SPAN = "span", "span"
+ SPAN_ATTRIBUTE = "span_attribute", "span_attribute"
+ SPAN_RESOURCE_ATTRIBUTE = "span_resource_attribute", "span_resource_attribute"
+
+
class _TracingValuesQuerySerializer(serializers.Serializer):
key = serializers.CharField(help_text="The attribute key to get values for.")
attribute_type = serializers.ChoiceField(
- choices=["span", "span_attribute", "span_resource_attribute"],
+ choices=SpanPropertyType.choices,
required=False,
help_text='Type of attribute: "span" for built-in span fields (e.g. name), "span_attribute" for span-level attributes, "span_resource_attribute" for resource-level attributes.',
)
@@ -474,7 +482,7 @@ class _TracingAttributeBreakdownQueryBodySerializer(serializers.Serializer):
help_text='Attribute key to group by (e.g. "server.address", "http.response.status_code"). Discover keys with apm-attributes-list. For the "span" breakdown type, must be one of the allowlisted top-level columns: "service_name", "status_code".',
)
breakdownType = serializers.ChoiceField(
- choices=["span", "span_attribute", "span_resource_attribute"],
+ choices=SpanPropertyType.choices,
help_text='Where the key lives: "span" for allowlisted top-level span columns, "span_attribute" for span-level attributes, "span_resource_attribute" for resource-level attributes.',
)
excludeBreakdownFilter = serializers.BooleanField(
diff --git a/products/user_interviews/frontend/generated/api.schemas.ts b/products/user_interviews/frontend/generated/api.schemas.ts
index 629796c60fda..78915d92c56a 100644
--- a/products/user_interviews/frontend/generated/api.schemas.ts
+++ b/products/user_interviews/frontend/generated/api.schemas.ts
@@ -328,9 +328,10 @@ export interface BulkIntervieweeContextResponseApi {
* * `abandoned` - Abandoned
* * `off-topic` - Off-topic
*/
-export type ClassificationsEnumApi = (typeof ClassificationsEnumApi)[keyof typeof ClassificationsEnumApi]
+export type UserInterviewClassificationEnumApi =
+ (typeof UserInterviewClassificationEnumApi)[keyof typeof UserInterviewClassificationEnumApi]
-export const ClassificationsEnumApi = {
+export const UserInterviewClassificationEnumApi = {
Abandoned: 'abandoned',
OffTopic: 'off-topic',
} as const
@@ -347,7 +348,7 @@ export interface UserInterviewApi {
readonly transcript: string
summary?: string
/** Searchable classifications on the response. `abandoned` is auto-derived from the transcript when the interview is recorded; `off-topic` is set manually. Sending `classifications` on an update replaces the whole list — pass the full desired set, not a delta. */
- classifications?: ClassificationsEnumApi[]
+ classifications?: UserInterviewClassificationEnumApi[]
audio: string
}
@@ -372,7 +373,7 @@ export interface PatchedUserInterviewApi {
readonly transcript?: string
summary?: string
/** Searchable classifications on the response. `abandoned` is auto-derived from the transcript when the interview is recorded; `off-topic` is set manually. Sending `classifications` on an update replaces the whole list — pass the full desired set, not a delta. */
- classifications?: ClassificationsEnumApi[]
+ classifications?: UserInterviewClassificationEnumApi[]
audio?: string
}
@@ -408,7 +409,7 @@ export interface UserInterviewSearchRequestApi {
* Optional. Restrict results to interviews carrying any of these classifications (OR). Combines with `topic_id` as AND.
* @minItems 1
*/
- classifications?: ClassificationsEnumApi[]
+ classifications?: UserInterviewClassificationEnumApi[]
/**
* Maximum number of matches to return (1-50). Defaults to 10. Two matches per interview are possible — one for the transcript, one for the summary.
* @minimum 1
diff --git a/products/user_interviews/frontend/userInterviewLogic.ts b/products/user_interviews/frontend/userInterviewLogic.ts
index 950021ce1303..8ac53a1de3f8 100644
--- a/products/user_interviews/frontend/userInterviewLogic.ts
+++ b/products/user_interviews/frontend/userInterviewLogic.ts
@@ -20,7 +20,7 @@ import {
userInterviewTopicsTestLinkRetrieve,
userInterviewsList,
} from './generated/api'
-import { ClassificationsEnumApi } from './generated/api.schemas'
+import { UserInterviewClassificationEnumApi } from './generated/api.schemas'
import type {
IntervieweeContextApi,
InterviewLinkApi,
@@ -385,7 +385,7 @@ export const userInterviewLogic = kea<userInterviewLogicType>([
// Mirror the backend `has_replied` rule: an abandoned partial (e.g. a mid-call
// refresh) is not a reply, so it must not mark the invitee responded — otherwise
// the topic page and the public link disagree on who still needs chasing.
- if (interview.classifications?.includes(ClassificationsEnumApi.Abandoned)) {
+ if (interview.classifications?.includes(UserInterviewClassificationEnumApi.Abandoned)) {
continue
}
if (interview.transcript || interview.summary) {
diff --git a/products/warehouse_sources/frontend/generated/api.schemas.ts b/products/warehouse_sources/frontend/generated/api.schemas.ts
index 3df3343c987f..779832099a79 100644
--- a/products/warehouse_sources/frontend/generated/api.schemas.ts
+++ b/products/warehouse_sources/frontend/generated/api.schemas.ts
@@ -15,9 +15,10 @@
* * `cdc` - cdc
* * `xmin` - xmin
*/
-export type SyncTypeEnumApi = (typeof SyncTypeEnumApi)[keyof typeof SyncTypeEnumApi]
+export type ExternalDataSchemaSyncTypeEnumApi =
+ (typeof ExternalDataSchemaSyncTypeEnumApi)[keyof typeof ExternalDataSchemaSyncTypeEnumApi]
-export const SyncTypeEnumApi = {
+export const ExternalDataSchemaSyncTypeEnumApi = {
FullRefresh: 'full_refresh',
Incremental: 'incremental',
Append: 'append',
@@ -166,7 +167,7 @@ export interface ExternalDataSchemaApi {
* * `webhook` - webhook
* * `cdc` - cdc
* * `xmin` - xmin */
- sync_type?: SyncTypeEnumApi | null
+ sync_type?: ExternalDataSchemaSyncTypeEnumApi | null
/**
* Column name used to track sync progress.
* @nullable
@@ -329,7 +330,7 @@ export interface PatchedExternalDataSchemaApi {
* * `webhook` - webhook
* * `cdc` - cdc
* * `xmin` - xmin */
- sync_type?: SyncTypeEnumApi | null
+ sync_type?: ExternalDataSchemaSyncTypeEnumApi | null
/**
* Column name used to track sync progress.
* @nullable
@@ -424,10 +425,10 @@ export interface PatchedExternalDataSchemaApi {
* * `wizard` - wizard
* * `self_driving` - self_driving
*/
-export type ExternalDataSourceSerializersCreatedViaEnumApi =
- (typeof ExternalDataSourceSerializersCreatedViaEnumApi)[keyof typeof ExternalDataSourceSerializersCreatedViaEnumApi]
+export type ExternalDataSourceCreatedViaEnumApi =
+ (typeof ExternalDataSourceCreatedViaEnumApi)[keyof typeof ExternalDataSourceCreatedViaEnumApi]
-export const ExternalDataSourceSerializersCreatedViaEnumApi = {
+export const ExternalDataSourceCreatedViaEnumApi = {
Web: 'web',
Api: 'api',
Mcp: 'mcp',
@@ -3097,9 +3098,10 @@ export const ExternalDataSourceTypeEnumApi = {
* * `warehouse` - warehouse
* * `direct` - direct
*/
-export type AccessMethodEnumApi = (typeof AccessMethodEnumApi)[keyof typeof AccessMethodEnumApi]
+export type ExternalDataSourceAccessMethodEnumApi =
+ (typeof ExternalDataSourceAccessMethodEnumApi)[keyof typeof ExternalDataSourceAccessMethodEnumApi]
-export const AccessMethodEnumApi = {
+export const ExternalDataSourceAccessMethodEnumApi = {
Warehouse: 'warehouse',
Direct: 'direct',
} as const
@@ -3149,7 +3151,7 @@ export interface ExternalDataSourceSerializersApi {
* * `mcp` - mcp
* * `wizard` - wizard
* * `self_driving` - self_driving */
- created_via?: ExternalDataSourceSerializersCreatedViaEnumApi | null
+ created_via?: ExternalDataSourceCreatedViaEnumApi | null
readonly status: string
client_secret: string
account_id: string
@@ -3166,7 +3168,7 @@ export interface ExternalDataSourceSerializersApi {
* @nullable
*/
description?: string | null
- readonly access_method: AccessMethodEnumApi
+ readonly access_method: ExternalDataSourceAccessMethodEnumApi
/** Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources. */
direct_query_enabled?: boolean
/** Automatically enable syncing for schemas discovered on this source after creation, on both the scheduled discovery pass and manual schema refreshes. Defaults to false. Not supported for direct-query sources. */
@@ -4586,7 +4588,7 @@ export interface ExternalDataSourceCreateApi {
*
* * `warehouse` - warehouse
* * `direct` - direct */
- access_method?: AccessMethodEnumApi
+ access_method?: ExternalDataSourceAccessMethodEnumApi
/** Where the request came from: `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. `wizard` and `self_driving` cannot be set directly — they are derived server-side for wizard- and PostHog Desktop-driven MCP calls. Defaults to `api`.
*
* * `web` - web
@@ -4619,7 +4621,7 @@ export interface PatchedExternalDataSourceSerializersApi {
* * `mcp` - mcp
* * `wizard` - wizard
* * `self_driving` - self_driving */
- created_via?: ExternalDataSourceSerializersCreatedViaEnumApi | null
+ created_via?: ExternalDataSourceCreatedViaEnumApi | null
readonly status?: string
client_secret?: string
account_id?: string
@@ -4636,7 +4638,7 @@ export interface PatchedExternalDataSourceSerializersApi {
* @nullable
*/
description?: string | null
- readonly access_method?: AccessMethodEnumApi
+ readonly access_method?: ExternalDataSourceAccessMethodEnumApi
/** Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources. */
direct_query_enabled?: boolean
/** Automatically enable syncing for schemas discovered on this source after creation, on both the scheduled discovery pass and manual schema refreshes. Defaults to false. Not supported for direct-query sources. */
@@ -4702,7 +4704,7 @@ export interface ExternalDataSourceBulkUpdateSchemaApi {
* * `webhook` - webhook
* * `cdc` - cdc
* * `xmin` - xmin */
- sync_type?: SyncTypeEnumApi | null
+ sync_type?: ExternalDataSchemaSyncTypeEnumApi | null
/**
* Incremental cursor field for incremental or append syncs.
* @nullable
@@ -6125,7 +6127,7 @@ export interface ExternalDataSourceConnectionOptionApi {
*
* * `warehouse` - warehouse
* * `direct` - direct */
- readonly access_method: AccessMethodEnumApi
+ readonly access_method: ExternalDataSourceAccessMethodEnumApi
/** Whether HogQL queries compile for this connection. When false, only raw SQL (sendRawQuery) works. */
readonly supports_hogql: boolean
/** Whether this option is the built-in PostHog managed warehouse connection. */
diff --git a/products/web_analytics/backend/serializers.py b/products/web_analytics/backend/serializers.py
index 0a0f6883c7e3..7367e03b68bd 100644
--- a/products/web_analytics/backend/serializers.py
+++ b/products/web_analytics/backend/serializers.py
@@ -1,4 +1,5 @@
from django.core.validators import URLValidator
+from django.db import models
from rest_framework import serializers
@@ -16,10 +17,15 @@ class LlmsTxtFetchResponseSerializer(serializers.Serializer):
url = serializers.URLField(help_text="Final public URL after redirects.")
+class WoWChangeDirection(models.TextChoices):
+ UP = "Up", "Up"
+ DOWN = "Down", "Down"
+
+
class WoWChangeSerializer(serializers.Serializer):
percent = serializers.IntegerField(help_text="Absolute percentage change, rounded to nearest integer.")
direction = serializers.ChoiceField(
- choices=["Up", "Down"], help_text="Direction of the change relative to the prior period."
+ choices=WoWChangeDirection.choices, help_text="Direction of the change relative to the prior period."
)
color = serializers.CharField(help_text="Hex color indicating whether the change is a positive or negative signal.")
text = serializers.CharField(help_text="Short label, e.g. 'Up 12%'.")
diff --git a/products/web_analytics/frontend/generated/api.schemas.ts b/products/web_analytics/frontend/generated/api.schemas.ts
index 9fb4fbc618c9..7dfdcaec7b76 100644
--- a/products/web_analytics/frontend/generated/api.schemas.ts
+++ b/products/web_analytics/frontend/generated/api.schemas.ts
@@ -12,9 +12,9 @@
* * `iframe` - Iframe
* * `recording` - Recording
*/
-export type HeatmapTypeApi = (typeof HeatmapTypeApi)[keyof typeof HeatmapTypeApi]
+export type SavedHeatmapTypeEnumApi = (typeof SavedHeatmapTypeEnumApi)[keyof typeof SavedHeatmapTypeEnumApi]
-export const HeatmapTypeApi = {
+export const SavedHeatmapTypeEnumApi = {
Screenshot: 'screenshot',
Iframe: 'iframe',
Recording: 'recording',
@@ -24,10 +24,9 @@ export const HeatmapTypeApi = {
* * `server` - Server
* * `toolbar` - Toolbar
*/
-export type HeatmapScreenshotResponseSourceEnumApi =
- (typeof HeatmapScreenshotResponseSourceEnumApi)[keyof typeof HeatmapScreenshotResponseSourceEnumApi]
+export type SavedHeatmapSourceEnumApi = (typeof SavedHeatmapSourceEnumApi)[keyof typeof SavedHeatmapSourceEnumApi]
-export const HeatmapScreenshotResponseSourceEnumApi = {
+export const SavedHeatmapSourceEnumApi = {
Server: 'server',
Toolbar: 'toolbar',
} as const
@@ -37,10 +36,9 @@ export const HeatmapScreenshotResponseSourceEnumApi = {
* * `completed` - Completed
* * `failed` - Failed
*/
-export type HeatmapScreenshotResponseStatusEnumApi =
- (typeof HeatmapScreenshotResponseStatusEnumApi)[keyof typeof HeatmapScreenshotResponseStatusEnumApi]
+export type SavedHeatmapStatusEnumApi = (typeof SavedHeatmapStatusEnumApi)[keyof typeof SavedHeatmapStatusEnumApi]
-export const HeatmapScreenshotResponseStatusEnumApi = {
+export const SavedHeatmapStatusEnumApi = {
Processing: 'processing',
Completed: 'completed',
Failed: 'failed',
@@ -137,18 +135,18 @@ export interface HeatmapScreenshotResponseApi {
* * `screenshot` - Screenshot
* * `iframe` - Iframe
* * `recording` - Recording */
- type?: HeatmapTypeApi
+ type?: SavedHeatmapTypeEnumApi
/** How the screenshot was captured: 'server' (rendered headlessly via Browserless) or 'toolbar' (captured client-side from the on-page toolbar, e.g. for pages behind a login).
*
* * `server` - Server
* * `toolbar` - Toolbar */
- readonly source: HeatmapScreenshotResponseSourceEnumApi
+ readonly source: SavedHeatmapSourceEnumApi
/** Screenshot generation status: 'processing', 'completed', or 'failed'.
*
* * `processing` - Processing
* * `completed` - Completed
* * `failed` - Failed */
- readonly status: HeatmapScreenshotResponseStatusEnumApi
+ readonly status: SavedHeatmapStatusEnumApi
/** Whether at least one rendered image is ready to fetch. */
readonly has_content: boolean
/** Per-width render metadata. Fetch the actual image bytes for a width from the content endpoint. */
@@ -250,7 +248,7 @@ export interface SavedHeatmapRequestApi {
* * `screenshot` - Screenshot
* * `iframe` - Iframe
* * `recording` - Recording */
- type?: HeatmapTypeApi
+ type?: SavedHeatmapTypeEnumApi
/** Set true to soft-delete the saved heatmap. */
deleted?: boolean
/** When true, ask the headless browser to dismiss cookie/consent banners before capturing the screenshot. Off by default: the blocker can stall the render on some sites and time out. Only applies to 'screenshot' heatmaps. */
@@ -283,7 +281,7 @@ export interface PatchedSavedHeatmapRequestApi {
* * `screenshot` - Screenshot
* * `iframe` - Iframe
* * `recording` - Recording */
- type?: HeatmapTypeApi
+ type?: SavedHeatmapTypeEnumApi
/** Set true to soft-delete the saved heatmap. */
deleted?: boolean
/** When true, ask the headless browser to dismiss cookie/consent banners before capturing the screenshot. Off by default: the blocker can stall the render on some sites and time out. Only applies to 'screenshot' heatmaps. */
diff --git a/products/workflows/backend/api/hog_flow.py b/products/workflows/backend/api/hog_flow.py
index 0ca046b6009e..140d66229399 100644
--- a/products/workflows/backend/api/hog_flow.py
+++ b/products/workflows/backend/api/hog_flow.py
@@ -13,7 +13,7 @@ from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import ValidationError as DjangoValidationError
from django.core.signing import BadSignature, SignatureExpired, TimestampSigner
-from django.db import transaction
+from django.db import models, transaction
from django.db.models import Q, QuerySet
from django.http import Http404, HttpResponse
from django.utils import timezone
@@ -983,10 +983,15 @@ class HogFlowConfigFunctionInputsSerializer(serializers.Serializer):
return super().to_internal_value(data)
+class HogFlowEdgeType(models.TextChoices):
+ CONTINUE = "continue", "continue"
+ BRANCH = "branch", "branch"
+
+
class HogFlowEdgeSerializer(serializers.Serializer):
to = serializers.CharField(help_text="Target action id.")
type = serializers.ChoiceField(
- choices=["continue", "branch"],
+ choices=HogFlowEdgeType.choices,
help_text=(
"continue: fall-through (sequential or the no-match path of conditional_branch). "
"branch: requires 'index' matching config.conditions[index]."
diff --git a/products/workflows/frontend/generated/api.schemas.ts b/products/workflows/frontend/generated/api.schemas.ts
index 3c9a346c8749..5a7f24744472 100644
--- a/products/workflows/frontend/generated/api.schemas.ts
+++ b/products/workflows/frontend/generated/api.schemas.ts
@@ -228,9 +228,9 @@ export interface PatchedHogFlowTemplateApi {
* * `active` - Active
* * `archived` - Archived
*/
-export type HogFlowStatusEnumApi = (typeof HogFlowStatusEnumApi)[keyof typeof HogFlowStatusEnumApi]
+export type HogFlowStateEnumApi = (typeof HogFlowStateEnumApi)[keyof typeof HogFlowStateEnumApi]
-export const HogFlowStatusEnumApi = {
+export const HogFlowStateEnumApi = {
Draft: 'draft',
Active: 'active',
Archived: 'archived',
@@ -302,7 +302,7 @@ export interface HogFlowMinimalApi {
readonly name: string | null
readonly description: string
readonly version: number
- readonly status: HogFlowStatusEnumApi
+ readonly status: HogFlowStateEnumApi
readonly created_at: string
readonly created_by: UserBasicApi
readonly updated_at: string
@@ -573,7 +573,7 @@ export interface HogFlowApi {
* * `draft` - Draft
* * `active` - Active
* * `archived` - Archived */
- status?: HogFlowStatusEnumApi
+ status?: HogFlowStateEnumApi
readonly created_at: string
readonly created_by: UserBasicApi
readonly updated_at: string
@@ -651,7 +651,7 @@ export interface PatchedHogFlowApi {
* * `draft` - Draft
* * `active` - Active
* * `archived` - Archived */
- status?: HogFlowStatusEnumApi
+ status?: HogFlowStateEnumApi
readonly created_at?: string
readonly created_by?: UserBasicApi
readonly updated_at?: string
@@ -796,10 +796,9 @@ export interface MessageAssetApi {
* * `cancelled` - Cancelled
* * `failed` - Failed
*/
-export type HogFlowBatchJobStatusEnumApi =
- (typeof HogFlowBatchJobStatusEnumApi)[keyof typeof HogFlowBatchJobStatusEnumApi]
+export type HogFlowBatchJobStateEnumApi = (typeof HogFlowBatchJobStateEnumApi)[keyof typeof HogFlowBatchJobStateEnumApi]
-export const HogFlowBatchJobStatusEnumApi = {
+export const HogFlowBatchJobStateEnumApi = {
Waiting: 'waiting',
Queued: 'queued',
Active: 'active',
@@ -818,7 +817,7 @@ export interface HogFlowBatchJobApi {
* * `completed` - Completed
* * `cancelled` - Cancelled
* * `failed` - Failed */
- status?: HogFlowBatchJobStatusEnumApi
+ status?: HogFlowBatchJobStateEnumApi
/** ID of the workflow this batch run belongs to. */
hog_flow: string
/** Audience snapshot the run fanned out to, taken from the workflow's batch trigger filters. */
@@ -844,7 +843,7 @@ export interface HogFlowBatchJobCancelResponseApi {
* * `completed` - Completed
* * `cancelled` - Cancelled
* * `failed` - Failed */
- status: HogFlowBatchJobStatusEnumApi
+ status: HogFlowBatchJobStateEnumApi
/** In-flight runs newly flagged for cancellation by this request. */
marked: number
/** In-flight runs of this batch not yet flagged. Non-zero on very large runs; call again. */
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 2c57775b4663..6d2889527a1a 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -52,10 +52,10 @@ export namespace Schemas {
* * `last_n_days` - Last N days
* * `days_ago_range` - Between X and Y days ago
*/
- export type AIWindowConfigModeEnum = typeof AIWindowConfigModeEnum[keyof typeof AIWindowConfigModeEnum];
+ export type SubscriptionAIWindowModeEnum = typeof SubscriptionAIWindowModeEnum[keyof typeof SubscriptionAIWindowModeEnum];
- export const AIWindowConfigModeEnum = {
+ export const SubscriptionAIWindowModeEnum = {
SinceLastSent: 'since_last_sent',
LastNDays: 'last_n_days',
DaysAgoRange: 'days_ago_range',
@@ -70,7 +70,7 @@ export namespace Schemas {
* * `since_last_sent` - Since last report
* * `last_n_days` - Last N days
* * `days_ago_range` - Between X and Y days ago */
- mode?: AIWindowConfigModeEnum;
+ mode?: SubscriptionAIWindowModeEnum;
/**
* Lower bound of the analysis window, in days before the run. Required for 'last_n_days' (the N) and 'days_ago_range'; ignored for 'since_last_sent'. 1-365.
* @minimum 1
@@ -155,18 +155,6 @@ export namespace Schemas {
None: 'none',
} as const;
- /**
- * * `warehouse` - warehouse
- * * `direct` - direct
- */
- export type AccessMethodEnum = typeof AccessMethodEnum[keyof typeof AccessMethodEnum];
-
-
- export const AccessMethodEnum = {
- Warehouse: 'warehouse',
- Direct: 'direct',
- } as const;
-
/**
* Typed account properties: website_domain, external system identifiers (stripe_customer_id, hubspot_deal_id, billing_id, sfdc_id, zendesk_id, slack_channel_id, usage_dashboard_link, metabase_link), and touchpoint matching lists: email_domains (the company's email domains) and known_emails (individual addresses pinned to the account). Defaults to an empty object. Unknown keys are rejected. User assignments live on account relationships, not here.
* @nullable
@@ -646,18 +634,6 @@ export namespace Schemas {
user: number;
}
- /**
- * * `tracked` - tracked
- * * `ignored` - ignored
- */
- export type AccountSegmentEnum = typeof AccountSegmentEnum[keyof typeof AccountSegmentEnum];
-
-
- export const AccountSegmentEnum = {
- Tracked: 'tracked',
- Ignored: 'ignored',
- } as const;
-
export interface AccountSupportTicketMessage {
/** UUID of the support ticket message. */
readonly id: string;
@@ -2485,6 +2461,20 @@ export namespace Schemas {
actionId: number;
}
+ /**
+ * * `group_summary` - Group summary
+ * * `alert` - Alert
+ * * `per_observation` - Per observation
+ */
+ export type ActionModeEnum = typeof ActionModeEnum[keyof typeof ActionModeEnum];
+
+
+ export const ActionModeEnum = {
+ GroupSummary: 'group_summary',
+ Alert: 'alert',
+ PerObservation: 'per_observation',
+ } as const;
+
export interface ActionReference {
/** Resource type: insight, experiment, cohort, or hog_function */
type: string;
@@ -8926,10 +8916,10 @@ export namespace Schemas {
* * `21` - Can view dashboard
* * `37` - Can edit dashboard
*/
- export type EffectivePrivilegeLevelEnum = typeof EffectivePrivilegeLevelEnum[keyof typeof EffectivePrivilegeLevelEnum];
+ export type PrivilegeLevelEnum = typeof PrivilegeLevelEnum[keyof typeof PrivilegeLevelEnum];
- export const EffectivePrivilegeLevelEnum = {
+ export const PrivilegeLevelEnum = {
Number21: 21,
Number37: 37,
} as const;
@@ -9053,7 +9043,7 @@ export namespace Schemas {
readonly last_modified_by: UserBasic;
readonly is_sample: boolean;
readonly effective_restriction_level: RestrictionLevelEnum;
- readonly effective_privilege_level: EffectivePrivilegeLevelEnum;
+ readonly effective_privilege_level: PrivilegeLevelEnum;
/**
* The effective access level the user has for this object
* @nullable
@@ -9319,18 +9309,6 @@ export namespace Schemas {
CustomerAnalytics: 'customer_analytics',
} as const;
- /**
- * * `langgraph` - LangGraph
- * * `sandbox` - Sandbox
- */
- export type AgentRuntimeEnum = typeof AgentRuntimeEnum[keyof typeof AgentRuntimeEnum];
-
-
- export const AgentRuntimeEnum = {
- Langgraph: 'langgraph',
- Sandbox: 'sandbox',
- } as const;
-
export interface AggregatedSpanRow {
avg_duration_nano: number;
count: number;
@@ -10064,10 +10042,10 @@ export namespace Schemas {
* * `every_match` - Every new match
* * `on_breach` - When a threshold is crossed
*/
- export type AlertConfigFrequencyEnum = typeof AlertConfigFrequencyEnum[keyof typeof AlertConfigFrequencyEnum];
+ export type AlertFrequencyEnum = typeof AlertFrequencyEnum[keyof typeof AlertFrequencyEnum];
- export const AlertConfigFrequencyEnum = {
+ export const AlertFrequencyEnum = {
EveryMatch: 'every_match',
OnBreach: 'on_breach',
} as const;
@@ -10076,10 +10054,10 @@ export namespace Schemas {
* * `count` - Count of matching observations
* * `avg_score` - Average score
*/
- export type VisionAlertMetricEnum = typeof VisionAlertMetricEnum[keyof typeof VisionAlertMetricEnum];
+ export type VisionActionAlertMetricEnum = typeof VisionActionAlertMetricEnum[keyof typeof VisionActionAlertMetricEnum];
- export const VisionAlertMetricEnum = {
+ export const VisionActionAlertMetricEnum = {
Count: 'count',
AvgScore: 'avg_score',
} as const;
@@ -10124,12 +10102,12 @@ export namespace Schemas {
*
* * `every_match` - Every new match
* * `on_breach` - When a threshold is crossed */
- frequency?: AlertConfigFrequencyEnum;
+ frequency?: AlertFrequencyEnum;
/** What to measure over the window: 'count' of targeted observations, or 'avg_score' (the mean scorer score; scorer scanners only). every_match supports 'count' only.
*
* * `count` - Count of matching observations
* * `avg_score` - Average score */
- metric?: VisionAlertMetricEnum;
+ metric?: VisionActionAlertMetricEnum;
/** The alert fires when the metric is at or above ('above') or at or below ('below') this value, per 'direction'. Required for on_breach; ignored for every_match. */
threshold?: number;
/** Which side of the threshold breaches: 'above' fires when the metric is at or above it, 'below' when at or below (e.g. an average score dropping under a floor). Both inclusive. Defaults to 'above'; ignored for every_match.
@@ -10269,10 +10247,10 @@ export namespace Schemas {
* * `USR` - user
* * `GIT` - GitHub
*/
- export type CreationTypeEnum = typeof CreationTypeEnum[keyof typeof CreationTypeEnum];
+ export type AnnotationCreationTypeEnum = typeof AnnotationCreationTypeEnum[keyof typeof AnnotationCreationTypeEnum];
- export const CreationTypeEnum = {
+ export const AnnotationCreationTypeEnum = {
Usr: 'USR',
Git: 'GIT',
} as const;
@@ -10312,7 +10290,7 @@ export namespace Schemas {
*
* * `USR` - user
* * `GIT` - GitHub */
- creation_type?: CreationTypeEnum;
+ creation_type?: AnnotationCreationTypeEnum;
/**
* Optional insight ID to attach this annotation to. Must belong to the current project.
* @nullable
@@ -11930,10 +11908,10 @@ export namespace Schemas {
* * `NoOp` - Noop
* * `FileDownload` - File Download
*/
- export type BatchExportDestinationTypeEnum = typeof BatchExportDestinationTypeEnum[keyof typeof BatchExportDestinationTypeEnum];
+ export type BatchExportDestinationDestinationEnum = typeof BatchExportDestinationDestinationEnum[keyof typeof BatchExportDestinationDestinationEnum];
- export const BatchExportDestinationTypeEnum = {
+ export const BatchExportDestinationDestinationEnum = {
S3: 'S3',
AwsS3: 'AwsS3',
S3Compatible: 'S3Compatible',
@@ -12226,7 +12204,7 @@ export namespace Schemas {
* * `HTTP` - Http
* * `NoOp` - Noop
* * `FileDownload` - File Download */
- type: BatchExportDestinationTypeEnum;
+ type: BatchExportDestinationDestinationEnum;
/** Destination-specific configuration. Fields depend on `type`. Credentials for integration-backed destinations (Databricks, AzureBlob, BigQuery, Postgres, AwsS3, S3Compatible, Snowflake, Redshift) are NOT stored here — they live in the linked Integration. Secret fields are stripped from responses. */
config: BatchExportDestinationConfig;
/**
@@ -13728,10 +13706,10 @@ export namespace Schemas {
* * `spend` - Spend
* * `projected_spend` - Projected spend
*/
- export type BillingAlertMetricEnum = typeof BillingAlertMetricEnum[keyof typeof BillingAlertMetricEnum];
+ export type BillingAlertConfigurationMetricEnum = typeof BillingAlertConfigurationMetricEnum[keyof typeof BillingAlertConfigurationMetricEnum];
- export const BillingAlertMetricEnum = {
+ export const BillingAlertConfigurationMetricEnum = {
Spend: 'spend',
ProjectedSpend: 'projected_spend',
} as const;
@@ -13743,10 +13721,10 @@ export namespace Schemas {
* * `snoozed` - Snoozed
* * `broken` - Broken
*/
- export type BillingAlertStateEnum = typeof BillingAlertStateEnum[keyof typeof BillingAlertStateEnum];
+ export type BillingAlertConfigurationStateEnum = typeof BillingAlertConfigurationStateEnum[keyof typeof BillingAlertConfigurationStateEnum];
- export const BillingAlertStateEnum = {
+ export const BillingAlertConfigurationStateEnum = {
NotFiring: 'not_firing',
Firing: 'firing',
Errored: 'errored',
@@ -13795,7 +13773,7 @@ export namespace Schemas {
*
* * `spend` - Spend
* * `projected_spend` - Projected spend */
- readonly metric: BillingAlertMetricEnum;
+ readonly metric: BillingAlertConfigurationMetricEnum;
/**
* Metric value for the evaluated billing date.
* @nullable
@@ -13829,7 +13807,7 @@ export namespace Schemas {
* * `errored` - Errored
* * `snoozed` - Snoozed
* * `broken` - Broken */
- readonly state_before: BillingAlertStateEnum | null;
+ readonly state_before: BillingAlertConfigurationStateEnum | null;
/** Alert state after this event was applied.
*
* * `not_firing` - Not firing
@@ -13837,7 +13815,7 @@ export namespace Schemas {
* * `errored` - Errored
* * `snoozed` - Snoozed
* * `broken` - Broken */
- readonly state_after: BillingAlertStateEnum | null;
+ readonly state_after: BillingAlertConfigurationStateEnum | null;
/**
* When notifications for this event were delivered.
* @nullable
@@ -13895,10 +13873,10 @@ export namespace Schemas {
* * `absolute_value` - Absolute value
* * `absolute_increase` - Absolute increase
*/
- export type ThresholdTypeEnum = typeof ThresholdTypeEnum[keyof typeof ThresholdTypeEnum];
+ export type BillingAlertConfigurationThresholdTypeEnum = typeof BillingAlertConfigurationThresholdTypeEnum[keyof typeof BillingAlertConfigurationThresholdTypeEnum];
- export const ThresholdTypeEnum = {
+ export const BillingAlertConfigurationThresholdTypeEnum = {
RelativeIncrease: 'relative_increase',
AbsoluteValue: 'absolute_value',
AbsoluteIncrease: 'absolute_increase',
@@ -13982,7 +13960,7 @@ export namespace Schemas {
*
* * `spend` - Spend
* * `projected_spend` - Projected spend */
- metric?: BillingAlertMetricEnum;
+ metric?: BillingAlertConfigurationMetricEnum;
/** Server-controlled currency for spend values.
*
* * `USD` - USD */
@@ -13994,7 +13972,7 @@ export namespace Schemas {
* * `relative_increase` - Relative increase
* * `absolute_value` - Absolute value
* * `absolute_increase` - Absolute increase */
- threshold_type?: ThresholdTypeEnum;
+ threshold_type?: BillingAlertConfigurationThresholdTypeEnum;
/**
* Reserved for future increase-over-baseline rules. Not used by absolute value alerts.
* @nullable
@@ -14031,7 +14009,7 @@ export namespace Schemas {
* * `errored` - Errored
* * `snoozed` - Snoozed
* * `broken` - Broken */
- readonly state: BillingAlertStateEnum;
+ readonly state: BillingAlertConfigurationStateEnum;
/**
* Minimum hours between repeated firing notifications.
* @minimum 0
@@ -14086,20 +14064,6 @@ export namespace Schemas {
hog_function_ids: string[];
}
- /**
- * * `posthog_health_check` - PostHog health check
- * * `posthog_onboarding` - PostHog onboarding
- * * `posthog_system` - PostHog system
- */
- export type BillingExemptReasonEnum = typeof BillingExemptReasonEnum[keyof typeof BillingExemptReasonEnum];
-
-
- export const BillingExemptReasonEnum = {
- PosthogHealthCheck: 'posthog_health_check',
- PosthogOnboarding: 'posthog_onboarding',
- PosthogSystem: 'posthog_system',
- } as const;
-
export type BillingOverviewResponseProductsItem = {[key: string]: unknown};
export interface BillingOverviewResponse {
@@ -14152,18 +14116,6 @@ export namespace Schemas {
never_drop_data?: boolean;
}
- /**
- * * `excluded` - Excluded
- * * `credited` - Credited
- */
- export type BillingPathEnum = typeof BillingPathEnum[keyof typeof BillingPathEnum];
-
-
- export const BillingPathEnum = {
- Excluded: 'excluded',
- Credited: 'credited',
- } as const;
-
export interface BillingPeriodResponse {
/**
* Start of the organization's current billing period, or null when billing has not synced a period.
@@ -16921,18 +16873,6 @@ export namespace Schemas {
max_selections?: number | null;
}
- /**
- * * `marketing` - Marketing
- * * `transactional` - Transactional
- */
- export type CategoryTypeEnum = typeof CategoryTypeEnum[keyof typeof CategoryTypeEnum];
-
-
- export const CategoryTypeEnum = {
- Marketing: 'marketing',
- Transactional: 'transactional',
- } as const;
-
/**
* * `consolidated` - consolidated
* * `cdc_only` - cdc_only
@@ -17094,16 +17034,6 @@ export namespace Schemas {
readonly state: ChangeRequestStateEnum;
}
- /**
- * * `manual` - Manual
- */
- export type ChangeSourceEnum = typeof ChangeSourceEnum[keyof typeof ChangeSourceEnum];
-
-
- export const ChangeSourceEnum = {
- Manual: 'manual',
- } as const;
-
/**
* The task currently generating this channel's CONTEXT.md, or null.
*/
@@ -17139,10 +17069,10 @@ export namespace Schemas {
* * `personal` - Personal
* * `general` - General
*/
- export type SystemRoleEnum = typeof SystemRoleEnum[keyof typeof SystemRoleEnum];
+ export type ChannelSystemRoleEnum = typeof ChannelSystemRoleEnum[keyof typeof ChannelSystemRoleEnum];
- export const SystemRoleEnum = {
+ export const ChannelSystemRoleEnum = {
Personal: 'personal',
General: 'general',
} as const;
@@ -17166,7 +17096,7 @@ export namespace Schemas {
*
* * `personal` - Personal
* * `general` - General */
- readonly system_role: SystemRoleEnum | null;
+ readonly system_role: ChannelSystemRoleEnum | null;
}
export interface ChannelDeleteConflict {
@@ -17198,6 +17128,24 @@ export namespace Schemas {
GithubIssue: 'github_issue',
} as const;
+ /**
+ * * `widget` - Widget
+ * * `email` - Email
+ * * `slack` - Slack
+ * * `teams` - Microsoft Teams
+ * * `github` - GitHub
+ */
+ export type ChannelEnum = typeof ChannelEnum[keyof typeof ChannelEnum];
+
+
+ export const ChannelEnum = {
+ Widget: 'widget',
+ Email: 'email',
+ Slack: 'slack',
+ Teams: 'teams',
+ Github: 'github',
+ } as const;
+
export type ChannelFeedMessageDTOPayload = { [key: string]: unknown };
/**
@@ -17270,24 +17218,6 @@ export namespace Schemas {
base_version?: number | null;
}
- /**
- * * `widget` - Widget
- * * `email` - Email
- * * `slack` - Slack
- * * `teams` - Microsoft Teams
- * * `github` - GitHub
- */
- export type ChannelSourceEnum = typeof ChannelSourceEnum[keyof typeof ChannelSourceEnum];
-
-
- export const ChannelSourceEnum = {
- Widget: 'widget',
- Email: 'email',
- Slack: 'slack',
- Teams: 'teams',
- Github: 'github',
- } as const;
-
/**
* Request body for starring/unstarring a channel for the requesting user.
*/
@@ -17393,18 +17323,6 @@ export namespace Schemas {
CustomSql: 'custom_sql',
} as const;
- /**
- * * `abandoned` - Abandoned
- * * `off-topic` - Off-topic
- */
- export type ClassificationsEnum = typeof ClassificationsEnum[keyof typeof ClassificationsEnum];
-
-
- export const ClassificationsEnum = {
- Abandoned: 'abandoned',
- OffTopic: 'off-topic',
- } as const;
-
export interface TagCount {
/** The tag value. */
tag: string;
@@ -18053,10 +17971,10 @@ export namespace Schemas {
benjamin_enabled?: boolean | null;
}
- export type PropertyGroupOperator = typeof PropertyGroupOperator[keyof typeof PropertyGroupOperator];
+ export type PropertyGroupOperatorEnum = typeof PropertyGroupOperatorEnum[keyof typeof PropertyGroupOperatorEnum];
- export const PropertyGroupOperator = {
+ export const PropertyGroupOperatorEnum = {
And: 'AND',
Or: 'OR',
} as const;
@@ -18101,7 +18019,7 @@ export namespace Schemas {
* AND/OR group containing cohort filters. Named to avoid collision with analytics Group model.
*/
export interface CohortFilterGroup {
- type: PropertyGroupOperator;
+ type: PropertyGroupOperatorEnum;
values: (BehavioralFilter | CohortFilter | PersonFilter | PersonMetadataFilter | CohortFilterGroup)[];
}
@@ -18469,10 +18387,10 @@ export namespace Schemas {
* * `verified` - Verified
* * `community` - Community
*/
- export type TrustTierEnum = typeof TrustTierEnum[keyof typeof TrustTierEnum];
+ export type CommunitySkillTrustTierEnum = typeof CommunitySkillTrustTierEnum[keyof typeof CommunitySkillTrustTierEnum];
- export const TrustTierEnum = {
+ export const CommunitySkillTrustTierEnum = {
Official: 'official',
Verified: 'verified',
Community: 'community',
@@ -18524,7 +18442,7 @@ export namespace Schemas {
* * `official` - Official
* * `verified` - Verified
* * `community` - Community */
- trust_tier: TrustTierEnum;
+ trust_tier: CommunitySkillTrustTierEnum;
/** GitHub handle (or name) of the contributor who published the skill. */
readonly author_handle: string;
/** Link to the skill's source directory on GitHub. */
@@ -18594,7 +18512,7 @@ export namespace Schemas {
* * `official` - Official
* * `verified` - Verified
* * `community` - Community */
- trust_tier: TrustTierEnum;
+ trust_tier: CommunitySkillTrustTierEnum;
/** GitHub handle (or name) of the contributor who published the skill. */
readonly author_handle: string;
/** Link to the skill's source directory on GitHub. */
@@ -18897,10 +18815,10 @@ export namespace Schemas {
* * `in_progress` - In progress
* * `canceling` - Canceling
*/
- export type ConversationStatus = typeof ConversationStatus[keyof typeof ConversationStatus];
+ export type ConversationStatusEnum = typeof ConversationStatusEnum[keyof typeof ConversationStatusEnum];
- export const ConversationStatus = {
+ export const ConversationStatusEnum = {
Idle: 'idle',
InProgress: 'in_progress',
Canceling: 'canceling',
@@ -18917,10 +18835,10 @@ export namespace Schemas {
* * `data_warehouse` - Data warehouse
* * `other` - Other
*/
- export type TopicEnum = typeof TopicEnum[keyof typeof TopicEnum];
+ export type ConversationTopicEnum = typeof ConversationTopicEnum[keyof typeof ConversationTopicEnum];
- export const TopicEnum = {
+ export const ConversationTopicEnum = {
WebAnalytics: 'web_analytics',
ProductAnalytics: 'product_analytics',
SessionReplay: 'session_replay',
@@ -18938,24 +18856,36 @@ export namespace Schemas {
* * `deep_research` - Deep research
* * `slack` - Slack
*/
- export type ConversationType = typeof ConversationType[keyof typeof ConversationType];
+ export type ConversationTypeEnum = typeof ConversationTypeEnum[keyof typeof ConversationTypeEnum];
- export const ConversationType = {
+ export const ConversationTypeEnum = {
Assistant: 'assistant',
ToolCall: 'tool_call',
DeepResearch: 'deep_research',
Slack: 'slack',
} as const;
+ /**
+ * * `langgraph` - LangGraph
+ * * `sandbox` - Sandbox
+ */
+ export type ConversationAgentRuntimeEnum = typeof ConversationAgentRuntimeEnum[keyof typeof ConversationAgentRuntimeEnum];
+
+
+ export const ConversationAgentRuntimeEnum = {
+ Langgraph: 'langgraph',
+ Sandbox: 'sandbox',
+ } as const;
+
/**
* * `acp` - ACP
* * `pi` - Pi
*/
- export type RuntimeEnum = typeof RuntimeEnum[keyof typeof RuntimeEnum];
+ export type TaskRuntimeEnum = typeof TaskRuntimeEnum[keyof typeof TaskRuntimeEnum];
- export const RuntimeEnum = {
+ export const TaskRuntimeEnum = {
Acp: 'acp',
Pi: 'pi',
} as const;
@@ -18983,7 +18913,7 @@ export namespace Schemas {
*
* * `acp` - ACP
* * `pi` - Pi */
- readonly runtime: RuntimeEnum;
+ readonly runtime: TaskRuntimeEnum;
/** @nullable */
repository: string | null;
/** @nullable */
@@ -19014,7 +18944,7 @@ export namespace Schemas {
export interface Conversation {
readonly id: string;
- readonly status: ConversationStatus;
+ readonly status: ConversationStatusEnum;
/**
* Title of the conversation.
* @nullable
@@ -19031,13 +18961,13 @@ export namespace Schemas {
* * `error_tracking` - Error tracking
* * `data_warehouse` - Data warehouse
* * `other` - Other */
- readonly topic: TopicEnum | null;
+ readonly topic: ConversationTopicEnum | null;
readonly user: UserBasic;
/** @nullable */
readonly created_at: string | null;
/** @nullable */
readonly updated_at: string | null;
- readonly type: ConversationType;
+ readonly type: ConversationTypeEnum;
/**
* Whether this conversation was created during an impersonated session (e.g., by support agents). Internal conversations are hidden from customers.
* @nullable
@@ -19061,7 +18991,7 @@ export namespace Schemas {
*
* * `langgraph` - LangGraph
* * `sandbox` - Sandbox */
- readonly agent_runtime: AgentRuntimeEnum;
+ readonly agent_runtime: ConversationAgentRuntimeEnum;
readonly is_sandbox: boolean;
/** Return pending approval cards as structured data.
*
@@ -19073,7 +19003,7 @@ export namespace Schemas {
export interface ConversationMinimal {
readonly id: string;
- readonly status: ConversationStatus;
+ readonly status: ConversationStatusEnum;
/**
* Title of the conversation.
* @nullable
@@ -19090,13 +19020,13 @@ export namespace Schemas {
* * `error_tracking` - Error tracking
* * `data_warehouse` - Data warehouse
* * `other` - Other */
- readonly topic: TopicEnum | null;
+ readonly topic: ConversationTopicEnum | null;
readonly user: UserBasic;
/** @nullable */
readonly created_at: string | null;
/** @nullable */
readonly updated_at: string | null;
- readonly type: ConversationType;
+ readonly type: ConversationTypeEnum;
/**
* Whether this conversation was created during an impersonated session (e.g., by support agents). Internal conversations are hidden from customers.
* @nullable
@@ -19571,6 +19501,20 @@ export namespace Schemas {
readonly updated_at: string;
}
+ /**
+ * * `pending` - Pending
+ * * `completed` - Completed
+ * * `skipped` - Skipped
+ */
+ export type CoreMemoryScrapingStatusEnum = typeof CoreMemoryScrapingStatusEnum[keyof typeof CoreMemoryScrapingStatusEnum];
+
+
+ export const CoreMemoryScrapingStatusEnum = {
+ Pending: 'pending',
+ Completed: 'completed',
+ Skipped: 'skipped',
+ } as const;
+
export interface CostPerMergeBucket {
/** Bucket start, aligned to cost_series_granularity (top of hour, midnight, or Monday). */
bucket_start: string;
@@ -19949,22 +19893,6 @@ export namespace Schemas {
AiGenerated: 'ai_generated',
} as const;
- /**
- * * `default` - Default
- * * `template` - Template
- * * `duplicate` - Duplicate
- * * `unlisted` - Unlisted (product-embedded)
- */
- export type CreationModeEnum = typeof CreationModeEnum[keyof typeof CreationModeEnum];
-
-
- export const CreationModeEnum = {
- Default: 'default',
- Template: 'template',
- Duplicate: 'duplicate',
- Unlisted: 'unlisted',
- } as const;
-
export interface Credential {
readonly id: string;
readonly created_by: UserBasic;
@@ -20010,10 +19938,10 @@ export namespace Schemas {
* * `superseded` - Superseded
* * `no_change` - No change
*/
- export type ReplayScannerPromptSuggestionStatusEnum = typeof ReplayScannerPromptSuggestionStatusEnum[keyof typeof ReplayScannerPromptSuggestionStatusEnum];
+ export type PromptSuggestionStatusEnum = typeof PromptSuggestionStatusEnum[keyof typeof PromptSuggestionStatusEnum];
- export const ReplayScannerPromptSuggestionStatusEnum = {
+ export const PromptSuggestionStatusEnum = {
Pending: 'pending',
Applied: 'applied',
Dismissed: 'dismissed',
@@ -20089,7 +20017,7 @@ export namespace Schemas {
* * `dismissed` - Dismissed
* * `superseded` - Superseded
* * `no_change` - No change */
- readonly status: ReplayScannerPromptSuggestionStatusEnum;
+ readonly status: PromptSuggestionStatusEnum;
/** The full rewritten prompt, ready to apply to the scanner. */
readonly suggested_prompt: string;
/** The scanner prompt this suggestion was generated against, for diffing. */
@@ -20227,6 +20155,18 @@ export namespace Schemas {
color: CustomPropertyOptionColorEnum;
}
+ /**
+ * * `tracked` - tracked
+ * * `ignored` - ignored
+ */
+ export type SyncSegmentEnum = typeof SyncSegmentEnum[keyof typeof SyncSegmentEnum];
+
+
+ export const SyncSegmentEnum = {
+ Tracked: 'tracked',
+ Ignored: 'ignored',
+ } as const;
+
/**
* * `staging` - staging
* * `dispatching` - dispatching
@@ -20257,7 +20197,7 @@ export namespace Schemas {
*
* * `tracked` - tracked
* * `ignored` - ignored */
- readonly account_segment: AccountSegmentEnum | null;
+ readonly account_segment: SyncSegmentEnum | null;
/** Current account sync phase. Person and group property runs return null.
*
* * `staging` - staging
@@ -20659,6 +20599,22 @@ export namespace Schemas {
export type DashboardTilesItem = { [key: string]: unknown };
+ /**
+ * * `default` - Default
+ * * `template` - Template
+ * * `duplicate` - Duplicate
+ * * `unlisted` - Unlisted (product-embedded)
+ */
+ export type DashboardCreationModeEnum = typeof DashboardCreationModeEnum[keyof typeof DashboardCreationModeEnum];
+
+
+ export const DashboardCreationModeEnum = {
+ Default: 'default',
+ Template: 'template',
+ Duplicate: 'duplicate',
+ Unlisted: 'unlisted',
+ } as const;
+
/**
* * `tight` - tight
* * `condensed` - condensed
@@ -20743,7 +20699,7 @@ export namespace Schemas {
readonly file_system_path: string | null;
readonly is_shared: boolean;
deleted?: boolean;
- readonly creation_mode: CreationModeEnum;
+ readonly creation_mode: DashboardCreationModeEnum;
readonly filters: DashboardFilters;
/** @nullable */
readonly variables: DashboardVariables;
@@ -20757,7 +20713,7 @@ export namespace Schemas {
tags?: unknown[];
restriction_level?: RestrictionLevelEnum;
readonly effective_restriction_level: RestrictionLevelEnum;
- readonly effective_privilege_level: EffectivePrivilegeLevelEnum;
+ readonly effective_privilege_level: PrivilegeLevelEnum;
/**
* The effective access level the user has for this object
* @nullable
@@ -20843,7 +20799,7 @@ export namespace Schemas {
readonly file_system_path: string | null;
readonly is_shared: boolean;
readonly deleted: boolean;
- readonly creation_mode: CreationModeEnum;
+ readonly creation_mode: DashboardCreationModeEnum;
tags?: unknown[];
/** Controls who can edit the dashboard.
*
@@ -20851,7 +20807,7 @@ export namespace Schemas {
* * `37` - Only those invited to this dashboard can edit */
readonly restriction_level: RestrictionLevelEnum;
readonly effective_restriction_level: RestrictionLevelEnum;
- readonly effective_privilege_level: EffectivePrivilegeLevelEnum;
+ readonly effective_privilege_level: PrivilegeLevelEnum;
/**
* The effective access level the user has for this object
* @nullable
@@ -22296,10 +22252,10 @@ export namespace Schemas {
* * `Failed` - Failed
* * `Running` - Running
*/
- export type SavedQueryStatusEnum = typeof SavedQueryStatusEnum[keyof typeof SavedQueryStatusEnum];
+ export type DataWarehouseSavedQueryStatusEnum = typeof DataWarehouseSavedQueryStatusEnum[keyof typeof DataWarehouseSavedQueryStatusEnum];
- export const SavedQueryStatusEnum = {
+ export const DataWarehouseSavedQueryStatusEnum = {
Cancelled: 'Cancelled',
Modified: 'Modified',
Completed: 'Completed',
@@ -22312,10 +22268,10 @@ export namespace Schemas {
* * `endpoint` - Endpoint
* * `managed_viewset` - Managed Viewset
*/
- export type OriginEnum = typeof OriginEnum[keyof typeof OriginEnum];
+ export type DataWarehouseSavedQueryOriginEnum = typeof DataWarehouseSavedQueryOriginEnum[keyof typeof DataWarehouseSavedQueryOriginEnum];
- export const OriginEnum = {
+ export const DataWarehouseSavedQueryOriginEnum = {
DataWarehouse: 'data_warehouse',
Endpoint: 'endpoint',
ManagedViewset: 'managed_viewset',
@@ -22372,7 +22328,7 @@ export namespace Schemas {
* * `Completed` - Completed
* * `Failed` - Failed
* * `Running` - Running */
- readonly status: SavedQueryStatusEnum | null;
+ readonly status: DataWarehouseSavedQueryStatusEnum | null;
/** @nullable */
readonly last_run_at: string | null;
/** @nullable */
@@ -22413,7 +22369,7 @@ export namespace Schemas {
* * `data_warehouse` - Data Warehouse
* * `endpoint` - Endpoint
* * `managed_viewset` - Managed Viewset */
- readonly origin: OriginEnum | null;
+ readonly origin: DataWarehouseSavedQueryOriginEnum | null;
/** Whether this view is for testing only and will auto-expire. */
is_test?: boolean;
/**
@@ -22435,10 +22391,10 @@ export namespace Schemas {
* * `ai_generated` - AI generated
* * `user_edited` - User edited
*/
- export type DescriptionSourceEnum = typeof DescriptionSourceEnum[keyof typeof DescriptionSourceEnum];
+ export type WarehouseColumnAnnotationDescriptionSourceEnum = typeof WarehouseColumnAnnotationDescriptionSourceEnum[keyof typeof WarehouseColumnAnnotationDescriptionSourceEnum];
- export const DescriptionSourceEnum = {
+ export const WarehouseColumnAnnotationDescriptionSourceEnum = {
Canonical: 'canonical',
AiGenerated: 'ai_generated',
UserEdited: 'user_edited',
@@ -22465,7 +22421,7 @@ export namespace Schemas {
* * `canonical` - Canonical
* * `ai_generated` - AI generated
* * `user_edited` - User edited */
- readonly description_source: DescriptionSourceEnum;
+ readonly description_source: WarehouseColumnAnnotationDescriptionSourceEnum;
/** Model used when the description was AI-generated, otherwise null. */
readonly ai_model: string;
/** True once a user has edited this annotation; such rows are never overwritten. */
@@ -22540,7 +22496,7 @@ export namespace Schemas {
* * `Completed` - Completed
* * `Failed` - Failed
* * `Running` - Running */
- readonly status: SavedQueryStatusEnum | null;
+ readonly status: DataWarehouseSavedQueryStatusEnum | null;
/** @nullable */
readonly last_run_at: string | null;
/** @nullable */
@@ -22560,7 +22516,7 @@ export namespace Schemas {
* * `data_warehouse` - Data Warehouse
* * `endpoint` - Endpoint
* * `managed_viewset` - Managed Viewset */
- readonly origin: OriginEnum | null;
+ readonly origin: DataWarehouseSavedQueryOriginEnum | null;
/** Whether this view is for testing only and will auto-expire. */
readonly is_test: boolean;
/**
@@ -22575,6 +22531,50 @@ export namespace Schemas {
readonly user_access_level: string | null;
}
+ /**
+ * * `web` - web
+ * * `api` - api
+ * * `mcp` - mcp
+ * * `wizard` - wizard
+ * * `self_driving` - self_driving
+ * * `source` - source
+ * * `materialized_view` - materialized_view
+ * * `demo` - demo
+ */
+ export type DataWarehouseTableCreatedViaEnum = typeof DataWarehouseTableCreatedViaEnum[keyof typeof DataWarehouseTableCreatedViaEnum];
+
+
+ export const DataWarehouseTableCreatedViaEnum = {
+ Web: 'web',
+ Api: 'api',
+ Mcp: 'mcp',
+ Wizard: 'wizard',
+ SelfDriving: 'self_driving',
+ Source: 'source',
+ MaterializedView: 'materialized_view',
+ Demo: 'demo',
+ } as const;
+
+ /**
+ * * `CSV` - CSV
+ * * `CSVWithNames` - CSVWithNames
+ * * `Parquet` - Parquet
+ * * `JSONEachRow` - JSON
+ * * `Delta` - Delta
+ * * `DeltaS3Wrapper` - DeltaS3Wrapper
+ */
+ export type DataWarehouseTableFormatEnum = typeof DataWarehouseTableFormatEnum[keyof typeof DataWarehouseTableFormatEnum];
+
+
+ export const DataWarehouseTableFormatEnum = {
+ Csv: 'CSV',
+ CSVWithNames: 'CSVWithNames',
+ Parquet: 'Parquet',
+ JSONEachRow: 'JSONEachRow',
+ Delta: 'Delta',
+ DeltaS3Wrapper: 'DeltaS3Wrapper',
+ } as const;
+
export type HedgehogActorAccessoryOption = typeof HedgehogActorAccessoryOption[keyof typeof HedgehogActorAccessoryOption];
@@ -27196,18 +27196,6 @@ export namespace Schemas {
Default: 'default',
} as const;
- /**
- * * `bayesian` - Bayesian
- * * `frequentist` - Frequentist
- */
- export type DefaultExperimentStatsMethodEnum = typeof DefaultExperimentStatsMethodEnum[keyof typeof DefaultExperimentStatsMethodEnum];
-
-
- export const DefaultExperimentStatsMethodEnum = {
- Bayesian: 'bayesian',
- Frequentist: 'frequentist',
- } as const;
-
export interface DeleteTileRequest {
/** ID of the dashboard tile to delete. Use dashboard-get to look up tile IDs. */
tile_id: number;
@@ -27267,24 +27255,6 @@ export namespace Schemas {
merged_pr_count: number;
}
- /**
- * * `pending` - Pending
- * * `generated` - Generated
- * * `delivered` - Delivered
- * * `partial_failure` - Partial Failure
- * * `failed` - Failed
- */
- export type DeliveryStatusEnum = typeof DeliveryStatusEnum[keyof typeof DeliveryStatusEnum];
-
-
- export const DeliveryStatusEnum = {
- Pending: 'pending',
- Generated: 'generated',
- Delivered: 'delivered',
- PartialFailure: 'partial_failure',
- Failed: 'failed',
- } as const;
-
/**
* * `slack` - Slack
* * `webhook` - Webhook
@@ -30854,18 +30824,6 @@ export namespace Schemas {
version?: number | null;
}
- /**
- * * `allow` - Allow
- * * `reject` - Reject
- */
- export type EnforcementModeEnum = typeof EnforcementModeEnum[keyof typeof EnforcementModeEnum];
-
-
- export const EnforcementModeEnum = {
- Allow: 'allow',
- Reject: 'reject',
- } as const;
-
/**
* * `duckdb` - duckdb
* * `postgres` - postgres
@@ -30944,6 +30902,18 @@ export namespace Schemas {
Merged: 'merged',
} as const;
+ /**
+ * * `allow` - Allow
+ * * `reject` - Reject
+ */
+ export type SchemaEnforcementModeEnum = typeof SchemaEnforcementModeEnum[keyof typeof SchemaEnforcementModeEnum];
+
+
+ export const SchemaEnforcementModeEnum = {
+ Allow: 'allow',
+ Reject: 'reject',
+ } as const;
+
/**
* Serializer mixin that handles tags for objects.
*/
@@ -30969,7 +30939,7 @@ export namespace Schemas {
readonly verified_by: UserBasic;
/** @nullable */
hidden?: boolean | null;
- enforcement_mode?: EnforcementModeEnum;
+ enforcement_mode?: SchemaEnforcementModeEnum;
/**
* Name of a single property on this event that PostHog UIs should display alongside the event (for example `$pathname` on `$pageview`). When set, surfaces like the session replay inspector show the property's value next to the event name without the user having to open the event.
* @maxLength 400
@@ -30993,10 +30963,10 @@ export namespace Schemas {
* * `Boolean` - Boolean
* * `Duration` - Duration
*/
- export type PropertyDefinitionTypeEnum = typeof PropertyDefinitionTypeEnum[keyof typeof PropertyDefinitionTypeEnum];
+ export type PropertyTypeEnum = typeof PropertyTypeEnum[keyof typeof PropertyTypeEnum];
- export const PropertyDefinitionTypeEnum = {
+ export const PropertyTypeEnum = {
DateTime: 'DateTime',
String: 'String',
Numeric: 'Numeric',
@@ -31018,7 +30988,7 @@ export namespace Schemas {
readonly updated_by: UserBasic;
/** @nullable */
readonly is_seen_on_filtered_events: boolean | null;
- property_type?: PropertyDefinitionTypeEnum | BlankEnum | null;
+ property_type?: PropertyTypeEnum | BlankEnum | null;
verified?: boolean;
/** @nullable */
readonly verified_at: string | null;
@@ -32733,10 +32703,10 @@ export namespace Schemas {
* * `model_not_found` - Model not found
* * `hog_error` - Hog evaluation code failed
*/
- export type StatusReasonEnum = typeof StatusReasonEnum[keyof typeof StatusReasonEnum];
+ export type EvaluationStatusReasonEnum = typeof EvaluationStatusReasonEnum[keyof typeof EvaluationStatusReasonEnum];
- export const StatusReasonEnum = {
+ export const EvaluationStatusReasonEnum = {
ProviderKeyRequired: 'provider_key_required',
ProviderKeyDeleted: 'provider_key_deleted',
NoDefaultModel: 'no_default_model',
@@ -32871,7 +32841,7 @@ export namespace Schemas {
/** Whether the evaluation runs automatically on new $ai_generation events. */
enabled?: boolean;
readonly status: EvaluationStatusEnum;
- readonly status_reason: StatusReasonEnum | null;
+ readonly status_reason: EvaluationStatusReasonEnum | null;
/**
* Additional detail for the current system-disabled status. This is only populated when the detail is safe to show in the evaluation UI.
* @nullable
@@ -33207,6 +33177,24 @@ export namespace Schemas {
metrics?: EvaluationReportMetrics | null;
}
+ /**
+ * * `pending` - Pending
+ * * `generated` - Generated
+ * * `delivered` - Delivered
+ * * `partial_failure` - Partial Failure
+ * * `failed` - Failed
+ */
+ export type EvaluationReportRunDeliveryStatusEnum = typeof EvaluationReportRunDeliveryStatusEnum[keyof typeof EvaluationReportRunDeliveryStatusEnum];
+
+
+ export const EvaluationReportRunDeliveryStatusEnum = {
+ Pending: 'pending',
+ Generated: 'generated',
+ Delivered: 'delivered',
+ PartialFailure: 'partial_failure',
+ Failed: 'failed',
+ } as const;
+
export interface EvaluationReportRun {
/** UUID of this report run. */
readonly id: string;
@@ -33227,7 +33215,7 @@ export namespace Schemas {
* * `delivered` - Delivered
* * `partial_failure` - Partial Failure
* * `failed` - Failed */
- readonly delivery_status: DeliveryStatusEnum;
+ readonly delivery_status: EvaluationReportRunDeliveryStatusEnum;
/** Delivery error messages. Empty when all configured deliveries succeeded. */
readonly delivery_errors: readonly string[];
/** When this report run was created. */
@@ -33359,7 +33347,7 @@ export namespace Schemas {
last_seen_at?: string | null;
readonly last_updated_at: string;
tags?: unknown[];
- enforcement_mode?: EnforcementModeEnum;
+ enforcement_mode?: SchemaEnforcementModeEnum;
/**
* Name of a single property on this event that PostHog UIs should display alongside the event (for example `$pathname` on `$pageview`). When set, surfaces like the session replay inspector show the property's value next to the event name without the user having to open the event.
* @maxLength 400
@@ -33379,10 +33367,10 @@ export namespace Schemas {
* * `dry_run` - Dry Run
* * `live` - Live
*/
- export type EventFilterConfigModeEnum = typeof EventFilterConfigModeEnum[keyof typeof EventFilterConfigModeEnum];
+ export type EventFilterModeEnum = typeof EventFilterModeEnum[keyof typeof EventFilterModeEnum];
- export const EventFilterConfigModeEnum = {
+ export const EventFilterModeEnum = {
Disabled: 'disabled',
DryRun: 'dry_run',
Live: 'live',
@@ -33390,7 +33378,7 @@ export namespace Schemas {
export interface EventFilterConfig {
readonly id: string;
- mode?: EventFilterConfigModeEnum;
+ mode?: EventFilterModeEnum;
/** Boolean expression tree. Nodes: {"type": "and"|"or", "children": [...]}, {"type": "not", "child": {...}}, {"type": "condition", "field": "event_name"|"distinct_id", "operator": "exact"|"contains", "value": "<string>"} */
filter_tree?: unknown;
/** Test events to validate the filter. Each: {"event_name": "...", "distinct_id": "...", "expected_result": "drop"|"ingest"} */
@@ -33424,10 +33412,10 @@ export namespace Schemas {
* * `clientwarnings` - Clientwarnings
* * `ai` - Ai
*/
- export type PipelinesEnum = typeof PipelinesEnum[keyof typeof PipelinesEnum];
+ export type IngestionPipelineEnum = typeof IngestionPipelineEnum[keyof typeof IngestionPipelineEnum];
- export const PipelinesEnum = {
+ export const IngestionPipelineEnum = {
Analytics: 'analytics',
SessionRecordings: 'session_recordings',
Errortracking: 'errortracking',
@@ -33453,7 +33441,7 @@ export namespace Schemas {
/** Event UUIDs the restriction applies to. Empty means it is not filtered by event UUID. */
event_uuids: string[];
/** Ingestion pipelines the restriction applies to. Filters combine with AND; values within a filter combine with OR. */
- pipelines: PipelinesEnum[];
+ pipelines: IngestionPipelineEnum[];
}
/**
@@ -33463,10 +33451,10 @@ export namespace Schemas {
* * `Boolean` - Boolean
* * `Object` - Object
*/
- export type SchemaPropertyGroupPropertyPropertyTypeEnum = typeof SchemaPropertyGroupPropertyPropertyTypeEnum[keyof typeof SchemaPropertyGroupPropertyPropertyTypeEnum];
+ export type SchemaPropertyTypeEnum = typeof SchemaPropertyTypeEnum[keyof typeof SchemaPropertyTypeEnum];
- export const SchemaPropertyGroupPropertyPropertyTypeEnum = {
+ export const SchemaPropertyTypeEnum = {
DateTime: 'DateTime',
String: 'String',
Numeric: 'Numeric',
@@ -33478,7 +33466,7 @@ export namespace Schemas {
readonly id: string;
/** @maxLength 400 */
name: string;
- property_type: SchemaPropertyGroupPropertyPropertyTypeEnum;
+ property_type: SchemaPropertyTypeEnum;
is_required?: boolean;
is_optional_in_types?: boolean;
description?: string;
@@ -34797,20 +34785,6 @@ export namespace Schemas {
can_view_task: boolean;
}
- /**
- * * `categorical` - categorical
- * * `numeric` - numeric
- * * `boolean` - boolean
- */
- export type ExperimentMetricKindEnum = typeof ExperimentMetricKindEnum[keyof typeof ExperimentMetricKindEnum];
-
-
- export const ExperimentMetricKindEnum = {
- Categorical: 'categorical',
- Numeric: 'numeric',
- Boolean: 'boolean',
- } as const;
-
/**
* * `manual` - Manual
* * `agent_mcp` - Agent (MCP)
@@ -34824,10 +34798,10 @@ export namespace Schemas {
* * `experiment_stop` - Experiment Stop
* * `experiment_update` - Experiment Update
*/
- export type TriggerEnum = typeof TriggerEnum[keyof typeof TriggerEnum];
+ export type ExperimentMetricsRecalculationTriggerEnum = typeof ExperimentMetricsRecalculationTriggerEnum[keyof typeof ExperimentMetricsRecalculationTriggerEnum];
- export const TriggerEnum = {
+ export const ExperimentMetricsRecalculationTriggerEnum = {
Manual: 'manual',
AgentMcp: 'agent_mcp',
ColdRun: 'cold_run',
@@ -34926,7 +34900,7 @@ export namespace Schemas {
* * `experiment_launch` - Experiment Launch
* * `experiment_stop` - Experiment Stop
* * `experiment_update` - Experiment Update */
- readonly trigger: TriggerEnum;
+ readonly trigger: ExperimentMetricsRecalculationTriggerEnum;
/** When the job was created */
readonly created_at: string;
/**
@@ -35830,10 +35804,10 @@ export namespace Schemas {
* * `cdc` - cdc
* * `xmin` - xmin
*/
- export type SyncTypeEnum = typeof SyncTypeEnum[keyof typeof SyncTypeEnum];
+ export type ExternalDataSchemaSyncTypeEnum = typeof ExternalDataSchemaSyncTypeEnum[keyof typeof ExternalDataSchemaSyncTypeEnum];
- export const SyncTypeEnum = {
+ export const ExternalDataSchemaSyncTypeEnum = {
FullRefresh: 'full_refresh',
Incremental: 'incremental',
Append: 'append',
@@ -35933,7 +35907,7 @@ export namespace Schemas {
* * `webhook` - webhook
* * `cdc` - cdc
* * `xmin` - xmin */
- sync_type?: SyncTypeEnum | null;
+ sync_type?: ExternalDataSchemaSyncTypeEnum | null;
/**
* Column name used to track sync progress.
* @nullable
@@ -36021,6 +35995,18 @@ export namespace Schemas {
readonly user_access_level: string | null;
}
+ /**
+ * * `warehouse` - warehouse
+ * * `direct` - direct
+ */
+ export type ExternalDataSourceAccessMethodEnum = typeof ExternalDataSourceAccessMethodEnum[keyof typeof ExternalDataSourceAccessMethodEnum];
+
+
+ export const ExternalDataSourceAccessMethodEnum = {
+ Warehouse: 'warehouse',
+ Direct: 'direct',
+ } as const;
+
export type ExternalDataSourceBulkUpdateSchemaRowFiltersItem = {
column: string;
/** One of: > >= < <= = != IN "NOT IN". */
@@ -36042,7 +36028,7 @@ export namespace Schemas {
* * `webhook` - webhook
* * `cdc` - cdc
* * `xmin` - xmin */
- sync_type?: SyncTypeEnum | null;
+ sync_type?: ExternalDataSchemaSyncTypeEnum | null;
/**
* Incremental cursor field for incremental or append syncs.
* @nullable
@@ -37435,7 +37421,7 @@ export namespace Schemas {
*
* * `warehouse` - warehouse
* * `direct` - direct */
- readonly access_method: AccessMethodEnum;
+ readonly access_method: ExternalDataSourceAccessMethodEnum;
/** Whether HogQL queries compile for this connection. When false, only raw SQL (sendRawQuery) works. */
readonly supports_hogql: boolean;
/** Whether this option is the built-in PostHog managed warehouse connection. */
@@ -38813,7 +38799,7 @@ export namespace Schemas {
*
* * `warehouse` - warehouse
* * `direct` - direct */
- access_method?: AccessMethodEnum;
+ access_method?: ExternalDataSourceAccessMethodEnum;
/** Where the request came from: `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls. `wizard` and `self_driving` cannot be set directly — they are derived server-side for wizard- and PostHog Desktop-driven MCP calls. Defaults to `api`.
*
* * `web` - web
@@ -38829,6 +38815,24 @@ export namespace Schemas {
id: string;
}
+ /**
+ * * `web` - web
+ * * `api` - api
+ * * `mcp` - mcp
+ * * `wizard` - wizard
+ * * `self_driving` - self_driving
+ */
+ export type ExternalDataSourceCreatedViaEnum = typeof ExternalDataSourceCreatedViaEnum[keyof typeof ExternalDataSourceCreatedViaEnum];
+
+
+ export const ExternalDataSourceCreatedViaEnum = {
+ Web: 'web',
+ Api: 'api',
+ Mcp: 'mcp',
+ Wizard: 'wizard',
+ SelfDriving: 'self_driving',
+ } as const;
+
/**
* One row in `inventory.external_data_sources`.
*/
@@ -38863,24 +38867,6 @@ export namespace Schemas {
export type ExternalDataSourceSerializersSchemasItem = { [key: string]: unknown };
- /**
- * * `web` - web
- * * `api` - api
- * * `mcp` - mcp
- * * `wizard` - wizard
- * * `self_driving` - self_driving
- */
- export type ExternalDataSourceSerializersCreatedViaEnum = typeof ExternalDataSourceSerializersCreatedViaEnum[keyof typeof ExternalDataSourceSerializersCreatedViaEnum];
-
-
- export const ExternalDataSourceSerializersCreatedViaEnum = {
- Web: 'web',
- Api: 'api',
- Mcp: 'mcp',
- Wizard: 'wizard',
- SelfDriving: 'self_driving',
- } as const;
-
/**
* Mixin for serializers to add user access control fields
*/
@@ -38896,7 +38882,7 @@ export namespace Schemas {
* * `mcp` - mcp
* * `wizard` - wizard
* * `self_driving` - self_driving */
- created_via?: ExternalDataSourceSerializersCreatedViaEnum | null;
+ created_via?: ExternalDataSourceCreatedViaEnum | null;
readonly status: string;
client_secret: string;
account_id: string;
@@ -38913,7 +38899,7 @@ export namespace Schemas {
* @nullable
*/
description?: string | null;
- readonly access_method: AccessMethodEnum;
+ readonly access_method: ExternalDataSourceAccessMethodEnum;
/** Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources. */
direct_query_enabled?: boolean;
/** Automatically enable syncing for schemas discovered on this source after creation, on both the scheduled discovery pass and manual schema refreshes. Defaults to false. Not supported for direct-query sources. */
@@ -39381,10 +39367,10 @@ export namespace Schemas {
* * `medium` - Medium
* * `low` - Low
*/
- export type RequestPriorityEnum = typeof RequestPriorityEnum[keyof typeof RequestPriorityEnum];
+ export type FeatureRequestPriorityEnum = typeof FeatureRequestPriorityEnum[keyof typeof FeatureRequestPriorityEnum];
- export const RequestPriorityEnum = {
+ export const FeatureRequestPriorityEnum = {
High: 'high',
Medium: 'medium',
Low: 'low',
@@ -39496,7 +39482,7 @@ export namespace Schemas {
* * `high` - High
* * `medium` - Medium
* * `low` - Low */
- readonly request_priority: RequestPriorityEnum | null;
+ readonly request_priority: FeatureRequestPriorityEnum | null;
/** Whether the request is archived. */
readonly is_archived: boolean;
/**
@@ -39746,6 +39732,16 @@ export namespace Schemas {
readonly after: FeatureRequestHistoryChangeAfter;
}
+ /**
+ * * `manual` - Manual
+ */
+ export type FeatureRequestHistorySourceEnum = typeof FeatureRequestHistorySourceEnum[keyof typeof FeatureRequestHistorySourceEnum];
+
+
+ export const FeatureRequestHistorySourceEnum = {
+ Manual: 'manual',
+ } as const;
+
export interface FeatureRequestHistory {
/** Stable request history entry ID. */
readonly id: string;
@@ -39756,7 +39752,7 @@ export namespace Schemas {
/** System that recorded the request change.
*
* * `manual` - Manual */
- readonly change_source: ChangeSourceEnum;
+ readonly change_source: FeatureRequestHistorySourceEnum;
/**
* ID of the user who changed the request, if known.
* @nullable
@@ -39793,7 +39789,7 @@ export namespace Schemas {
/** System that recorded the status change.
*
* * `manual` - Manual */
- readonly change_source: ChangeSourceEnum;
+ readonly change_source: FeatureRequestHistorySourceEnum;
/**
* ID of the user who changed the status, if known.
* @nullable
@@ -39840,7 +39836,7 @@ export namespace Schemas {
* * `high` - High
* * `medium` - Medium
* * `low` - Low */
- request_priority?: RequestPriorityEnum | null;
+ request_priority?: FeatureRequestPriorityEnum | null;
}
export interface FeatureRequestVersion {
@@ -40894,6 +40890,40 @@ export namespace Schemas {
trace_id: string;
}
+ /**
+ * * `initial` - initial
+ * * `regenerate` - regenerate
+ * * `improve` - improve
+ * * `revert` - revert
+ */
+ export type GeneratedWidgetVersionOperationEnum = typeof GeneratedWidgetVersionOperationEnum[keyof typeof GeneratedWidgetVersionOperationEnum];
+
+
+ export const GeneratedWidgetVersionOperationEnum = {
+ Initial: 'initial',
+ Regenerate: 'regenerate',
+ Improve: 'improve',
+ Revert: 'revert',
+ } as const;
+
+ /**
+ * * `none` - none
+ * * `low` - low
+ * * `medium` - medium
+ * * `high` - high
+ * * `critical` - critical
+ */
+ export type GeneratedWidgetVersionSecurityReviewSeverityEnum = typeof GeneratedWidgetVersionSecurityReviewSeverityEnum[keyof typeof GeneratedWidgetVersionSecurityReviewSeverityEnum];
+
+
+ export const GeneratedWidgetVersionSecurityReviewSeverityEnum = {
+ None: 'none',
+ Low: 'low',
+ Medium: 'medium',
+ High: 'high',
+ Critical: 'critical',
+ } as const;
+
/**
* * `initial` - initial
* * `regenerate` - regenerate
@@ -40952,10 +40982,10 @@ export namespace Schemas {
* * `approved` - Approved
* * `unidentified` - Unidentified
*/
- export type GitHubInstallRequestItemStatusEnum = typeof GitHubInstallRequestItemStatusEnum[keyof typeof GitHubInstallRequestItemStatusEnum];
+ export type GitHubInstallRequestStatusEnum = typeof GitHubInstallRequestStatusEnum[keyof typeof GitHubInstallRequestStatusEnum];
- export const GitHubInstallRequestItemStatusEnum = {
+ export const GitHubInstallRequestStatusEnum = {
Pending: 'pending',
Approved: 'approved',
Unidentified: 'unidentified',
@@ -40971,7 +41001,7 @@ export namespace Schemas {
* * `pending` - Pending
* * `approved` - Approved
* * `unidentified` - Unidentified */
- status: GitHubInstallRequestItemStatusEnum;
+ status: GitHubInstallRequestStatusEnum;
/**
* GitHub App installation id, set once the request is approved.
* @nullable
@@ -41359,10 +41389,10 @@ export namespace Schemas {
* * `count` - count
* * `sum` - sum
*/
- export type MathEnum = typeof MathEnum[keyof typeof MathEnum];
+ export type GroupUsageMetricMathEnum = typeof GroupUsageMetricMathEnum[keyof typeof GroupUsageMetricMathEnum];
- export const MathEnum = {
+ export const GroupUsageMetricMathEnum = {
Count: 'count',
Sum: 'sum',
} as const;
@@ -41396,7 +41426,7 @@ export namespace Schemas {
*
* * `count` - count
* * `sum` - sum */
- math?: MathEnum;
+ math?: GroupUsageMetricMathEnum;
/**
* Required when `math` is `sum`; must be empty when `math` is `count`. For events metrics this is an event property name. For data warehouse metrics this is the column name (or HogQL expression) to sum on the DW table.
* @maxLength 255
@@ -41673,10 +41703,10 @@ export namespace Schemas {
* * `iframe` - Iframe
* * `recording` - Recording
*/
- export type HeatmapType = typeof HeatmapType[keyof typeof HeatmapType];
+ export type SavedHeatmapTypeEnum = typeof SavedHeatmapTypeEnum[keyof typeof SavedHeatmapTypeEnum];
- export const HeatmapType = {
+ export const SavedHeatmapTypeEnum = {
Screenshot: 'screenshot',
Iframe: 'iframe',
Recording: 'recording',
@@ -41686,10 +41716,10 @@ export namespace Schemas {
* * `server` - Server
* * `toolbar` - Toolbar
*/
- export type HeatmapScreenshotResponseSourceEnum = typeof HeatmapScreenshotResponseSourceEnum[keyof typeof HeatmapScreenshotResponseSourceEnum];
+ export type SavedHeatmapSourceEnum = typeof SavedHeatmapSourceEnum[keyof typeof SavedHeatmapSourceEnum];
- export const HeatmapScreenshotResponseSourceEnum = {
+ export const SavedHeatmapSourceEnum = {
Server: 'server',
Toolbar: 'toolbar',
} as const;
@@ -41699,10 +41729,10 @@ export namespace Schemas {
* * `completed` - Completed
* * `failed` - Failed
*/
- export type HeatmapScreenshotResponseStatusEnum = typeof HeatmapScreenshotResponseStatusEnum[keyof typeof HeatmapScreenshotResponseStatusEnum];
+ export type SavedHeatmapStatusEnum = typeof SavedHeatmapStatusEnum[keyof typeof SavedHeatmapStatusEnum];
- export const HeatmapScreenshotResponseStatusEnum = {
+ export const SavedHeatmapStatusEnum = {
Processing: 'processing',
Completed: 'completed',
Failed: 'failed',
@@ -41742,18 +41772,18 @@ export namespace Schemas {
* * `screenshot` - Screenshot
* * `iframe` - Iframe
* * `recording` - Recording */
- type?: HeatmapType;
+ type?: SavedHeatmapTypeEnum;
/** How the screenshot was captured: 'server' (rendered headlessly via Browserless) or 'toolbar' (captured client-side from the on-page toolbar, e.g. for pages behind a login).
*
* * `server` - Server
* * `toolbar` - Toolbar */
- readonly source: HeatmapScreenshotResponseSourceEnum;
+ readonly source: SavedHeatmapSourceEnum;
/** Screenshot generation status: 'processing', 'completed', or 'failed'.
*
* * `processing` - Processing
* * `completed` - Completed
* * `failed` - Failed */
- readonly status: HeatmapScreenshotResponseStatusEnum;
+ readonly status: SavedHeatmapStatusEnum;
/** Whether at least one rendered image is ready to fetch. */
readonly has_content: boolean;
/** Per-width render metadata. Fetch the actual image bytes for a width from the content endpoint. */
@@ -41809,10 +41839,10 @@ export namespace Schemas {
* * `active` - Active
* * `archived` - Archived
*/
- export type HogFlowStatusEnum = typeof HogFlowStatusEnum[keyof typeof HogFlowStatusEnum];
+ export type HogFlowStateEnum = typeof HogFlowStateEnum[keyof typeof HogFlowStateEnum];
- export const HogFlowStatusEnum = {
+ export const HogFlowStateEnum = {
Draft: 'draft',
Active: 'active',
Archived: 'archived',
@@ -42117,7 +42147,7 @@ export namespace Schemas {
* * `draft` - Draft
* * `active` - Active
* * `archived` - Archived */
- status?: HogFlowStatusEnum;
+ status?: HogFlowStateEnum;
readonly created_at: string;
readonly created_by: UserBasic;
readonly updated_at: string;
@@ -42173,10 +42203,10 @@ export namespace Schemas {
* * `cancelled` - Cancelled
* * `failed` - Failed
*/
- export type HogFlowBatchJobStatusEnum = typeof HogFlowBatchJobStatusEnum[keyof typeof HogFlowBatchJobStatusEnum];
+ export type HogFlowBatchJobStateEnum = typeof HogFlowBatchJobStateEnum[keyof typeof HogFlowBatchJobStateEnum];
- export const HogFlowBatchJobStatusEnum = {
+ export const HogFlowBatchJobStateEnum = {
Waiting: 'waiting',
Queued: 'queued',
Active: 'active',
@@ -42195,7 +42225,7 @@ export namespace Schemas {
* * `completed` - Completed
* * `cancelled` - Cancelled
* * `failed` - Failed */
- status?: HogFlowBatchJobStatusEnum;
+ status?: HogFlowBatchJobStateEnum;
/** ID of the workflow this batch run belongs to. */
hog_flow: string;
/** Audience snapshot the run fanned out to, taken from the workflow's batch trigger filters. */
@@ -42221,7 +42251,7 @@ export namespace Schemas {
* * `completed` - Completed
* * `cancelled` - Cancelled
* * `failed` - Failed */
- status: HogFlowBatchJobStatusEnum;
+ status: HogFlowBatchJobStateEnum;
/** In-flight runs newly flagged for cancellation by this request. */
marked: number;
/** In-flight runs of this batch not yet flagged. Non-zero on very large runs; call again. */
@@ -42299,7 +42329,7 @@ export namespace Schemas {
readonly name: string | null;
readonly description: string;
readonly version: number;
- readonly status: HogFlowStatusEnum;
+ readonly status: HogFlowStateEnum;
readonly created_at: string;
readonly created_by: UserBasic;
readonly updated_at: string;
@@ -46810,10 +46840,10 @@ export namespace Schemas {
* * `url` - URL
* * `file` - File
*/
- export type KnowledgeSourceSourceTypeEnum = typeof KnowledgeSourceSourceTypeEnum[keyof typeof KnowledgeSourceSourceTypeEnum];
+ export type SourceTypeEnum = typeof SourceTypeEnum[keyof typeof SourceTypeEnum];
- export const KnowledgeSourceSourceTypeEnum = {
+ export const SourceTypeEnum = {
Text: 'text',
Url: 'url',
File: 'file',
@@ -46825,10 +46855,10 @@ export namespace Schemas {
* * `ready` - Ready
* * `error` - Error
*/
- export type KnowledgeSourceStatusEnum = typeof KnowledgeSourceStatusEnum[keyof typeof KnowledgeSourceStatusEnum];
+ export type SourceStatusEnum = typeof SourceStatusEnum[keyof typeof SourceStatusEnum];
- export const KnowledgeSourceStatusEnum = {
+ export const SourceStatusEnum = {
Pending: 'pending',
Processing: 'processing',
Ready: 'ready',
@@ -46840,10 +46870,10 @@ export namespace Schemas {
* * `not_modified` - Not modified
* * `error` - Error
*/
- export type LastRefreshStatusEnum = typeof LastRefreshStatusEnum[keyof typeof LastRefreshStatusEnum];
+ export type RefreshStatusEnum = typeof RefreshStatusEnum[keyof typeof RefreshStatusEnum];
- export const LastRefreshStatusEnum = {
+ export const RefreshStatusEnum = {
Success: 'success',
NotModified: 'not_modified',
Error: 'error',
@@ -46871,8 +46901,8 @@ export namespace Schemas {
readonly id: string;
readonly team_id: number;
readonly name: string;
- readonly source_type: KnowledgeSourceSourceTypeEnum;
- readonly status: KnowledgeSourceStatusEnum;
+ readonly source_type: SourceTypeEnum;
+ readonly status: SourceStatusEnum;
readonly error_message: string;
/** Number of documents belonging to this source. */
readonly document_count: number;
@@ -46884,7 +46914,7 @@ export namespace Schemas {
readonly source_url: string;
/** @nullable */
readonly last_refresh_at: string | null;
- readonly last_refresh_status: LastRefreshStatusEnum;
+ readonly last_refresh_status: RefreshStatusEnum;
readonly last_refresh_error: string;
readonly refresh_interval: RefreshIntervalEnum;
/**
@@ -47899,10 +47929,10 @@ export namespace Schemas {
* * `above` - Above
* * `below` - Below
*/
- export type LogsAlertThresholdOperatorEnum = typeof LogsAlertThresholdOperatorEnum[keyof typeof LogsAlertThresholdOperatorEnum];
+ export type LogsAlertConfigurationThresholdOperatorEnum = typeof LogsAlertConfigurationThresholdOperatorEnum[keyof typeof LogsAlertConfigurationThresholdOperatorEnum];
- export const LogsAlertThresholdOperatorEnum = {
+ export const LogsAlertConfigurationThresholdOperatorEnum = {
Above: 'above',
Below: 'below',
} as const;
@@ -47966,7 +47996,7 @@ export namespace Schemas {
*
* * `above` - Above
* * `below` - Below */
- threshold_operator?: LogsAlertThresholdOperatorEnum;
+ threshold_operator?: LogsAlertConfigurationThresholdOperatorEnum;
/** Time window in minutes over which log entries are counted. Allowed values: 5, 10, 15, 30, 60. */
window_minutes?: number;
/** How often the alert is evaluated, in minutes. Server-managed. */
@@ -48086,7 +48116,7 @@ export namespace Schemas {
*
* * `above` - Above
* * `below` - Below */
- threshold_operator?: LogsAlertThresholdOperatorEnum;
+ threshold_operator?: LogsAlertConfigurationThresholdOperatorEnum;
/** Time window in minutes over which log entries are counted. Allowed values: 5, 10, 15, 30, 60. */
window_minutes?: number;
/** How often the alert is evaluated, in minutes. Server-managed. */
@@ -48262,7 +48292,7 @@ export namespace Schemas {
*
* * `above` - Above
* * `below` - Below */
- threshold_operator: LogsAlertThresholdOperatorEnum;
+ threshold_operator: LogsAlertConfigurationThresholdOperatorEnum;
/** Window size in minutes — determines bucket interval. */
window_minutes: number;
/**
@@ -48553,6 +48583,20 @@ export namespace Schemas {
issues: LogsAnomalyScanIssue[];
}
+ /**
+ * * `severity_sampling` - Severity-based reduction
+ * * `path_drop` - Path exclusion
+ * * `rate_limit` - Rate limit
+ */
+ export type LogsExclusionRuleRuleTypeEnum = typeof LogsExclusionRuleRuleTypeEnum[keyof typeof LogsExclusionRuleRuleTypeEnum];
+
+
+ export const LogsExclusionRuleRuleTypeEnum = {
+ SeveritySampling: 'severity_sampling',
+ PathDrop: 'path_drop',
+ RateLimit: 'rate_limit',
+ } as const;
+
/**
* * `log` - log
* * `resource` - resource
@@ -48702,20 +48746,6 @@ export namespace Schemas {
export type LogsSamplingRuleScopeAttributeFiltersItem = { [key: string]: unknown };
- /**
- * * `severity_sampling` - Severity-based reduction
- * * `path_drop` - Path exclusion
- * * `rate_limit` - Rate limit
- */
- export type RuleTypeEnum = typeof RuleTypeEnum[keyof typeof RuleTypeEnum];
-
-
- export const RuleTypeEnum = {
- SeveritySampling: 'severity_sampling',
- PathDrop: 'path_drop',
- RateLimit: 'rate_limit',
- } as const;
-
export interface LogsSamplingRule {
/** Unique identifier for this sampling rule. */
readonly id: string;
@@ -48737,7 +48767,7 @@ export namespace Schemas {
* * `severity_sampling` - Severity-based reduction
* * `path_drop` - Path exclusion
* * `rate_limit` - Rate limit */
- rule_type: RuleTypeEnum;
+ rule_type: LogsExclusionRuleRuleTypeEnum;
/**
* Optional legacy service-name scope; new rules use `config.filter_group` for matching instead.
* @maxLength 512
@@ -49553,6 +49583,24 @@ export namespace Schemas {
readonly updated_at: string;
}
+ /**
+ * * `results` - Results
+ * * `usability` - Usability
+ * * `bug` - Bug
+ * * `docs` - Docs
+ * * `other` - Other
+ */
+ export type MCPAnalyticsSubmissionFeedbackCategoryEnum = typeof MCPAnalyticsSubmissionFeedbackCategoryEnum[keyof typeof MCPAnalyticsSubmissionFeedbackCategoryEnum];
+
+
+ export const MCPAnalyticsSubmissionFeedbackCategoryEnum = {
+ Results: 'results',
+ Usability: 'usability',
+ Bug: 'bug',
+ Docs: 'docs',
+ Other: 'other',
+ } as const;
+
/**
* * `auto` - Auto-approved
* * `approved` - Approved
@@ -49627,24 +49675,6 @@ export namespace Schemas {
readonly count: number;
}
- /**
- * * `results` - Results
- * * `usability` - Usability
- * * `bug` - Bug
- * * `docs` - Docs
- * * `other` - Other
- */
- export type MCPFeedbackCreateCategoryEnum = typeof MCPFeedbackCreateCategoryEnum[keyof typeof MCPFeedbackCreateCategoryEnum];
-
-
- export const MCPFeedbackCreateCategoryEnum = {
- Results: 'results',
- Usability: 'usability',
- Bug: 'bug',
- Docs: 'docs',
- Other: 'other',
- } as const;
-
export interface MCPFeedbackCreate {
/**
* The tool the user tried before leaving feedback, if known.
@@ -49698,7 +49728,7 @@ export namespace Schemas {
* * `bug` - Bug
* * `docs` - Docs
* * `other` - Other */
- category?: MCPFeedbackCreateCategoryEnum;
+ category?: MCPAnalyticsSubmissionFeedbackCategoryEnum;
}
/**
@@ -51017,10 +51047,26 @@ export namespace Schemas {
bucket_overrides?: MaterializationPreviewRequestBucketOverrides;
}
+ /**
+ * * `1` - event
+ * * `2` - person
+ * * `3` - group
+ * * `4` - session
+ */
+ export type PropertyDefinitionTypeEnum = typeof PropertyDefinitionTypeEnum[keyof typeof PropertyDefinitionTypeEnum];
+
+
+ export const PropertyDefinitionTypeEnum = {
+ Number1: 1,
+ Number2: 2,
+ Number3: 3,
+ Number4: 4,
+ } as const;
+
export interface PropertyDefinition {
readonly id: string;
readonly name: string;
- readonly property_type: PropertyDefinitionTypeEnum | null;
+ readonly property_type: PropertyTypeEnum | null;
readonly type: PropertyDefinitionTypeEnum;
}
@@ -51063,25 +51109,11 @@ export namespace Schemas {
readonly updated_at: string;
}
- /**
- * * `pending` - Pending
- * * `completed` - Completed
- * * `skipped` - Skipped
- */
- export type ScrapingStatusEnum = typeof ScrapingStatusEnum[keyof typeof ScrapingStatusEnum];
-
-
- export const ScrapingStatusEnum = {
- Pending: 'pending',
- Completed: 'completed',
- Skipped: 'skipped',
- } as const;
-
export interface MaxCoreMemory {
readonly id: string;
/** @maxLength 10000 */
text: string;
- scraping_status?: ScrapingStatusEnum | BlankEnum | null;
+ scraping_status?: CoreMemoryScrapingStatusEnum | BlankEnum | null;
}
/**
@@ -51187,6 +51219,18 @@ export namespace Schemas {
sent_at: string;
}
+ /**
+ * * `marketing` - Marketing
+ * * `transactional` - Transactional
+ */
+ export type MessageCategoryTypeEnum = typeof MessageCategoryTypeEnum[keyof typeof MessageCategoryTypeEnum];
+
+
+ export const MessageCategoryTypeEnum = {
+ Marketing: 'marketing',
+ Transactional: 'transactional',
+ } as const;
+
export interface MessageCategory {
readonly id: string;
/** @maxLength 64 */
@@ -51195,7 +51239,7 @@ export namespace Schemas {
name: string;
description?: string;
public_description?: string;
- category_type?: CategoryTypeEnum;
+ category_type?: MessageCategoryTypeEnum;
readonly created_at: string;
readonly updated_at: string;
/** @nullable */
@@ -51227,10 +51271,10 @@ export namespace Schemas {
* * `MANUAL` - Manual
* * `COMPLAINT` - Complaint
*/
- export type MessageSuppressionSourceEnum = typeof MessageSuppressionSourceEnum[keyof typeof MessageSuppressionSourceEnum];
+ export type SuppressionSourceEnum = typeof SuppressionSourceEnum[keyof typeof SuppressionSourceEnum];
- export const MessageSuppressionSourceEnum = {
+ export const SuppressionSourceEnum = {
Bounce: 'BOUNCE',
Manual: 'MANUAL',
Complaint: 'COMPLAINT',
@@ -51246,7 +51290,7 @@ export namespace Schemas {
* * `BOUNCE` - Bounce
* * `MANUAL` - Manual
* * `COMPLAINT` - Complaint */
- readonly source: MessageSuppressionSourceEnum;
+ readonly source: SuppressionSourceEnum;
/**
* Human-readable reason for the suppression (e.g. 'Auto-suppressed after 5 consecutive soft bounces').
* @nullable
@@ -51471,16 +51515,6 @@ export namespace Schemas {
models: ModelChoice[];
}
- /**
- * * `FeatureFlag` - feature flag
- */
- export type ModelNameEnum = typeof ModelNameEnum[keyof typeof ModelNameEnum];
-
-
- export const ModelNameEnum = {
- FeatureFlag: 'FeatureFlag',
- } as const;
-
export interface MonitorStats {
/** Succeeded observations whose verdict was `yes`. */
yes_total: number;
@@ -51507,20 +51541,6 @@ export namespace Schemas {
value: unknown;
}
- /**
- * * `trusted` - Trusted
- * * `full` - Full
- * * `custom` - Custom
- */
- export type NetworkAccessLevelEnum = typeof NetworkAccessLevelEnum[keyof typeof NetworkAccessLevelEnum];
-
-
- export const NetworkAccessLevelEnum = {
- Trusted: 'trusted',
- Full: 'full',
- Custom: 'custom',
- } as const;
-
/**
* * `run_was_efficient` - run_was_efficient
* * `too_short_to_judge` - too_short_to_judge
@@ -52839,16 +52859,28 @@ export namespace Schemas {
* * `6` - install
* * `9` - root
*/
- export type PluginsAccessLevelEnum = typeof PluginsAccessLevelEnum[keyof typeof PluginsAccessLevelEnum];
+ export type OrganizationPluginsAccessLevelEnum = typeof OrganizationPluginsAccessLevelEnum[keyof typeof OrganizationPluginsAccessLevelEnum];
- export const PluginsAccessLevelEnum = {
+ export const OrganizationPluginsAccessLevelEnum = {
Number0: 0,
Number3: 3,
Number6: 6,
Number9: 9,
} as const;
+ /**
+ * * `bayesian` - Bayesian
+ * * `frequentist` - Frequentist
+ */
+ export type OrganizationDefaultExperimentStatsMethodEnum = typeof OrganizationDefaultExperimentStatsMethodEnum[keyof typeof OrganizationDefaultExperimentStatsMethodEnum];
+
+
+ export const OrganizationDefaultExperimentStatsMethodEnum = {
+ Bayesian: 'bayesian',
+ Frequentist: 'frequentist',
+ } as const;
+
export interface Organization {
readonly id: string;
/** @maxLength 64 */
@@ -52860,7 +52892,7 @@ export namespace Schemas {
readonly created_at: string;
readonly updated_at: string;
readonly membership_level: OrganizationMembershipLevelEnum;
- readonly plugins_access_level: PluginsAccessLevelEnum;
+ readonly plugins_access_level: OrganizationPluginsAccessLevelEnum;
readonly teams: readonly OrganizationTeamsItem[];
readonly projects: readonly OrganizationProjectsItem[];
/** @nullable */
@@ -52917,7 +52949,7 @@ export namespace Schemas {
*
* * `bayesian` - Bayesian
* * `frequentist` - Frequentist */
- default_experiment_stats_method?: DefaultExperimentStatsMethodEnum | BlankEnum | null;
+ default_experiment_stats_method?: OrganizationDefaultExperimentStatsMethodEnum | BlankEnum | null;
/** Default setting for 'Discard client IP data' for new projects in this organization. */
default_anonymize_ips?: boolean;
/**
@@ -53284,56 +53316,6 @@ export namespace Schemas {
removed_members: number;
}
- /**
- * * `onboarding` - Onboarding
- * * `error_tracking` - Error Tracking
- * * `eval_clusters` - Eval Clusters
- * * `user_created` - User Created
- * * `slack` - Slack
- * * `support_queue` - Support Queue
- * * `session_summaries` - Session Summaries
- * * `posthog_ai` - PostHog AI
- * * `experiments` - Experiments
- * * `signal_report` - Signal Report
- * * `signals_scout` - Signals Scout
- * * `scout_suggestions` - Signals Scout Suggestions
- * * `support_reply` - Support Reply
- * * `hogdesk` - HogDesk
- * * `review_hog` - ReviewHog
- * * `image_builder` - Image Builder
- * * `loop` - Loop
- * * `mcp_analytics` - MCP Analytics
- * * `signals_chat` - Signals Chat
- * * `task_analysis` - Task Analysis
- * * `workflow` - Workflow
- */
- export type OriginProductEnum = typeof OriginProductEnum[keyof typeof OriginProductEnum];
-
-
- export const OriginProductEnum = {
- Onboarding: 'onboarding',
- ErrorTracking: 'error_tracking',
- EvalClusters: 'eval_clusters',
- UserCreated: 'user_created',
- Slack: 'slack',
- SupportQueue: 'support_queue',
- SessionSummaries: 'session_summaries',
- PosthogAi: 'posthog_ai',
- Experiments: 'experiments',
- SignalReport: 'signal_report',
- SignalsScout: 'signals_scout',
- ScoutSuggestions: 'scout_suggestions',
- SupportReply: 'support_reply',
- Hogdesk: 'hogdesk',
- ReviewHog: 'review_hog',
- ImageBuilder: 'image_builder',
- Loop: 'loop',
- McpAnalytics: 'mcp_analytics',
- SignalsChat: 'signals_chat',
- TaskAnalysis: 'task_analysis',
- Workflow: 'workflow',
- } as const;
-
/**
* * `gauge` - gauge
* * `sum` - sum
@@ -56108,6 +56090,16 @@ export namespace Schemas {
results: SandboxEnvironmentDTO[];
}
+ /**
+ * * `FeatureFlag` - feature flag
+ */
+ export type ScheduledChangeAllowedModelsEnum = typeof ScheduledChangeAllowedModelsEnum[keyof typeof ScheduledChangeAllowedModelsEnum];
+
+
+ export const ScheduledChangeAllowedModelsEnum = {
+ FeatureFlag: 'FeatureFlag',
+ } as const;
+
/**
* * `daily` - daily
* * `weekly` - weekly
@@ -56135,7 +56127,7 @@ export namespace Schemas {
/** The type of record to modify. Currently only "FeatureFlag" is supported.
*
* * `FeatureFlag` - feature flag */
- model_name: ModelNameEnum;
+ model_name: ScheduledChangeAllowedModelsEnum;
/** The change to apply. Must include an 'operation' key and a 'value' key. Supported operations: 'update_status' (value: true/false to enable/disable the flag), 'add_release_condition' (value: object with 'groups', 'payloads', and 'multivariate' keys), 'update_variants' (value: object with 'variants' and 'payloads' keys). */
payload: unknown;
/** ISO 8601 datetime when the change should be applied (e.g. '2025-06-01T14:00:00Z'). */
@@ -56195,13 +56187,27 @@ export namespace Schemas {
results: SchemaPropertyGroup[];
}
+ /**
+ * * `categorical` - categorical
+ * * `numeric` - numeric
+ * * `boolean` - boolean
+ */
+ export type ScoreDefinitionKindEnum = typeof ScoreDefinitionKindEnum[keyof typeof ScoreDefinitionKindEnum];
+
+
+ export const ScoreDefinitionKindEnum = {
+ Categorical: 'categorical',
+ Numeric: 'numeric',
+ Boolean: 'boolean',
+ } as const;
+
export type ScoreDefinitionConfig = CategoricalScoreDefinitionConfig | NumericScoreDefinitionConfig | BooleanScoreDefinitionConfig;
export interface ScoreDefinition {
readonly id: string;
readonly name: string;
readonly description: string;
- readonly kind: ExperimentMetricKindEnum;
+ readonly kind: ScoreDefinitionKindEnum;
readonly archived: boolean;
/** Current immutable configuration version number. */
readonly current_version: number;
@@ -56344,10 +56350,10 @@ export namespace Schemas {
* * `collection` - Collection
* * `filters` - Filters
*/
- export type SessionRecordingPlaylistTypeEnum = typeof SessionRecordingPlaylistTypeEnum[keyof typeof SessionRecordingPlaylistTypeEnum];
+ export type SessionRecordingPlaylistPlaylistTypeEnum = typeof SessionRecordingPlaylistPlaylistTypeEnum[keyof typeof SessionRecordingPlaylistPlaylistTypeEnum];
- export const SessionRecordingPlaylistTypeEnum = {
+ export const SessionRecordingPlaylistPlaylistTypeEnum = {
Collection: 'collection',
Filters: 'filters',
} as const;
@@ -56385,7 +56391,7 @@ export namespace Schemas {
*
* * `collection` - Collection
* * `filters` - Filters */
- type?: SessionRecordingPlaylistTypeEnum | null;
+ type?: SessionRecordingPlaylistPlaylistTypeEnum | null;
/** Return whether this is a synthetic playlist */
readonly is_synthetic: boolean;
_create_in_folder?: string;
@@ -56419,10 +56425,10 @@ export namespace Schemas {
* * `code_review` - Code Review
* * `related_to` - Related To
*/
- export type SignalReportArtefactTypeEnum = typeof SignalReportArtefactTypeEnum[keyof typeof SignalReportArtefactTypeEnum];
+ export type SignalReportArtefactArtefactTypeEnum = typeof SignalReportArtefactArtefactTypeEnum[keyof typeof SignalReportArtefactArtefactTypeEnum];
- export const SignalReportArtefactTypeEnum = {
+ export const SignalReportArtefactArtefactTypeEnum = {
VideoSegment: 'video_segment',
SafetyJudgment: 'safety_judgment',
ActionabilityJudgment: 'actionability_judgment',
@@ -56454,7 +56460,7 @@ export namespace Schemas {
export interface SignalReportArtefact {
readonly id: string;
- readonly type: SignalReportArtefactTypeEnum;
+ readonly type: SignalReportArtefactArtefactTypeEnum;
readonly content: SignalReportArtefactContent;
readonly created_at: string;
/** @nullable */
@@ -56519,6 +56525,18 @@ export namespace Schemas {
Other: 'other',
} as const;
+ /**
+ * * `excluded` - Excluded
+ * * `credited` - Credited
+ */
+ export type SignalReportRefundBillingPathEnum = typeof SignalReportRefundBillingPathEnum[keyof typeof SignalReportRefundBillingPathEnum];
+
+
+ export const SignalReportRefundBillingPathEnum = {
+ Excluded: 'excluded',
+ Credited: 'credited',
+ } as const;
+
export interface SignalReportRefund {
readonly id: string;
/** Why the user refunded this PR (feeds the refund review).
@@ -56534,7 +56552,7 @@ export namespace Schemas {
*
* * `excluded` - Excluded
* * `credited` - Credited */
- readonly billing_path: BillingPathEnum;
+ readonly billing_path: SignalReportRefundBillingPathEnum;
/** Signals credits refunded (flat per-PR charge snapshot; 1 credit = $0.01). */
readonly credits: number;
/** The refunded implementation PR's GitHub URL, snapshotted at refund time. */
@@ -56563,6 +56581,20 @@ export namespace Schemas {
OutOfPeriod: 'out_of_period',
} as const;
+ /**
+ * * `posthog_health_check` - PostHog health check
+ * * `posthog_onboarding` - PostHog onboarding
+ * * `posthog_system` - PostHog system
+ */
+ export type SignalReportBillingExemptReasonEnum = typeof SignalReportBillingExemptReasonEnum[keyof typeof SignalReportBillingExemptReasonEnum];
+
+
+ export const SignalReportBillingExemptReasonEnum = {
+ PosthogHealthCheck: 'posthog_health_check',
+ PosthogOnboarding: 'posthog_onboarding',
+ PosthogSystem: 'posthog_system',
+ } as const;
+
export interface SignalReport {
readonly id: string;
/** @nullable */
@@ -56629,7 +56661,7 @@ export namespace Schemas {
* * `posthog_health_check` - PostHog health check
* * `posthog_onboarding` - PostHog onboarding
* * `posthog_system` - PostHog system */
- readonly billing_exempt_reason: BillingExemptReasonEnum | null;
+ readonly billing_exempt_reason: SignalReportBillingExemptReasonEnum | null;
/**
* The space (task channel) this report is assigned to, or null when unassigned. The general view lists every report regardless of this value.
* @nullable
@@ -57089,10 +57121,10 @@ export namespace Schemas {
* * `dashboard` - Dashboard
* * `ai_prompt` - AI prompt
*/
- export type ResourceTypeEnum = typeof ResourceTypeEnum[keyof typeof ResourceTypeEnum];
+ export type SubscriptionResourceTypeEnum = typeof SubscriptionResourceTypeEnum[keyof typeof SubscriptionResourceTypeEnum];
- export const ResourceTypeEnum = {
+ export const SubscriptionResourceTypeEnum = {
Insight: 'insight',
Dashboard: 'dashboard',
AiPrompt: 'ai_prompt',
@@ -57102,10 +57134,10 @@ export namespace Schemas {
* * `email` - Email
* * `slack` - Slack
*/
- export type TargetTypeEnum = typeof TargetTypeEnum[keyof typeof TargetTypeEnum];
+ export type SubscriptionTargetEnum = typeof SubscriptionTargetEnum[keyof typeof SubscriptionTargetEnum];
- export const TargetTypeEnum = {
+ export const SubscriptionTargetEnum = {
Email: 'email',
Slack: 'slack',
} as const;
@@ -57142,7 +57174,7 @@ export namespace Schemas {
* * `insight` - Insight
* * `dashboard` - Dashboard
* * `ai_prompt` - AI prompt */
- readonly resource_type: ResourceTypeEnum;
+ readonly resource_type: SubscriptionResourceTypeEnum;
/**
* Dashboard ID to subscribe to (mutually exclusive with insight on create).
* @nullable
@@ -57170,7 +57202,7 @@ export namespace Schemas {
*
* * `email` - Email
* * `slack` - Slack */
- target_type: TargetTypeEnum;
+ target_type: SubscriptionTargetEnum;
/** Recipient(s): comma-separated email addresses for email, or Slack channel name/ID for slack. */
target_value: string;
/** How often to deliver: daily, weekly, monthly, or yearly.
@@ -57266,10 +57298,10 @@ export namespace Schemas {
* * `external_survey` - external survey
* * `api` - api
*/
- export type SurveyType = typeof SurveyType[keyof typeof SurveyType];
+ export type SurveyTypeEnum = typeof SurveyTypeEnum[keyof typeof SurveyTypeEnum];
- export const SurveyType = {
+ export const SurveyTypeEnum = {
Popover: 'popover',
Widget: 'widget',
ExternalSurvey: 'external_survey',
@@ -57281,10 +57313,10 @@ export namespace Schemas {
* * `week` - week
* * `month` - month
*/
- export type ResponseSamplingIntervalTypeEnum = typeof ResponseSamplingIntervalTypeEnum[keyof typeof ResponseSamplingIntervalTypeEnum];
+ export type SurveySamplingIntervalTypeEnum = typeof SurveySamplingIntervalTypeEnum[keyof typeof SurveySamplingIntervalTypeEnum];
- export const ResponseSamplingIntervalTypeEnum = {
+ export const SurveySamplingIntervalTypeEnum = {
Day: 'day',
Week: 'week',
Month: 'month',
@@ -57305,7 +57337,7 @@ export namespace Schemas {
/** @maxLength 400 */
name: string;
description?: string;
- type: SurveyType;
+ type: SurveyTypeEnum;
/** @nullable */
schedule?: string | null;
readonly linked_flag: MinimalFeatureFlag;
@@ -57469,7 +57501,7 @@ export namespace Schemas {
current_iteration_start_date?: string | null;
/** @nullable */
response_sampling_start_date?: string | null;
- response_sampling_interval_type?: ResponseSamplingIntervalTypeEnum | BlankEnum | null;
+ response_sampling_interval_type?: SurveySamplingIntervalTypeEnum | BlankEnum | null;
/**
* @minimum 0
* @maximum 2147483647
@@ -57512,50 +57544,6 @@ export namespace Schemas {
results: Survey[];
}
- /**
- * * `CSV` - CSV
- * * `CSVWithNames` - CSVWithNames
- * * `Parquet` - Parquet
- * * `JSONEachRow` - JSON
- * * `Delta` - Delta
- * * `DeltaS3Wrapper` - DeltaS3Wrapper
- */
- export type TableFormatEnum = typeof TableFormatEnum[keyof typeof TableFormatEnum];
-
-
- export const TableFormatEnum = {
- Csv: 'CSV',
- CSVWithNames: 'CSVWithNames',
- Parquet: 'Parquet',
- JSONEachRow: 'JSONEachRow',
- Delta: 'Delta',
- DeltaS3Wrapper: 'DeltaS3Wrapper',
- } as const;
-
- /**
- * * `web` - web
- * * `api` - api
- * * `mcp` - mcp
- * * `wizard` - wizard
- * * `self_driving` - self_driving
- * * `source` - source
- * * `materialized_view` - materialized_view
- * * `demo` - demo
- */
- export type TableCreatedViaEnum = typeof TableCreatedViaEnum[keyof typeof TableCreatedViaEnum];
-
-
- export const TableCreatedViaEnum = {
- Web: 'web',
- Api: 'api',
- Mcp: 'mcp',
- Wizard: 'wizard',
- SelfDriving: 'self_driving',
- Source: 'source',
- MaterializedView: 'materialized_view',
- Demo: 'demo',
- } as const;
-
export interface SimpleExternalDataSourceSerializers {
readonly id: string;
readonly created_at: string;
@@ -57602,7 +57590,7 @@ export namespace Schemas {
* * `JSONEachRow` - JSON
* * `Delta` - Delta
* * `DeltaS3Wrapper` - DeltaS3Wrapper */
- format: TableFormatEnum;
+ format: DataWarehouseTableFormatEnum;
readonly created_by: UserBasic;
readonly created_at: string;
/** Where the table came from: `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup agent, `self_driving` for a self-driving run, `source` for a table a data source syncs, `materialized_view` for the table behind a materialized view, and `demo` for a demo project's sample table. Set server-side from the request, never from the request body. Null on tables created before this was recorded.
@@ -57615,7 +57603,7 @@ export namespace Schemas {
* * `source` - source
* * `materialized_view` - materialized_view
* * `demo` - demo */
- readonly created_via: TableCreatedViaEnum | null;
+ readonly created_via: DataWarehouseTableCreatedViaEnum | null;
/**
* HTTPS URL of the files to read, with `*` matching any part of a path segment (e.g. `https://your-bucket.s3.amazonaws.com/orders/*.parquet`). All matched files are read as one table. Must point at a bucket you control, not at PostHog's own storage.
* @maxLength 500
@@ -58012,7 +58000,7 @@ export namespace Schemas {
*
* * `acp` - ACP
* * `pi` - Pi */
- runtime: RuntimeEnum;
+ runtime: TaskRuntimeEnum;
/** @nullable */
repository: string | null;
repositories: string[];
@@ -58294,7 +58282,7 @@ export namespace Schemas {
export interface Ticket {
readonly id: string;
readonly ticket_number: number;
- readonly channel_source: ChannelSourceEnum;
+ readonly channel_source: ChannelEnum;
readonly channel_detail: ChannelDetailEnum | null;
readonly distinct_id: string;
/** Ticket status: new, open, pending, on_hold, or resolved
@@ -58837,6 +58825,18 @@ export namespace Schemas {
results: UserGitHubIntegrationListResponse[];
}
+ /**
+ * * `abandoned` - Abandoned
+ * * `off-topic` - Off-topic
+ */
+ export type UserInterviewClassificationEnum = typeof UserInterviewClassificationEnum[keyof typeof UserInterviewClassificationEnum];
+
+
+ export const UserInterviewClassificationEnum = {
+ Abandoned: 'abandoned',
+ OffTopic: 'off-topic',
+ } as const;
+
export interface UserInterview {
readonly id: string;
readonly created_by: UserBasic;
@@ -58849,7 +58849,7 @@ export namespace Schemas {
readonly transcript: string;
summary?: string;
/** Searchable classifications on the response. `abandoned` is auto-derived from the transcript when the interview is recorded; `off-topic` is set manually. Sending `classifications` on an update replaces the whole list — pass the full desired set, not a delta. */
- classifications?: ClassificationsEnum[];
+ classifications?: UserInterviewClassificationEnum[];
audio: string;
}
@@ -59141,28 +59141,14 @@ export namespace Schemas {
* * `schedule` - Schedule
* * `threshold` - Threshold
*/
- export type VisionActionTriggerTypeEnum = typeof VisionActionTriggerTypeEnum[keyof typeof VisionActionTriggerTypeEnum];
+ export type TriggerTypeEnum = typeof TriggerTypeEnum[keyof typeof TriggerTypeEnum];
- export const VisionActionTriggerTypeEnum = {
+ export const TriggerTypeEnum = {
Schedule: 'schedule',
Threshold: 'threshold',
} as const;
- /**
- * * `group_summary` - Group summary
- * * `alert` - Alert
- * * `per_observation` - Per observation
- */
- export type VisionActionModeEnum = typeof VisionActionModeEnum[keyof typeof VisionActionModeEnum];
-
-
- export const VisionActionModeEnum = {
- GroupSummary: 'group_summary',
- Alert: 'alert',
- PerObservation: 'per_observation',
- } as const;
-
/**
* Schedule trigger parameters. Threshold triggers are reserved and rejected at the API for now.
*/
@@ -59235,13 +59221,13 @@ export namespace Schemas {
*
* * `schedule` - Schedule
* * `threshold` - Threshold */
- trigger_type?: VisionActionTriggerTypeEnum;
+ trigger_type?: TriggerTypeEnum;
/** What the action produces. MVP supports 'group_summary' only.
*
* * `group_summary` - Group summary
* * `alert` - Alert
* * `per_observation` - Per observation */
- mode?: VisionActionModeEnum;
+ mode?: ActionModeEnum;
/** Trigger parameters. For schedule triggers: {rrule, timezone}. */
trigger_config?: TriggerConfig;
/** Targeting predicate: which of the scanner's observations this action runs on. */
@@ -59341,10 +59327,10 @@ export namespace Schemas {
* * `metric` - Metric
* * `match` - Match
*/
- export type VisionAlertConfigurationKindEnum = typeof VisionAlertConfigurationKindEnum[keyof typeof VisionAlertConfigurationKindEnum];
+ export type VisionAlertKindEnum = typeof VisionAlertKindEnum[keyof typeof VisionAlertKindEnum];
- export const VisionAlertConfigurationKindEnum = {
+ export const VisionAlertKindEnum = {
Metric: 'metric',
Match: 'match',
} as const;
@@ -59372,10 +59358,10 @@ export namespace Schemas {
* * `count` - Count matching observations
* * `avg_score` - Average score
*/
- export type VisionAlertConfigurationMetricEnum = typeof VisionAlertConfigurationMetricEnum[keyof typeof VisionAlertConfigurationMetricEnum];
+ export type VisionAlertMetricEnum = typeof VisionAlertMetricEnum[keyof typeof VisionAlertMetricEnum];
- export const VisionAlertConfigurationMetricEnum = {
+ export const VisionAlertMetricEnum = {
Count: 'count',
AvgScore: 'avg_score',
} as const;
@@ -59396,14 +59382,14 @@ export namespace Schemas {
*
* * `metric` - Metric
* * `match` - Match */
- kind: VisionAlertConfigurationKindEnum;
+ kind: VisionAlertKindEnum;
/** Which observations count. Empty matches every observation of the scanner. */
selection?: VisionAlertSelection;
/** Metric alerts only: what to measure over the window. 'avg_score' requires a scorer scanner.
*
* * `count` - Count matching observations
* * `avg_score` - Average score */
- metric?: VisionAlertConfigurationMetricEnum;
+ metric?: VisionAlertMetricEnum;
/** Metric alerts only: whether the alert fires at or above, or at or below, the threshold.
*
* * `above` - At or above
@@ -59560,7 +59546,7 @@ export namespace Schemas {
* * `canonical` - Canonical
* * `ai_generated` - AI generated
* * `user_edited` - User edited */
- readonly description_source: DescriptionSourceEnum;
+ readonly description_source: WarehouseColumnAnnotationDescriptionSourceEnum;
/** Model used when the description was AI-generated, otherwise null. */
readonly ai_model: string;
/** True once a user has edited this annotation; such rows are never overwritten. */
@@ -60060,7 +60046,7 @@ export namespace Schemas {
*
* * `USR` - user
* * `GIT` - GitHub */
- creation_type?: CreationTypeEnum;
+ creation_type?: AnnotationCreationTypeEnum;
/**
* Optional insight ID to attach this annotation to. Must belong to the current project.
* @nullable
@@ -60239,7 +60225,7 @@ export namespace Schemas {
*
* * `spend` - Spend
* * `projected_spend` - Projected spend */
- metric?: BillingAlertMetricEnum;
+ metric?: BillingAlertConfigurationMetricEnum;
/** Server-controlled currency for spend values.
*
* * `USD` - USD */
@@ -60251,7 +60237,7 @@ export namespace Schemas {
* * `relative_increase` - Relative increase
* * `absolute_value` - Absolute value
* * `absolute_increase` - Absolute increase */
- threshold_type?: ThresholdTypeEnum;
+ threshold_type?: BillingAlertConfigurationThresholdTypeEnum;
/**
* Reserved for future increase-over-baseline rules. Not used by absolute value alerts.
* @nullable
@@ -60288,7 +60274,7 @@ export namespace Schemas {
* * `errored` - Errored
* * `snoozed` - Snoozed
* * `broken` - Broken */
- readonly state?: BillingAlertStateEnum;
+ readonly state?: BillingAlertConfigurationStateEnum;
/**
* Minimum hours between repeated firing notifications.
* @minimum 0
@@ -60571,7 +60557,7 @@ export namespace Schemas {
export interface PatchedConversation {
readonly id?: string;
- readonly status?: ConversationStatus;
+ readonly status?: ConversationStatusEnum;
/**
* Title of the conversation.
* @nullable
@@ -60588,13 +60574,13 @@ export namespace Schemas {
* * `error_tracking` - Error tracking
* * `data_warehouse` - Data warehouse
* * `other` - Other */
- readonly topic?: TopicEnum | null;
+ readonly topic?: ConversationTopicEnum | null;
readonly user?: UserBasic;
/** @nullable */
readonly created_at?: string | null;
/** @nullable */
readonly updated_at?: string | null;
- readonly type?: ConversationType;
+ readonly type?: ConversationTypeEnum;
/**
* Whether this conversation was created during an impersonated session (e.g., by support agents). Internal conversations are hidden from customers.
* @nullable
@@ -60618,7 +60604,7 @@ export namespace Schemas {
*
* * `langgraph` - LangGraph
* * `sandbox` - Sandbox */
- readonly agent_runtime?: AgentRuntimeEnum;
+ readonly agent_runtime?: ConversationAgentRuntimeEnum;
readonly is_sandbox?: boolean;
/** Return pending approval cards as structured data.
*
@@ -61171,7 +61157,7 @@ export namespace Schemas {
* * `Completed` - Completed
* * `Failed` - Failed
* * `Running` - Running */
- readonly status?: SavedQueryStatusEnum | null;
+ readonly status?: DataWarehouseSavedQueryStatusEnum | null;
/** @nullable */
readonly last_run_at?: string | null;
/** @nullable */
@@ -61212,7 +61198,7 @@ export namespace Schemas {
* * `data_warehouse` - Data Warehouse
* * `endpoint` - Endpoint
* * `managed_viewset` - Managed Viewset */
- readonly origin?: OriginEnum | null;
+ readonly origin?: DataWarehouseSavedQueryOriginEnum | null;
/** Whether this view is for testing only and will auto-expire. */
is_test?: boolean;
/**
@@ -61250,7 +61236,7 @@ export namespace Schemas {
* * `canonical` - Canonical
* * `ai_generated` - AI generated
* * `user_edited` - User edited */
- readonly description_source?: DescriptionSourceEnum;
+ readonly description_source?: WarehouseColumnAnnotationDescriptionSourceEnum;
/** Model used when the description was AI-generated, otherwise null. */
readonly ai_model?: string;
/** True once a user has edited this annotation; such rows are never overwritten. */
@@ -61532,7 +61518,7 @@ export namespace Schemas {
readonly verified_by?: UserBasic;
/** @nullable */
hidden?: boolean | null;
- enforcement_mode?: EnforcementModeEnum;
+ enforcement_mode?: SchemaEnforcementModeEnum;
/**
* Name of a single property on this event that PostHog UIs should display alongside the event (for example `$pathname` on `$pageview`). When set, surfaces like the session replay inspector show the property's value next to the event name without the user having to open the event.
* @maxLength 400
@@ -61563,7 +61549,7 @@ export namespace Schemas {
readonly updated_by?: UserBasic;
/** @nullable */
readonly is_seen_on_filtered_events?: boolean | null;
- property_type?: PropertyDefinitionTypeEnum | BlankEnum | null;
+ property_type?: PropertyTypeEnum | BlankEnum | null;
verified?: boolean;
/** @nullable */
readonly verified_at?: string | null;
@@ -61878,7 +61864,7 @@ export namespace Schemas {
/** Whether the evaluation runs automatically on new $ai_generation events. */
enabled?: boolean;
readonly status?: EvaluationStatusEnum;
- readonly status_reason?: StatusReasonEnum | null;
+ readonly status_reason?: EvaluationStatusReasonEnum | null;
/**
* Additional detail for the current system-disabled status. This is only populated when the detail is safe to show in the evaluation UI.
* @nullable
@@ -62309,7 +62295,7 @@ export namespace Schemas {
* * `webhook` - webhook
* * `cdc` - cdc
* * `xmin` - xmin */
- sync_type?: SyncTypeEnum | null;
+ sync_type?: ExternalDataSchemaSyncTypeEnum | null;
/**
* Column name used to track sync progress.
* @nullable
@@ -62419,7 +62405,7 @@ export namespace Schemas {
* * `mcp` - mcp
* * `wizard` - wizard
* * `self_driving` - self_driving */
- created_via?: ExternalDataSourceSerializersCreatedViaEnum | null;
+ created_via?: ExternalDataSourceCreatedViaEnum | null;
readonly status?: string;
client_secret?: string;
account_id?: string;
@@ -62436,7 +62422,7 @@ export namespace Schemas {
* @nullable
*/
description?: string | null;
- readonly access_method?: AccessMethodEnum;
+ readonly access_method?: ExternalDataSourceAccessMethodEnum;
/** Whether this synced source is also live-queryable via direct connection. Defaults to false for new sources; ignored for pure direct-query sources. */
direct_query_enabled?: boolean;
/** Automatically enable syncing for schemas discovered on this source after creation, on both the scheduled discovery pass and manual schema refreshes. Defaults to false. Not supported for direct-query sources. */
@@ -62572,7 +62558,7 @@ export namespace Schemas {
* * `high` - High
* * `medium` - Medium
* * `low` - Low */
- request_priority?: RequestPriorityEnum | null;
+ request_priority?: FeatureRequestPriorityEnum | null;
}
/**
@@ -62783,7 +62769,7 @@ export namespace Schemas {
*
* * `count` - count
* * `sum` - sum */
- math?: MathEnum;
+ math?: GroupUsageMetricMathEnum;
/**
* Required when `math` is `sum`; must be empty when `math` is `count`. For events metrics this is an event property name. For data warehouse metrics this is the column name (or HogQL expression) to sum on the DW table.
* @maxLength 255
@@ -62863,7 +62849,7 @@ export namespace Schemas {
* * `draft` - Draft
* * `active` - Active
* * `archived` - Archived */
- status?: HogFlowStatusEnum;
+ status?: HogFlowStateEnum;
readonly created_at?: string;
readonly created_by?: UserBasic;
readonly updated_at?: string;
@@ -63261,7 +63247,7 @@ export namespace Schemas {
readonly last_modified_by?: UserBasic;
readonly is_sample?: boolean;
readonly effective_restriction_level?: RestrictionLevelEnum;
- readonly effective_privilege_level?: EffectivePrivilegeLevelEnum;
+ readonly effective_privilege_level?: PrivilegeLevelEnum;
/**
* The effective access level the user has for this object
* @nullable
@@ -63533,7 +63519,7 @@ export namespace Schemas {
*
* * `above` - Above
* * `below` - Below */
- threshold_operator?: LogsAlertThresholdOperatorEnum;
+ threshold_operator?: LogsAlertConfigurationThresholdOperatorEnum;
/** Time window in minutes over which log entries are counted. Allowed values: 5, 10, 15, 30, 60. */
window_minutes?: number;
/** How often the alert is evaluated, in minutes. Server-managed. */
@@ -63697,7 +63683,7 @@ export namespace Schemas {
* * `severity_sampling` - Severity-based reduction
* * `path_drop` - Path exclusion
* * `rate_limit` - Rate limit */
- rule_type?: RuleTypeEnum;
+ rule_type?: LogsExclusionRuleRuleTypeEnum;
/**
* Optional legacy service-name scope; new rules use `config.filter_group` for matching instead.
* @maxLength 512
@@ -63906,7 +63892,7 @@ export namespace Schemas {
readonly id?: string;
/** @maxLength 10000 */
text?: string;
- scraping_status?: ScrapingStatusEnum | BlankEnum | null;
+ scraping_status?: CoreMemoryScrapingStatusEnum | BlankEnum | null;
}
export interface PatchedMessageCategory {
@@ -63917,7 +63903,7 @@ export namespace Schemas {
name?: string;
description?: string;
public_description?: string;
- category_type?: CategoryTypeEnum;
+ category_type?: MessageCategoryTypeEnum;
readonly created_at?: string;
readonly updated_at?: string;
/** @nullable */
@@ -64081,7 +64067,7 @@ export namespace Schemas {
readonly created_at?: string;
readonly updated_at?: string;
readonly membership_level?: OrganizationMembershipLevelEnum;
- readonly plugins_access_level?: PluginsAccessLevelEnum;
+ readonly plugins_access_level?: OrganizationPluginsAccessLevelEnum;
readonly teams?: readonly PatchedOrganizationTeamsItem[];
readonly projects?: readonly PatchedOrganizationProjectsItem[];
/** @nullable */
@@ -64138,7 +64124,7 @@ export namespace Schemas {
*
* * `bayesian` - Bayesian
* * `frequentist` - Frequentist */
- default_experiment_stats_method?: DefaultExperimentStatsMethodEnum | BlankEnum | null;
+ default_experiment_stats_method?: OrganizationDefaultExperimentStatsMethodEnum | BlankEnum | null;
/** Default setting for 'Discard client IP data' for new projects in this organization. */
default_anonymize_ips?: boolean;
/**
@@ -65596,10 +65582,10 @@ export namespace Schemas {
* * `should_fix` - Should Fix
* * `must_fix` - Must Fix
*/
- export type UrgencyThresholdEnum = typeof UrgencyThresholdEnum[keyof typeof UrgencyThresholdEnum];
+ export type ReviewUserSettingsUrgencyThresholdEnum = typeof ReviewUserSettingsUrgencyThresholdEnum[keyof typeof ReviewUserSettingsUrgencyThresholdEnum];
- export const UrgencyThresholdEnum = {
+ export const ReviewUserSettingsUrgencyThresholdEnum = {
Consider: 'consider',
ShouldFix: 'should_fix',
MustFix: 'must_fix',
@@ -65619,7 +65605,7 @@ export namespace Schemas {
* * `consider` - Consider
* * `should_fix` - Should Fix
* * `must_fix` - Must Fix */
- urgency_threshold?: UrgencyThresholdEnum;
+ urgency_threshold?: ReviewUserSettingsUrgencyThresholdEnum;
/** Whether reviews can be started from this project's Code review page (the UI trigger is limited to the designated ReviewHog teams while the product is in alpha). */
readonly can_trigger_reviews?: boolean;
/** Whether this project has at least one synced, enabled Stamphog repository. When false, the stamphog_review_inbox_prs toggle has nothing to act on and the UI renders it disabled with a pointer to connect the Stamphog GitHub App. */
@@ -65658,6 +65644,20 @@ export namespace Schemas {
description?: string;
}
+ /**
+ * * `trusted` - Trusted
+ * * `full` - Full
+ * * `custom` - Custom
+ */
+ export type SandboxEnvironmentNetworkAccessLevelEnum = typeof SandboxEnvironmentNetworkAccessLevelEnum[keyof typeof SandboxEnvironmentNetworkAccessLevelEnum];
+
+
+ export const SandboxEnvironmentNetworkAccessLevelEnum = {
+ Trusted: 'trusted',
+ Full: 'full',
+ Custom: 'custom',
+ } as const;
+
/**
* Request body for creating or updating a sandbox environment.
*/
@@ -65672,7 +65672,7 @@ export namespace Schemas {
* * `trusted` - Trusted
* * `full` - Full
* * `custom` - Custom */
- network_access_level?: NetworkAccessLevelEnum;
+ network_access_level?: SandboxEnvironmentNetworkAccessLevelEnum;
/**
* Allowed domains for custom network access.
* @maxItems 100
@@ -65723,7 +65723,7 @@ export namespace Schemas {
* * `screenshot` - Screenshot
* * `iframe` - Iframe
* * `recording` - Recording */
- type?: HeatmapType;
+ type?: SavedHeatmapTypeEnum;
/** Set true to soft-delete the saved heatmap. */
deleted?: boolean;
/** When true, ask the headless browser to dismiss cookie/consent banners before capturing the screenshot. Off by default: the blocker can stall the render on some sites and time out. Only applies to 'screenshot' heatmaps. */
@@ -65741,7 +65741,7 @@ export namespace Schemas {
/** The type of record to modify. Currently only "FeatureFlag" is supported.
*
* * `FeatureFlag` - feature flag */
- model_name?: ModelNameEnum;
+ model_name?: ScheduledChangeAllowedModelsEnum;
/** The change to apply. Must include an 'operation' key and a 'value' key. Supported operations: 'update_status' (value: true/false to enable/disable the flag), 'add_release_condition' (value: object with 'groups', 'payloads', and 'multivariate' keys), 'update_variants' (value: object with 'variants' and 'payloads' keys). */
payload?: unknown;
/** ISO 8601 datetime when the change should be applied (e.g. '2025-06-01T14:00:00Z'). */
@@ -65927,7 +65927,7 @@ export namespace Schemas {
*
* * `collection` - Collection
* * `filters` - Filters */
- type?: SessionRecordingPlaylistTypeEnum | null;
+ type?: SessionRecordingPlaylistPlaylistTypeEnum | null;
/** Return whether this is a synthetic playlist */
readonly is_synthetic?: boolean;
_create_in_folder?: string;
@@ -66012,10 +66012,10 @@ export namespace Schemas {
* * `trusted` - Trusted domains only
* * `full` - Full
*/
- export type ScoutConfigNetworkAccessEnum = typeof ScoutConfigNetworkAccessEnum[keyof typeof ScoutConfigNetworkAccessEnum];
+ export type SignalScoutConfigNetworkAccessEnum = typeof SignalScoutConfigNetworkAccessEnum[keyof typeof SignalScoutConfigNetworkAccessEnum];
- export const ScoutConfigNetworkAccessEnum = {
+ export const SignalScoutConfigNetworkAccessEnum = {
Trusted: 'trusted',
Full: 'full',
} as const;
@@ -66051,7 +66051,7 @@ export namespace Schemas {
*
* * `trusted` - Trusted domains only
* * `full` - Full */
- network_access?: ScoutConfigNetworkAccessEnum;
+ network_access?: SignalScoutConfigNetworkAccessEnum;
/**
* Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it.
* @maxLength 200
@@ -66152,7 +66152,7 @@ export namespace Schemas {
* * `insight` - Insight
* * `dashboard` - Dashboard
* * `ai_prompt` - AI prompt */
- readonly resource_type?: ResourceTypeEnum;
+ readonly resource_type?: SubscriptionResourceTypeEnum;
/**
* Dashboard ID to subscribe to (mutually exclusive with insight on create).
* @nullable
@@ -66180,7 +66180,7 @@ export namespace Schemas {
*
* * `email` - Email
* * `slack` - Slack */
- target_type?: TargetTypeEnum;
+ target_type?: SubscriptionTargetEnum;
/** Recipient(s): comma-separated email addresses for email, or Slack channel name/ID for slack. */
target_value?: string;
/** How often to deliver: daily, weekly, monthly, or yearly.
@@ -66266,10 +66266,10 @@ export namespace Schemas {
* * `recurring` - recurring
* * `always` - always
*/
- export type ScheduleEnum = typeof ScheduleEnum[keyof typeof ScheduleEnum];
+ export type SurveyScheduleEnum = typeof SurveyScheduleEnum[keyof typeof SurveyScheduleEnum];
- export const ScheduleEnum = {
+ export const SurveyScheduleEnum = {
Once: 'once',
Recurring: 'recurring',
Always: 'always',
@@ -66685,13 +66685,13 @@ export namespace Schemas {
* * `widget` - widget
* * `external_survey` - external survey
* * `api` - api */
- type?: SurveyType;
+ type?: SurveyTypeEnum;
/** Survey scheduling behavior: 'once' = show once per user (default), 'recurring' = repeat based on iteration_count and iteration_frequency_days settings, 'always' = show every time conditions are met (mainly for widget surveys)
*
* * `once` - once
* * `recurring` - recurring
* * `always` - always */
- schedule?: ScheduleEnum | null;
+ schedule?: SurveyScheduleEnum | null;
readonly linked_flag?: MinimalFeatureFlag;
/**
* The feature flag linked to this survey.
@@ -66876,7 +66876,7 @@ export namespace Schemas {
current_iteration_start_date?: string | null;
/** @nullable */
response_sampling_start_date?: string | null;
- response_sampling_interval_type?: ResponseSamplingIntervalTypeEnum | BlankEnum | null;
+ response_sampling_interval_type?: SurveySamplingIntervalTypeEnum | BlankEnum | null;
/**
* @minimum 0
* @maximum 2147483647
@@ -66944,7 +66944,7 @@ export namespace Schemas {
* * `JSONEachRow` - JSON
* * `Delta` - Delta
* * `DeltaS3Wrapper` - DeltaS3Wrapper */
- format?: TableFormatEnum;
+ format?: DataWarehouseTableFormatEnum;
readonly created_by?: UserBasic;
readonly created_at?: string;
/** Where the table came from: `web` for the in-app UI, `api` for direct API callers, `mcp` for agent/MCP tool calls, `wizard` for the setup agent, `self_driving` for a self-driving run, `source` for a table a data source syncs, `materialized_view` for the table behind a materialized view, and `demo` for a demo project's sample table. Set server-side from the request, never from the request body. Null on tables created before this was recorded.
@@ -66957,7 +66957,7 @@ export namespace Schemas {
* * `source` - source
* * `materialized_view` - materialized_view
* * `demo` - demo */
- readonly created_via?: TableCreatedViaEnum | null;
+ readonly created_via?: DataWarehouseTableCreatedViaEnum | null;
/**
* HTTPS URL of the files to read, with `*` matching any part of a path segment (e.g. `https://your-bucket.s3.amazonaws.com/orders/*.parquet`). All matched files are read as one table. Must point at a bucket you control, not at PostHog's own storage.
* @maxLength 500
@@ -67061,6 +67061,56 @@ export namespace Schemas {
error_message?: string | null;
}
+ /**
+ * * `onboarding` - Onboarding
+ * * `error_tracking` - Error Tracking
+ * * `eval_clusters` - Eval Clusters
+ * * `user_created` - User Created
+ * * `slack` - Slack
+ * * `support_queue` - Support Queue
+ * * `session_summaries` - Session Summaries
+ * * `posthog_ai` - PostHog AI
+ * * `experiments` - Experiments
+ * * `signal_report` - Signal Report
+ * * `signals_scout` - Signals Scout
+ * * `scout_suggestions` - Signals Scout Suggestions
+ * * `support_reply` - Support Reply
+ * * `hogdesk` - HogDesk
+ * * `review_hog` - ReviewHog
+ * * `image_builder` - Image Builder
+ * * `loop` - Loop
+ * * `mcp_analytics` - MCP Analytics
+ * * `signals_chat` - Signals Chat
+ * * `task_analysis` - Task Analysis
+ * * `workflow` - Workflow
+ */
+ export type TaskOriginProductEnum = typeof TaskOriginProductEnum[keyof typeof TaskOriginProductEnum];
+
+
+ export const TaskOriginProductEnum = {
+ Onboarding: 'onboarding',
+ ErrorTracking: 'error_tracking',
+ EvalClusters: 'eval_clusters',
+ UserCreated: 'user_created',
+ Slack: 'slack',
+ SupportQueue: 'support_queue',
+ SessionSummaries: 'session_summaries',
+ PosthogAi: 'posthog_ai',
+ Experiments: 'experiments',
+ SignalReport: 'signal_report',
+ SignalsScout: 'signals_scout',
+ ScoutSuggestions: 'scout_suggestions',
+ SupportReply: 'support_reply',
+ Hogdesk: 'hogdesk',
+ ReviewHog: 'review_hog',
+ ImageBuilder: 'image_builder',
+ Loop: 'loop',
+ McpAnalytics: 'mcp_analytics',
+ SignalsChat: 'signals_chat',
+ TaskAnalysis: 'task_analysis',
+ Workflow: 'workflow',
+ } as const;
+
/**
* * `default` - default
* * `acceptEdits` - acceptEdits
@@ -67123,7 +67173,7 @@ export namespace Schemas {
* * `signals_chat` - Signals Chat
* * `task_analysis` - Task Analysis
* * `workflow` - Workflow */
- origin_product?: OriginProductEnum;
+ origin_product?: TaskOriginProductEnum;
/**
* Target GitHub repository in `organization/repo` format (e.g. `posthog/posthog-js`).
* @maxLength 255
@@ -67858,7 +67908,7 @@ export namespace Schemas {
readonly transcript?: string;
summary?: string;
/** Searchable classifications on the response. `abandoned` is auto-derived from the transcript when the interview is recorded; `off-topic` is set manually. Sending `classifications` on an update replaces the whole list — pass the full desired set, not a delta. */
- classifications?: ClassificationsEnum[];
+ classifications?: UserInterviewClassificationEnum[];
audio?: string;
}
@@ -67961,13 +68011,13 @@ export namespace Schemas {
*
* * `schedule` - Schedule
* * `threshold` - Threshold */
- trigger_type?: VisionActionTriggerTypeEnum;
+ trigger_type?: TriggerTypeEnum;
/** What the action produces. MVP supports 'group_summary' only.
*
* * `group_summary` - Group summary
* * `alert` - Alert
* * `per_observation` - Per observation */
- mode?: VisionActionModeEnum;
+ mode?: ActionModeEnum;
/** Trigger parameters. For schedule triggers: {rrule, timezone}. */
trigger_config?: TriggerConfig;
/** Targeting predicate: which of the scanner's observations this action runs on. */
@@ -68015,14 +68065,14 @@ export namespace Schemas {
*
* * `metric` - Metric
* * `match` - Match */
- kind?: VisionAlertConfigurationKindEnum;
+ kind?: VisionAlertKindEnum;
/** Which observations count. Empty matches every observation of the scanner. */
selection?: VisionAlertSelection;
/** Metric alerts only: what to measure over the window. 'avg_score' requires a scorer scanner.
*
* * `count` - Count matching observations
* * `avg_score` - Average score */
- metric?: VisionAlertConfigurationMetricEnum;
+ metric?: VisionAlertMetricEnum;
/** Metric alerts only: whether the alert fires at or above, or at or below, the threshold.
*
* * `above` - At or above
@@ -68126,7 +68176,7 @@ export namespace Schemas {
* * `canonical` - Canonical
* * `ai_generated` - AI generated
* * `user_edited` - User edited */
- readonly description_source?: DescriptionSourceEnum;
+ readonly description_source?: WarehouseColumnAnnotationDescriptionSourceEnum;
/** Model used when the description was AI-generated, otherwise null. */
readonly ai_model?: string;
/** True once a user has edited this annotation; such rows are never overwritten. */
@@ -70326,7 +70376,7 @@ export namespace Schemas {
*
* * `AND` - AND
* * `OR` - OR */
- type?: PropertyGroupOperator;
+ type?: PropertyGroupOperatorEnum;
values: PropertyItem[];
}
@@ -70826,20 +70876,6 @@ export namespace Schemas {
readonly reaction: PullRequestCommentReaction;
}
- /**
- * * `ios` - iOS
- * * `android` - Android
- * * `web` - Web
- */
- export type PushTokenPlatformEnum = typeof PushTokenPlatformEnum[keyof typeof PushTokenPlatformEnum];
-
-
- export const PushTokenPlatformEnum = {
- Ios: 'ios',
- Android: 'android',
- Web: 'web',
- } as const;
-
/**
* * `run` - RUN
* * `skip` - SKIP
@@ -73904,7 +73940,7 @@ export namespace Schemas {
* * `experiment_launch` - Experiment Launch
* * `experiment_stop` - Experiment Stop
* * `experiment_update` - Experiment Update */
- trigger?: TriggerEnum;
+ trigger?: ExperimentMetricsRecalculationTriggerEnum;
}
export interface RecapHighlight {
@@ -75423,7 +75459,7 @@ export namespace Schemas {
* * `consider` - Consider
* * `should_fix` - Should Fix
* * `must_fix` - Must Fix */
- urgency_threshold?: UrgencyThresholdEnum;
+ urgency_threshold?: ReviewUserSettingsUrgencyThresholdEnum;
/** Whether reviews can be started from this project's Code review page (the UI trigger is limited to the designated ReviewHog teams while the product is in alpha). */
readonly can_trigger_reviews: boolean;
/** Whether this project has at least one synced, enabled Stamphog repository. When false, the stamphog_review_inbox_prs toggle has nothing to act on and the UI renders it disabled with a pointer to connect the Stamphog GitHub App. */
@@ -75770,7 +75806,7 @@ export namespace Schemas {
* * `trusted` - Trusted
* * `full` - Full
* * `custom` - Custom */
- network_access_level?: NetworkAccessLevelEnum;
+ network_access_level?: SandboxEnvironmentNetworkAccessLevelEnum;
/**
* Allowed domains for custom network access.
* @maxItems 100
@@ -75936,7 +75972,7 @@ export namespace Schemas {
* * `screenshot` - Screenshot
* * `iframe` - Iframe
* * `recording` - Recording */
- type?: HeatmapType;
+ type?: SavedHeatmapTypeEnum;
/** Set true to soft-delete the saved heatmap. */
deleted?: boolean;
/** When true, ask the headless browser to dismiss cookie/consent banners before capturing the screenshot. Off by default: the blocker can stall the render on some sites and time out. Only applies to 'screenshot' heatmaps. */
@@ -76021,7 +76057,7 @@ export namespace Schemas {
*
* * `trusted` - Trusted domains only
* * `full` - Full */
- network_access?: ScoutConfigNetworkAccessEnum;
+ network_access?: SignalScoutConfigNetworkAccessEnum;
/** Exempt this scout from the inactivity pause, which otherwise switches off a scout that goes a fortnight without surfacing anything anyone engages with. Set it on watchdog scouts whose value is staying quiet. Defaults to false. */
auto_pause_exempt?: boolean;
/**
@@ -76095,10 +76131,10 @@ export namespace Schemas {
* * `paused_by_system` - Paused by system
* * `paused_by_user` - Paused by user
*/
- export type ScoutConfigStatusEnum = typeof ScoutConfigStatusEnum[keyof typeof ScoutConfigStatusEnum];
+ export type SignalScoutConfigStatusEnum = typeof SignalScoutConfigStatusEnum[keyof typeof SignalScoutConfigStatusEnum];
- export const ScoutConfigStatusEnum = {
+ export const SignalScoutConfigStatusEnum = {
Active: 'active',
PendingPause: 'pending_pause',
PausedBySystem: 'paused_by_system',
@@ -76110,10 +76146,10 @@ export namespace Schemas {
* * `ignored` - Ignored
* * `repeated_failures` - Repeated failures
*/
- export type ScoutConfigPauseReasonEnum = typeof ScoutConfigPauseReasonEnum[keyof typeof ScoutConfigPauseReasonEnum];
+ export type SignalScoutConfigPauseReasonEnum = typeof SignalScoutConfigPauseReasonEnum[keyof typeof SignalScoutConfigPauseReasonEnum];
- export const ScoutConfigPauseReasonEnum = {
+ export const SignalScoutConfigPauseReasonEnum = {
NoOutput: 'no_output',
Ignored: 'ignored',
RepeatedFailures: 'repeated_failures',
@@ -76149,13 +76185,13 @@ export namespace Schemas {
* * `pending_pause` - Pending pause
* * `paused_by_system` - Paused by system
* * `paused_by_user` - Paused by user */
- readonly status: ScoutConfigStatusEnum;
+ readonly status: SignalScoutConfigStatusEnum;
/** Why the system paused (or warned) this scout: `no_output` (it emitted nothing over the evaluation window), `ignored` (no person engaged with its reports — no view, rating, note, dismissal, or resolution), or `repeated_failures` (consecutive failed runs). Null unless `status` is `pending_pause` or `paused_by_system`.
*
* * `no_output` - No output
* * `ignored` - Ignored
* * `repeated_failures` - Repeated failures */
- readonly pause_reason: ScoutConfigPauseReasonEnum | null;
+ readonly pause_reason: SignalScoutConfigPauseReasonEnum | null;
/** Whether the scout writes findings to the inbox. False = dry-run: it runs and logs but emits nothing. */
readonly emit: boolean;
/**
@@ -76180,7 +76216,7 @@ export namespace Schemas {
*
* * `trusted` - Trusted domains only
* * `full` - Full */
- readonly network_access: ScoutConfigNetworkAccessEnum;
+ readonly network_access: SignalScoutConfigNetworkAccessEnum;
/**
* Optional model id this scout's runs are pinned to, e.g. `claude-opus-4-5`. Must be one of the platform's agent models; an invalid id is rejected with the available ones listed. Null keeps the default model, chosen by the platform. Early access: the pin can only be set on projects enrolled in the scout model preview, and only takes effect there. Set null to clear it.
* @nullable
@@ -76292,7 +76328,7 @@ export namespace Schemas {
* * `categorical` - categorical
* * `numeric` - numeric
* * `boolean` - boolean */
- kind: ExperimentMetricKindEnum;
+ kind: ScoreDefinitionKindEnum;
/** New scorers are always created as active. */
archived?: boolean;
/** Initial immutable scorer configuration. */
@@ -76536,10 +76572,10 @@ export namespace Schemas {
* * `failed` - Failed
* * `empty` - Empty
*/
- export type ScoutSuggestionSetStatusEnum = typeof ScoutSuggestionSetStatusEnum[keyof typeof ScoutSuggestionSetStatusEnum];
+ export type SignalScoutSuggestionSetStatusEnum = typeof SignalScoutSuggestionSetStatusEnum[keyof typeof SignalScoutSuggestionSetStatusEnum];
- export const ScoutSuggestionSetStatusEnum = {
+ export const SignalScoutSuggestionSetStatusEnum = {
Fresh: 'fresh',
Stale: 'stale',
Failed: 'failed',
@@ -76553,7 +76589,7 @@ export namespace Schemas {
* * `stale` - Stale
* * `failed` - Failed
* * `empty` - Empty */
- status: ScoutSuggestionSetStatusEnum;
+ status: SignalScoutSuggestionSetStatusEnum;
/**
* When the current batch was generated; null before the first run.
* @nullable
@@ -77181,7 +77217,7 @@ export namespace Schemas {
*
* * `excluded` - Excluded
* * `credited` - Credited */
- readonly billing_path: BillingPathEnum;
+ readonly billing_path: SignalReportRefundBillingPathEnum;
/** Signals credits refunded (flat per-PR charge snapshot; 1 credit = $0.01). */
readonly credits: number;
/** The refunded implementation PR's GitHub URL, snapshotted at refund time. */
@@ -77280,7 +77316,7 @@ export namespace Schemas {
*
* * `trusted` - Trusted domains only
* * `full` - Full */
- network_access?: ScoutConfigNetworkAccessEnum;
+ network_access?: SignalScoutConfigNetworkAccessEnum;
/** Exempt this scout from the inactivity pause, which otherwise switches off a scout that goes a fortnight without surfacing anything anyone engages with. Set it on watchdog scouts whose value is staying quiet. Defaults to false. */
auto_pause_exempt?: boolean;
/**
@@ -82825,7 +82861,7 @@ export namespace Schemas {
/** @maxLength 400 */
name: string;
description?: string;
- type: SurveyType;
+ type: SurveyTypeEnum;
/** @nullable */
schedule?: string | null;
readonly linked_flag: MinimalFeatureFlag;
@@ -82991,7 +83027,7 @@ export namespace Schemas {
current_iteration_start_date?: string | null;
/** @nullable */
response_sampling_start_date?: string | null;
- response_sampling_interval_type?: ResponseSamplingIntervalTypeEnum | BlankEnum | null;
+ response_sampling_interval_type?: SurveySamplingIntervalTypeEnum | BlankEnum | null;
/**
* @minimum 0
* @maximum 2147483647
@@ -83035,13 +83071,13 @@ export namespace Schemas {
* * `widget` - widget
* * `external_survey` - external survey
* * `api` - api */
- type: SurveyType;
+ type: SurveyTypeEnum;
/** Survey scheduling behavior: 'once' = show once per user (default), 'recurring' = repeat based on iteration_count and iteration_frequency_days settings, 'always' = show every time conditions are met (mainly for widget surveys)
*
* * `once` - once
* * `recurring` - recurring
* * `always` - always */
- schedule?: ScheduleEnum | null;
+ schedule?: SurveyScheduleEnum | null;
readonly linked_flag: MinimalFeatureFlag;
/**
* The feature flag linked to this survey.
@@ -83226,7 +83262,7 @@ export namespace Schemas {
current_iteration_start_date?: string | null;
/** @nullable */
response_sampling_start_date?: string | null;
- response_sampling_interval_type?: ResponseSamplingIntervalTypeEnum | BlankEnum | null;
+ response_sampling_interval_type?: SurveySamplingIntervalTypeEnum | BlankEnum | null;
/**
* @minimum 0
* @maximum 2147483647
@@ -83686,7 +83722,7 @@ export namespace Schemas {
* * `signals_chat` - Signals Chat
* * `task_analysis` - Task Analysis
* * `workflow` - Workflow */
- origin_product?: OriginProductEnum;
+ origin_product?: TaskOriginProductEnum;
/**
* Target GitHub repository in `organization/repo` format (e.g. `posthog/posthog-js`).
* @maxLength 255
@@ -83799,7 +83835,7 @@ export namespace Schemas {
*
* * `acp` - ACP
* * `pi` - Pi */
- runtime?: RuntimeEnum;
+ runtime?: TaskRuntimeEnum;
}
/**
@@ -85086,7 +85122,7 @@ export namespace Schemas {
* * `signals_chat` - Signals Chat
* * `task_analysis` - Task Analysis
* * `workflow` - Workflow */
- origin_product?: OriginProductEnum;
+ origin_product?: TaskOriginProductEnum;
/**
* Target GitHub repository in `organization/repo` format (e.g. `posthog/posthog-js`).
* @maxLength 255
@@ -86213,7 +86249,7 @@ export namespace Schemas {
* Optional. Restrict results to interviews carrying any of these classifications (OR). Combines with `topic_id` as AND.
* @minItems 1
*/
- classifications?: ClassificationsEnum[];
+ classifications?: UserInterviewClassificationEnum[];
/**
* Maximum number of matches to return (1-50). Defaults to 10. Two matches per interview are possible — one for the transcript, one for the summary.
* @minimum 1
@@ -86245,6 +86281,20 @@ export namespace Schemas {
created_at: string;
}
+ /**
+ * * `ios` - iOS
+ * * `android` - Android
+ * * `web` - Web
+ */
+ export type UserPushTokenPlatformEnum = typeof UserPushTokenPlatformEnum[keyof typeof UserPushTokenPlatformEnum];
+
+
+ export const UserPushTokenPlatformEnum = {
+ Ios: 'ios',
+ Android: 'android',
+ Web: 'web',
+ } as const;
+
export interface UserPushTokenItem {
/** PostHog UserPushToken row id. */
id: string;
@@ -86253,7 +86303,7 @@ export namespace Schemas {
* * `ios` - iOS
* * `android` - Android
* * `web` - Web */
- platform: PushTokenPlatformEnum;
+ platform: UserPushTokenPlatformEnum;
/** When this token was first registered. */
created_at: string;
/** Last time the mobile app re-registered this token. */
@@ -86271,7 +86321,7 @@ export namespace Schemas {
* * `ios` - iOS
* * `android` - Android
* * `web` - Web */
- platform: PushTokenPlatformEnum;
+ platform: UserPushTokenPlatformEnum;
}
export interface UserPushTokenUnregisterRequest {
@@ -86401,22 +86451,6 @@ export namespace Schemas {
code: string;
}
- /**
- * * `initial` - initial
- * * `regenerate` - regenerate
- * * `improve` - improve
- * * `revert` - revert
- */
- export type VersionOperationEnum = typeof VersionOperationEnum[keyof typeof VersionOperationEnum];
-
-
- export const VersionOperationEnum = {
- Initial: 'initial',
- Regenerate: 'regenerate',
- Improve: 'improve',
- Revert: 'revert',
- } as const;
-
export interface ViewLinkValidation {
/**
* Name of the table or view being joined onto the source table.
@@ -87095,24 +87129,6 @@ export namespace Schemas {
details: string;
}
- /**
- * * `none` - none
- * * `low` - low
- * * `medium` - medium
- * * `high` - high
- * * `critical` - critical
- */
- export type WidgetSecurityReviewSeverityEnum = typeof WidgetSecurityReviewSeverityEnum[keyof typeof WidgetSecurityReviewSeverityEnum];
-
-
- export const WidgetSecurityReviewSeverityEnum = {
- None: 'none',
- Low: 'low',
- Medium: 'medium',
- High: 'high',
- Critical: 'critical',
- } as const;
-
export interface WidgetSecurityReview {
/** Highest severity found, or none when the review found no issues.
*
@@ -87121,7 +87137,7 @@ export namespace Schemas {
* * `medium` - medium
* * `high` - high
* * `critical` - critical */
- severity: WidgetSecurityReviewSeverityEnum;
+ severity: GeneratedWidgetVersionSecurityReviewSeverityEnum;
/** Concise result from the automated security review. */
summary: string;
/** Potential security issues found in the source. */
@@ -87208,7 +87224,7 @@ export namespace Schemas {
* * `regenerate` - regenerate
* * `improve` - improve
* * `revert` - revert */
- version_operation: VersionOperationEnum;
+ version_operation: GeneratedWidgetVersionOperationEnum;
/** Instructions added by this version. */
prompt_delta: string;
/** Complete instructions represented by this version. */