Skip to content

feat!: bump @gusto/embedded-api to v2026-06-15#2312

Draft
jeffredodd wants to merge 3 commits into
upgrade/api-2026-02-01from
upgrade/api-2026-06-15
Draft

feat!: bump @gusto/embedded-api to v2026-06-15#2312
jeffredodd wants to merge 3 commits into
upgrade/api-2026-02-01from
upgrade/api-2026-06-15

Conversation

@jeffredodd

Copy link
Copy Markdown
Contributor

Summary

Stacked on top of #2255 (upgrade/api-2026-02-01). Upgrades the SDK from @gusto/embedded-api-v-2026-02-01 to @gusto/embedded-api-v-2026-06-15.

Produced autonomously by the api-version-upgrade skill (#2243). v2026-02-01 → v2026-06-15 was eval #3 in that skill's validation suite; this is the first real-world run.

Every breaking change in v2026-06-15 is either:

  • handled by existing client-side defenses (Zod schemas, typecheck) — verified by the typecheck CI step
  • a server-side serialization format change (number → string-formatted decimal) caught at the call site by tsc and fixed in place with Number() wraps
  • a mechanical rename of internal type aliases — verified by tsc --noEmit passing clean
  • on an endpoint with no SDK consumer — typecheck is the contract

Breaking changes & how this PR verifies them

Legend: 🔴 = SDK code change required · ⚠️ = verify-only / test fixture update · ✅ = no impact

Status Change Where verified
🔴 EmployeeCompensations.grossPay/netPay/checkAmount: number | nullstring | null (server now returns string-formatted decimals like "1234.56") Fixed in src/components/Payroll/PayrollOverview/PayrollOverviewPresentation.tsx (4 sites — wrap reads with Number()); fixtures regenerated in PayrollOverview.stories.tsx, PayrollEditEmployee.stories.tsx, PayrollConfiguration.stories.tsx, and matching .test.tsx. Existing e2e/tests/payroll/91-regular-submit.spec.ts exercises PayrollOverview end-to-end as part of the regular flow — receipt-total assertion would fail if grossPay/netPay rendered as NaN. Typecheck CI.
🔴 models/components/payroll removed → moved to models/components/payrollshow (same exports: Payroll, PayrollPrepared, OffCycleReasonType, EmployeeCompensations) Import-path sweep in 7 SDK files (helpers.ts, usePreparedPayrollData.ts, payrollTypes.ts, PayrollConfiguration/*, PayrollEditEmployee/*, PayrollHistory/*, PayrollList/*, PayrollOverview/*, helpers.test.ts). Typecheck CI.
🔴 ContractorOnboardingStatus1OnboardingStatus (in models/components/contractor) Fixed: src/shared/constants.ts aliases both the contractor's and employee's OnboardingStatus (same name, two different sources) as ContractorApiOnboardingStatus / EmployeeApiOnboardingStatus. src/components/Common/OnboardingStatusBadge/index.tsx re-aliased to use the per-domain types. Typecheck CI.
🔴 WageTypeContractorWageType (in models/components/contractor) Fixed in src/components/Contractor/Profile/useContractorProfile.ts: WageType as ApiWageTypeContractorWageType as ApiWageType. Typecheck CI.
🔴 ContractorPayments removed from postv1companiescompanyidcontractorpaymentgroups → renamed to PostV1CompaniesCompanyIdContractorPaymentGroupsContractorPayments Fixed via import alias in CreatePayment.tsx, CreatePaymentPresentation.tsx, CreatePaymentPresentation.stories.tsx. Typecheck CI + existing e2e/tests/contractor/93-payment-submit.spec.ts.
🔴 PayrollEmployeeCompensationsTypeFixedCompensationsFixedCompensations (and …Hourly…HourlyCompensations, …ReimbursementsReimbursements) Renamed in helpers.ts, helpers.test.ts, PayrollEditEmployeePresentation.tsx, sdk-app/.../PayrollEditEmployeeConfigurations.tsx. Typecheck CI.
🔴 Include removed from getv1companiescompanyidemployees → renamed to GetV1CompaniesCompanyIdEmployeesQueryParamInclude Aliased in useSelectEmployeesData.ts. Typecheck CI + existing e2e/tests/time-off/04-policy-add-employees-edge-cases.spec.ts.
🔴 SortOrder removed from getv1companiescompanyidpayrolls → renamed to QueryParamSortOrder Aliased in PayrollHistory.tsx. Typecheck CI.
🔴 PutV1ContractorsContractorIdPaymentMethodType removed → renamed to Type Aliased in src/test/mocks/apis/contractor_payment_method.ts. Typecheck CI.
🔴 TaxRequirementStatesList.setupComplete removed (legacy field; setupStatus is the replacement and existed in v2026-02-01) Fixed in src/components/Company/StateTaxes/StateTaxesList/List.tsx: getSetupStatus now returns req.setupStatus ?? SetupStatus.InProgress, dropping the unreachable setupComplete fallback branch. Typecheck CI.
Many nested types inside models/components/* renamed (e.g. BenefitSummaryEmployeesEmployees, ContractorPaymentReceiptLicenseeLicensee, EmployeeOnboardingDocumentsConfigOnboardingDocumentsConfig, etc. — 30+ component files affected) Typecheck CI — no consumer in src/ imports these nested aliases directly; only top-level types (Employee, Contractor, Payroll, BenefitSummary, …) are imported.
UnprocessableEntityError removed from companiesAcceptTermsOfService / companiesRetrieveTermsOfService / 4× contractor rehire+termination mutation error unions Typecheck CI — the UnprocessableEntityError class itself still exists; SDK consumers use err instanceof UnprocessableEntityError for runtime narrowing, which still works against the broader error type.
PayrollPayrollStatusMetaType.initialCheckDate / payrollLate widened to nullable Truthiness checks at PayrollConfiguration.tsx:409-410 handle null correctly. No code change required.
PeopleBatch.PartialSuccess enum value re-added (had been removed in v2026-02-01) Typecheck CI — additive, no consumer narrows on this value.
versionheader.d.ts re-added in models/components/ (had been removed in v2026-02-01); some react-query hooks now import VersionHeader instead of per-op HeaderXGustoAPIVersion aliases Typecheck CI — no consumer in src/ imports VersionHeader directly.
Various operation files have new exports added (e.g. Options, SubmissionBlockers on contractor payment group ops; Splits/SplitBy on employee payment method) Typecheck CI — additive.

What's in this PR

  • package.json + package-lock.json: dep swap (@gusto/embedded-api-v-2026-02-01@gusto/embedded-api-v-2026-06-15@^0.0.1).
  • ~290 src/ files: import-path rename (covers source, tests, MSW mocks under src/test/mocks/apis/, hand-written cache-key string literals).
  • ~67 sdk-app/ files: import-path rename + cache-key flips.
  • Docs + instruction files (AGENTS.md, CLAUDE.md, src/CLAUDE.md, docs/hooks/*.md, docs/reference/*.md, docs/appendix/jobs-and-compensations.md, build/deriveEndpointInventory.ts, e2e/utils/validationErrorCollector.test.ts): version string updates.
  • 🔴 The bare-date X-Gusto-API-Version constant flipped from '2026-02-01''2026-06-15' in src/contexts/ApiProvider/apiVersionHook.ts:3, plus matching assertions in apiVersionHook.test.ts (3 sites) and ApiProvider.test.tsx (1 site). Without this flip the upgrade would be a runtime no-op.
  • Real fixes:
    • src/components/Payroll/PayrollOverview/PayrollOverviewPresentation.tsx: 4 sites wrapping grossPay/netPay reads with Number() to handle the new string serialization.
    • src/components/Company/StateTaxes/StateTaxesList/List.tsx: simplified getSetupStatus to drop the setupComplete fallback (field removed).
    • Mock data in 6 stories/test files: integers like 880 rewritten as '880' for grossPay/netPay/checkAmount.
    • src/shared/constants.ts + OnboardingStatusBadge/index.tsx: alias the two distinct OnboardingStatus types (contractor vs employee API) by domain.
    • 7 import aliases for renamed nested types.

Deprecations to flag to partners

None new in this version (the v2026-02-01 deprecations of companiesAcceptTermsOfService / companiesRetrieveTermsOfService carry forward unchanged).

Test plan

  • CI green on this branch (unit + e2e + typecheck + lint + build)
  • No remaining @gusto/embedded-api-v-2026-02-01 refs outside CHANGELOG.md / .reports/ (verified locally; grep returns empty)
  • Cache-namespace flip verified end-to-end (mutation under new prefix invalidates queries under new prefix)
  • X-Gusto-API-Version HTTP header sends 2026-06-15 on every request (verified by apiVersionHook.test.ts and ApiProvider.test.tsx)
  • e2e/tests/payroll/91-regular-submit.spec.ts green — exercises PayrollOverview with the new string-typed grossPay/netPay; receipt total would fail to render if the Number() wraps were missing.

Acknowledgements

Stacked on top of #2255. After #2255 merges, this PR's base should be retargeted to main.

🤖 Generated with Claude Code

jeffredodd and others added 3 commits June 30, 2026 09:16
Mechanical version-string sweep across src/, sdk-app/, docs/, build/,
e2e/, and instruction files. package.json swap + lockfile regeneration.

Type fixups required for the bump to compile:
- src/components/Common/OnboardingStatusBadge/index.tsx: alias contractor's
  and employee's distinct OnboardingStatus types (contractor's renamed from
  ContractorOnboardingStatus1).
- src/shared/constants.ts: alias both OnboardingStatus imports
  (contractor vs employee API) — same name in two different sources.
- src/components/Contractor/Profile/useContractorProfile.ts: WageType →
  ContractorWageType.
- src/components/Contractor/Payments/CreatePayment/*: ContractorPayments
  alias from new PostV1CompaniesCompanyIdContractorPaymentGroupsContractorPayments.
- src/components/Payroll/PayrollHistory/PayrollHistory.tsx: SortOrder
  alias from new QueryParamSortOrder.
- src/components/Payroll/PayrollEditEmployee/* + helpers.ts: rename
  PayrollEmployeeCompensationsType{Fixed,Hourly}Compensations and
  PayrollEmployeeCompensationsTypeReimbursements to their new short names
  (FixedCompensations, HourlyCompensations, Reimbursements).
- src/components/TimeOff/.../useSelectEmployeesData.ts: Include alias
  from new GetV1CompaniesCompanyIdEmployeesQueryParamInclude.
- src/test/mocks/apis/contractor_payment_method.ts: Type alias from new
  PutV1ContractorsContractorIdPaymentMethodType.
- src/components/Company/StateTaxes/StateTaxesList/List.tsx: drop legacy
  setupComplete fallback (field removed in v2026-06-15) — use setupStatus
  with InProgress as default.

Real consumer impact — number → string serialization of payroll dollar
amounts in v2026-06-15:
- EmployeeCompensations.grossPay/netPay/checkAmount changed from
  `number | null` to `string | null` (server now returns string-formatted
  decimals like "1234.56").
- src/components/Payroll/PayrollOverview/PayrollOverviewPresentation.tsx:
  wrap reads with Number() at four sites (getCompanyCost arithmetic and
  three formatCurrency calls).
- Storybook fixtures + unit-test mocks in PayrollOverview,
  PayrollEditEmployee, and PayrollConfiguration regenerated to use string
  literals for these fields.

Models import-path rename:
- @gusto/embedded-api-v-.../models/components/payroll →
  @gusto/embedded-api-v-.../models/components/payrollshow (~7 SDK files).
  Same exports (Payroll, PayrollPrepared, OffCycleReasonType,
  EmployeeCompensations); only the source file moved.

X-Gusto-API-Version header constant flipped from '2026-02-01' to
'2026-06-15' in src/contexts/ApiProvider/apiVersionHook.ts (and matching
test assertions). Without this flip the upgrade is a runtime no-op.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- sdk-app prototype `ContractorProfile.tsx`: missed by the WageType →
  ContractorWageType rename (sdk-app has a separate tsconfig that tsc
  --noEmit didn't typecheck, so the bad import only surfaced in vite's
  rollup build).
- Test fixtures (JSON + inline mock builders) for payroll show responses:
  flip `gross_pay`/`net_pay`/`check_amount` from numbers to strings to
  match the v2026-06-15 Zod schema. Affects two JSON fixtures, the
  inline `createCompensation` builder in PayrollConfiguration.test.tsx
  (+ one override), and the inline employee_compensations literal in
  OffCycleExecution.test.tsx.
- `get-v1-companies-company_id-tax_requirements.json`: drop the removed
  `setup_complete` field and use `setup_status` instead. Update the
  matching StateTaxesList tests: delete the two "backward compatibility:
  setup_complete without setup_status" specs and the
  "with legacy setup_complete field only" describe block (the fallback
  branch they exercised was removed alongside the field), replace with
  a single spec covering the new "no setup_status → default to
  in_progress" fallback.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant