forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactors models to make it more clear what our data model is internally and what our API responses are. Also some small changes to make it more elasticsearch-y: - isSchema variants now are based on specific type narrowing instead of from any > type, as the latter only gives runtime safety, but does not add much in terms of type safety - validation is now entirely encapsulated in the type, removed additional checks such as `isCompleteCondition` - the stored document puts all stream properties top level (currently only `ingest`, instead of `stream.ingest`) - `condition` is renamed to `if`, and required everywhere - `always` and `never` conditions were added - `grok` and `dissect` processors are now similar to ES, where the condition is a part of the processor config - `GET /api/streams/{id}` returns `{ stream: ..., dashboards: ..., ... }` instead of `{ ingest: ...., dashboards: ..., ... }` - `PUT /api/streams/{id}` now requires `dashboards`, and `stream` is a top-level property - `PUT /api/streams/{id}/_ingest` was added to allow consumers to only update the stream, and not its assets - there are some legacy definitions (in `legacy.ts`) to minimize the amount of changes in the UI, this still needs to happen at some point but not in this PR --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
f4ff699
commit 8d4a70c
Showing
90 changed files
with
1,964 additions
and
1,436 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,5 @@ | |
* 2.0. | ||
*/ | ||
|
||
export * from './src/apis'; | ||
export * from './src/models'; | ||
export * from './src/helpers'; |
111 changes: 0 additions & 111 deletions
111
...ity/packages/kbn-streams-schema/src/apis/__snapshots__/read_streams_response.test.ts.snap
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
x-pack/solutions/observability/packages/kbn-streams-schema/src/apis/list_streams_response.ts
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
...olutions/observability/packages/kbn-streams-schema/src/apis/read_streams_response.test.ts
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
x-pack/solutions/observability/packages/kbn-streams-schema/src/apis/read_streams_response.ts
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,5 @@ | |
* 2.0. | ||
*/ | ||
|
||
export * from './processing'; | ||
export * from './type_guards'; | ||
export * from './hierarchy'; |
38 changes: 0 additions & 38 deletions
38
x-pack/solutions/observability/packages/kbn-streams-schema/src/helpers/processing.ts
This file was deleted.
Oops, something went wrong.
This file contains 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
19 changes: 19 additions & 0 deletions
19
x-pack/solutions/observability/packages/kbn-streams-schema/src/models/api.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { z } from '@kbn/zod'; | ||
import { | ||
ingestStreamUpsertRequestSchema, | ||
type IngestStreamGetResponse, | ||
type IngestStreamUpsertRequest, | ||
} from './ingest'; | ||
|
||
export const streamUpsertRequestSchema: z.Schema<StreamUpsertRequest> = | ||
ingestStreamUpsertRequestSchema; | ||
|
||
export type StreamGetResponse = IngestStreamGetResponse; | ||
export type StreamUpsertRequest = IngestStreamUpsertRequest; |
Oops, something went wrong.