chore(codegen): daily schema refresh (2026-07-28) - #105
Draft
timgl wants to merge 1 commit into
Draft
Conversation
Regenerate src/generated/api.d.ts from the live PostHog OpenAPI spec and
reconcile managed-resource drift.
- endpoints resource moved from /api/environments/{environment_id}/endpoints/
(environments_endpoints_*) to /api/projects/{project_id}/endpoints/
(endpoints_*); added the endpoints_* CRUD ops to openapi-filter.yaml and
repointed the endpoint client paths/params.
- patched stale schema references: PatchedDashboard -> PatchedPatchedDashboardOpenApi,
PatchedExperiment -> PatchedExperimentWrite, PaginatedExperimentList ->
PaginatedExperimentBasicList, and the experiment write body Experiment ->
ExperimentWrite.
Generated-By: PostHog Code
Task-Id: db3032f0-7553-4d21-9ab5-ccd55a893746
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Automated daily OpenAPI schema refresh. The live PostHog spec drifted (
api.d.ts changed: true), sosrc/generated/api.d.tswas regenerated and managed-resource drift reconciled.Spec diff size
src/generated/api.d.ts: +3571 / −1537 lines (regenerated viapnpm codegen, never hand-edited).New operationIds added to the filter
The
endpointsresource was renamed/moved in the live spec:environments_endpoints_*at/api/environments/{environment_id}/endpoints/→endpoints_*at/api/projects/{project_id}/endpoints/.Added the matching CRUD operationIds to
openapi-filter.yaml:Only the 6 CRUD ops the endpoint resource manages were added (the spec also exposes
endpoints_logs_*,endpoints_run_*,endpoints_versions_*,endpoints_materialization_*, etc. — out of scope for this resource).Resources touched
src/resources/endpoint/client.ts): repointed all five operations from/api/environments/{environment_id}/endpoints/…to/api/projects/{project_id}/endpoints/…and renamed theenvironment_idpath param toproject_id. Retrieve now returnsEndpointVersionResponse(a superset ofEndpointResponse), so the projection is unaffected.src/resources/dashboard/client.ts): PATCH body schema renamedPatchedDashboard→PatchedPatchedDashboardOpenApi. That schema no longer listsdeleted, so the soft-delete PATCH now casts past the schema (same pattern the experiment client already uses); runtime behavior is unchanged.src/resources/experiment/client.ts):PatchedExperiment→PatchedExperimentWrite,PaginatedExperimentList→PaginatedExperimentBasicList, and the create/update body targetExperiment→ExperimentWrite(POST/PUT/PATCH now take the*Writevariants). Bodies are cast, so this is a type-alias accuracy fix.Unresolved drift (needs a human)
environments_endpoints_list/create/retrieve/update/partial_update/destroyno longer exist in the live spec (renamed as above). Per policy they were not removed — they are kept inopenapi-filter.yamlwith a note so a human can confirm the migration and delete them (openapi-formatignores unmatched ids, so they're harmless meanwhile).event_definitions_update,event_schemas_update/event_schemas_partial_update,experiment_holdouts_update,experiment_saved_metrics_update,experiments_update, andcohorts_update. These families intentionally manage updates via PATCH, not PUT, and their clients have no PUT consumer, so adding them would only widen the generated surface. Left out by design.add-resourceskill, registration, and tests — out of scope for an automated refresh.Verification
pnpm typecheck,pnpm test(291 passed), andpnpm buildall pass. Pre-existing repo-wide lint/format warnings are untouched (unrelated files).TaskRun
https://us.posthog.com/project/423401/tasks/db3032f0-7553-4d21-9ab5-ccd55a893746
Created with PostHog Code