-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Files] Refactor how types are shared between server and client #141580
[Files] Refactor how types are shared between server and client #141580
Conversation
* main: [Files] Use self destruct flag in upload component (elastic#141366) [Synthetics] Unskip certs flaky test (elastic#141423) updated openapi for bulk action responses (elastic#141566) Fix page responsiveness for smaller screen sizes (elastic#141471)
💚 Build Succeeded
Metrics [docs]
To update your PR or re-run it, just comment with: |
Pinging @elastic/kibana-app-services (Team:AppServicesUx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
) * migrated uploads component and added new way of typing and creating an endpoint * updated create endpoint types * convert delete endpoint * convert download endpoint * convert get by id endpoint * convert list endpoint * convert update endpoint * convert public facing download * convert share get * convert list shares * missed a spot * remove unused import * convert share endpoint * convert unshare endpoint * convert find find endpoint, fix types and fix use of empty value check * convert metrics (cherry picked from commit 6429468)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
) (#141643) * migrated uploads component and added new way of typing and creating an endpoint * updated create endpoint types * convert delete endpoint * convert download endpoint * convert get by id endpoint * convert list endpoint * convert update endpoint * convert public facing download * convert share get * convert list shares * missed a spot * remove unused import * convert share endpoint * convert unshare endpoint * convert find find endpoint, fix types and fix use of empty value check * convert metrics (cherry picked from commit 6429468) Co-authored-by: Jean-Louis Leysens <jeanlouis.leysens@elastic.co>
The current implementation declares all types under
common
and shares these withpublic
andserver
. This results in some duplication because types can be derived from the @kbn/config-schema objects, so we can use them as the source of truth of endpoint input values.Refactor out some repetitive declarations: convert the way we declare the share types to derive their shape from the runtime type checks that live on the server.
The convention is, per endpoint:
CreateEndpoint
type as a generic argumentCreateEndpoint
, i.e.,Endpoint
, to derive types for the client