From aae570bc9b659307b8c95bfde4558a9f8eb5ad64 Mon Sep 17 00:00:00 2001 From: "Christiane (Tina) Heiligers" Date: Mon, 6 Mar 2023 18:36:08 -0700 Subject: [PATCH] update type imports --- src/plugins/usage_collection/server/usage_counters/index.ts | 5 ++++- .../server/usage_counters/saved_objects.test.ts | 4 ++-- .../server/usage_counters/usage_counter.test.ts | 5 +++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/plugins/usage_collection/server/usage_counters/index.ts b/src/plugins/usage_collection/server/usage_counters/index.ts index cc1ee77ef3ea4..3ff122d8509de 100644 --- a/src/plugins/usage_collection/server/usage_counters/index.ts +++ b/src/plugins/usage_collection/server/usage_counters/index.ts @@ -8,7 +8,10 @@ export type { UsageCountersServiceSetup } from './usage_counters_service'; export type { UsageCountersSavedObjectAttributes, UsageCountersSavedObject } from './saved_objects'; -export type { IUsageCounter as UsageCounter, IncrementCounterParams } from './usage_counter'; +export type { IUsageCounter as UsageCounter } from './usage_counter'; + +import { v1 } from '../../common/types/usage_counters'; +export type IncrementCounterParams = v1.IncrementCounterParams; export { UsageCountersService } from './usage_counters_service'; export type { SerializeCounterParams } from './saved_objects'; diff --git a/src/plugins/usage_collection/server/usage_counters/saved_objects.test.ts b/src/plugins/usage_collection/server/usage_counters/saved_objects.test.ts index cb3c5e7683b16..40f92ea3a5e3a 100644 --- a/src/plugins/usage_collection/server/usage_counters/saved_objects.test.ts +++ b/src/plugins/usage_collection/server/usage_counters/saved_objects.test.ts @@ -8,7 +8,7 @@ import { serializeCounterKey, storeCounter } from './saved_objects'; import { savedObjectsRepositoryMock } from '@kbn/core/server/mocks'; -import { CounterMetric } from './usage_counter'; +import { v1 } from '../../common/types/usage_counters'; import moment from 'moment'; describe('counterKey', () => { @@ -38,7 +38,7 @@ describe('storeCounter', () => { }); it('stores counter in a saved object', async () => { - const counterMetric: CounterMetric = { + const counterMetric: v1.CounterMetric = { domainId: 'a', counterName: 'b', counterType: 'c', diff --git a/src/plugins/usage_collection/server/usage_counters/usage_counter.test.ts b/src/plugins/usage_collection/server/usage_counters/usage_counter.test.ts index 3602ff1a29376..8bd35b85edc21 100644 --- a/src/plugins/usage_collection/server/usage_counters/usage_counter.test.ts +++ b/src/plugins/usage_collection/server/usage_counters/usage_counter.test.ts @@ -5,13 +5,14 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -import { UsageCounter, CounterMetric } from './usage_counter'; +import { UsageCounter } from './usage_counter'; import * as Rx from 'rxjs'; import * as rxOp from 'rxjs/operators'; +import { v1 } from '../../common/types/usage_counters'; describe('UsageCounter', () => { const domainId = 'test-domain-id'; - const counter$ = new Rx.Subject(); + const counter$ = new Rx.Subject(); const usageCounter = new UsageCounter({ domainId, counter$ }); afterAll(() => {