From e82a1f83185d3798c694d29a7cc84bf906d23cc4 Mon Sep 17 00:00:00 2001 From: Bastien Caudan Date: Wed, 18 May 2022 15:53:20 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20dependency=20issue=20(#154?= =?UTF-8?q?9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/src/domain/configuration/endpointBuilder.ts | 7 +------ packages/core/src/domain/configuration/index.ts | 11 ++--------- packages/core/src/domain/configuration/intakeSites.ts | 5 +++++ .../domain/configuration/transportConfiguration.ts | 3 ++- .../internalMonitoring/internalMonitoring.spec.ts | 4 ++-- .../domain/internalMonitoring/internalMonitoring.ts | 2 +- 6 files changed, 13 insertions(+), 19 deletions(-) create mode 100644 packages/core/src/domain/configuration/intakeSites.ts diff --git a/packages/core/src/domain/configuration/endpointBuilder.ts b/packages/core/src/domain/configuration/endpointBuilder.ts index a2b27d9bbc..8ae2886028 100644 --- a/packages/core/src/domain/configuration/endpointBuilder.ts +++ b/packages/core/src/domain/configuration/endpointBuilder.ts @@ -2,6 +2,7 @@ import { timeStampNow } from '../../tools/timeUtils' import { normalizeUrl } from '../../tools/urlPolyfill' import { generateUUID } from '../../tools/utils' import type { InitConfiguration } from './configuration' +import { INTAKE_SITE_US } from './intakeSites' // replaced at build time declare const __BUILD_ENV__SDK_VERSION__: string @@ -20,12 +21,6 @@ const INTAKE_TRACKS = { type EndpointType = keyof typeof ENDPOINTS -export const INTAKE_SITE_STAGING = 'datad0g.com' -export const INTAKE_SITE_US = 'datadoghq.com' -export const INTAKE_SITE_US3 = 'us3.datadoghq.com' -export const INTAKE_SITE_US5 = 'us5.datadoghq.com' -export const INTAKE_SITE_EU = 'datadoghq.eu' - export type EndpointBuilder = ReturnType export function createEndpointBuilder( diff --git a/packages/core/src/domain/configuration/index.ts b/packages/core/src/domain/configuration/index.ts index d0745068f6..d75d9b6090 100644 --- a/packages/core/src/domain/configuration/index.ts +++ b/packages/core/src/domain/configuration/index.ts @@ -5,17 +5,10 @@ export { DefaultPrivacyLevel, validateAndBuildConfiguration, } from './configuration' -export { - createEndpointBuilder, - EndpointBuilder, - INTAKE_SITE_STAGING, - INTAKE_SITE_US5, - INTAKE_SITE_US, - INTAKE_SITE_US3, - INTAKE_SITE_EU, -} from './endpointBuilder' +export { createEndpointBuilder, EndpointBuilder } from './endpointBuilder' export { isExperimentalFeatureEnabled, updateExperimentalFeatures, resetExperimentalFeatures, } from './experimentalFeatures' +export * from './intakeSites' diff --git a/packages/core/src/domain/configuration/intakeSites.ts b/packages/core/src/domain/configuration/intakeSites.ts new file mode 100644 index 0000000000..ea49c6f83b --- /dev/null +++ b/packages/core/src/domain/configuration/intakeSites.ts @@ -0,0 +1,5 @@ +export const INTAKE_SITE_STAGING = 'datad0g.com' +export const INTAKE_SITE_US = 'datadoghq.com' +export const INTAKE_SITE_US3 = 'us3.datadoghq.com' +export const INTAKE_SITE_US5 = 'us5.datadoghq.com' +export const INTAKE_SITE_EU = 'datadoghq.eu' diff --git a/packages/core/src/domain/configuration/transportConfiguration.ts b/packages/core/src/domain/configuration/transportConfiguration.ts index 36813c32a4..7e9be1edc1 100644 --- a/packages/core/src/domain/configuration/transportConfiguration.ts +++ b/packages/core/src/domain/configuration/transportConfiguration.ts @@ -1,8 +1,9 @@ import { assign, objectValues } from '../../tools/utils' import type { InitConfiguration } from './configuration' import type { EndpointBuilder } from './endpointBuilder' -import { createEndpointBuilder, INTAKE_SITE_US } from './endpointBuilder' +import { createEndpointBuilder } from './endpointBuilder' import { buildTags } from './tags' +import { INTAKE_SITE_US } from './intakeSites' export interface TransportConfiguration { logsEndpointBuilder: EndpointBuilder diff --git a/packages/core/src/domain/internalMonitoring/internalMonitoring.spec.ts b/packages/core/src/domain/internalMonitoring/internalMonitoring.spec.ts index 2d12072d22..5eacdaa5ec 100644 --- a/packages/core/src/domain/internalMonitoring/internalMonitoring.spec.ts +++ b/packages/core/src/domain/internalMonitoring/internalMonitoring.spec.ts @@ -4,10 +4,10 @@ import type { Configuration } from '../configuration' import { updateExperimentalFeatures, resetExperimentalFeatures, - INTAKE_SITE_US, - INTAKE_SITE_US3, INTAKE_SITE_EU, INTAKE_SITE_US5, + INTAKE_SITE_US3, + INTAKE_SITE_US, } from '../configuration' import type { InternalMonitoring, MonitoringMessage } from './internalMonitoring' import { diff --git a/packages/core/src/domain/internalMonitoring/internalMonitoring.ts b/packages/core/src/domain/internalMonitoring/internalMonitoring.ts index a33fec9558..b3904a02a8 100644 --- a/packages/core/src/domain/internalMonitoring/internalMonitoring.ts +++ b/packages/core/src/domain/internalMonitoring/internalMonitoring.ts @@ -6,7 +6,7 @@ import type { Configuration } from '../configuration' import { computeStackTrace } from '../tracekit' import { Observable } from '../../tools/observable' import { timeStampNow } from '../../tools/timeUtils' -import { isExperimentalFeatureEnabled, INTAKE_SITE_STAGING, INTAKE_SITE_US5, INTAKE_SITE_US3 } from '../configuration' +import { isExperimentalFeatureEnabled, INTAKE_SITE_US5, INTAKE_SITE_US3, INTAKE_SITE_STAGING } from '../configuration' import type { TelemetryEvent } from './telemetryEvent.types' // replaced at build time