2
0

🐛 (embed) Make sure env.ts is not bundled in js embed lib

This commit is contained in:
Baptiste Arnaud
2023-08-29 14:52:44 +02:00
parent 5b20f414c8
commit da4005e160
19 changed files with 1813 additions and 68 deletions

View File

@@ -0,0 +1,4 @@
import { env } from '@typebot.io/env'
export const getViewerUrl = () =>
env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ?? env.NEXT_PUBLIC_VIEWER_URL[0]

View File

@@ -1,6 +1,5 @@
import got from 'got'
import { TelemetryEvent } from '@typebot.io/schemas/features/telemetry'
import { isNotEmpty } from '../utils'
import { env } from '@typebot.io/env'
export const sendTelemetryEvents = async (events: TelemetryEvent[]) => {

View File

@@ -19,7 +19,6 @@ import { BubbleBlockType } from '@typebot.io/schemas/features/blocks/bubbles/enu
import { LogicBlockType } from '@typebot.io/schemas/features/blocks/logic/enums'
import { IntegrationBlockType } from '@typebot.io/schemas/features/blocks/integrations/enums'
import { PictureChoiceBlock } from '@typebot.io/schemas/features/blocks/inputs/pictureChoice'
import { env } from '@typebot.io/env'
export const sendRequest = async <ResponseData>(
params:
@@ -257,9 +256,6 @@ export const hasValue = (
value !== 'undefined' &&
value !== 'null'
export const getViewerUrl = () =>
env.NEXT_PUBLIC_VIEWER_INTERNAL_URL ?? env.NEXT_PUBLIC_VIEWER_URL[0]
export const parseNumberWithCommas = (num: number) =>
num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')