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.

chore(devex): regenerate the desktop api client in the openapi pipeline (#114640)

Julian Bez7cab1ab9af4c
diff --git a/.depot/workflows/ci-backend.yml b/.depot/workflows/ci-backend.yml
index dba73f52bdb8..3022460f3c4c 100644
--- a/.depot/workflows/ci-backend.yml
+++ b/.depot/workflows/ci-backend.yml
@@ -764,6 +764,13 @@ jobs:
# Exec command reference templates - feed generate-exec-docs.ts
- 'services/mcp/src/templates/sections/**/*'
- 'services/mcp/schema/exec-command-reference.md'
+ # Desktop API client - regenerated by bin/build-desktop-api-client.sh
+ - 'products/desktop/packages/api-client/src/generated.ts'
+ - 'products/desktop/packages/api-client/endpoint-allowlist.json'
+ # Pins typed-openapi exactly, so a generator bump changes this file and not only the desktop lockfile.
+ - 'products/desktop/packages/api-client/package.json'
+ - 'products/desktop/packages/api-client/scripts/**'
+ - 'bin/build-desktop-api-client.sh'
detect-snapshot-mode:
name: Detect snapshot mode
@@ -2655,6 +2662,14 @@ jobs:
with:
install-command: pnpm --filter=@posthog/root --filter=@posthog/frontend... --filter=@posthog/mcp... install --frozen-lockfile
token: ${{ steps.setup-gh-token.outputs.token || github.token }}
+ - name: Install desktop API client generator
+ working-directory: products/desktop
+ run: |
+ if [ ! -f ../../bin/build-desktop-api-client.sh ]; then
+ echo "This branch predates the desktop API client regen, so there is nothing to install."
+ exit 0
+ fi
+ pnpm install --frozen-lockfile --filter @posthog/api-client --ignore-scripts --config.node-linker=isolated
- name: Wait for Docker services
env:
COMPOSE_FILE: docker-compose.dev.yml:docker-compose.profiles.yml
diff --git a/.github/scripts/assign-reviewers.js b/.github/scripts/assign-reviewers.js
index e7179a42c923..456fdd99429f 100644
--- a/.github/scripts/assign-reviewers.js
+++ b/.github/scripts/assign-reviewers.js
@@ -15,6 +15,8 @@ const CONFIG = {
'frontend/src/generated/**',
'products/*/frontend/generated/**',
'services/mcp/src/**/generated/**',
+ // Backend CI regenerates it from the schema on backend PRs and replaces any hand edit, so it must not pull in desktop owners.
+ 'products/desktop/packages/api-client/src/generated.ts',
'pnpm-lock.yaml',
'Cargo.lock',
'uv.lock',
diff --git a/.github/scripts/assign-reviewers.test.js b/.github/scripts/assign-reviewers.test.js
index 57084ae6f919..33a7fbd8aea3 100644
--- a/.github/scripts/assign-reviewers.test.js
+++ b/.github/scripts/assign-reviewers.test.js
@@ -40,6 +40,8 @@ for (const [filename, expected] of [
['frontend/src/generated/core/api.schemas.ts', true],
['products/surveys/frontend/generated/api.zod.ts', true],
['services/mcp/src/tools/generated/surveys.ts', true],
+ ['products/desktop/packages/api-client/src/generated.ts', true],
+ ['products/desktop/packages/api-client/src/posthog-client.ts', false],
['pnpm-lock.yaml', true],
['rust/Cargo.lock', true],
['uv.lock', true],
diff --git a/.github/scripts/desktop/check-pr-backend-coupling.sh b/.github/scripts/desktop/check-pr-backend-coupling.sh
index 73c75bd4d085..0cc02e54f9ff 100755
--- a/.github/scripts/desktop/check-pr-backend-coupling.sh
+++ b/.github/scripts/desktop/check-pr-backend-coupling.sh
@@ -31,6 +31,8 @@ is_backend_path() {
is_desktop_path() {
case "$1" in
+ # Backend CI regenerates this file from the schema and replaces any hand edit. New endpoints in it stay unused until a desktop call site uses them, and call sites stay gated.
+ products/desktop/packages/api-client/src/generated.ts) return 1 ;;
products/desktop/*) return 0 ;;
# The desktop app bundles these packages, so they ship on its release schedule.
packages/agent/packages/*) return 0 ;;
diff --git a/.github/scripts/desktop/check-pr-backend-coupling.test.sh b/.github/scripts/desktop/check-pr-backend-coupling.test.sh
index 400c78467deb..b5c771fa657c 100755
--- a/.github/scripts/desktop/check-pr-backend-coupling.test.sh
+++ b/.github/scripts/desktop/check-pr-backend-coupling.test.sh
@@ -79,6 +79,12 @@ assert_result "agent workspace package coupled with backend fails" 7 1 "must be
register_pr 8 "[]" packages/agent/agent-shadow/main.go products/tasks/backend/sandbox/images/Dockerfile.sandbox-base
assert_result "agent-shadow ships with the sandbox image, so it is out of scope" 8 0 "No products/desktop changes"
+register_pr 9 "[]" products/desktop/packages/api-client/src/generated.ts posthog/api/insight.py
+assert_result "regenerated desktop API client types ride along with a backend change" 9 0 "No products/desktop changes"
+
+register_pr 10 "[]" products/desktop/packages/api-client/src/generated.ts products/desktop/packages/api-client/src/posthog-client.ts posthog/api/insight.py
+assert_result "a desktop call site next to the regenerated types still fails" 10 1 "must be separated into different PRs"
+
register_pr 4 '[{"name": "desktop-skip-backend-check"}]' products/desktop/apps/foo.ts posthog/models.py
assert_result "skip label suppresses the check" 4 0 "skipping the coupling check"
diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.yml
index 06f3e9b2a2a7..4f04dc1fed77 100644
--- a/.github/workflows/ci-backend.yml
+++ b/.github/workflows/ci-backend.yml
@@ -506,6 +506,13 @@ jobs:
# Exec command reference templates - feed generate-exec-docs.ts
- 'services/mcp/src/templates/sections/**/*'
- 'services/mcp/schema/exec-command-reference.md'
+ # Desktop API client - regenerated by bin/build-desktop-api-client.sh
+ - 'products/desktop/packages/api-client/src/generated.ts'
+ - 'products/desktop/packages/api-client/endpoint-allowlist.json'
+ # Pins typed-openapi exactly, so a generator bump changes this file and not only the desktop lockfile.
+ - 'products/desktop/packages/api-client/package.json'
+ - 'products/desktop/packages/api-client/scripts/**'
+ - 'bin/build-desktop-api-client.sh'
# Last, so the paths filter runs while Depot starts its run for this event.
- name: Pick the engine that runs the backend tests
id: route
@@ -2546,6 +2553,19 @@ jobs:
install-command: pnpm --filter=@posthog/root --filter=@posthog/frontend... --filter=@posthog/mcp... install --frozen-lockfile
token: ${{ steps.setup-gh-token.outputs.token || github.token }}
+ # Installs only the desktop API client generator, not the Electron app. The desktop
+ # workspace defaults to the hoisted linker, which ignores --filter and installs every
+ # package, so the isolated linker is forced here. A branch that predates the generator
+ # move skips this step.
+ - name: Install desktop API client generator
+ working-directory: products/desktop
+ run: |
+ if [ ! -f ../../bin/build-desktop-api-client.sh ]; then
+ echo "This branch predates the desktop API client regen, so there is nothing to install."
+ exit 0
+ fi
+ pnpm install --frozen-lockfile --filter @posthog/api-client --ignore-scripts --config.node-linker=isolated
+
- name: Wait for Docker services
env:
COMPOSE_FILE: docker-compose.dev.yml:docker-compose.profiles.yml
diff --git a/bin/build-desktop-api-client.sh b/bin/build-desktop-api-client.sh
new file mode 100755
index 000000000000..b548945d265e
--- /dev/null
+++ b/bin/build-desktop-api-client.sh
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+# Regenerates the desktop app's typed API client from frontend/tmp/openapi.json.
+#
+# Locally, a missing toolchain or a generator error leaves generated.ts unchanged,
+# prints a warning and exits 0, so `hogli build:openapi` works without the desktop
+# install. In CI both fail. Backend CI overwrites any hand edit to generated.ts
+# with the generator output, and reviewer routing and the desktop coupling check
+# skip the file because of that. A skipped regen would let a hand edit through.
+
+set -uo pipefail
+
+package_dir="products/desktop/packages/api-client"
+generated="$package_dir/src/generated.ts"
+
+fail() {
+ if [ "${GITHUB_ACTIONS:-}" = "true" ]; then
+ echo "::error title=Desktop API client not regenerated::$1"
+ exit 1
+ fi
+ echo "Warning: $1" >&2
+ exit 0
+}
+
+# Run pnpm from inside the desktop workspace so it uses that workspace's pnpm version.
+if ! (cd "$package_dir" && pnpm exec typed-openapi --version) >/dev/null 2>&1; then
+ fail "The desktop API client generator is not installed, so $generated was not regenerated. Backend CI regenerates it on pull requests. To run it locally, install it with: pnpm --dir products/desktop install"
+fi
+
+backup=$(mktemp)
+cp "$generated" "$backup"
+# The generator can fail after typed-openapi has written an unformatted file, so restore the last good copy.
+if ! (cd "$package_dir" && pnpm run generate-client); then
+ cp "$backup" "$generated"
+ rm -f "$backup"
+ fail "The desktop API client generator failed, so $generated was not regenerated. See the log above. Released desktop apps depend on every endpoint and schema in $package_dir/endpoint-allowlist.json. Remove an endpoint or schema from the allowlist in a desktop PR first, then remove it from the backend."
+fi
+rm -f "$backup"
diff --git a/hogli.yaml b/hogli.yaml
index 4c371ece21a0..6749e46fb99b 100644
--- a/hogli.yaml
+++ b/hogli.yaml
@@ -537,6 +537,11 @@ build:
cmd: pnpm --filter=@posthog/mcp run generate-cli-agent-scopes
description: Generate the CLI `agent` login use-case scope list from the MCP
tool definitions (must run after build:openapi-mcp-tools)
+ build:desktop-api-client:
+ bin_script: build-desktop-api-client.sh
+ description: Regenerate the desktop app's typed API client from the OpenAPI
+ schema. Locally, warns and skips when the desktop toolchain is not
+ installed. In CI, a skipped regen fails
build:openapi-exec-docs:
cmd: pnpm --filter=@posthog/mcp run generate-exec-docs
description: Render the MCP exec tool's command reference into the markdown
@@ -588,6 +593,7 @@ build:
trap - INT TERM
exit "$generation_status"
- build:openapi-cli-agent-scopes
+ - build:desktop-api-client
description: 'Generate OpenAPI schema and TypeScript types from the backend.
Needs the dev stack running (Postgres and ClickHouse): Django starts
before the schema is generated. Start it with hogli up -d'
diff --git a/products/desktop/AGENTS.md b/products/desktop/AGENTS.md
index 028866779f8d..ee46f3a76b94 100644
--- a/products/desktop/AGENTS.md
+++ b/products/desktop/AGENTS.md
@@ -227,7 +227,7 @@ await boot(container);
- `pnpm --filter code package|make`: package the Electron app.
- `node scripts/check-host-boundaries.mjs`: verify host boundary allowlist.
- `node scripts/check-mobile-types.mjs`: typecheck `apps/mobile` against its error baseline.
-- `pnpm --filter @posthog/code generate-client`: regenerate the typed PostHog API client from the local OpenAPI schema. See [API client](#api-client).
+- `pnpm --filter @posthog/api-client generate-client` (or the `@posthog/code` alias): regenerate the typed PostHog API client from the local OpenAPI schema. See [API client](#api-client).
## Mobile Host Types
@@ -255,15 +255,17 @@ It contains only what `packages/api-client/endpoint-allowlist.json` names:
Everything those reference is generated with them. The full schema documents thousands of routes, and generating all of them made every backend change churn this file; the allowlist keeps a regen to the routes the desktop uses.
+The generator is `packages/api-client/scripts/update-openapi-client.ts`. `hogli build:openapi` runs it after the other OpenAPI generators, and Backend CI's "Validate OpenAPI types" job runs `hogli build:openapi` on backend PRs. A backend change that alters an allowlisted endpoint or schema therefore gets the regenerated `generated.ts` committed to its PR automatically, together with the frontend and MCP types. If the generator fails in CI (for example, an allowlisted path left the schema), the job fails. Released desktop apps still call that path, so remove it from the allowlist and its call sites in a desktop PR first, then from the backend.
+
To call a new endpoint or import a new schema type:
1. Add the path template to `paths`, or the schema name to `schemas`.
2. From the repo root, run `hogli build:openapi-schema` to write `frontend/tmp/openapi.json` from the checkout.
-3. Run `pnpm --filter @posthog/code generate-client`. It fails if an allowlisted path or schema is not in the schema, naming it, and formats the output with prettier so the diff shows only what changed.
+3. Run `pnpm --filter @posthog/api-client generate-client`. It fails if an allowlisted path or schema is not in the schema, naming it, and formats the output with prettier so the diff shows only what changed.
4. Run `pnpm typecheck`. A call site whose path is not allowlisted fails with `not assignable to keyof GetEndpoints` (or the matching method); add the path and regenerate.
5. Commit `generated.ts` together with the allowlist change.
-Keep desktop and backend changes in separate PRs: the desktop ships on its own auto-update schedule, so a client that calls an endpoint before it is deployed reaches users. A regen from a branch that adds a backend endpoint only carries types for it, which is safe; the call site lands after the endpoint is live.
+Keep desktop and backend changes in separate PRs: the desktop ships on its own auto-update schedule, so a client that calls an endpoint before it is deployed reaches users. A regen from a branch that adds a backend endpoint only carries types for it, which is safe; the call site lands after the endpoint is live. For this reason the desktop/backend coupling check ignores `generated.ts`, but not the allowlist or any call site.
Raw `fetch` calls through `this.api.fetcher.fetch` with a hand-built path do not need an allowlist entry, and endpoints that leave the schema surface as a generator error on the next regen: remove them from the allowlist, and typecheck shows any call site that still used them.
diff --git a/products/desktop/apps/code/package.json b/products/desktop/apps/code/package.json
index c658d12c6c2b..f0f51d8327f9 100644
--- a/products/desktop/apps/code/package.json
+++ b/products/desktop/apps/code/package.json
@@ -23,7 +23,7 @@
"build": "pnpm package",
"build-icons": "bash scripts/generate-icns.sh",
"typecheck": "tsc -p tsconfig.node.json --noEmit && tsc -p tsconfig.web.json --noEmit",
- "generate-client": "tsx scripts/update-openapi-client.ts",
+ "generate-client": "pnpm --filter @posthog/api-client generate-client",
"test": "vitest run",
"test:e2e": "playwright test --config=tests/e2e/playwright.config.ts",
"test:e2e:headed": "playwright test --config=tests/e2e/playwright.config.ts --headed",
@@ -68,12 +68,10 @@
"jsdom": "^26.0.0",
"mockdate": "^3.0.5",
"playwright": "^1.60.0",
- "prettier": "3.8.1",
"storybook": "10.4.1",
"tailwindcss": "^4.3.0",
"tar": "^7.5.19",
"tsx": "^4.22.3",
- "typed-openapi": "^2.2.6",
"typescript": "^5.9.3",
"vite": "^7.0.0",
"vite-tsconfig-paths": "^6.0.0",
diff --git a/products/desktop/knip.json b/products/desktop/knip.json
index 306210f37313..73341ca93753 100644
--- a/products/desktop/knip.json
+++ b/products/desktop/knip.json
@@ -25,7 +25,6 @@
],
"project": ["src/**/*.{ts,tsx}", "scripts/**/*.{ts,mts,mjs}"],
"ignoreDependencies": [
- "typed-openapi",
"chokidar",
"detect-libc",
"is-glob",
@@ -38,9 +37,10 @@
]
},
"packages/api-client": {
- "entry": ["src/**/*.test.ts"],
- "project": ["src/**/*.{ts,tsx}"],
+ "entry": ["src/**/*.test.ts", "scripts/*.ts"],
+ "project": ["src/**/*.{ts,tsx}", "scripts/*.ts"],
"ignore": ["src/generated.ts", "src/generated.augment.ts"],
+ "ignoreDependencies": ["prettier", "typed-openapi"],
"includeEntryExports": true
},
"packages/core": {
diff --git a/products/desktop/packages/api-client/endpoint-allowlist.json b/products/desktop/packages/api-client/endpoint-allowlist.json
index 3237282c6fe6..981a2ef85170 100644
--- a/products/desktop/packages/api-client/endpoint-allowlist.json
+++ b/products/desktop/packages/api-client/endpoint-allowlist.json
@@ -1,5 +1,5 @@
{
- "$comment": "What apps/code/scripts/update-openapi-client.ts generates into packages/api-client/src/generated.ts: `paths` are the endpoints the desktop calls through the typed client; `schemas` are the component schemas desktop code imports as `Schemas.<Name>` directly. Everything either of those references is generated with it. See the 'API client' section of products/desktop/AGENTS.md for how to add one.",
+ "$comment": "What packages/api-client/scripts/update-openapi-client.ts generates into packages/api-client/src/generated.ts: `paths` are the endpoints the desktop calls through the typed client; `schemas` are the component schemas desktop code imports as `Schemas.<Name>` directly. Everything either of those references is generated with it. See the 'API client' section of products/desktop/AGENTS.md for how to add one.",
"paths": [
"/api/projects/{project_id}/actions/{id}/",
"/api/projects/{project_id}/cohorts/{id}/",
diff --git a/products/desktop/packages/api-client/package.json b/products/desktop/packages/api-client/package.json
index 9282ebbb0d51..a93cad43bf13 100644
--- a/products/desktop/packages/api-client/package.json
+++ b/products/desktop/packages/api-client/package.json
@@ -13,10 +13,14 @@
"scripts": {
"typecheck": "tsc --noEmit",
"test": "vitest run",
- "clean": "node ../../scripts/rimraf.mjs .turbo"
+ "clean": "node ../../scripts/rimraf.mjs .turbo",
+ "generate-client": "tsx scripts/update-openapi-client.ts"
},
"devDependencies": {
"@posthog/tsconfig": "workspace:*",
+ "prettier": "3.8.1",
+ "tsx": "^4.22.3",
+ "typed-openapi": "2.2.7",
"typescript": "catalog:",
"vitest": "^4.1.8"
},
diff --git a/products/desktop/apps/code/scripts/update-openapi-client.ts b/products/desktop/packages/api-client/scripts/update-openapi-client.ts
similarity index 97%
rename from products/desktop/apps/code/scripts/update-openapi-client.ts
rename to products/desktop/packages/api-client/scripts/update-openapi-client.ts
index fa43deae2d2b..161969774837 100644
--- a/products/desktop/apps/code/scripts/update-openapi-client.ts
+++ b/products/desktop/packages/api-client/scripts/update-openapi-client.ts
@@ -5,7 +5,7 @@ import * as fs from "node:fs";
import * as path from "node:path";
import { fileURLToPath } from "node:url";
-// Anchor to apps/code so the relative paths below (and the pnpm binary lookup)
+// Anchor to the package root so the relative paths below (and the pnpm binary lookup)
// resolve the same way no matter which directory the script is invoked from.
process.chdir(path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."));
@@ -15,12 +15,12 @@ const REPO_ROOT = path.resolve(process.cwd(), "../../../..");
// the checkout, so a stale regeneration is a diff rather than a silent mismatch.
const OPENAPI_PATH = path.resolve(REPO_ROOT, "frontend/tmp/openapi.json");
const TEMP_SCHEMA_PATH = "temp-openapi.json";
-const OUTPUT_PATH = "../../packages/api-client/src/generated.ts";
+const OUTPUT_PATH = "src/generated.ts";
// Only the endpoints the desktop calls through the typed client are generated. The full
// schema documents thousands of routes, and every backend change to any of them would
// otherwise churn generated.ts; an allowlist keeps a regen to the routes we actually use.
-const ALLOWLIST_PATH = "../../packages/api-client/endpoint-allowlist.json";
+const ALLOWLIST_PATH = "endpoint-allowlist.json";
function readSchema() {
console.log(`Reading OpenAPI schema from ${OPENAPI_PATH}...`);
diff --git a/products/desktop/packages/api-client/src/generated.ts b/products/desktop/packages/api-client/src/generated.ts
index 1e741dd17d25..e0d3989e7671 100644
--- a/products/desktop/packages/api-client/src/generated.ts
+++ b/products/desktop/packages/api-client/src/generated.ts
@@ -340,6 +340,7 @@ export namespace Schemas {
table_name: string;
};
export type DataWarehouseSyncWarning = {
+ data_is_current?: (boolean | null) | undefined;
/**
* Human-readable warning shown to the user
*/
@@ -2180,13 +2181,17 @@ export namespace Schemas {
custom_name?: (string | null) | undefined;
formula: string;
};
+ export type Calculation = "fixed" | "mean" | "median" | "min" | "max";
export type Position = "start" | "end";
+ export type Scope = "all" | "series";
export type GoalLine = {
borderColor?: (string | null) | undefined;
+ calculation?: (Calculation | null) | undefined;
displayIfCrossed?: (boolean | null) | undefined;
displayLabel?: (boolean | null) | undefined;
label: string;
position?: (Position | null) | undefined;
+ scope?: (Scope | null) | undefined;
value: number;
};
export type LegendPosition = "top" | "bottom" | "left" | "right";
@@ -4601,13 +4606,19 @@ export namespace Schemas {
| "month"
| "quarter"
| "year";
+ export type DatePart = "month" | "quarter" | "day_of_week";
export type BILocalFieldDefinition1 = {
+ aggregate: boolean;
+ expression: string;
+ kind?: string | undefined;
+ };
+ export type BILocalFieldDefinition2 = {
expression: string;
groups: Array<BICategoryGroup>;
kind?: string | undefined;
other: string;
};
- export type BILocalFieldDefinition2 = {
+ export type BILocalFieldDefinition3 = {
expression: string;
kind?: string | undefined;
origin: number;
@@ -4636,11 +4647,18 @@ export namespace Schemas {
| "unknown";
export type BIField = {
dateBucket?: (BIDateBucket | null) | undefined;
+ datePart?: (DatePart | null) | undefined;
expression: string;
id: string;
localDefinition?:
- | (BILocalFieldDefinition1 | BILocalFieldDefinition2 | null)
+ | (
+ | BILocalFieldDefinition1
+ | BILocalFieldDefinition2
+ | BILocalFieldDefinition3
+ | null
+ )
| undefined;
+ localFieldId?: (string | null) | undefined;
name: string;
source: BIDataSource;
type: DatabaseSerializedFieldType;
@@ -4668,6 +4686,14 @@ export namespace Schemas {
valueTo?: (string | null) | undefined;
values?: (Array<string> | null) | undefined;
};
+ export type BIHierarchy = {
+ id: string;
+ /**
+ * Ordered from the broadest dimension to the most detailed.
+ */
+ levels: Array<BIField>;
+ name: string;
+ };
export type BIQueryLimit = 100 | 1000 | 10000 | 50000;
export type MissingDates = "gap" | "zero";
export type Operator2 =
@@ -4717,6 +4743,7 @@ export namespace Schemas {
style: Style | null;
suffix: string | null;
}>;
+ export type Shelf = "rows" | "columns";
export type BITableCalculationType =
| "percent_of_total"
| "running_total"
@@ -4737,16 +4764,19 @@ export namespace Schemas {
field: BIField;
formatting?: (ChartSettingsFormatting | null) | undefined;
label?: (string | null) | undefined;
+ shelf?: (Shelf | null) | undefined;
tableCalculation?: (BITableCalculation | null) | undefined;
};
export type BIConfig = {
chartType: ChartDisplayType;
+ colorBy?: (string | null) | undefined;
columns: Array<BIField>;
compareFilter?: (CompareFilter | null) | undefined;
comparisonPeriod?: (ComparisonPeriod | null) | undefined;
dateField?: (BIField | null) | undefined;
dateRange?: (DateRange | null) | undefined;
filters: Array<BIFilter>;
+ hierarchies?: (Array<BIHierarchy> | null) | undefined;
limit: BIQueryLimit;
localFields?: (Array<BIField> | null) | undefined;
missingDates?: (MissingDates | null) | undefined;
@@ -6317,6 +6347,7 @@ export namespace Schemas {
};
export type DashboardFilter = Partial<{
breakdown_filter: BreakdownFilter | null;
+ compareFilter: CompareFilter | null;
date_from: string | null;
date_to: string | null;
explicitDate: boolean | null;
@@ -8416,7 +8447,8 @@ export namespace Schemas {
| "first_seen"
| "occurrences"
| "users"
- | "sessions";
+ | "sessions"
+ | "severity";
export type OrderDirection2 = "ASC" | "DESC";
export type ErrorTrackingPendingFingerprintIssueStateUpdate = {
assigned_role_id?: (string | null) | undefined;
@@ -9042,6 +9074,41 @@ export namespace Schemas {
name: string | null;
description: string | null;
}>;
+ /**
+ * * `agent_reported` - agent_reported
+ * * `agent_server_crash` - agent_server_crash
+ * * `agent_declined` - agent_declined
+ * * `output_parse_failed` - output_parse_failed
+ * * `poll_timeout` - poll_timeout
+ * * `pi_runtime_error` - pi_runtime_error
+ * * `upstream_stream_terminated` - upstream_stream_terminated
+ * * `upstream_connection_error` - upstream_connection_error
+ * * `upstream_timeout` - upstream_timeout
+ * * `upstream_provider_failure` - upstream_provider_failure
+ * * `upstream_request_rejected` - upstream_request_rejected
+ * * `content_block_rejection` - content_block_rejection
+ * * `turn_ended_without_response` - turn_ended_without_response
+ * * `subscription_usage_limit` - subscription_usage_limit
+ * * `task_spend_limit` - task_spend_limit
+ * * `agent_error` - agent_error
+ */
+ export type ErrorTypeEnum =
+ | "agent_reported"
+ | "agent_server_crash"
+ | "agent_declined"
+ | "output_parse_failed"
+ | "poll_timeout"
+ | "pi_runtime_error"
+ | "upstream_stream_terminated"
+ | "upstream_connection_error"
+ | "upstream_timeout"
+ | "upstream_provider_failure"
+ | "upstream_request_rejected"
+ | "content_block_rejection"
+ | "turn_ended_without_response"
+ | "subscription_usage_limit"
+ | "task_spend_limit"
+ | "agent_error";
/**
* * `active` - Active
* * `paused` - Paused
@@ -9910,6 +9977,7 @@ export namespace Schemas {
* * `srm` - Sample Ratio Mismatch
* * `zero_exposures` - Zero Exposures
* * `forced_variant_release_condition` - Forced Variant Release Condition
+ * * `flag_variants_mismatch` - Flag Variants Mismatch
*/
export type ExperimentHealthFindingCodeEnum =
| "flag_off_while_running"
@@ -9920,7 +9988,8 @@ export namespace Schemas {
| "no_metric"
| "srm"
| "zero_exposures"
- | "forced_variant_release_condition";
+ | "forced_variant_release_condition"
+ | "flag_variants_mismatch";
/**
* * `critical` - Critical severity
* * `warning` - Warning severity
@@ -9960,6 +10029,7 @@ export namespace Schemas {
* * `srm` - Sample Ratio Mismatch
* * `zero_exposures` - Zero Exposures
* * `forced_variant_release_condition` - Forced Variant Release Condition
+ * * `flag_variants_mismatch` - Flag Variants Mismatch
*/
code: ExperimentHealthFindingCodeEnum;
/**
@@ -10310,7 +10380,7 @@ export namespace Schemas {
*/
resolved_exposure_event: string;
/**
- * Health check diagnostics for this experiment: problems in its configuration and its feature flag that keep it from producing trustworthy results, each with a fix. Read `findings` first when you diagnose an experiment. Null where health checks are not enabled yet.
+ * Always null. Read the health findings from `GET /api/projects/{project_id}/experiments/{id}/health/`: problems in this experiment's configuration and its feature flag that keep it from producing trustworthy results, each with a fix.
*/
health: ExperimentHealth | null;
/**
@@ -10612,7 +10682,7 @@ export namespace Schemas {
*/
resolved_exposure_event: string;
/**
- * Health check diagnostics for this experiment: problems in its configuration and its feature flag that keep it from producing trustworthy results, each with a fix. Read `findings` first when you diagnose an experiment. Null where health checks are not enabled yet.
+ * Always null. Read the health findings from `GET /api/projects/{project_id}/experiments/{id}/health/`: problems in this experiment's configuration and its feature flag that keep it from producing trustworthy results, each with a fix.
*/
health: ExperimentHealth | null;
/**
@@ -12256,6 +12326,13 @@ export namespace Schemas {
* * `ChessCom` - ChessCom
* * `Userback` - Userback
* * `Rewardful` - Rewardful
+ * * `Tracklution` - Tracklution
+ * * `StackAdapt` - StackAdapt
+ * * `CheckHQ` - CheckHQ
+ * * `RainforestPay` - RainforestPay
+ * * `Wise` - Wise
+ * * `LaravelCloud` - LaravelCloud
+ * * `Northbeam` - Northbeam
*/
export type ExternalDataSourceTypeEnum =
| "Ashby"
@@ -13632,7 +13709,14 @@ export namespace Schemas {
| "TestDino"
| "ChessCom"
| "Userback"
- | "Rewardful";
+ | "Rewardful"
+ | "Tracklution"
+ | "StackAdapt"
+ | "CheckHQ"
+ | "RainforestPay"
+ | "Wise"
+ | "LaravelCloud"
+ | "Northbeam";
/**
* * `web` - web
* * `api` - api
@@ -15018,6 +15102,13 @@ export namespace Schemas {
* * `ChessCom` - ChessCom
* * `Userback` - Userback
* * `Rewardful` - Rewardful
+ * * `Tracklution` - Tracklution
+ * * `StackAdapt` - StackAdapt
+ * * `CheckHQ` - CheckHQ
+ * * `RainforestPay` - RainforestPay
+ * * `Wise` - Wise
+ * * `LaravelCloud` - LaravelCloud
+ * * `Northbeam` - Northbeam
*/
source_type: ExternalDataSourceTypeEnum;
/**
@@ -15962,6 +16053,7 @@ export namespace Schemas {
>;
export type TileFilters = Partial<{
breakdown_filter: BreakdownFilter | null;
+ compareFilter: CompareFilter | null;
date_from: string | null;
date_to: string | null;
explicitDate: boolean | null;
@@ -18118,6 +18210,8 @@ export namespace Schemas {
is_pending_deletion?: (boolean | null) | undefined;
};
/**
+ * * `approval_requested` - approval_requested
+ * * `approval_resolved` - approval_resolved
* * `data_catalog_weekly_digest` - data_catalog_weekly_digest
* * `discussions_mentioned` - discussions_mentioned
* * `error_tracking_issue_assigned` - error_tracking_issue_assigned
@@ -18131,6 +18225,8 @@ export namespace Schemas {
* * `web_analytics_weekly_digest_project_enabled` - web_analytics_weekly_digest_project_enabled
*/
export type SettingEnum =
+ | "approval_requested"
+ | "approval_resolved"
| "data_catalog_weekly_digest"
| "discussions_mentioned"
| "error_tracking_issue_assigned"
@@ -18146,6 +18242,8 @@ export namespace Schemas {
/**
* Notification setting this rule enforces.
*
+ * * `approval_requested` - approval_requested
+ * * `approval_resolved` - approval_resolved
* * `data_catalog_weekly_digest` - data_catalog_weekly_digest
* * `discussions_mentioned` - discussions_mentioned
* * `error_tracking_issue_assigned` - error_tracking_issue_assigned
@@ -19416,12 +19514,42 @@ export namespace Schemas {
deviceTypesMatchType: SurveyMatchTypeEnum;
linkedFlagVariant: string;
}>;
+ /**
+ * * `top_left` - top_left
+ * * `top_center` - top_center
+ * * `top_right` - top_right
+ * * `middle_left` - middle_left
+ * * `middle_center` - middle_center
+ * * `middle_right` - middle_right
+ * * `left` - left
+ * * `center` - center
+ * * `right` - right
+ * * `next_to_trigger` - next_to_trigger
+ */
+ export type SurveyPositionEnum =
+ | "top_left"
+ | "top_center"
+ | "top_right"
+ | "middle_left"
+ | "middle_center"
+ | "middle_right"
+ | "left"
+ | "center"
+ | "right"
+ | "next_to_trigger";
/**
* * `button` - button
* * `tab` - tab
* * `selector` - selector
*/
export type WidgetTypeEnum = "button" | "tab" | "selector";
+ /**
+ * * `top` - top
+ * * `left` - left
+ * * `right` - right
+ * * `bottom` - bottom
+ */
+ export type SurveyTabPositionEnum = "top" | "left" | "right" | "bottom";
export type SurveyAppearanceSchema = Partial<{
backgroundColor: string;
submitButtonColor: string;
@@ -19432,6 +19560,9 @@ export namespace Schemas {
ratingButtonColor: string;
ratingButtonActiveColor: string;
ratingButtonHoverColor: string;
+ textSubtleColor: string;
+ inputBackground: string;
+ inputTextColor: string;
whiteLabel: boolean;
autoDisappear: boolean;
displayThankYouMessage: boolean;
@@ -19439,21 +19570,30 @@ export namespace Schemas {
thankYouMessageDescription: string;
thankYouMessageDescriptionContentType: DescriptionContentTypeEnum;
thankYouMessageCloseButtonText: string;
+ displayIntroScreen: boolean;
+ introScreenHeader: string;
+ introScreenDescription: string;
+ introScreenDescriptionContentType: DescriptionContentTypeEnum;
+ introScreenButtonText: string;
borderColor: string;
placeholder: string;
+ position: SurveyPositionEnum;
shuffleQuestions: boolean;
- surveyPopupDelaySeconds: number;
+ surveyPopupDelaySeconds: number | null;
allowGoBack: boolean;
backButtonText: string;
widgetType: WidgetTypeEnum;
widgetSelector: string;
widgetLabel: string;
widgetColor: string;
+ tabPosition: SurveyTabPositionEnum;
fontFamily: string;
maxWidth: string;
zIndex: string;
disabledButtonOpacity: string;
boxPadding: string;
+ boxShadow: string;
+ borderRadius: string;
}>;
/**
* * `day` - day
@@ -19528,6 +19668,7 @@ export namespace Schemas {
state_remove_keys: Array<string>;
state_append: Record<string, unknown>;
error_message: string | null;
+ error_type: ErrorTypeEnum | NullEnum;
}>;
/**
* * `onboarding` - Onboarding
@@ -19554,6 +19695,7 @@ export namespace Schemas {
* * `workflow` - Workflow
* * `space_setup` - Space Setup
* * `business_knowledge` - Business Knowledge
+ * * `metrics_import` - Metrics Import
*/
export type TaskOriginProductEnum =
| "onboarding"
@@ -19579,7 +19721,8 @@ export namespace Schemas {
| "task_analysis"
| "workflow"
| "space_setup"
- | "business_knowledge";
+ | "business_knowledge"
+ | "metrics_import";
/**
* * `default` - default
* * `acceptEdits` - acceptEdits
@@ -19818,6 +19961,8 @@ export namespace Schemas {
workflow_task_rate_limit_per_day: number | null;
workflow_task_team_rate_limit_per_day: number | null;
default_email_integration_id: number | null;
+ marketing_frequency_cap_max_messages: number | null;
+ marketing_frequency_cap_window_days: number | null;
}>;
export type TeamFeatureFlagPolicyConfig = Partial<{
require_tags: boolean;
@@ -22689,7 +22834,8 @@ export namespace Endpoints {
| "task_analysis"
| "workflow"
| "space_setup"
- | "business_knowledge";
+ | "business_knowledge"
+ | "metrics_import";
hog_flow_id: string;
internal: "true" | "false" | "all";
limit: number;
diff --git a/products/desktop/pnpm-lock.yaml b/products/desktop/pnpm-lock.yaml
index f3360b0c0fe7..ac735a8c3481 100644
--- a/products/desktop/pnpm-lock.yaml
+++ b/products/desktop/pnpm-lock.yaml
@@ -394,9 +394,6 @@ importers:
playwright:
specifier: ^1.60.0
version: 1.60.0
- prettier:
- specifier: 3.8.1
- version: 3.8.1
storybook:
specifier: 10.4.1
@@ -409,9 +406,6 @@ importers:
tsx:
specifier: ^4.22.3
version: 4.22.4
- typed-openapi:
- specifier: ^2.2.6
typescript:
specifier: ^5.9.3
version: 5.9.3
@@ -905,6 +899,15 @@ importers:
'@posthog/tsconfig':
specifier: workspace:*
version: link:../../tooling/typescript
+ prettier:
+ specifier: 3.8.1
+ version: 3.8.1
+ tsx:
+ specifier: ^4.22.3
+ version: 4.22.4
+ typed-openapi:
+ specifier: 2.2.7
typescript:
specifier: 'catalog:'
version: 5.9.3