Skip to content

fix(ts-sdk): export ClusterSortOption type#1171

Open
realfishsam wants to merge 1 commit into
mainfrom
fix/issue-1169-cluster-sort-option
Open

fix(ts-sdk): export ClusterSortOption type#1171
realfishsam wants to merge 1 commit into
mainfrom
fix/issue-1169-cluster-sort-option

Conversation

@realfishsam

Copy link
Copy Markdown
Contributor

Summary

  • Export ClusterSortOption from the TypeScript SDK models to match the Python SDK's canonical cluster sort type.
  • Keep MatchedClusterSort as an alias of ClusterSortOption for existing callers.
  • Add a public type-export regression test.

Fixes #1169

Test Plan

  • RED: npm test --workspace=pmxtjs -- --runInBand tests/public-exports.test.ts failed with Module '../index' has no exported member 'ClusterSortOption'.
  • GREEN/static: npx tsc --noEmit --skipLibCheck --moduleResolution node --target ES2020 --module commonjs sdks/typescript/pmxt/models.ts
  • Local full public-exports Jest is blocked after the fix by missing generated SDK artifacts (../generated/src/index.js). Attempted npm run generate --workspace=pmxtjs, but this runner lacks java for openapi-generator.

@realfishsam

Copy link
Copy Markdown
Contributor Author

CI note after opening this focused #1169 fix:

  • The PR itself only changes sdks/typescript/pmxt/models.ts and sdks/typescript/tests/public-exports.test.ts to add/export the ClusterSortOption type alias.
  • Local focused static check passed: npx tsc --noEmit --skipLibCheck --moduleResolution node --target ES2020 --module commonjs sdks/typescript/pmxt/models.ts.
  • I verified the test is meaningful before the fix: npm test --workspace=pmxtjs -- --runInBand tests/public-exports.test.ts failed with Module '../index' has no exported member 'ClusterSortOption'.
  • After the fix, local full public-exports Jest is blocked by missing generated SDK artifacts (../generated/src/index.js); attempting npm run generate --workspace=pmxtjs is blocked in this runner because java is not installed for openapi-generator.
  • Current red generated-sync checks show broad pre-existing/unrelated generator drift (API_REFERENCE.md sourceExchange/exchange changes, client method hosted-routing diffs, etc.) rather than drift caused by this type alias. I am keeping this PR scoped instead of folding that broad generator churn into a small TS public type export fix.

@realfishsam

Copy link
Copy Markdown
Contributor Author

PR Review: PASS (NOT VERIFIED)

What This Does

Adds ClusterSortOption as a public TypeScript SDK type alias and keeps MatchedClusterSort as an alias of it. This matters to SDK consumers who want to import the canonical cluster sort type from the package root instead of relying on the older matched-cluster-specific name.

Blast Radius

TypeScript SDK public model exports only: sdks/typescript/pmxt/models.ts and the public-export test. No sidecar exchange, router, OpenAPI schema, Python SDK, or runtime HTTP behavior is affected.

Consumer Verification

Before (base branch):
Static consumer-path check on origin/main showed no export type ClusterSortOption; MatchedClusterSort was defined directly as 'volume' | 'confidence'.

// origin/main, sdks/typescript/pmxt/models.ts
export type MatchedClusterSort = 'volume' | 'confidence';

A consumer import such as import type { ClusterSortOption } from 'pmxtjs' would not have a public type to resolve.

After (PR branch):
Static consumer-path check on pr-1171 showed ClusterSortOption is exported and MatchedClusterSort aliases it, so both names share the same literal union.

export type ClusterSortOption = 'volume' | 'confidence';
export type MatchedClusterSort = ClusterSortOption;

Test Results

  • Build: NOT VERIFIED — npm run build --workspace=pmxtjs is blocked in this checkout by missing generated SDK artifacts: Cannot find module '../generated/src/index.js' from pmxt/client.ts and pmxt/server-manager.ts.
  • Unit tests: NOT VERIFIED — targeted npm test --workspace=pmxtjs -- --runTestsByPath tests/public-exports.test.ts hits the same missing ../generated/src/index.js artifact before executing tests.
  • Server starts: N/A — type-export-only SDK change.
  • E2E smoke: N/A — no sidecar API behavior changed.

Findings

No blocking findings.

PMXT Pipeline Check

  • Field propagation (3-layer): N/A
  • OpenAPI sync: N/A
  • Financial precision: N/A
  • Type safety: OK — alias preserves the existing 'volume' | 'confidence' union and keeps MatchedClusterSort backward-compatible.
  • Auth safety: N/A

Semver Impact

patch -- public type export/backward-compatible alias fix.

Risk

I could not run the TypeScript package build or public-export Jest test in this review environment because generated SDK artifacts are absent, so this is verified by static source inspection rather than a compiled package import.

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.

SDK drift: ClusterSortOption type exported from Python but absent from TypeScript (TypeScript only has MatchedClusterSort)

1 participant