feat: take the API contract types from kuzzle-types - #771
Merged
Merged
Conversation
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>
This was referenced Sep 30, 2026
Merged
Contributor
|
🎉 This PR is included in version 7.18.0-beta.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Merged
Contributor
|
🎉 This PR is included in version 7.18.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-typesbecomes a dependency (^1.0.0-beta.1).src/types/stays, now a type re-export ofkuzzle-typesunder 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, whichkuzzle-typesdeclares as an interface.DocumentHitstays with it.Not breaking — checked
out/index.d.tsand their kind (type / value) — identical before and after (compiler API listing, diffed).out/index.js— identical;kuzzle-typesnever reachesdist/kuzzle.js(type-only re-exports).Documentincluded.declare module "kuzzle-sdk" { interface KDocumentContent … }) still merges through the re-export — tested on TS 5.4.5,node10andnode16resolution.tsc, its typings gate (typecheck:typings, both strict modes, pins the 139 re-exported names) andtypecheck:testsare green.Gate added
test/types/kuzzle-types.ts, run bynpm run test:types(strict, against the built declarations, in the unit-tests CI action after the build): every contract type still exported, identical tokuzzle-types'. Checked it bites.Before a stable release
^1.0.0-beta.1is a prerelease range: publishkuzzle-types1.0.0 and bump this to^1.0.0before the SDK goes stable (no prerelease runtime dependency in a stable release).🤖 Generated with Claude Code