mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
chore to move critical path files (#1314)
moves them into a core folder, this allows us to easily track when core files are modified via path no changeset because no version bump required fixes HDX-2589
This commit is contained in:
parent
f98193852c
commit
43dfb3aaff
55 changed files with 101 additions and 92 deletions
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
import { ChSql } from '@hyperdx/common-utils/dist/clickhouse';
|
||||
import { ClickhouseClient } from '@hyperdx/common-utils/dist/clickhouse/node';
|
||||
import { getMetadata } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { renderChartConfig } from '@hyperdx/common-utils/dist/renderChartConfig';
|
||||
import { getMetadata } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import { renderChartConfig } from '@hyperdx/common-utils/dist/core/renderChartConfig';
|
||||
import {
|
||||
AggregateFunctionSchema,
|
||||
DerivedColumn,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { ClickhouseClient } from '@hyperdx/common-utils/dist/clickhouse/node';
|
|||
import {
|
||||
getMetadata,
|
||||
TableMetadata,
|
||||
} from '@hyperdx/common-utils/dist/metadata';
|
||||
} from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import {
|
||||
AggregateFunctionSchema,
|
||||
ChartConfigWithDateRange,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { ClickhouseClient } from '@hyperdx/common-utils/dist/clickhouse/node';
|
||||
import { getMetadata } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { getMetadata } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import { Granularity } from '@hyperdx/common-utils/dist/core/utils';
|
||||
import {
|
||||
ChartConfigWithOptDateRange,
|
||||
DisplayType,
|
||||
} from '@hyperdx/common-utils/dist/types';
|
||||
import { SourceKind } from '@hyperdx/common-utils/dist/types';
|
||||
import { Granularity } from '@hyperdx/common-utils/dist/utils';
|
||||
import opentelemetry, { SpanStatusCode } from '@opentelemetry/api';
|
||||
import express from 'express';
|
||||
import _ from 'lodash';
|
||||
|
|
|
|||
|
|
@ -744,8 +744,8 @@ describe('checkAlerts', () => {
|
|||
};
|
||||
|
||||
// Mock the getMetadata function
|
||||
jest.mock('@hyperdx/common-utils/dist/metadata', () => ({
|
||||
...jest.requireActual('@hyperdx/common-utils/dist/metadata'),
|
||||
jest.mock('@hyperdx/common-utils/dist/core/metadata', () => ({
|
||||
...jest.requireActual('@hyperdx/common-utils/dist/core/metadata'),
|
||||
getMetadata: jest.fn().mockReturnValue(mockMetadata),
|
||||
}));
|
||||
|
||||
|
|
@ -1009,8 +1009,8 @@ describe('checkAlerts', () => {
|
|||
};
|
||||
|
||||
// Mock the getMetadata function
|
||||
jest.mock('@hyperdx/common-utils/dist/metadata', () => ({
|
||||
...jest.requireActual('@hyperdx/common-utils/dist/metadata'),
|
||||
jest.mock('@hyperdx/common-utils/dist/core/metadata', () => ({
|
||||
...jest.requireActual('@hyperdx/common-utils/dist/core/metadata'),
|
||||
getMetadata: jest.fn().mockReturnValue(mockMetadata),
|
||||
}));
|
||||
|
||||
|
|
@ -1264,8 +1264,8 @@ describe('checkAlerts', () => {
|
|||
};
|
||||
|
||||
// Mock the getMetadata function
|
||||
jest.mock('@hyperdx/common-utils/dist/metadata', () => ({
|
||||
...jest.requireActual('@hyperdx/common-utils/dist/metadata'),
|
||||
jest.mock('@hyperdx/common-utils/dist/core/metadata', () => ({
|
||||
...jest.requireActual('@hyperdx/common-utils/dist/core/metadata'),
|
||||
getMetadata: jest.fn().mockReturnValue(mockMetadata),
|
||||
}));
|
||||
|
||||
|
|
@ -1496,8 +1496,8 @@ describe('checkAlerts', () => {
|
|||
};
|
||||
|
||||
// Mock the getMetadata function
|
||||
jest.mock('@hyperdx/common-utils/dist/metadata', () => ({
|
||||
...jest.requireActual('@hyperdx/common-utils/dist/metadata'),
|
||||
jest.mock('@hyperdx/common-utils/dist/core/metadata', () => ({
|
||||
...jest.requireActual('@hyperdx/common-utils/dist/core/metadata'),
|
||||
getMetadata: jest.fn().mockReturnValue(mockMetadata),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -424,8 +424,8 @@ describe('Single Invocation Alert Test', () => {
|
|||
};
|
||||
|
||||
// Mock the getMetadata function
|
||||
jest.mock('@hyperdx/common-utils/dist/metadata', () => ({
|
||||
...jest.requireActual('@hyperdx/common-utils/dist/metadata'),
|
||||
jest.mock('@hyperdx/common-utils/dist/core/metadata', () => ({
|
||||
...jest.requireActual('@hyperdx/common-utils/dist/core/metadata'),
|
||||
getMetadata: jest.fn().mockReturnValue(mockMetadata),
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,10 @@
|
|||
import PQueue from '@esm2cjs/p-queue';
|
||||
import * as clickhouse from '@hyperdx/common-utils/dist/clickhouse';
|
||||
import { ClickhouseClient } from '@hyperdx/common-utils/dist/clickhouse/node';
|
||||
import { getMetadata, Metadata } from '@hyperdx/common-utils/dist/metadata';
|
||||
import {
|
||||
getMetadata,
|
||||
Metadata,
|
||||
} from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import {
|
||||
ChartConfigWithOptDateRange,
|
||||
DisplayType,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { ClickhouseClient } from '@hyperdx/common-utils/dist/clickhouse/node';
|
||||
import { Metadata } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { renderChartConfig } from '@hyperdx/common-utils/dist/renderChartConfig';
|
||||
import { Metadata } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import { renderChartConfig } from '@hyperdx/common-utils/dist/core/renderChartConfig';
|
||||
import { _useTry, formatDate } from '@hyperdx/common-utils/dist/core/utils';
|
||||
import {
|
||||
AlertChannelType,
|
||||
ChartConfigWithOptDateRange,
|
||||
|
|
@ -8,7 +9,6 @@ import {
|
|||
WebhookService,
|
||||
zAlertChannelType,
|
||||
} from '@hyperdx/common-utils/dist/types';
|
||||
import { _useTry, formatDate } from '@hyperdx/common-utils/dist/utils';
|
||||
import { isValidSlackUrl } from '@hyperdx/common-utils/dist/validation';
|
||||
import Handlebars, { HelperOptions } from 'handlebars';
|
||||
import _ from 'lodash';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Granularity } from '@hyperdx/common-utils/dist/utils';
|
||||
import { Granularity } from '@hyperdx/common-utils/dist/core/utils';
|
||||
|
||||
export type JSONBlob = Record<string, Json>;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ import { Controller, useForm } from 'react-hook-form';
|
|||
import { StringParam, useQueryParam } from 'use-query-params';
|
||||
import { z } from 'zod';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { convertToDashboardDocument } from '@hyperdx/common-utils/dist/core/utils';
|
||||
import { DashboardTemplateSchema } from '@hyperdx/common-utils/dist/types';
|
||||
import { convertToDashboardDocument } from '@hyperdx/common-utils/dist/utils';
|
||||
import {
|
||||
Button,
|
||||
Collapse,
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ import { parseAsString, useQueryState } from 'nuqs';
|
|||
import { ErrorBoundary } from 'react-error-boundary';
|
||||
import RGL, { WidthProvider } from 'react-grid-layout';
|
||||
import { Controller, useForm } from 'react-hook-form';
|
||||
import { TableConnection } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { TableConnection } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import { convertToDashboardTemplate } from '@hyperdx/common-utils/dist/core/utils';
|
||||
import {
|
||||
AlertState,
|
||||
DashboardFilter,
|
||||
|
|
@ -28,7 +29,6 @@ import {
|
|||
SearchConditionLanguage,
|
||||
SQLInterval,
|
||||
} from '@hyperdx/common-utils/dist/types';
|
||||
import { convertToDashboardTemplate } from '@hyperdx/common-utils/dist/utils';
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
|
|
|
|||
|
|
@ -23,17 +23,17 @@ import { useForm } from 'react-hook-form';
|
|||
import { z } from 'zod';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { ClickHouseQueryError } from '@hyperdx/common-utils/dist/clickhouse';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import {
|
||||
isBrowser,
|
||||
splitAndTrimWithBracket,
|
||||
} from '@hyperdx/common-utils/dist/core/utils';
|
||||
import {
|
||||
ChartConfigWithDateRange,
|
||||
DisplayType,
|
||||
Filter,
|
||||
SourceKind,
|
||||
} from '@hyperdx/common-utils/dist/types';
|
||||
import {
|
||||
isBrowser,
|
||||
splitAndTrimWithBracket,
|
||||
} from '@hyperdx/common-utils/dist/utils';
|
||||
import {
|
||||
ActionIcon,
|
||||
Box,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { useForm } from 'react-hook-form';
|
|||
import { NativeSelect, NumberInput } from 'react-hook-form-mantine';
|
||||
import { z } from 'zod';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import {
|
||||
type Alert,
|
||||
AlertIntervalSchema,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useEffect, useState } from 'react';
|
||||
import { Controller, FieldError, useForm } from 'react-hook-form';
|
||||
import { TableConnection } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { TableConnection } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import {
|
||||
DashboardFilter,
|
||||
MetricsDataType,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import * as React from 'react';
|
||||
import Link from 'next/link';
|
||||
import { StringParam, useQueryParam, withDefault } from 'use-query-params';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import { TSource } from '@hyperdx/common-utils/dist/types';
|
||||
import {
|
||||
Anchor,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import * as React from 'react';
|
||||
import Link from 'next/link';
|
||||
import { StringParam, useQueryParam, withDefault } from 'use-query-params';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import {
|
||||
SearchConditionLanguage,
|
||||
TSource,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import * as React from 'react';
|
||||
import Link from 'next/link';
|
||||
import { StringParam, useQueryParam, withDefault } from 'use-query-params';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import { TSource } from '@hyperdx/common-utils/dist/types';
|
||||
import {
|
||||
Anchor,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { useHotkeys } from 'react-hotkeys-hook';
|
|||
import {
|
||||
Field,
|
||||
TableConnectionChoice,
|
||||
} from '@hyperdx/common-utils/dist/metadata';
|
||||
} from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import { genEnglishExplanation } from '@hyperdx/common-utils/dist/queryParser';
|
||||
|
||||
import AutocompleteInput from '@/AutocompleteInput';
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
useQueryStates,
|
||||
} from 'nuqs';
|
||||
import { UseControllerProps, useForm } from 'react-hook-form';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import {
|
||||
DisplayType,
|
||||
Filter,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import throttle from 'lodash/throttle';
|
|||
import { parseAsInteger, useQueryState } from 'nuqs';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import {
|
||||
ChartConfigWithOptDateRange,
|
||||
DateRange,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import {
|
|||
useQueryParams,
|
||||
withDefault,
|
||||
} from 'use-query-params';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import {
|
||||
DateRange,
|
||||
SearchCondition,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import type { ZodIssue } from 'zod';
|
|||
import { json, jsonParseLinter } from '@codemirror/lang-json';
|
||||
import { linter } from '@codemirror/lint';
|
||||
import { EditorView } from '@codemirror/view';
|
||||
import { DEFAULT_METADATA_MAX_ROWS_TO_READ } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { DEFAULT_METADATA_MAX_ROWS_TO_READ } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import { SourceKind, WebhookService } from '@hyperdx/common-utils/dist/types';
|
||||
import {
|
||||
isValidSlackUrl,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { sq } from 'date-fns/locale';
|
|||
import ms from 'ms';
|
||||
import { parseAsString, useQueryState } from 'nuqs';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import {
|
||||
ChartConfigWithDateRange,
|
||||
TSource,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import {
|
|||
import { NativeSelect, NumberInput } from 'react-hook-form-mantine';
|
||||
import z from 'zod';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import {
|
||||
ChartAlertBaseSchema,
|
||||
ChartConfigWithDateRange,
|
||||
|
|
|
|||
|
|
@ -29,12 +29,12 @@ import {
|
|||
isJSDataTypeJSONStringifiable,
|
||||
JSDataType,
|
||||
} from '@hyperdx/common-utils/dist/clickhouse';
|
||||
import { splitAndTrimWithBracket } from '@hyperdx/common-utils/dist/core/utils';
|
||||
import {
|
||||
ChartConfigWithDateRange,
|
||||
SelectList,
|
||||
TSource,
|
||||
} from '@hyperdx/common-utils/dist/types';
|
||||
import { splitAndTrimWithBracket } from '@hyperdx/common-utils/dist/utils';
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import {
|
|||
TableMetadata,
|
||||
tcFromChartConfig,
|
||||
tcFromSource,
|
||||
} from '@hyperdx/common-utils/dist/metadata';
|
||||
} from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import { ChartConfigWithDateRange } from '@hyperdx/common-utils/dist/types';
|
||||
import {
|
||||
Accordion,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import Link from 'next/link';
|
|||
import cx from 'classnames';
|
||||
import { add } from 'date-fns';
|
||||
import { ClickHouseQueryError } from '@hyperdx/common-utils/dist/clickhouse';
|
||||
import { isMetricChartConfig } from '@hyperdx/common-utils/dist/renderChartConfig';
|
||||
import { isMetricChartConfig } from '@hyperdx/common-utils/dist/core/renderChartConfig';
|
||||
import {
|
||||
ChartConfigWithDateRange,
|
||||
DisplayType,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { useEffect, useState } from 'react';
|
||||
import { parseAsJson, useQueryState } from 'nuqs';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import { SourceKind } from '@hyperdx/common-utils/dist/types';
|
||||
import {
|
||||
Button,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import * as React from 'react';
|
|||
import Link from 'next/link';
|
||||
import { sub } from 'date-fns';
|
||||
import type { ResponseJSON } from '@hyperdx/common-utils/dist/clickhouse';
|
||||
import { renderChartConfig } from '@hyperdx/common-utils/dist/renderChartConfig';
|
||||
import { renderChartConfig } from '@hyperdx/common-utils/dist/core/renderChartConfig';
|
||||
import {
|
||||
ChartConfigWithDateRange,
|
||||
DateRange,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import {
|
||||
ChartConfigWithDateRange,
|
||||
TSource,
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import { sql, SQLDialect } from '@codemirror/lang-sql';
|
|||
import {
|
||||
Field,
|
||||
TableConnectionChoice,
|
||||
} from '@hyperdx/common-utils/dist/metadata';
|
||||
} from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import { Flex, Paper, Text, Tooltip } from '@mantine/core';
|
||||
import { IconInfoCircle } from '@tabler/icons-react';
|
||||
import CodeMirror, {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { zodResolver } from '@hookform/resolvers/zod';
|
|||
import {
|
||||
TableConnection,
|
||||
tcFromSource,
|
||||
} from '@hyperdx/common-utils/dist/metadata';
|
||||
} from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import {
|
||||
ChartConfigWithDateRange,
|
||||
DisplayType,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import {
|
|||
isNonEmptyWhereExpr,
|
||||
isUsingGroupBy,
|
||||
renderChartConfig,
|
||||
} from '@hyperdx/common-utils/dist/renderChartConfig';
|
||||
} from '@hyperdx/common-utils/dist/core/renderChartConfig';
|
||||
import {
|
||||
AggregateFunction,
|
||||
ChartConfigWithOptDateRange,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { JSDataType } from '@hyperdx/common-utils/dist/clickhouse';
|
||||
import { Field } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { Field } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import { renderHook } from '@testing-library/react';
|
||||
|
||||
import { LuceneLanguageFormatter } from '../../SearchInputV2';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
import React from 'react';
|
||||
import * as metadataModule from '@hyperdx/app/src/metadata';
|
||||
import { ClickhouseClient } from '@hyperdx/common-utils/dist/clickhouse/browser';
|
||||
import { Metadata, MetadataCache } from '@hyperdx/common-utils/dist/metadata';
|
||||
import {
|
||||
Metadata,
|
||||
MetadataCache,
|
||||
} from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import { ChartConfigWithDateRange } from '@hyperdx/common-utils/dist/types';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { renderHook, waitFor } from '@testing-library/react';
|
||||
|
|
|
|||
|
|
@ -28,13 +28,13 @@ jest.mock('@hyperdx/app/src/metadata', () => ({
|
|||
}));
|
||||
|
||||
// Mock the renderChartConfig function
|
||||
jest.mock('@hyperdx/common-utils/dist/renderChartConfig', () => ({
|
||||
jest.mock('@hyperdx/common-utils/dist/core/renderChartConfig', () => ({
|
||||
renderChartConfig: jest.fn(),
|
||||
}));
|
||||
|
||||
// Import mocked modules after jest.mock calls
|
||||
import { getClickhouseClient } from '@hyperdx/app/src/clickhouse';
|
||||
import { renderChartConfig } from '@hyperdx/common-utils/dist/renderChartConfig';
|
||||
import { renderChartConfig } from '@hyperdx/common-utils/dist/core/renderChartConfig';
|
||||
|
||||
// Create a mock ChartConfig based on the Zod schema
|
||||
const createMockChartConfig = (
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { Field, TableConnection } from '@hyperdx/common-utils/dist/metadata';
|
||||
import {
|
||||
Field,
|
||||
TableConnection,
|
||||
} from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import { ChartConfigWithDateRange } from '@hyperdx/common-utils/dist/types';
|
||||
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import {
|
|||
isMetricChartConfig,
|
||||
isUsingGranularity,
|
||||
renderChartConfig,
|
||||
} from '@hyperdx/common-utils/dist/renderChartConfig';
|
||||
} from '@hyperdx/common-utils/dist/core/renderChartConfig';
|
||||
import { format } from '@hyperdx/common-utils/dist/sqlFormatter';
|
||||
import {
|
||||
ChartConfigWithDateRange,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { renderChartConfig } from '@hyperdx/common-utils/dist/renderChartConfig';
|
||||
import { renderChartConfig } from '@hyperdx/common-utils/dist/core/renderChartConfig';
|
||||
import { ChartConfigWithDateRange } from '@hyperdx/common-utils/dist/types';
|
||||
import { useQuery, UseQueryOptions } from '@tanstack/react-query';
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import {
|
|||
Field,
|
||||
TableConnection,
|
||||
TableMetadata,
|
||||
} from '@hyperdx/common-utils/dist/metadata';
|
||||
} from '@hyperdx/common-utils/dist/core/metadata';
|
||||
import { ChartConfigWithDateRange } from '@hyperdx/common-utils/dist/types';
|
||||
import {
|
||||
keepPreviousData,
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ import {
|
|||
ClickHouseQueryError,
|
||||
ColumnMetaType,
|
||||
} from '@hyperdx/common-utils/dist/clickhouse';
|
||||
import { renderChartConfig } from '@hyperdx/common-utils/dist/renderChartConfig';
|
||||
import { ChartConfigWithOptTimestamp } from '@hyperdx/common-utils/dist/types';
|
||||
import { renderChartConfig } from '@hyperdx/common-utils/dist/core/renderChartConfig';
|
||||
import {
|
||||
isFirstOrderByAscending,
|
||||
isTimestampExpressionInFirstOrderBy,
|
||||
} from '@hyperdx/common-utils/dist/utils';
|
||||
} from '@hyperdx/common-utils/dist/core/utils';
|
||||
import { ChartConfigWithOptTimestamp } from '@hyperdx/common-utils/dist/types';
|
||||
import {
|
||||
QueryClient,
|
||||
QueryFunction,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { getMetadata as _getMetadata } from '@hyperdx/common-utils/dist/metadata';
|
||||
import { getMetadata as _getMetadata } from '@hyperdx/common-utils/dist/core/metadata';
|
||||
|
||||
import { getClickhouseClient } from '@/clickhouse';
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
|||
import produce from 'immer';
|
||||
import type { ResponseJSON } from '@hyperdx/common-utils/dist/clickhouse';
|
||||
import { chSql } from '@hyperdx/common-utils/dist/clickhouse';
|
||||
import { renderChartConfig } from '@hyperdx/common-utils/dist/renderChartConfig';
|
||||
import { renderChartConfig } from '@hyperdx/common-utils/dist/core/renderChartConfig';
|
||||
import {
|
||||
DateRange,
|
||||
SearchCondition,
|
||||
|
|
|
|||
|
|
@ -9,16 +9,16 @@ import {
|
|||
filterColumnMetaByType,
|
||||
JSDataType,
|
||||
} from '@hyperdx/common-utils/dist/clickhouse';
|
||||
import {
|
||||
hashCode,
|
||||
splitAndTrimWithBracket,
|
||||
} from '@hyperdx/common-utils/dist/core/utils';
|
||||
import {
|
||||
MetricsDataType,
|
||||
SourceKind,
|
||||
TSource,
|
||||
TSourceUnion,
|
||||
} from '@hyperdx/common-utils/dist/types';
|
||||
import {
|
||||
hashCode,
|
||||
splitAndTrimWithBracket,
|
||||
} from '@hyperdx/common-utils/dist/utils';
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
|
||||
import { hdxServer } from '@/api';
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ import {
|
|||
useQueryParams,
|
||||
withDefault,
|
||||
} from 'use-query-params';
|
||||
import { formatDate } from '@hyperdx/common-utils/dist/core/utils';
|
||||
import { DateRange } from '@hyperdx/common-utils/dist/types';
|
||||
import { formatDate } from '@hyperdx/common-utils/dist/utils';
|
||||
|
||||
import { parseTimeRangeInput } from './components/TimePicker/utils';
|
||||
import { useUserPreferences } from './useUserPreferences';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import { formatDate } from '@hyperdx/common-utils/dist/utils';
|
||||
import { formatDate } from '@hyperdx/common-utils/dist/core/utils';
|
||||
|
||||
import { useUserPreferences } from './useUserPreferences';
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { createClient } from '@clickhouse/client';
|
|||
import { ClickHouseClient } from '@clickhouse/client-common';
|
||||
|
||||
import { ClickhouseClient as HdxClickhouseClient } from '@/clickhouse/node';
|
||||
import { Metadata, MetadataCache } from '@/metadata';
|
||||
import { Metadata, MetadataCache } from '@/core/metadata';
|
||||
import { ChartConfigWithDateRange } from '@/types';
|
||||
|
||||
describe('Metadata Integration Tests', () => {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { ClickhouseClient } from '../clickhouse/node';
|
||||
import { Metadata, MetadataCache } from '../metadata';
|
||||
import * as renderChartConfigModule from '../renderChartConfig';
|
||||
import { Metadata, MetadataCache } from '../core/metadata';
|
||||
import * as renderChartConfigModule from '../core/renderChartConfig';
|
||||
import { ChartConfigWithDateRange } from '../types';
|
||||
|
||||
// Mock ClickhouseClient
|
||||
|
|
@ -14,7 +14,7 @@ const mockCache = {
|
|||
set: jest.fn(),
|
||||
} as any;
|
||||
|
||||
jest.mock('../renderChartConfig', () => ({
|
||||
jest.mock('../core/renderChartConfig', () => ({
|
||||
renderChartConfig: jest
|
||||
.fn()
|
||||
.mockResolvedValue({ sql: 'SELECT 1', params: {} }),
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ClickhouseClient } from '@/clickhouse/node';
|
||||
import { getMetadata } from '@/metadata';
|
||||
import { getMetadata } from '@/core/metadata';
|
||||
import { CustomSchemaSQLSerializerV2 } from '@/queryParser';
|
||||
|
||||
describe('CustomSchemaSQLSerializerV2 - json', () => {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import { chSql, ColumnMeta, parameterizedQueryToSql } from '@/clickhouse';
|
||||
import { Metadata } from '@/metadata';
|
||||
import { Metadata } from '@/core/metadata';
|
||||
import {
|
||||
ChartConfigWithOptDateRange,
|
||||
DisplayType,
|
||||
MetricsDataType,
|
||||
} from '@/types';
|
||||
|
||||
import { renderChartConfig, timeFilterExpr } from '../renderChartConfig';
|
||||
import { renderChartConfig, timeFilterExpr } from '../core/renderChartConfig';
|
||||
|
||||
describe('renderChartConfig', () => {
|
||||
let mockMetadata: jest.Mocked<Metadata>;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import {
|
|||
replaceJsonExpressions,
|
||||
splitAndTrimCSV,
|
||||
splitAndTrimWithBracket,
|
||||
} from '../utils';
|
||||
} from '../core/utils';
|
||||
|
||||
describe('utils', () => {
|
||||
describe('formatDate', () => {
|
||||
|
|
|
|||
|
|
@ -11,18 +11,18 @@ import type { ClickHouseClient as WebClickHouseClient } from '@clickhouse/client
|
|||
import * as SQLParser from 'node-sql-parser';
|
||||
import objectHash from 'object-hash';
|
||||
|
||||
import { Metadata } from '@/metadata';
|
||||
import { Metadata } from '@/core/metadata';
|
||||
import {
|
||||
renderChartConfig,
|
||||
setChartSelectsAlias,
|
||||
splitChartConfigs,
|
||||
} from '@/renderChartConfig';
|
||||
import { ChartConfigWithOptDateRange } from '@/types';
|
||||
} from '@/core/renderChartConfig';
|
||||
import {
|
||||
hashCode,
|
||||
replaceJsonExpressions,
|
||||
splitAndTrimWithBracket,
|
||||
} from '@/utils';
|
||||
} from '@/core/utils';
|
||||
import { ChartConfigWithOptDateRange } from '@/types';
|
||||
|
||||
// export @clickhouse/client-common types
|
||||
export type {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import {
|
|||
JSDataType,
|
||||
tableExpr,
|
||||
} from '@/clickhouse';
|
||||
import { renderChartConfig } from '@/renderChartConfig';
|
||||
import { renderChartConfig } from '@/core/renderChartConfig';
|
||||
import type { ChartConfig, ChartConfigWithDateRange, TSource } from '@/types';
|
||||
|
||||
// If filters initially are taking too long to load, decrease this number.
|
||||
|
|
@ -3,7 +3,7 @@ import * as SQLParser from 'node-sql-parser';
|
|||
import SqlString from 'sqlstring';
|
||||
|
||||
import { ChSql, chSql, concatChSql, wrapChSqlIfNotEmpty } from '@/clickhouse';
|
||||
import { Metadata } from '@/metadata';
|
||||
import { Metadata } from '@/core/metadata';
|
||||
import { CustomSchemaSQLSerializerV2, SearchQueryBuilder } from '@/queryParser';
|
||||
|
||||
/**
|
||||
|
|
@ -20,6 +20,14 @@ function createMetricNameFilter(
|
|||
}
|
||||
return SqlString.format('MetricName = ?', [metricName]);
|
||||
}
|
||||
import {
|
||||
convertDateRangeToGranularityString,
|
||||
convertGranularityToSeconds,
|
||||
getFirstTimestampValueExpression,
|
||||
optimizeTimestampValueExpression,
|
||||
parseToStartOfFunction,
|
||||
splitAndTrimWithBracket,
|
||||
} from '@/core/utils';
|
||||
import {
|
||||
AggregateFunction,
|
||||
AggregateFunctionWithCombinators,
|
||||
|
|
@ -38,14 +46,6 @@ import {
|
|||
SqlAstFilter,
|
||||
SQLInterval,
|
||||
} from '@/types';
|
||||
import {
|
||||
convertDateRangeToGranularityString,
|
||||
convertGranularityToSeconds,
|
||||
getFirstTimestampValueExpression,
|
||||
optimizeTimestampValueExpression,
|
||||
parseToStartOfFunction,
|
||||
splitAndTrimWithBracket,
|
||||
} from '@/utils';
|
||||
|
||||
/** The default maximum number of buckets setting when determining a bucket duration for 'auto' granularity */
|
||||
export const DEFAULT_AUTO_GRANULARITY_MAX_BUCKETS = 60;
|
||||
|
|
@ -2,8 +2,8 @@ import lucene from '@hyperdx/lucene';
|
|||
import SqlString from 'sqlstring';
|
||||
|
||||
import { convertCHTypeToPrimitiveJSType, JSDataType } from '@/clickhouse';
|
||||
import { Metadata } from '@/metadata';
|
||||
import { splitAndTrimWithBracket } from '@/utils';
|
||||
import { Metadata } from '@/core/metadata';
|
||||
import { splitAndTrimWithBracket } from '@/core/utils';
|
||||
|
||||
function encodeSpecialTokens(query: string): string {
|
||||
return query
|
||||
|
|
|
|||
Loading…
Reference in a new issue