🐛 (embed) Make sure env.ts is not bundled in js embed lib
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
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 = (
|
||||
typebotId: string,
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { authenticatedProcedure } from '@/helpers/server/trpc'
|
||||
import { z } from 'zod'
|
||||
import got, { HTTPError } from 'got'
|
||||
import { getViewerUrl } from '@typebot.io/lib'
|
||||
import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
|
||||
import prisma from '@/lib/prisma'
|
||||
import { TRPCError } from '@trpc/server'
|
||||
|
||||
|
@ -18,7 +18,7 @@ import {
|
||||
Text,
|
||||
Stack,
|
||||
} from '@chakra-ui/react'
|
||||
import { getViewerUrl } from '@typebot.io/lib'
|
||||
import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
|
||||
import { ModalProps } from '../EmbedButton'
|
||||
|
||||
export const FlutterFlowModal = ({
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { FlexProps } from '@chakra-ui/react'
|
||||
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 prettier from 'prettier/standalone'
|
||||
import parserHtml from 'prettier/parser-html'
|
||||
|
@ -18,7 +18,7 @@ import {
|
||||
Text,
|
||||
Stack,
|
||||
} from '@chakra-ui/react'
|
||||
import { getViewerUrl } from '@typebot.io/lib'
|
||||
import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
|
||||
import { ModalProps } from '../EmbedButton'
|
||||
|
||||
export const NotionModal = ({
|
||||
|
@ -40,7 +40,8 @@ import {
|
||||
InputRightElement,
|
||||
} from '@chakra-ui/react'
|
||||
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'
|
||||
|
||||
const steps = [
|
||||
|
@ -12,7 +12,7 @@ import {
|
||||
import { useState } from 'react'
|
||||
import { StandardSettings } from '../../../settings/StandardSettings'
|
||||
import { isCloudProdInstance } from '@/helpers/isCloudProdInstance'
|
||||
import { getViewerUrl } from '@typebot.io/lib'
|
||||
import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
|
||||
|
||||
type Props = {
|
||||
publicId: string
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { BotProps } from '@typebot.io/nextjs'
|
||||
import parserBabel from 'prettier/parser-babel'
|
||||
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 { isCloudProdInstance } from '@/helpers/isCloudProdInstance'
|
||||
import packageJson from '../../../../../../../../packages/embeds/js/package.json'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Seo } from '@/components/Seo'
|
||||
import { Flex } from '@chakra-ui/react'
|
||||
import { Standard } from '@typebot.io/nextjs'
|
||||
import { getViewerUrl } from '@typebot.io/lib'
|
||||
import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
|
||||
import { SettingsSideMenu } from './SettingsSideMenu'
|
||||
import { TypebotHeader } from '@/features/editor/components/TypebotHeader'
|
||||
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
||||
|
@ -14,6 +14,9 @@
|
||||
"post": {
|
||||
"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.",
|
||||
"tags": [
|
||||
"Telemetry"
|
||||
],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
@ -1985,7 +1988,9 @@
|
||||
"Tomorrow",
|
||||
"Random ID",
|
||||
"Moment of the day",
|
||||
"Map item with same index"
|
||||
"Map item with same index",
|
||||
"Phone number",
|
||||
"Contact name"
|
||||
]
|
||||
},
|
||||
"mapListItemParams": {
|
||||
@ -2562,8 +2567,7 @@
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"description": "Deprecated. Use `filter` instead."
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -2609,8 +2613,7 @@
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"description": "Deprecated. Use `filter` instead."
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"referenceCell": {
|
||||
@ -6270,7 +6273,9 @@
|
||||
"Tomorrow",
|
||||
"Random ID",
|
||||
"Moment of the day",
|
||||
"Map item with same index"
|
||||
"Map item with same index",
|
||||
"Phone number",
|
||||
"Contact name"
|
||||
]
|
||||
},
|
||||
"mapListItemParams": {
|
||||
@ -6847,8 +6852,7 @@
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"description": "Deprecated. Use `filter` instead."
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -6894,8 +6898,7 @@
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"description": "Deprecated. Use `filter` instead."
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"referenceCell": {
|
||||
@ -8432,6 +8435,67 @@
|
||||
}
|
||||
},
|
||||
"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": [
|
||||
@ -10129,7 +10193,9 @@
|
||||
"Tomorrow",
|
||||
"Random ID",
|
||||
"Moment of the day",
|
||||
"Map item with same index"
|
||||
"Map item with same index",
|
||||
"Phone number",
|
||||
"Contact name"
|
||||
]
|
||||
},
|
||||
"mapListItemParams": {
|
||||
@ -10706,8 +10772,7 @@
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"description": "Deprecated. Use `filter` instead."
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -10753,8 +10818,7 @@
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"description": "Deprecated. Use `filter` instead."
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"referenceCell": {
|
||||
@ -12380,6 +12444,67 @@
|
||||
}
|
||||
},
|
||||
"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": [
|
||||
@ -12451,6 +12576,10 @@
|
||||
},
|
||||
"isClosed": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"whatsAppPhoneNumberId": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@ -12472,7 +12601,8 @@
|
||||
"workspaceId",
|
||||
"resultsTablePreferences",
|
||||
"isArchived",
|
||||
"isClosed"
|
||||
"isClosed",
|
||||
"whatsAppPhoneNumberId"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
@ -14123,7 +14253,9 @@
|
||||
"Tomorrow",
|
||||
"Random ID",
|
||||
"Moment of the day",
|
||||
"Map item with same index"
|
||||
"Map item with same index",
|
||||
"Phone number",
|
||||
"Contact name"
|
||||
]
|
||||
},
|
||||
"mapListItemParams": {
|
||||
@ -14700,8 +14832,7 @@
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"description": "Deprecated. Use `filter` instead."
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -14747,8 +14878,7 @@
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"description": "Deprecated. Use `filter` instead."
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"referenceCell": {
|
||||
@ -16285,6 +16415,67 @@
|
||||
}
|
||||
},
|
||||
"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": [
|
||||
@ -16423,6 +16614,10 @@
|
||||
},
|
||||
"isClosed": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"whatsAppPhoneNumberId": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
@ -17998,7 +18193,9 @@
|
||||
"Tomorrow",
|
||||
"Random ID",
|
||||
"Moment of the day",
|
||||
"Map item with same index"
|
||||
"Map item with same index",
|
||||
"Phone number",
|
||||
"Contact name"
|
||||
]
|
||||
},
|
||||
"mapListItemParams": {
|
||||
@ -18575,8 +18772,7 @@
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"description": "Deprecated. Use `filter` instead."
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -18622,8 +18818,7 @@
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"description": "Deprecated. Use `filter` instead."
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"referenceCell": {
|
||||
@ -20249,6 +20444,67 @@
|
||||
}
|
||||
},
|
||||
"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": [
|
||||
@ -20320,6 +20576,10 @@
|
||||
},
|
||||
"isClosed": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"whatsAppPhoneNumberId": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@ -20341,7 +20601,8 @@
|
||||
"workspaceId",
|
||||
"resultsTablePreferences",
|
||||
"isArchived",
|
||||
"isClosed"
|
||||
"isClosed",
|
||||
"whatsAppPhoneNumberId"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
@ -21927,7 +22188,9 @@
|
||||
"Tomorrow",
|
||||
"Random ID",
|
||||
"Moment of the day",
|
||||
"Map item with same index"
|
||||
"Map item with same index",
|
||||
"Phone number",
|
||||
"Contact name"
|
||||
]
|
||||
},
|
||||
"mapListItemParams": {
|
||||
@ -22504,8 +22767,7 @@
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"description": "Deprecated. Use `filter` instead."
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -22551,8 +22813,7 @@
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"description": "Deprecated. Use `filter` instead."
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"referenceCell": {
|
||||
@ -24178,6 +24439,67 @@
|
||||
}
|
||||
},
|
||||
"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": [
|
||||
@ -24249,6 +24571,10 @@
|
||||
},
|
||||
"isClosed": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"whatsAppPhoneNumberId": {
|
||||
"type": "string",
|
||||
"nullable": true
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@ -24270,7 +24596,8 @@
|
||||
"workspaceId",
|
||||
"resultsTablePreferences",
|
||||
"isArchived",
|
||||
"isClosed"
|
||||
"isClosed",
|
||||
"whatsAppPhoneNumberId"
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
@ -25919,7 +26246,9 @@
|
||||
"Tomorrow",
|
||||
"Random ID",
|
||||
"Moment of the day",
|
||||
"Map item with same index"
|
||||
"Map item with same index",
|
||||
"Phone number",
|
||||
"Contact name"
|
||||
]
|
||||
},
|
||||
"mapListItemParams": {
|
||||
@ -26496,8 +26825,7 @@
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"description": "Deprecated. Use `filter` instead."
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -26543,8 +26871,7 @@
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"description": "Deprecated. Use `filter` instead."
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"referenceCell": {
|
||||
@ -28166,6 +28493,67 @@
|
||||
}
|
||||
},
|
||||
"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": [
|
||||
@ -29968,6 +30356,46 @@
|
||||
"name"
|
||||
],
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -30034,6 +30462,8 @@
|
||||
"anyOf": [
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
"anyOf": [
|
||||
{
|
||||
@ -30065,6 +30495,14 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"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": {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
import React from 'react'
|
||||
import { getViewerUrl } from '@typebot.io/lib'
|
||||
import { getViewerUrl } from '@typebot.io/lib/getViewerUrl'
|
||||
|
||||
export const ErrorPage = ({ error }: { error: Error }) => {
|
||||
return (
|
||||
|
@ -14,7 +14,8 @@ import {
|
||||
} from '@typebot.io/schemas'
|
||||
import { Log } from '@typebot.io/prisma'
|
||||
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 = {
|
||||
typebot: Omit<PublicTypebot, 'updatedAt' | 'createdAt'>
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/js",
|
||||
"version": "0.1.21",
|
||||
"version": "0.1.22",
|
||||
"description": "Javascript library to display typebots on your website",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/nextjs",
|
||||
"version": "0.1.21",
|
||||
"version": "0.1.22",
|
||||
"description": "Convenient library to display typebots on your Next.js website",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@typebot.io/react",
|
||||
"version": "0.1.21",
|
||||
"version": "0.1.22",
|
||||
"description": "Convenient library to display typebots on your React app",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
4
packages/lib/getViewerUrl.ts
Normal file
4
packages/lib/getViewerUrl.ts
Normal 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]
|
@ -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[]) => {
|
||||
|
@ -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, ',')
|
||||
|
||||
|
Reference in New Issue
Block a user