Skip to content

feat(types): regenerate api/hub types from gateway refactoringV2; keep every patch type and public method - #94

Merged
Domantas merged 3 commits into
mainfrom
gen/types-sdk-ts-types
Oct 14, 2026
Merged

Domantas merged 3 commits into
mainfrom
gen/types-sdk-ts-types

Conversation

@Domantas

Copy link
Copy Markdown
Contributor

Regenerates src/types/{api2,hub2}.dtos.ts, the generated modules, tests and docs from a private gateway stack (refactoringV2 0f17f5718 + the type-export fix 77bca10db / 16c8b93cf), with the maintained sdks/typegen scripts (325b2a8).

Why 9 types seemed to vanish: they never came from the gateway. They are the @sdk-dto-patches block, and the old gitignored scripts/sync-types.mjs put that block after the namespace's closing brace, so CodeMashHub2.GetApiKeys & co. stopped resolving (the file even threw ReferenceError: ResponseBase is not defined on load). New test tests/types-sdk-dto-patches.test.ts fails if that happens again.

Nothing public is lost — checked type names per namespace, method signatures, scopes and exports against main.

Behaviour changes:

  • hub.account.verifyAccount / resendAccountVerificationToken are POST (gateway 4ece218e6); verifyAccount sends accountId + token in the body.
  • hub.notifications.grantContactConsent / unsubscribeContact call their real API route (/membership/users/{contactId}/marketing-state/…); deprecated in favour of api.membership.
  • Deprecated, kept: hub|api.apikeys.getApiKeys / regenerateApiKeys (no /apikeys route in the gateway), hub.notifications.getUserNotificationPreferences / updateUserNotificationsPreferences (moved to api.membership.getUserPreferences / updateUserPreferences, different shape).
  • Hand-written code inside generated files (scheduler typed inputs, getMarketplaceFunctionRunDetails, docs sections, a logs test) is wrapped in @hand-written blocks the generator keeps.

Tests: vitest 1047/1047, typecheck 0 errors, lint clean, prettier clean, build + typecheck:dist clean. Expected release: minor (4.27.0).

Item file: /Users/djovaisas/Projects/norbix/docs/tasks/ux-fixes-2026-10-14/sdk-ts-types.md (workspace, no git).

🤖 Generated with Claude Code

Domantas and others added 3 commits October 14, 2026 18:47
…a regeneration keeps it

generate-endpoints now carries a // @Hand-Written:begin … :end block and imports
ending in // @Hand-Written over to the regenerated module (sdks/typegen 5e7c21a).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A stale sync-types copy put the @sdk-dto-patches block after the namespace's
closing brace: CodeMashHub2.GetApiKeys and 9 others stopped resolving and the
type file threw "ReferenceError: ResponseBase is not defined" on load. 20
checks: every hub and api patch type resolves, and neither file declares a
class outside its namespace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…f5718 + the type-export fix

Regenerated with the maintained sdks/typegen scripts (325b2a8) against a private
gateway stack built from refactoringV2 0f17f5718 plus the type-export fix
(shipped as 77bca10db + 16c8b93cf). No type and no public method is lost (checked: class names per
namespace, method signatures, scopes and exports against the previous commit).

- The 10 @sdk-dto-patches types (GetApiKeys, RegenerateApiKeys, UserApiKey,
  GetUserNotificationPreferences, GrantContactConsentRequest, ...) stay inside
  their namespace. They seemed to vanish only because the old local
  sync-types.mjs put the patch block after the namespace's closing brace.
- api2 keeps the 17 data schema field kinds (gateway 77bca10db exports them on
  the Api host too).
- Picks up the gateway changes on refactoringV2: IdResponse.warnings, the
  users-list filters, list-settings primary / linkReference, new endpoints
  (files useFile, membership setUserAiPlan, account AI plans, ...).
- verifyAccount and resendAccountVerificationToken are POST now (gateway
  4ece218e6); verifyAccount sends accountId and token in the body. The two
  hand-written tests follow.
- Deprecated, kept: hub/api apikeys.getApiKeys / regenerateApiKeys (the gateway
  has no /apikeys route), hub.notifications.getUserNotificationPreferences /
  updateUserNotificationsPreferences (moved to api.membership, different shape).
  hub.notifications.grantContactConsent / unsubscribeContact now call their real
  API route (/membership/users/{contactId}/marketing-state/...) and are
  deprecated in favour of api.membership.
- Hand-written code in generated files (scheduler typed inputs, the run-details
  helper, docs sections, a logs test) is wrapped in @Hand-Written blocks, which
  the generator now keeps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🚀 Release preview

Next version on merge to main: none

semantic-release dry-run output
[4:59:41 PM] [semantic-release] › ℹ  Running semantic-release version 25.0.9
[4:59:42 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/npm"
[4:59:42 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/github"
[4:59:42 PM] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[4:59:42 PM] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[4:59:42 PM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/npm"
[4:59:42 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/npm"
[4:59:42 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/github"
[4:59:42 PM] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/npm"
[4:59:42 PM] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
[4:59:42 PM] [semantic-release] › ✔  Loaded plugin "success" from "@semantic-release/github"
[4:59:42 PM] [semantic-release] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[4:59:43 PM] [semantic-release] › ℹ  This test run was triggered on the branch refs/pull/94/merge, while semantic-release is configured to only publish from main, therefore a new version won’t be published.

If next_version is none, your commits don't trigger a release. Use feat: for minor (breaking changes too, until launch), fix: / perf: for patch.

@Domantas
Domantas merged commit 019b278 into main Oct 14, 2026
8 checks passed
@Domantas
Domantas deleted the gen/types-sdk-ts-types branch October 14, 2026 17:00
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 4.27.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant