Skip to content

SDK regeneration - #25

Closed
chiragjn wants to merge 9 commits into
mainfrom
chiragjn-nullable-optional
Closed

chiragjn wants to merge 9 commits into
mainfrom
chiragjn-nullable-optional

Conversation

@chiragjn

@chiragjn chiragjn commented Jul 29, 2026 •

Copy link
Copy Markdown
Member

Note

Medium Risk
Breaking baseUrl requirement and widespread renamed request types can break existing SDK consumers at compile time; new budget and auth-related endpoints touch tenant security and spend controls.

Overview
Regenerates the TrueFoundry TypeScript SDK from Fern (CLI 5.109.0, generator 3.88.3), aligning the client with the latest API definition and generator behavior.

Breaking client config: TrueFoundryClient now requires baseUrl (generator requireBaseUrl); environment is optional fallback. README and examples switch from environment to baseUrl.

New API surface: Adds client.gatewayBudgets (list, create/update, usage, simulate, get, delete, leaderboard) and a ./gatewayBudgets package export. Also documents/adds methods such as personalAccessTokens.createForUser, agent identity token helpers (getToken, createToken, regenerateToken), and apply support for optional force plus additionalBodyParameters on requests.

Type and doc churn: Many request/response TypeScript names are renamed (e.g. UsersListRequest → ListUsersRequest, InternalGetIdFromFqnRequest → GetIdFromFqnInternalRequest). Reference examples drop placeholder optional fields; several endpoint behaviors are clarified in docs (deployments, virtual accounts, secret sync, token grace periods in minutes).

Build/tooling: scripts/rename-to-esm-files.js now fixes extensionless relative imports for ESM. pnpm-lock.yaml bumps dev dependencies (vitest, vite, webpack, etc.).

Reviewed by Cursor Bugbot for commit be04ef0. Bugbot is set up for automated code reviews on this repo. Configure here.

@chiragjn

This comment was marked as outdated.

@chiragjn

This comment was marked as outdated.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5a728f51-c59c-483b-92cf-8259889ecfe7


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chiragjn

Copy link
Copy Markdown
Member Author

PR #25 breaking-change review (chiragjn-nullable-optional → main)

This is a Fern SDK regeneration (~2,600 files). No public client methods were removed. Most list/filter parameters still exist on the request types; reference.md and README examples were simplified, which can look like removals but is not reflected in the generated interfaces.

Below are the changes that will break existing consumers.


1. Request / response type renames (import breaks)

36 request types were renamed from {Resource}{Action}Request → {Action}{Resource}Request. Any code importing the old names will fail to compile.

Old name New name
UsersListRequest ListUsersRequest
UsersDeleteRequest DeleteUsersRequest
TeamsListRequest ListTeamsRequest
TeamsListMembersRequest ListMembersTeamsRequest
TeamsListManagersRequest ListManagersTeamsRequest
ApplicationsListRequest ListApplicationsRequest
ApplicationVersionsListRequest ListApplicationVersionsRequest
ClustersListRequest ListClustersRequest
ClustersGetAddonsRequest GetAddonsClustersRequest
WorkspacesListRequest ListWorkspacesRequest
WorkspacesSearchRequest SearchWorkspacesRequest
VirtualAccountsListRequest ListVirtualAccountsRequest
JobsListRunsRequest ListRunsJobsRequest
JobsTerminateRequest TerminateJobsRequest
SecretsDeleteRequest DeleteSecretsRequest
PersonalAccessTokensListRequest ListPersonalAccessTokensRequest
PersonalAccessTokensGetRequest GetPersonalAccessTokensRequest
… (same pattern for agents, artifacts, alerts, events, logs, mlRepos, models, prompts, runs, secretGroups, dataDirectories, environments, agentSkills, agentSkillVersions, agentVersions)

Response type rename:

  • ApplicationsCancelDeploymentResponse → CancelDeploymentApplicationsResponse

Scoped enum/type renames tied to requests:

  • AgentsListRequestType → ListAgentsRequestType
  • ApplicationsListRequestDeviceTypeFilter → ListApplicationsRequestDeviceTypeFilter
  • ApplicationsListRequestLifecycleStage → ListApplicationsRequestLifecycleStage

2. Removed exported types (compile breaks)

These types are deleted from src/api/types/ with no same-name replacement:

Removed type Replacement / notes
BuildStatus Renamed → DeploymentBuildStatus (same values: STARTED, SUCCEEDED, FAILED)
IChangeOperation Renamed → IChangeType (same values)
ResourceType Split/replaced by scoped types like UpdateUserRolesRequestResourceType, RoleResourceType, PermissionSetV2ResourceType
GatewayLoggingRule Removed — GatewayLoggingConfig restructured (see §4)
GatewayLoggingWhen Removed — replaced by LoggingWhen

3. Enum member removals (runtime / exhaustiveness breaks)

Enum Removed members Added members
SubjectType ExternalIdentity ("external-identity") Agent, AgentChannelIdentity
SubjectSubjectType (new; used on Subject.subjectType) — Same set as above
RoleBindingSubjectType ExternalIdentity —
RoleWithResourceResourceType ExternalIdentity, SsoBasedIdentity GatewayPolicy, GatewayApprovalRequest, AgentChannel

