Skip to content

Commit

Permalink
Use APIReturnType instead of PromiseReturnType
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv committed Aug 5, 2021
1 parent 154375e commit e00a7c9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Expand Up @@ -7,12 +7,13 @@

import { euiPaletteColorBlind } from '@elastic/eui';
import { first, flatten, groupBy, isEmpty, sortBy, sum, uniq } from 'lodash';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { TraceAPIResponse } from '../../../../../../../../server/lib/traces/get_trace';
import { APIReturnType } from '../../../../../../../services/rest/createCallApmApi';
import { APMError } from '../../../../../../../../typings/es_schemas/ui/apm_error';
import { Span } from '../../../../../../../../typings/es_schemas/ui/span';
import { Transaction } from '../../../../../../../../typings/es_schemas/ui/transaction';

type TraceAPIResponse = APIReturnType<'GET /api/apm/traces/{traceId}'>;

interface IWaterfallGroup {
[key: string]: IWaterfallSpanOrTransaction[];
}
Expand Down
Expand Up @@ -7,9 +7,8 @@

import React, { ComponentType } from 'react';
import { MemoryRouter } from 'react-router-dom';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { TraceAPIResponse } from '../../../../../../server/lib/traces/get_trace';
import { MockApmPluginContextWrapper } from '../../../../../context/apm_plugin/mock_apm_plugin_context';
import { APIReturnType } from '../../../../../services/rest/createCallApmApi';
import { WaterfallContainer } from './index';
import { getWaterfall } from './Waterfall/waterfall_helpers/waterfall_helpers';
import {
Expand All @@ -20,6 +19,8 @@ import {
urlParams,
} from './waterfallContainer.stories.data';

type TraceAPIResponse = APIReturnType<'GET /api/apm/traces/{traceId}'>;

export default {
title: 'app/TransactionDetails/Waterfall',
component: WaterfallContainer,
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/apm/server/lib/traces/get_trace.ts
Expand Up @@ -5,11 +5,9 @@
* 2.0.
*/

import { PromiseReturnType } from '../../../../observability/typings/common';
import { Setup, SetupTimeRange } from '../helpers/setup_request';
import { getTraceItems } from './get_trace_items';

export type TraceAPIResponse = PromiseReturnType<typeof getTrace>;
export async function getTrace(traceId: string, setup: Setup & SetupTimeRange) {
const { errorsPerTransaction, ...trace } = await getTraceItems(
traceId,
Expand Down

0 comments on commit e00a7c9

Please sign in to comment.