Skip to content

Commit

Permalink
More type fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo committed Aug 19, 2024
1 parent 19cdd48 commit ebffcdd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,8 @@ const getDataComparisonQuery = ({

if (rangeFilter && isPopulatedObject<string, QueryDslBoolQuery>(query, ['bool'])) {
if (Array.isArray(query.bool.filter)) {
// @ts-expect-error gte and lte can be numeric
query.bool.filter.push(rangeFilter);
} else {
// @ts-expect-error gte and lte can be numeric
query.bool.filter = [rangeFilter];
}
}
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugins/rule_registry/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@ const allowedFilterKeysSchema = t.union([
t.literal('range'),
t.literal('rank_feature'),
t.literal('regexp'),
t.literal('rule_query'),
t.literal('rule'),
t.literal('semantic'),
t.literal('shape'),
t.literal('simple_query_string'),
t.literal('span_containing'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import {
AggregateName,
AggregationsAggregate,
AggregationsMultiBucketAggregateBase,
InlineScript,
MappingRuntimeFields,
QueryDslQueryContainer,
SortCombinations,
Expand Down Expand Up @@ -826,18 +825,16 @@ export class AlertsClient {
const result = await this.esClient.updateByQuery({
index,
conflicts: 'proceed',
body: {
script: {
source: `if (ctx._source['${ALERT_WORKFLOW_STATUS}'] != null) {
script: {
source: `if (ctx._source['${ALERT_WORKFLOW_STATUS}'] != null) {
ctx._source['${ALERT_WORKFLOW_STATUS}'] = '${status}'
}
if (ctx._source.signal != null && ctx._source.signal.status != null) {
ctx._source.signal.status = '${status}'
}`,
lang: 'painless',
} as InlineScript,
query: fetchAndAuditResponse.authorizedQuery as Omit<QueryDslQueryContainer, 'script'>,
lang: 'painless',
},
query: fetchAndAuditResponse.authorizedQuery as Omit<QueryDslQueryContainer, 'script'>,
ignore_unavailable: true,
});
return result;
Expand Down Expand Up @@ -965,14 +962,12 @@ export class AlertsClient {
await this.esClient.updateByQuery({
index,
conflicts: 'proceed',
body: {
script: {
source: painlessScript,
lang: 'painless',
params: { caseIds },
} as InlineScript,
query: esQuery,
script: {
source: painlessScript,
lang: 'painless',
params: { caseIds },
},
query: esQuery,
ignore_unavailable: true,
});
} catch (err) {
Expand Down

0 comments on commit ebffcdd

Please sign in to comment.