Skip to content

Commit

Permalink
fix the first batch of ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
restrry committed Feb 23, 2022
1 parent 4c43fee commit 3c6b64a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ async function createIndexTemplate({
await client.indices.putIndexTemplate({
name: templateName,
body: template,
// @ts-expect-error doesn't exist in @elastic/elasticsearch
create: true,
});
} catch (err) {
Expand Down
3 changes: 1 addition & 2 deletions x-pack/plugins/event_log/server/es/cluster_client_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ export class ClusterClientAdapter<TDoc extends { body: AliasAny; index: string }
await esClient.indices.putIndexTemplate({
name,
body: template,
// @ts-expect-error doesn't exist in @elastic/elasticsearch
create: true,
});
} catch (err) {
Expand Down Expand Up @@ -248,7 +247,7 @@ export class ClusterClientAdapter<TDoc extends { body: AliasAny; index: string }
await esClient.indices.putSettings({
index: indexName,
body: {
'index.hidden': true,
index: { hidden: true },
},
});
} catch (err) {
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/index_management/server/lib/fetch_indices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ async function fetchIndicesCall(
const indexStats = indicesStats[indexName];
const aliases = Object.keys(indexData.aliases!);
return {
// @ts-expect-error new property https://github.com/elastic/elasticsearch-specification/issues/1253
health: indexStats?.health,
// @ts-expect-error new property https://github.com/elastic/elasticsearch-specification/issues/1253
status: indexStats?.status,
name: indexName,
uuid: indexStats?.uuid,
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/license_management/server/lib/license.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface PutLicenseArg {
export async function putLicense({ acknowledge, client, licensing, license }: PutLicenseArg) {
try {
const response = await client.asCurrentUser.license.post({
// @ts-expect-error license is not typed in LM code
body: license,
acknowledge,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ export const registerDeprecationsRoutes = (reporting: ReportingCore, logger: Log
await client.indices.putSettings({
index: indexPattern,
body: {
'index.lifecycle': {
name: ILM_POLICY_NAME,
index: {
lifecycle: {
name: ILM_POLICY_NAME,
},
},
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ export function registerSnapshotsRoutes({
operator: searchOperator,
})
: '_all',
// @ts-expect-error @elastic/elasticsearch new API params
// https://github.com/elastic/elasticsearch-specification/issues/845
slm_policy_filter:
searchField === 'policyName'
Expand All @@ -139,6 +138,7 @@ export function registerSnapshotsRoutes({
})
: '*,_none',
order: sortDirection,
// @ts-expect-error sortField: string is not comptible with SnapshotSnapshotSort type
sort: sortField,
size: pageSize,
offset: pageIndex * pageSize,
Expand Down

0 comments on commit 3c6b64a

Please sign in to comment.