Skip to content

feat(entity-client): regenerate from the Entity API spec merged on main - #484

Merged
josecarneiro merged 1 commit into
mainfrom
claude/conditional-pricing-variant-overridable-tn6k5z
Sep 4, 2026
Merged

feat(entity-client): regenerate from the Entity API spec merged on main#484
josecarneiro merged 1 commit into
mainfrom
claude/conditional-pricing-variant-overridable-tn6k5z

Conversation

@josecarneiro

@josecarneiro josecarneiro commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Regenerates @epilot/entity-client (and the v2 @epilot/sdk artifacts derived from it) from the Entity API spec as merged on entity-api main, rather than hand-editing model files. Two merged changes come across:

  • overridable_attribute documents what it accepts and rejects — accepted on scalar attributes and on relations (a variant overrides a relation by replacing its whole $relation list, e.g. a product's prices); rejected on system (_-prefixed), readonly, hidden, computed and repeatable attributes. From entity-api!1704.
  • A select condition declares its vocabulary as options — a bare value or a { value, title } object, matching a select attribute's options — replacing values: string[]. From the select-options MR merged after it.

How it was generated

node scripts/update-openapi.js <default> <entity-api main openapi.yml>   # in clients/entity-client
npx openapicmd openapi typegen src/openapi.json --client > src/openapi.d.ts
tsx scripts/generate-sdk-v2.ts && pnpm lint:fix

The spec was taken from entity-api origin/main, not from https://docs.api.epilot.io/entity.yaml: the merged changes are not deployed to prod yet, so the published spec still serves the old shape. This is the "use a local spec file (e.g. if still deploying)" path in the SDK client docs. Re-running against prod after the deploy should be a no-op.

The generator rewrites every client's apis/*.ts without semicolons and lint:fix puts them back, so the intermediate run touched 110 files; after the chained lint:fix only the entity files below remain changed.

Changed files

File Change
clients/entity-client/src/openapi.json regenerated spec
clients/entity-client/src/openapi.d.ts regenerated types
packages/epilot-sdk-v2/src/types/entity.d.ts regenerated v2 types
packages/epilot-sdk-v2/src/docs/entity.json, docs/entity.md regenerated docs
.changeset/entity-client-conditional-pricing-regen.md minor bump for @epilot/entity-client and @epilot/sdk

src/definitions/entity*.json is a compacted definition that carries no schema descriptions, so it is correctly unchanged.

Note for consumers

SelectConditionDefinition.values: string[] becomes options?: Array<string | { value: string; title?: string }>. Anything reading values off a select condition needs updating. This lands as a minor bump, matching how the earlier conditional-pricing regenerations were versioned while the feature is still behind a flag — say the word if you would rather it went out as major.

Relationship to #479

#479 (relation types added to OVERRIDABLE_ATTRIBUTE_TYPE_LIST in the pricing model) has since been merged and released as @epilot/sdk@2.20.4. This PR is complementary and does not touch those files — it is scoped to the entity-client regeneration, so the two compose cleanly and mergeable_state is still clean against the advanced base.

Test plan

  • pnpm --filter @epilot/entity-client run test — 3 passed; tsc --noEmit clean
  • pnpm lint (biome, 524 files) — no fixes applied
  • Spec diff verified to contain only the two intended changes (no structural drift: 148 schemas and 64 paths before and after)
  • CI green on f0bd4a6 — Lint, Test, Analyze (javascript), CodeQL all pass. (The 30 @epilot/sdk test failures seen while developing were local only: the sandbox's HTTPS proxy prepends itself to test URLs, giving ERR_INVALID_URL. Identical counts on a clean main checkout, and CI has no such proxy.)

🤖 Generated with Claude Code

https://claude.ai/code/session_01AjvE4vREJChRUTwAfNW3LZ


Generated by Claude Code

Picks up two merged Entity API changes: `overridable_attribute` now
documents what it accepts and rejects (scalars and relations accepted;
system, readonly, hidden, computed and repeatable rejected), and a
`select` condition declares its vocabulary as `options` — a bare value or
a `{ value, title }` object — replacing `values: string[]`.

Regenerated with `update-openapi.js` against the merged spec (prod does
not serve it yet), then `typegen` and `generate-sdk-v2`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AjvE4vREJChRUTwAfNW3LZ
@josecarneiro
josecarneiro merged commit 4a980da into main Sep 4, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants