@@ -11,13 +11,14 @@ import type {
1111 IndicesDataStream ,
1212 IndicesGetDataStreamResponse ,
1313 QueryDslQueryContainer ,
14+ Result ,
1415} from '@elastic/elasticsearch/lib/api/types' ;
15- import type { IScopedClusterClient , KibanaRequest , Logger } from '@kbn/core/server' ;
16+ import type { IScopedClusterClient , Logger , KibanaRequest } from '@kbn/core/server' ;
1617import { isNotFoundError } from '@kbn/es-errors' ;
17- import type { LockManagerService } from '@kbn/lock-manager' ;
18- import type { Condition } from '@kbn/streamlang' ;
1918import type { RoutingStatus } from '@kbn/streams-schema' ;
2019import { Streams , getAncestors , getParentId } from '@kbn/streams-schema' ;
20+ import type { LockManagerService } from '@kbn/lock-manager' ;
21+ import type { Condition } from '@kbn/streamlang' ;
2122import type { AssetClient } from './assets/asset_client' ;
2223import type { QueryClient } from './assets/query/query_client' ;
2324import {
@@ -26,11 +27,9 @@ import {
2627} from './errors/definition_not_found_error' ;
2728import { SecurityError } from './errors/security_error' ;
2829import { StatusError } from './errors/status_error' ;
29- import { StreamsStatusConflictError } from './errors/streams_status_conflict_error' ;
30- import type { FeatureClient } from './feature/feature_client' ;
3130import { LOGS_ROOT_STREAM_NAME , rootStreamDefinition } from './root_stream_definition' ;
32- import { State } from './state_management/state' ;
3331import type { StreamsStorageClient } from './storage/streams_storage_client' ;
32+ import { State } from './state_management/state' ;
3433import { checkAccess , checkAccessBulk } from './stream_crud' ;
3534import { StreamsStatusConflictError } from './errors/streams_status_conflict_error' ;
3635import type { FeatureClient } from './feature/feature_client' ;
@@ -326,23 +325,6 @@ export class StreamsClient {
326325 throw new StatusError ( `Child stream ${ name } already exists` , 409 ) ;
327326 }
328327
329- // TODO - These constants need to be shared between both plugins so I don't have to duplicate them
330- // TODO: need to know prefix to do min check properly
331- logger . info ( `parent: ${ parent } , \n name: ${ name } ` ) ;
332- const MIN_NAME_LENGTH = 6 ; // 'logs.' is already included which is 5 characters, so user must enter at least one more.
333- const MAX_NAME_LENGTH = 200 ;
334-
335- if ( name . length < MIN_NAME_LENGTH ) {
336- throw new StatusError ( 'Stream name must not be empty.' , 400 ) ;
337- }
338-
339- if ( name . length > MAX_STREAM_NAME_LENGTH ) {
340- throw new StatusError (
341- `Stream name cannot be longer than ${ MAX_STREAM_NAME_LENGTH } characters.` ,
342- 400
343- ) ;
344- }
345-
346328 await State . attemptChanges (
347329 [
348330 {
0 commit comments