@@ -402,18 +402,18 @@ async function getUnmanagedElasticsearchAssets({
402402}
403403
404404interface ReadAncestorsParams extends BaseParams {
405- id : string ;
405+ name : string ;
406406}
407407
408408export interface ReadAncestorsResponse {
409409 ancestors : StreamDefinition [ ] ;
410410}
411411
412412export async function readAncestors ( {
413- id ,
413+ name ,
414414 scopedClusterClient,
415415} : ReadAncestorsParams ) : Promise < { ancestors : WiredStreamDefinition [ ] } > {
416- const ancestorIds = getAncestors ( id ) ;
416+ const ancestorIds = getAncestors ( name ) ;
417417
418418 return {
419419 ancestors : await Promise . all (
@@ -430,10 +430,10 @@ export async function readAncestors({
430430}
431431
432432interface ReadDescendantsParams extends BaseParams {
433- id : string ;
433+ name : string ;
434434}
435435
436- export async function readDescendants ( { id , scopedClusterClient } : ReadDescendantsParams ) {
436+ export async function readDescendants ( { name , scopedClusterClient } : ReadDescendantsParams ) {
437437 const response = await scopedClusterClient . asInternalUser . search < WiredStreamDefinition > ( {
438438 index : STREAMS_INDEX ,
439439 size : 10000 ,
@@ -442,12 +442,12 @@ export async function readDescendants({ id, scopedClusterClient }: ReadDescendan
442442 bool : {
443443 filter : {
444444 prefix : {
445- id ,
445+ name ,
446446 } ,
447447 } ,
448448 must_not : {
449449 term : {
450- id ,
450+ name ,
451451 } ,
452452 } ,
453453 } ,
@@ -459,25 +459,25 @@ export async function readDescendants({ id, scopedClusterClient }: ReadDescendan
459459
460460export async function validateAncestorFields (
461461 scopedClusterClient : IScopedClusterClient ,
462- id : string ,
462+ name : string ,
463463 fields : FieldDefinition
464464) {
465465 const { ancestors } = await readAncestors ( {
466- id ,
466+ name ,
467467 scopedClusterClient,
468468 } ) ;
469469 for ( const ancestor of ancestors ) {
470- for ( const name in fields ) {
470+ for ( const fieldName in fields ) {
471471 if (
472- Object . hasOwn ( fields , name ) &&
472+ Object . hasOwn ( fields , fieldName ) &&
473473 isWiredReadStream ( ancestor ) &&
474474 Object . entries ( ancestor . stream . ingest . wired . fields ) . some (
475475 ( [ ancestorFieldName , attr ] ) =>
476- attr . type !== fields [ name ] . type && ancestorFieldName === name
476+ attr . type !== fields [ fieldName ] . type && ancestorFieldName === fieldName
477477 )
478478 ) {
479479 throw new MalformedFields (
480- `Field ${ name } is already defined with incompatible type in the parent stream ${ ancestor . name } `
480+ `Field ${ fieldName } is already defined with incompatible type in the parent stream ${ ancestor . name } `
481481 ) ;
482482 }
483483 }
@@ -486,20 +486,20 @@ export async function validateAncestorFields(
486486
487487export async function validateDescendantFields (
488488 scopedClusterClient : IScopedClusterClient ,
489- id : string ,
489+ name : string ,
490490 fields : FieldDefinition
491491) {
492492 const descendants = await readDescendants ( {
493- id ,
493+ name ,
494494 scopedClusterClient,
495495 } ) ;
496496 for ( const descendant of descendants ) {
497- for ( const name in fields ) {
497+ for ( const fieldName in fields ) {
498498 if (
499- Object . hasOwn ( fields , name ) &&
499+ Object . hasOwn ( fields , fieldName ) &&
500500 Object . entries ( descendant . stream . ingest . wired . fields ) . some (
501501 ( [ descendantFieldName , attr ] ) =>
502- attr . type !== fields [ name ] . type && descendantFieldName === name
502+ attr . type !== fields [ fieldName ] . type && descendantFieldName === fieldName
503503 )
504504 ) {
505505 throw new MalformedFields (
0 commit comments