Code comparing against "external-identity" or "sso-based-identity", or switch/if exhaustiveness over these enums, will break.


4. Model / manifest schema breaks (field removed or renamed)

These are actual field removals or renames on types consumers build or read — not just example/doc changes.

RegenerateVirtualAccountTokenRequest — breaking rename + unit change:

// before
gracePeriodInDays: number
// after
gracePeriodInMinutes: number

Callers passing gracePeriodInDays will fail at compile time; callers passing 30 thinking “days” will behave incorrectly at runtime.

GatewayLoggingConfig — full schema change:

// before
{ name, type, rules: GatewayLoggingRule[] }
// after
{ type, name, when?, log, redactWith? }

The rules array is gone; GatewayLoggingRule type is deleted.

BudgetV2Alert — field removed:

  • notifyBreachingUser?: boolean removed

TrueFoundryAgentUserMessage — discriminator renamed:

// before: role: "user"
// after:  type: "user.message"

IdentityProviderBackedIdentity — literal value changed:

// before: type: "idp-backed"
// after:  type: "identity-provider-backed"

Manifests or comparisons using the old literal will fail validation.

IChange.type — type reference changed:

  • TrueFoundry.IChangeOperation → TrueFoundry.IChangeType

Subject.subjectType — type reference changed:

  • TrueFoundry.SubjectType → TrueFoundry.SubjectSubjectType

DeploymentBuild.status — type reference changed:

  • TrueFoundry.BuildStatus → TrueFoundry.DeploymentBuildStatus

Deployment.deploymentBuilds — element type changed:

  • TrueFoundry.BuildInfo[] → TrueFoundry.DeploymentBuild[]

5. Request parameter type narrowing (compile breaks)

No list/filter fields were removed from public request interfaces, but several union types were narrowed. Code passing a scalar where an array was also allowed will now fail:

Request type Field Before After
ListTeamsRequest, ListClustersRequest, ListWorkspacesRequest, ListAgentsRequest, etc. attributes string | string[] string[] | null
ListVirtualAccountsRequest ownedByTeams string | string[] string[] | null
ListRunsJobsRequest triggeredBy string | string[] string[] | null
ListRunsJobsRequest versionNumbers number | number[] number[] | null

Example fix: attributes: "id,name" → attributes: ["id", "name"].


6. Widespread nullable widening (~409 fields)

Most response/model/request optional fields changed from T to T | null (e.g. Application.id?: string → string | null, Account.createdAt: Date → Date | null).

This is backward-compatible at runtime (existing code still works) but breaks strict TypeScript consumers that assumed non-null when a field is present. Notable clusters:

  • Nearly all entity IDs, timestamps, metadata on Application, Deployment, User, Secret, Cluster, etc.
  • Record<string, string> env maps → Record<string, string | null> | null on job/service configs
  • Error type fields: HttpError.code, HttpError.details now nullable

7. Error class typing (minor compile impact)

Several error subclasses now declare body: TrueFoundry.HttpError explicitly (ConflictError, ForbiddenError, UnauthorizedError, etc.). Code that typed catch blocks against a wider/narrower body shape may need adjustment.


8. Client init / docs (soft break)

README now shows:

new TrueFoundryClient({ baseUrl: "...", apiKey: "..." })

instead of environment. Both baseUrl and environment still exist on BaseClientOptions; environment is still required in the type signature. This is a documentation preference change, not a runtime removal — but copy-paste from README will differ from older code.


9. What is not breaking (for context)

  • New APIs only: client.gatewayBudgets.*, client.agents.{getToken,createToken,regenerateToken}, client.personalAccessTokens.createForUser
  • New optional params: TrueFoundryApplyRequest.force, DeleteUsersRequest.forceDelete, ListTeamsRequest.includeMembership
  • No public client methods removed
  • List endpoints (applications.list, users.list, teams.list, etc.) retain their filter fields — only examples were trimmed

Recommended migration checklist

  1. Global find/replace for the 36 request type renames (or import from regenerated TrueFoundry namespace).
  2. Replace BuildStatus → DeploymentBuildStatus, IChangeOperation → IChangeType, ResourceType → scoped replacements.
  3. Update gracePeriodInDays → gracePeriodInMinutes on virtual account token regeneration.
  4. Migrate GatewayLoggingConfig manifests from rules[] to { when, log, redactWith }.
  5. Update agent message manifests: role: "user" → type: "user.message".
  6. Update identity manifests: "idp-backed" → "identity-provider-backed".
  7. Pass arrays instead of comma-separated strings for attributes, ownedByTeams, triggeredBy, versionNumbers.
  8. Audit code referencing SubjectType.ExternalIdentity or RoleWithResourceResourceType.SsoBasedIdentity / .ExternalIdentity.
  9. Enable/adjust strict-null handling for response types if using strictNullChecks.

If you want, I can turn this into a PR comment or a MIGRATION.md draft keyed to your release version.

@chiragjn chiragjn closed this Aug 31, 2026
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