Skip to content

Commit

Permalink
[main] update ES client version to 8.2.0-canary1 (#126430)
Browse files Browse the repository at this point in the history
* [main] update ES client version to 8.2.0-canary1

* fix type errors - batch 1

* fix more type errors

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
pgayvallet and kibanamachine authored Mar 3, 2022
1 parent f88e8b5 commit 97adf28
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"@elastic/apm-synthtrace": "link:bazel-bin/packages/elastic-apm-synthtrace",
"@elastic/charts": "43.1.1",
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@8.1.0-canary.3",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@8.2.0-canary.1",
"@elastic/ems-client": "8.0.0",
"@elastic/eui": "48.1.1",
"@elastic/filesaver": "1.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ async function fetchTemplates(
const response = isLegacy
? await client.indices.getTemplate({}, options)
: await client.indices.getIndexTemplate({}, options);
// @ts-expect-error TemplateSerialized.index_patterns not compatible with IndicesIndexTemplate.index_patterns
return response;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export function registerGetAllRoute({ router, lib: { handleEsError } }: RouteDep
const body = componentTemplates.map((componentTemplate: ComponentTemplateFromEs) => {
const deserializedComponentTemplateListItem = deserializeComponentTemplateList(
componentTemplate,
// @ts-expect-error TemplateSerialized.index_patterns not compatible with IndicesIndexTemplate.index_patterns
indexTemplates
);
return deserializedComponentTemplateListItem;
Expand Down Expand Up @@ -70,6 +71,7 @@ export function registerGetAllRoute({ router, lib: { handleEsError } }: RouteDep
await client.asCurrentUser.indices.getIndexTemplate();

return response.ok({
// @ts-expect-error TemplateSerialized.index_patterns not compatible with IndicesIndexTemplate.index_patterns
body: deserializeComponentTemplate(componentTemplates[0], indexTemplates),
});
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export function registerGetAllRoute({ router, lib: { handleEsError } }: RouteDep
legacyTemplatesEs,
cloudManagedTemplatePrefix
);
// @ts-expect-error TemplateSerialized.index_patterns not compatible with IndicesIndexTemplate.index_patterns
const templates = deserializeTemplateList(templatesEs, cloudManagedTemplatePrefix);

const body = {
Expand Down Expand Up @@ -92,6 +93,7 @@ export function registerGetOneRoute({ router, lib: { handleEsError } }: RouteDep
if (indexTemplates.length > 0) {
return response.ok({
body: deserializeTemplate(
// @ts-expect-error TemplateSerialized.index_patterns not compatible with IndicesIndexTemplate.index_patterns
{ ...indexTemplates[0].index_template, name },
cloudManagedTemplatePrefix
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export const RevertModelSnapshotFlyout: FC<Props> = ({
fadeChart={true}
overlayRanges={[
{
start: currentSnapshot.latest_record_time_stamp,
start: currentSnapshot.latest_record_time_stamp!,
end: job.data_counts.latest_record_timestamp!,
color: '#ff0000',
},
Expand All @@ -253,7 +253,7 @@ export const RevertModelSnapshotFlyout: FC<Props> = ({
<FormattedMessage
id="xpack.ml.newJob.wizard.revertModelSnapshotFlyout.warningCallout.contents"
defaultMessage="All anomaly detection results after {date} will be deleted."
values={{ date: timeFormatter(currentSnapshot.latest_record_time_stamp) }}
values={{ date: timeFormatter(currentSnapshot.latest_record_time_stamp!) }}
/>
</EuiCallOut>

Expand Down Expand Up @@ -333,7 +333,7 @@ export const RevertModelSnapshotFlyout: FC<Props> = ({
<CreateCalendar
calendarEvents={calendarEvents}
setCalendarEvents={setCalendarEvents}
minSelectableTimeStamp={snapshot.latest_record_time_stamp}
minSelectableTimeStamp={snapshot.latest_record_time_stamp!}
maxSelectableTimeStamp={job.data_counts.latest_record_timestamp!}
eventRateData={eventRateData}
anomalies={anomalies}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ export function modelSnapshotProvider(client: IScopedClusterClient, mlClient: Ml
await cm.newCalendar(calendar);
}

forceStartDatafeeds([datafeedId], +snapshot.model_snapshots[0].latest_record_time_stamp, end);
forceStartDatafeeds(
[datafeedId],
+snapshot.model_snapshots[0].latest_record_time_stamp!,
end
);
}

return { success: true };
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2376,10 +2376,10 @@
dependencies:
"@elastic/ecs-helpers" "^1.1.0"

"@elastic/elasticsearch@npm:@elastic/elasticsearch-canary@8.1.0-canary.3":
version "8.1.0-canary.3"
resolved "https://registry.yarnpkg.com/@elastic/elasticsearch-canary/-/elasticsearch-canary-8.1.0-canary.3.tgz#a84669ad45ea465e533d860bf99aa55aed781cb3"
integrity sha512-rpsMiJX5sAAlPjfWzZhijQgpu7ZlPwjcJQHCT3wNz03DTDnokLCqkhc8gsU+uqesbQ/GqYUlSL9erCk4GqjOLg==
"@elastic/elasticsearch@npm:@elastic/elasticsearch-canary@8.2.0-canary.1":
version "8.2.0-canary.1"
resolved "https://registry.yarnpkg.com/@elastic/elasticsearch-canary/-/elasticsearch-canary-8.2.0-canary.1.tgz#da547aaf0a39846cda4484bc021dea2117acaf0c"
integrity sha512-MxDCQjcKgxQulX+PJiPWdwFJwYq5J1EVycU5EaE1sDODLnnJp5dvQFPtRRla9MM5Elyy52swtfzQA5ktGixyRg==
dependencies:
"@elastic/transport" "^8.0.2"
tslib "^2.3.0"
Expand Down

0 comments on commit 97adf28

Please sign in to comment.