-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Streams 🌊] Introduce GroupStreams #208126
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
Merged
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
edecbca
[Streams] Introduce GroupedStream
simianhacker b1100eb
Include api into index for grouped models
simianhacker ee9027a
Merge branch 'main' of github.com:elastic/kibana into streams/grouped
simianhacker 8b39702
Fixing type errors
simianhacker 64ea60b
fixing type error
simianhacker 1d7ecf3
refactoring getStream to be more async/await
simianhacker 46c482d
Merge branch 'main' of github.com:elastic/kibana into streams/grouped
simianhacker 06e58f2
Fixing type errors
simianhacker 1a987b0
Merge branch 'main' of github.com:elastic/kibana into streams/grouped
simianhacker 9a30bb4
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine c74f83f
Fixing types
simianhacker fa65dd7
Merge branch 'main' of github.com:elastic/kibana into streams/grouped
simianhacker 682c29b
Merge branch 'main' of github.com:elastic/kibana into streams/grouped
simianhacker 56d64ac
two-types storage adapter
flash1293 15f2b2b
Merge branch 'streams/grouped' of github.com:simianhacker/kibana into…
flash1293 33bd797
renaming UnWired to Unwired
simianhacker 2e3ed33
Adding appropriate type checks and assertions
simianhacker 20c2aa1
Fixing spelling error
simianhacker d7061de
Fixign merge type issues
simianhacker b9090c3
Renaming from GroupedStream to GroupStream
simianhacker b386d07
attempt to fix types
flash1293 3e6610a
fix types
flash1293 8f734f8
Merge branch 'main' of github.com:elastic/kibana into streams/grouped
simianhacker 5f4370a
Fixing some overlooked renames
simianhacker 7095389
Fixing naming
simianhacker eebc7e6
Fixing naming
simianhacker d45df43
Merge branch 'main' of github.com:elastic/kibana into streams/grouped
simianhacker c43c6f8
fixing missing import
simianhacker b50af78
Merge branch 'main' of github.com:elastic/kibana into streams/grouped
simianhacker a0068c3
Fixing name chagnes that didn't get picked up in a merge conflict
simianhacker 2daf0e8
Merge branch 'main' of github.com:elastic/kibana into streams/grouped
simianhacker b069684
Update x-pack/solutions/observability/packages/utils_server/es/storag…
simianhacker 09c7a7b
Update x-pack/solutions/observability/plugins/streams/server/lib/stre…
simianhacker bc2adcd
ensure response matches the type definitions
simianhacker c0d2930
Renaming validateGroupStream to assertVaildGroupMembers
simianhacker d5fd6b5
moving the Zod type closer to the manual type
simianhacker c631b1f
Merge branch 'main' of github.com:elastic/kibana into streams/grouped
simianhacker 3198e5b
Fixing tests to match response from GET /api/streams/{id}
simianhacker 3f4dd69
Merge branch 'main' of github.com:elastic/kibana into streams/grouped
simianhacker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
49 changes: 49 additions & 0 deletions
49
x-pack/solutions/observability/packages/kbn-streams-schema/src/models/group/api.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /* | ||
| * 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 { | ||
| StreamGetResponseBase, | ||
| streamGetResponseSchemaBase, | ||
| StreamUpsertRequestBase, | ||
| streamUpsertRequestSchemaBase, | ||
| } from '../base/api'; | ||
| import { GroupStreamDefinitionBase, groupStreamDefinitionBaseSchema } from './base'; | ||
|
|
||
| /** | ||
| * Group get response | ||
| */ | ||
| interface GroupStreamGetResponse extends StreamGetResponseBase { | ||
| stream: GroupStreamDefinitionBase; | ||
| } | ||
|
|
||
| const groupStreamGetResponseSchema: z.Schema<GroupStreamGetResponse> = z.intersection( | ||
simianhacker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| streamGetResponseSchemaBase, | ||
| z.object({ | ||
| stream: groupStreamDefinitionBaseSchema, | ||
| }) | ||
| ); | ||
|
|
||
| /** | ||
| * Group upsert request | ||
| */ | ||
| interface GroupStreamUpsertRequest extends StreamUpsertRequestBase { | ||
| stream: GroupStreamDefinitionBase; | ||
| } | ||
|
|
||
| const groupStreamUpsertRequestSchema: z.Schema<GroupStreamUpsertRequest> = z.intersection( | ||
| streamUpsertRequestSchemaBase, | ||
| z.object({ | ||
| stream: groupStreamDefinitionBaseSchema, | ||
| }) | ||
| ); | ||
|
|
||
| export { | ||
| type GroupStreamGetResponse, | ||
| type GroupStreamUpsertRequest, | ||
| groupStreamGetResponseSchema, | ||
| groupStreamUpsertRequestSchema, | ||
| }; | ||
44 changes: 44 additions & 0 deletions
44
x-pack/solutions/observability/packages/kbn-streams-schema/src/models/group/base.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| /* | ||
| * 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 { NonEmptyString } from '@kbn/zod-helpers'; | ||
| import { StreamDefinitionBase } from '../base'; | ||
|
|
||
| interface GroupBase { | ||
simianhacker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| description?: string; | ||
| members: string[]; | ||
| } | ||
|
|
||
| const groupBaseSchema: z.Schema<GroupBase> = z.object({ | ||
| description: z.optional(z.string()), | ||
| members: z.array(NonEmptyString), | ||
| }); | ||
|
|
||
| interface GroupStreamDefinitionBase { | ||
| group: GroupBase; | ||
| } | ||
|
|
||
| const groupStreamDefinitionBaseSchema: z.Schema<GroupStreamDefinitionBase> = z.object({ | ||
| group: groupBaseSchema, | ||
| }); | ||
|
|
||
| type GroupStreamDefinition = StreamDefinitionBase & GroupStreamDefinitionBase; | ||
|
|
||
| const groupStreamDefinitionSchema: z.Schema<GroupStreamDefinition> = z.intersection( | ||
| z.object({ name: NonEmptyString }), | ||
| groupStreamDefinitionBaseSchema | ||
| ); | ||
|
|
||
| export { | ||
| type GroupBase, | ||
| type GroupStreamDefinitionBase, | ||
| type GroupStreamDefinition, | ||
| groupBaseSchema, | ||
| groupStreamDefinitionBaseSchema, | ||
| groupStreamDefinitionSchema, | ||
| }; | ||
9 changes: 9 additions & 0 deletions
9
x-pack/solutions/observability/packages/kbn-streams-schema/src/models/group/index.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| /* | ||
| * 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. | ||
| */ | ||
|
|
||
| export * from './base'; | ||
| export * from './api'; |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.