Skip to content

feat: take the API contract types from kuzzle-types - #771

Merged
rolljee merged 2 commits into
7-devfrom
feat/kuzzle-types
Sep 30, 2026
Merged

rolljee merged 2 commits into
7-devfrom
feat/kuzzle-types

Conversation

@rolljee

@rolljee rolljee commented Sep 30, 2026

Copy link
Copy Markdown
Member

Kuzzle ADR-0002 step 03: the API contract types move to kuzzle-types (types only, no dependency), shared by the server and the SDK.

Change

  • kuzzle-types becomes a dependency (^1.0.0-beta.1).
  • Every file of src/types/ stays, now a type re-export of kuzzle-types under the same names — deep imports keep working, and the SDK's own code is untouched.
  • Document (deprecated) stays in the SDK: it is a class, a runtime value, which kuzzle-types declares as an interface. DocumentHit stays with it.

Not breaking — checked

  • Exported names: the 139 names of out/index.d.ts and their kind (type / value) — identical before and after (compiler API listing, diffed).
  • Runtime: the 27 runtime exports of out/index.js — identical; kuzzle-types never reaches dist/kuzzle.js (type-only re-exports).
  • Types: each of the 40 contract types identical (not merely assignable) to kuzzle-sdk 7.17.1's, Document included.
  • Module augmentation (declare module "kuzzle-sdk" { interface KDocumentContent … }) still merges through the re-export — tested on TS 5.4.5, node10 and node16 resolution.
  • Kuzzle built against this SDK (packed): tsc, its typings gate (typecheck:typings, both strict modes, pins the 139 re-exported names) and typecheck:tests are green.
  • Unit tests: 686 passing; lint clean.

Gate added

test/types/kuzzle-types.ts, run by npm run test:types (strict, against the built declarations, in the unit-tests CI action after the build): every contract type still exported, identical to kuzzle-types'. Checked it bites.

Before a stable release

^1.0.0-beta.1 is a prerelease range: publish kuzzle-types 1.0.0 and bump this to ^1.0.0 before the SDK goes stable (no prerelease runtime dependency in a stable release).

🤖 Generated with Claude Code

rolljee and others added 2 commits September 30, 2026 16:32
The types of src/types (JSONObject, KDocument*, RequestPayload / ResponsePayload, Notification, mappings, security definitions, m* requests and responses...) now come from kuzzle-types, the types-only package the server and the SDK share (Kuzzle ADR-0002 step 03). Every file of src/types stays, as a type re-export under the same names, so deep imports keep working.

Document stays here: it is a class, a runtime value, which kuzzle-types declares as an interface. DocumentHit, which extends it, stays too.

Not breaking: the 139 exported names and their kinds are unchanged, the 27 runtime exports are unchanged, and each contract type is identical to kuzzle-sdk 7.17.1's (Document included).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…anged

test/types/kuzzle-types.ts, type-checked in strict mode against the built declarations by `npm run test:types` (run in the unit-tests CI action after the build): every contract type is still exported, identical to kuzzle-types' — which asserts they are kuzzle-sdk 7.17.1's. Checked it bites.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rolljee
rolljee merged commit f4418b6 into 7-dev Sep 30, 2026
12 checks passed
@kuzzle

kuzzle commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 7.18.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@kuzzle

kuzzle commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 7.18.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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants