Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions oas_docs/output/kibana.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64815,6 +64815,7 @@ paths:
append: {}
attachment: {}
bytes: {}
cef: {}
circle: {}
community_id: {}
convert: {}
Expand Down Expand Up @@ -64861,6 +64862,7 @@ paths:
- append
- attachment
- bytes
- cef
- circle
- community_id
- convert
Expand Down Expand Up @@ -69766,6 +69768,7 @@ paths:
append: {}
attachment: {}
bytes: {}
cef: {}
circle: {}
community_id: {}
convert: {}
Expand Down Expand Up @@ -69812,6 +69815,7 @@ paths:
- append
- attachment
- bytes
- cef
- circle
- community_id
- convert
Expand Down Expand Up @@ -74458,6 +74462,7 @@ paths:
append: {}
attachment: {}
bytes: {}
cef: {}
circle: {}
community_id: {}
convert: {}
Expand Down Expand Up @@ -74504,6 +74509,7 @@ paths:
- append
- attachment
- bytes
- cef
- circle
- community_id
- convert
Expand Down Expand Up @@ -79221,6 +79227,7 @@ paths:
append: {}
attachment: {}
bytes: {}
cef: {}
circle: {}
community_id: {}
convert: {}
Expand Down Expand Up @@ -79267,6 +79274,7 @@ paths:
- append
- attachment
- bytes
- cef
- circle
- community_id
- convert
Expand Down Expand Up @@ -84247,6 +84255,7 @@ paths:
append: {}
attachment: {}
bytes: {}
cef: {}
circle: {}
community_id: {}
convert: {}
Expand Down Expand Up @@ -84293,6 +84302,7 @@ paths:
- append
- attachment
- bytes
- cef
- circle
- community_id
- convert
Expand Down Expand Up @@ -88869,6 +88879,7 @@ paths:
append: {}
attachment: {}
bytes: {}
cef: {}
circle: {}
community_id: {}
convert: {}
Expand Down Expand Up @@ -88915,6 +88926,7 @@ paths:
- append
- attachment
- bytes
- cef
- circle
- community_id
- convert
Expand Down
12 changes: 12 additions & 0 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69269,6 +69269,7 @@ paths:
append: {}
attachment: {}
bytes: {}
cef: {}
circle: {}
community_id: {}
convert: {}
Expand Down Expand Up @@ -69315,6 +69316,7 @@ paths:
- append
- attachment
- bytes
- cef
- circle
- community_id
- convert
Expand Down Expand Up @@ -74220,6 +74222,7 @@ paths:
append: {}
attachment: {}
bytes: {}
cef: {}
circle: {}
community_id: {}
convert: {}
Expand Down Expand Up @@ -74266,6 +74269,7 @@ paths:
- append
- attachment
- bytes
- cef
- circle
- community_id
- convert
Expand Down Expand Up @@ -78912,6 +78916,7 @@ paths:
append: {}
attachment: {}
bytes: {}
cef: {}
circle: {}
community_id: {}
convert: {}
Expand Down Expand Up @@ -78958,6 +78963,7 @@ paths:
- append
- attachment
- bytes
- cef
- circle
- community_id
- convert
Expand Down Expand Up @@ -83675,6 +83681,7 @@ paths:
append: {}
attachment: {}
bytes: {}
cef: {}
circle: {}
community_id: {}
convert: {}
Expand Down Expand Up @@ -83721,6 +83728,7 @@ paths:
- append
- attachment
- bytes
- cef
- circle
- community_id
- convert
Expand Down Expand Up @@ -88701,6 +88709,7 @@ paths:
append: {}
attachment: {}
bytes: {}
cef: {}
circle: {}
community_id: {}
convert: {}
Expand Down Expand Up @@ -88747,6 +88756,7 @@ paths:
- append
- attachment
- bytes
- cef
- circle
- community_id
- convert
Expand Down Expand Up @@ -93323,6 +93333,7 @@ paths:
append: {}
attachment: {}
bytes: {}
cef: {}
circle: {}
community_id: {}
convert: {}
Expand Down Expand Up @@ -93369,6 +93380,7 @@ paths:
- append
- attachment
- bytes
- cef
- circle
- community_id
- convert
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"@elastic/datemath": "5.0.3",
"@elastic/ebt": "1.4.1",
"@elastic/ecs": "9.2.0",
"@elastic/elasticsearch": "9.2.0",
"@elastic/elasticsearch": "9.3.1",
"@elastic/ems-client": "8.6.3",
"@elastic/eui": "113.0.0",
"@elastic/eui-theme-borealis": "6.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export const checkForUnknownDocs =
UnknownDocsFound | {}
> =>
() => {
const excludeQuery = addExcludedTypesToBoolQuery(knownTypes, excludeOnUpgradeQuery.bool);
const excludeQuery = addExcludedTypesToBoolQuery(knownTypes, excludeOnUpgradeQuery?.bool);
return getAggregatedTypesDocuments(client, indexName, excludeQuery)
.then((unknownDocs) => {
if (unknownDocs.length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,9 @@ describe('createBulkIndexOperationTuple', () => {
_source: { type: 'cases', title: 'no originId' },
};
const [operation] = createBulkIndexOperationTuple(document);
expect(operation.index).toBeDefined();
expect((operation.index as any).if_seq_no).toBe(10);
expect((operation.index as any).if_primary_term).toBe(20);
expect(operation!.index).toBeDefined();
expect((operation!.index as any).if_seq_no).toBe(10);
expect((operation!.index as any).if_primary_term).toBe(20);
});

it('includes if_seq_no and if_primary_term when originId === _id', () => {
Expand All @@ -445,9 +445,9 @@ describe('createBulkIndexOperationTuple', () => {
_source: { type: 'cases', title: 'originId equals _id', originId: 'doc2' },
};
const [operation] = createBulkIndexOperationTuple(document);
expect(operation.index).toBeDefined();
expect((operation.index as any).if_seq_no).toBe(11);
expect((operation.index as any).if_primary_term).toBe(21);
expect(operation!.index).toBeDefined();
expect((operation!.index as any).if_seq_no).toBe(11);
expect((operation!.index as any).if_primary_term).toBe(21);
});

it('does NOT include if_seq_no and if_primary_term when originId !== _id', () => {
Expand All @@ -458,9 +458,9 @@ describe('createBulkIndexOperationTuple', () => {
_source: { type: 'cases', title: 'originId not equal _id', originId: 'other-id' },
};
const [operation] = createBulkIndexOperationTuple(document);
expect(operation.index).toBeDefined();
expect((operation.index as any).if_seq_no).toBeUndefined();
expect((operation.index as any).if_primary_term).toBeUndefined();
expect(operation!.index).toBeDefined();
expect((operation!.index as any).if_seq_no).toBeUndefined();
expect((operation!.index as any).if_primary_term).toBeUndefined();
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ export const model = (currentState: State, resW: ResponseType<AllActionStates>):

excludeOnUpgradeQuery = addMustClausesToBoolQuery(
[{ exists: { field: 'type' } }],
excludeOnUpgradeQuery.bool
excludeOnUpgradeQuery?.bool
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ describe('Bulk update', () => {
expect(operations.length).toBe(4);

// Validate presence of delete operations for non-placeholder ids only
const deletes = operations.filter((op) => op.delete);
const deleteIds = deletes.map((d) => d.delete?._id).sort();
const deletes = operations.filter((op) => op!.delete);
const deleteIds = deletes.map((d) => d!.delete!._id).sort();
expect(deleteIds).toEqual(['abc123', 'to-del']);

// Validate there is an index operation and that the document merges values
const indexIdx = operations.findIndex((op) => op.index);
const indexIdx = operations.findIndex((op) => op!.index);
expect(indexIdx).toBeGreaterThanOrEqual(0);
const doc = operations[indexIdx + 1];
const doc = operations[indexIdx + 1]!;
expect(doc).toEqual({ b: 2, c: 3 });
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type RuleRegistrySearchRequest = IEsSearchRequest & {
ruleTypeIds: string[];
consumers?: string[];
fields?: QueryDslFieldAndFormat[];
query?: Pick<QueryDslQueryContainer, 'bool' | 'ids'>;
query?: Pick<NonNullable<QueryDslQueryContainer>, 'bool' | 'ids'>;
sort?: SortCombinations[];
pagination?: RuleRegistrySearchRequestPagination;
runtimeMappings?: MappingRuntimeFields;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface SearchAlertsParams {
/**
* ES query to perform on the affected alert indices
*/
query: Pick<QueryDslQueryContainer, 'bool' | 'ids'>;
query: Partial<Pick<NonNullable<QueryDslQueryContainer>, 'bool' | 'ids'>>;
/**
* The alert document fields to include in the response
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ function buildQuery(
should: [],
must_not: [],
},
kueryQuery.bool
kueryQuery?.bool
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import { isString } from 'lodash';
* @public
*/
export function luceneStringToDsl(
query: string | estypes.QueryDslQueryContainer
): estypes.QueryDslQueryContainer {
query: string | NonNullable<estypes.QueryDslQueryContainer>
): NonNullable<estypes.QueryDslQueryContainer> {
if (isString(query)) {
if (query.trim() === '') {
return { match_all: {} };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export type PhraseFilterMeta = FilterMeta & {
export type PhraseFilter = Filter & {
meta: PhraseFilterMeta;
query: {
match_phrase?: estypes.QueryDslQueryContainer['match_phrase'];
match?: estypes.QueryDslQueryContainer['match'];
match_phrase?: NonNullable<estypes.QueryDslQueryContainer>['match_phrase'];
match?: NonNullable<estypes.QueryDslQueryContainer>['match'];
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export type ScriptedRangeFilter = Filter & {
export type MatchAllRangeFilter = Filter & {
meta: RangeFilterMeta;
query: {
match_all: estypes.QueryDslQueryContainer['match_all'];
match_all: NonNullable<estypes.QueryDslQueryContainer>['match_all'];
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const fromLiteralExpression = (
};

export const fromKueryExpression = (
expression: string | estypes.QueryDslQueryContainer,
expression: string | NonNullable<estypes.QueryDslQueryContainer>,
parseOptions: Partial<KueryParseOptions> = {}
): KueryNode => {
try {
Expand Down
Loading
Loading