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

@ -1,5 +1,6 @@
import { Variable, WebhookResponse } from '@typebot.io/schemas' import { Variable, WebhookResponse } from '@typebot.io/schemas'
import { getViewerUrl, sendRequest } from '@typebot.io/lib' import { sendRequest } from '@typebot.io/lib'
import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
export const executeWebhook = ( export const executeWebhook = (
typebotId: string, typebotId: string,

View File

@ -1,7 +1,7 @@
import { authenticatedProcedure } from '@/helpers/server/trpc' import { authenticatedProcedure } from '@/helpers/server/trpc'
import { z } from 'zod' import { z } from 'zod'
import got, { HTTPError } from 'got' import got, { HTTPError } from 'got'
import { getViewerUrl } from '@typebot.io/lib' import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
import prisma from '@/lib/prisma' import prisma from '@/lib/prisma'
import { TRPCError } from '@trpc/server' import { TRPCError } from '@trpc/server'

View File

@ -18,7 +18,7 @@ import {
Text, Text,
Stack, Stack,
} from '@chakra-ui/react' } from '@chakra-ui/react'
import { getViewerUrl } from '@typebot.io/lib' import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
import { ModalProps } from '../EmbedButton' import { ModalProps } from '../EmbedButton'
export const FlutterFlowModal = ({ export const FlutterFlowModal = ({

View File

@ -1,6 +1,6 @@
import { FlexProps } from '@chakra-ui/react' import { FlexProps } from '@chakra-ui/react'
import { useTypebot } from '@/features/editor/providers/TypebotProvider' import { useTypebot } from '@/features/editor/providers/TypebotProvider'
import { getViewerUrl } from '@typebot.io/lib' import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
import { CodeEditor } from '@/components/inputs/CodeEditor' import { CodeEditor } from '@/components/inputs/CodeEditor'
import prettier from 'prettier/standalone' import prettier from 'prettier/standalone'
import parserHtml from 'prettier/parser-html' import parserHtml from 'prettier/parser-html'

View File

@ -18,7 +18,7 @@ import {
Text, Text,
Stack, Stack,
} from '@chakra-ui/react' } from '@chakra-ui/react'
import { getViewerUrl } from '@typebot.io/lib' import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
import { ModalProps } from '../EmbedButton' import { ModalProps } from '../EmbedButton'
export const NotionModal = ({ export const NotionModal = ({

View File

@ -40,7 +40,8 @@ import {
InputRightElement, InputRightElement,
} from '@chakra-ui/react' } from '@chakra-ui/react'
import { env } from '@typebot.io/env' import { env } from '@typebot.io/env'
import { getViewerUrl, isEmpty, isNotEmpty } from '@typebot.io/lib/utils' import { isEmpty, isNotEmpty } from '@typebot.io/lib/utils'
import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
import React, { useState } from 'react' import React, { useState } from 'react'
const steps = [ const steps = [

View File

@ -12,7 +12,7 @@ import {
import { useState } from 'react' import { useState } from 'react'
import { StandardSettings } from '../../../settings/StandardSettings' import { StandardSettings } from '../../../settings/StandardSettings'
import { isCloudProdInstance } from '@/helpers/isCloudProdInstance' import { isCloudProdInstance } from '@/helpers/isCloudProdInstance'
import { getViewerUrl } from '@typebot.io/lib' import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
type Props = { type Props = {
publicId: string publicId: string

View File

@ -1,7 +1,8 @@
import { BotProps } from '@typebot.io/nextjs' import { BotProps } from '@typebot.io/nextjs'
import parserBabel from 'prettier/parser-babel' import parserBabel from 'prettier/parser-babel'
import prettier from 'prettier/standalone' import prettier from 'prettier/standalone'
import { getViewerUrl, isDefined } from '@typebot.io/lib' import { isDefined } from '@typebot.io/lib'
import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
import { Typebot } from '@typebot.io/schemas' import { Typebot } from '@typebot.io/schemas'
import { isCloudProdInstance } from '@/helpers/isCloudProdInstance' import { isCloudProdInstance } from '@/helpers/isCloudProdInstance'
import packageJson from '../../../../../../../../packages/embeds/js/package.json' import packageJson from '../../../../../../../../packages/embeds/js/package.json'

View File

@ -1,7 +1,7 @@
import { Seo } from '@/components/Seo' import { Seo } from '@/components/Seo'
import { Flex } from '@chakra-ui/react' import { Flex } from '@chakra-ui/react'
import { Standard } from '@typebot.io/nextjs' import { Standard } from '@typebot.io/nextjs'
import { getViewerUrl } from '@typebot.io/lib' import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
import { SettingsSideMenu } from './SettingsSideMenu' import { SettingsSideMenu } from './SettingsSideMenu'
import { TypebotHeader } from '@/features/editor/components/TypebotHeader' import { TypebotHeader } from '@/features/editor/components/TypebotHeader'
import { useTypebot } from '@/features/editor/providers/TypebotProvider' import { useTypebot } from '@/features/editor/providers/TypebotProvider'

View File

@ -14,6 +14,9 @@
"post": { "post": {
"operationId": "processTelemetryEvent", "operationId": "processTelemetryEvent",
"description": "Only used for the cloud version of Typebot. It's the way it processes telemetry events and inject it to thrid-party services.", "description": "Only used for the cloud version of Typebot. It's the way it processes telemetry events and inject it to thrid-party services.",
"tags": [
"Telemetry"
],
"requestBody": { "requestBody": {
"required": true, "required": true,
"content": { "content": {
@ -1985,7 +1988,9 @@
"Tomorrow", "Tomorrow",
"Random ID", "Random ID",
"Moment of the day", "Moment of the day",
"Map item with same index" "Map item with same index",
"Phone number",
"Contact name"
] ]
}, },
"mapListItemParams": { "mapListItemParams": {
@ -2562,8 +2567,7 @@
"required": [ "required": [
"id" "id"
], ],
"additionalProperties": false, "additionalProperties": false
"description": "Deprecated. Use `filter` instead."
} }
} }
}, },
@ -2609,8 +2613,7 @@
"required": [ "required": [
"id" "id"
], ],
"additionalProperties": false, "additionalProperties": false
"description": "Deprecated. Use `filter` instead."
} }
}, },
"referenceCell": { "referenceCell": {
@ -6270,7 +6273,9 @@
"Tomorrow", "Tomorrow",
"Random ID", "Random ID",
"Moment of the day", "Moment of the day",
"Map item with same index" "Map item with same index",
"Phone number",
"Contact name"
] ]
}, },
"mapListItemParams": { "mapListItemParams": {
@ -6847,8 +6852,7 @@
"required": [ "required": [
"id" "id"
], ],
"additionalProperties": false, "additionalProperties": false
"description": "Deprecated. Use `filter` instead."
} }
} }
}, },
@ -6894,8 +6898,7 @@
"required": [ "required": [
"id" "id"
], ],
"additionalProperties": false, "additionalProperties": false
"description": "Deprecated. Use `filter` instead."
} }
}, },
"referenceCell": { "referenceCell": {
@ -8432,6 +8435,67 @@
} }
}, },
"additionalProperties": false "additionalProperties": false
},
"whatsApp": {
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"startCondition": {
"type": "object",
"properties": {
"logicalOperator": {
"type": "string",
"enum": [
"OR",
"AND"
]
},
"comparisons": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"comparisonOperator": {
"type": "string",
"enum": [
"Equal to",
"Not equal",
"Contains",
"Does not contain",
"Greater than",
"Less than",
"Is set",
"Is empty",
"Starts with",
"Ends with",
"Matches regex",
"Does not match regex"
]
},
"value": {
"type": "string"
}
},
"required": [
"id"
],
"additionalProperties": false
}
}
},
"required": [
"logicalOperator",
"comparisons"
],
"additionalProperties": false
}
},
"additionalProperties": false
} }
}, },
"required": [ "required": [
@ -10129,7 +10193,9 @@
"Tomorrow", "Tomorrow",
"Random ID", "Random ID",
"Moment of the day", "Moment of the day",
"Map item with same index" "Map item with same index",
"Phone number",
"Contact name"
] ]
}, },
"mapListItemParams": { "mapListItemParams": {
@ -10706,8 +10772,7 @@
"required": [ "required": [
"id" "id"
], ],
"additionalProperties": false, "additionalProperties": false
"description": "Deprecated. Use `filter` instead."
} }
} }
}, },
@ -10753,8 +10818,7 @@
"required": [ "required": [
"id" "id"
], ],
"additionalProperties": false, "additionalProperties": false
"description": "Deprecated. Use `filter` instead."
} }
}, },
"referenceCell": { "referenceCell": {
@ -12380,6 +12444,67 @@
} }
}, },
"additionalProperties": false "additionalProperties": false
},
"whatsApp": {
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"startCondition": {
"type": "object",
"properties": {
"logicalOperator": {
"type": "string",
"enum": [
"OR",
"AND"
]
},
"comparisons": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"comparisonOperator": {
"type": "string",
"enum": [
"Equal to",
"Not equal",
"Contains",
"Does not contain",
"Greater than",
"Less than",
"Is set",
"Is empty",
"Starts with",
"Ends with",
"Matches regex",
"Does not match regex"
]
},
"value": {
"type": "string"
}
},
"required": [
"id"
],
"additionalProperties": false
}
}
},
"required": [
"logicalOperator",
"comparisons"
],
"additionalProperties": false
}
},
"additionalProperties": false
} }
}, },
"required": [ "required": [
@ -12451,6 +12576,10 @@
}, },
"isClosed": { "isClosed": {
"type": "boolean" "type": "boolean"
},
"whatsAppPhoneNumberId": {
"type": "string",
"nullable": true
} }
}, },
"required": [ "required": [
@ -12472,7 +12601,8 @@
"workspaceId", "workspaceId",
"resultsTablePreferences", "resultsTablePreferences",
"isArchived", "isArchived",
"isClosed" "isClosed",
"whatsAppPhoneNumberId"
], ],
"additionalProperties": false "additionalProperties": false
} }
@ -14123,7 +14253,9 @@
"Tomorrow", "Tomorrow",
"Random ID", "Random ID",
"Moment of the day", "Moment of the day",
"Map item with same index" "Map item with same index",
"Phone number",
"Contact name"
] ]
}, },
"mapListItemParams": { "mapListItemParams": {
@ -14700,8 +14832,7 @@
"required": [ "required": [
"id" "id"
], ],
"additionalProperties": false, "additionalProperties": false
"description": "Deprecated. Use `filter` instead."
} }
} }
}, },
@ -14747,8 +14878,7 @@
"required": [ "required": [
"id" "id"
], ],
"additionalProperties": false, "additionalProperties": false
"description": "Deprecated. Use `filter` instead."
} }
}, },
"referenceCell": { "referenceCell": {
@ -16285,6 +16415,67 @@
} }
}, },
"additionalProperties": false "additionalProperties": false
},
"whatsApp": {
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"startCondition": {
"type": "object",
"properties": {
"logicalOperator": {
"type": "string",
"enum": [
"OR",
"AND"
]
},
"comparisons": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"comparisonOperator": {
"type": "string",
"enum": [
"Equal to",
"Not equal",
"Contains",
"Does not contain",
"Greater than",
"Less than",
"Is set",
"Is empty",
"Starts with",
"Ends with",
"Matches regex",
"Does not match regex"
]
},
"value": {
"type": "string"
}
},
"required": [
"id"
],
"additionalProperties": false
}
}
},
"required": [
"logicalOperator",
"comparisons"
],
"additionalProperties": false
}
},
"additionalProperties": false
} }
}, },
"required": [ "required": [
@ -16423,6 +16614,10 @@
}, },
"isClosed": { "isClosed": {
"type": "boolean" "type": "boolean"
},
"whatsAppPhoneNumberId": {
"type": "string",
"nullable": true
} }
}, },
"additionalProperties": false "additionalProperties": false
@ -17998,7 +18193,9 @@
"Tomorrow", "Tomorrow",
"Random ID", "Random ID",
"Moment of the day", "Moment of the day",
"Map item with same index" "Map item with same index",
"Phone number",
"Contact name"
] ]
}, },
"mapListItemParams": { "mapListItemParams": {
@ -18575,8 +18772,7 @@
"required": [ "required": [
"id" "id"
], ],
"additionalProperties": false, "additionalProperties": false
"description": "Deprecated. Use `filter` instead."
} }
} }
}, },
@ -18622,8 +18818,7 @@
"required": [ "required": [
"id" "id"
], ],
"additionalProperties": false, "additionalProperties": false
"description": "Deprecated. Use `filter` instead."
} }
}, },
"referenceCell": { "referenceCell": {
@ -20249,6 +20444,67 @@
} }
}, },
"additionalProperties": false "additionalProperties": false
},
"whatsApp": {
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"startCondition": {
"type": "object",
"properties": {
"logicalOperator": {
"type": "string",
"enum": [
"OR",
"AND"
]
},
"comparisons": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"comparisonOperator": {
"type": "string",
"enum": [
"Equal to",
"Not equal",
"Contains",
"Does not contain",
"Greater than",
"Less than",
"Is set",
"Is empty",
"Starts with",
"Ends with",
"Matches regex",
"Does not match regex"
]
},
"value": {
"type": "string"
}
},
"required": [
"id"
],
"additionalProperties": false
}
}
},
"required": [
"logicalOperator",
"comparisons"
],
"additionalProperties": false
}
},
"additionalProperties": false
} }
}, },
"required": [ "required": [
@ -20320,6 +20576,10 @@
}, },
"isClosed": { "isClosed": {
"type": "boolean" "type": "boolean"
},
"whatsAppPhoneNumberId": {
"type": "string",
"nullable": true
} }
}, },
"required": [ "required": [
@ -20341,7 +20601,8 @@
"workspaceId", "workspaceId",
"resultsTablePreferences", "resultsTablePreferences",
"isArchived", "isArchived",
"isClosed" "isClosed",
"whatsAppPhoneNumberId"
], ],
"additionalProperties": false "additionalProperties": false
} }
@ -21927,7 +22188,9 @@
"Tomorrow", "Tomorrow",
"Random ID", "Random ID",
"Moment of the day", "Moment of the day",
"Map item with same index" "Map item with same index",
"Phone number",
"Contact name"
] ]
}, },
"mapListItemParams": { "mapListItemParams": {
@ -22504,8 +22767,7 @@
"required": [ "required": [
"id" "id"
], ],
"additionalProperties": false, "additionalProperties": false
"description": "Deprecated. Use `filter` instead."
} }
} }
}, },
@ -22551,8 +22813,7 @@
"required": [ "required": [
"id" "id"
], ],
"additionalProperties": false, "additionalProperties": false
"description": "Deprecated. Use `filter` instead."
} }
}, },
"referenceCell": { "referenceCell": {
@ -24178,6 +24439,67 @@
} }
}, },
"additionalProperties": false "additionalProperties": false
},
"whatsApp": {
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"startCondition": {
"type": "object",
"properties": {
"logicalOperator": {
"type": "string",
"enum": [
"OR",
"AND"
]
},
"comparisons": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"comparisonOperator": {
"type": "string",
"enum": [
"Equal to",
"Not equal",
"Contains",
"Does not contain",
"Greater than",
"Less than",
"Is set",
"Is empty",
"Starts with",
"Ends with",
"Matches regex",
"Does not match regex"
]
},
"value": {
"type": "string"
}
},
"required": [
"id"
],
"additionalProperties": false
}
}
},
"required": [
"logicalOperator",
"comparisons"
],
"additionalProperties": false
}
},
"additionalProperties": false
} }
}, },
"required": [ "required": [
@ -24249,6 +24571,10 @@
}, },
"isClosed": { "isClosed": {
"type": "boolean" "type": "boolean"
},
"whatsAppPhoneNumberId": {
"type": "string",
"nullable": true
} }
}, },
"required": [ "required": [
@ -24270,7 +24596,8 @@
"workspaceId", "workspaceId",
"resultsTablePreferences", "resultsTablePreferences",
"isArchived", "isArchived",
"isClosed" "isClosed",
"whatsAppPhoneNumberId"
], ],
"additionalProperties": false "additionalProperties": false
}, },
@ -25919,7 +26246,9 @@
"Tomorrow", "Tomorrow",
"Random ID", "Random ID",
"Moment of the day", "Moment of the day",
"Map item with same index" "Map item with same index",
"Phone number",
"Contact name"
] ]
}, },
"mapListItemParams": { "mapListItemParams": {
@ -26496,8 +26825,7 @@
"required": [ "required": [
"id" "id"
], ],
"additionalProperties": false, "additionalProperties": false
"description": "Deprecated. Use `filter` instead."
} }
} }
}, },
@ -26543,8 +26871,7 @@
"required": [ "required": [
"id" "id"
], ],
"additionalProperties": false, "additionalProperties": false
"description": "Deprecated. Use `filter` instead."
} }
}, },
"referenceCell": { "referenceCell": {
@ -28166,6 +28493,67 @@
} }
}, },
"additionalProperties": false "additionalProperties": false
},
"whatsApp": {
"type": "object",
"properties": {
"credentialsId": {
"type": "string"
},
"startCondition": {
"type": "object",
"properties": {
"logicalOperator": {
"type": "string",
"enum": [
"OR",
"AND"
]
},
"comparisons": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"comparisonOperator": {
"type": "string",
"enum": [
"Equal to",
"Not equal",
"Contains",
"Does not contain",
"Greater than",
"Less than",
"Is set",
"Is empty",
"Starts with",
"Ends with",
"Matches regex",
"Does not match regex"
]
},
"value": {
"type": "string"
}
},
"required": [
"id"
],
"additionalProperties": false
}
}
},
"required": [
"logicalOperator",
"comparisons"
],
"additionalProperties": false
}
},
"additionalProperties": false
} }
}, },
"required": [ "required": [
@ -29968,6 +30356,46 @@
"name" "name"
], ],
"additionalProperties": false "additionalProperties": false
},
{
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"systemUserAccessToken": {
"type": "string"
},
"phoneNumberId": {
"type": "string"
}
},
"required": [
"systemUserAccessToken",
"phoneNumberId"
],
"additionalProperties": false
},
"type": {
"type": "string",
"enum": [
"whatsApp"
]
},
"workspaceId": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"data",
"type",
"workspaceId",
"name"
],
"additionalProperties": false
} }
] ]
} }
@ -30037,15 +30465,25 @@
{ {
"anyOf": [ "anyOf": [
{ {
"type": "string", "anyOf": [
"enum": [ {
"stripe" "type": "string",
"enum": [
"stripe"
]
},
{
"type": "string",
"enum": [
"smtp"
]
}
] ]
}, },
{ {
"type": "string", "type": "string",
"enum": [ "enum": [
"smtp" "google sheets"
] ]
} }
] ]
@ -30053,7 +30491,7 @@
{ {
"type": "string", "type": "string",
"enum": [ "enum": [
"google sheets" "openai"
] ]
} }
] ]
@ -30061,7 +30499,7 @@
{ {
"type": "string", "type": "string",
"enum": [ "enum": [
"openai" "whatsApp"
] ]
} }
] ]
@ -31347,6 +31785,220 @@
} }
} }
} }
},
"/whatsapp/phoneNumber": {
"get": {
"operationId": "whatsApp-getPhoneNumber",
"security": [
{
"Authorization": []
}
],
"parameters": [
{
"name": "credentialsId",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "systemToken",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "phoneNumberId",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"id",
"name"
],
"additionalProperties": false
}
}
}
},
"default": {
"$ref": "#/components/responses/error"
}
}
}
},
"/whatsapp/systemToken": {
"get": {
"operationId": "whatsApp-getSystemTokenInfo",
"security": [
{
"Authorization": []
}
],
"parameters": [
{
"name": "token",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "credentialsId",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"appId": {
"type": "string"
},
"appName": {
"type": "string"
},
"expiresAt": {
"type": "number"
},
"scopes": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"appId",
"appName",
"expiresAt",
"scopes"
],
"additionalProperties": false
}
}
}
},
"default": {
"$ref": "#/components/responses/error"
}
}
}
},
"/whatsapp/phoneNumber/{phoneNumberDisplayName}/available": {
"get": {
"operationId": "whatsApp-verifyIfPhoneNumberAvailable",
"security": [
{
"Authorization": []
}
],
"parameters": [
{
"name": "phoneNumberDisplayName",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"enum": [
"available",
"taken"
]
}
},
"required": [
"message"
],
"additionalProperties": false
}
}
}
},
"default": {
"$ref": "#/components/responses/error"
}
}
}
},
"/verficiationTokens": {
"post": {
"operationId": "whatsApp-generateVerificationToken",
"security": [
{
"Authorization": []
}
],
"parameters": [],
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"verificationToken": {
"type": "string"
}
},
"required": [
"verificationToken"
],
"additionalProperties": false
}
}
}
},
"default": {
"$ref": "#/components/responses/error"
}
}
}
} }
}, },
"components": { "components": {

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
import React from 'react' import React from 'react'
import { getViewerUrl } from '@typebot.io/lib' import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
export const ErrorPage = ({ error }: { error: Error }) => { export const ErrorPage = ({ error }: { error: Error }) => {
return ( return (

View File

@ -14,7 +14,8 @@ import {
} from '@typebot.io/schemas' } from '@typebot.io/schemas'
import { Log } from '@typebot.io/prisma' import { Log } from '@typebot.io/prisma'
import { LiteBadge } from './LiteBadge' import { LiteBadge } from './LiteBadge'
import { getViewerUrl, isEmpty, isNotEmpty } from '@typebot.io/lib' import { isNotEmpty } from '@typebot.io/lib'
import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
export type TypebotViewerProps = { export type TypebotViewerProps = {
typebot: Omit<PublicTypebot, 'updatedAt' | 'createdAt'> typebot: Omit<PublicTypebot, 'updatedAt' | 'createdAt'>

View File

@ -1,6 +1,6 @@
{ {
"name": "@typebot.io/js", "name": "@typebot.io/js",
"version": "0.1.21", "version": "0.1.22",
"description": "Javascript library to display typebots on your website", "description": "Javascript library to display typebots on your website",
"type": "module", "type": "module",
"main": "dist/index.js", "main": "dist/index.js",

View File

@ -1,6 +1,6 @@
{ {
"name": "@typebot.io/nextjs", "name": "@typebot.io/nextjs",
"version": "0.1.21", "version": "0.1.22",
"description": "Convenient library to display typebots on your Next.js website", "description": "Convenient library to display typebots on your Next.js website",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",

View File

@ -1,6 +1,6 @@
{ {
"name": "@typebot.io/react", "name": "@typebot.io/react",
"version": "0.1.21", "version": "0.1.22",
"description": "Convenient library to display typebots on your React app", "description": "Convenient library to display typebots on your React app",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",

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