<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced file visibility options for uploaded files, allowing users to set files as public or private. - Added a new API endpoint for retrieving temporary URLs for files, enhancing file accessibility. - Expanded file upload documentation to include information on file visibility settings. - Updated URL validation to support URLs with port numbers and "http://localhost". - **Enhancements** - Improved media download functionality by replacing the `got` library with a custom `downloadMedia` function. - Enhanced bot flow continuation and session start logic to support a wider range of reply types, including WhatsApp media messages. - **Bug Fixes** - Adjusted file path and URL construction in the `generateUploadUrl` function to correctly reflect file visibility settings. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
34 lines
847 B
TypeScript
34 lines
847 B
TypeScript
import {
|
|
ContinueChatResponse,
|
|
CustomEmbedBubble,
|
|
SessionState,
|
|
} from '@typebot.io/schemas'
|
|
|
|
export type EdgeId = string
|
|
|
|
export type ExecuteLogicResponse = {
|
|
outgoingEdgeId: EdgeId | undefined
|
|
newSessionState?: SessionState
|
|
} & Pick<ContinueChatResponse, 'clientSideActions' | 'logs'>
|
|
|
|
export type ExecuteIntegrationResponse = {
|
|
outgoingEdgeId: EdgeId | undefined
|
|
newSessionState?: SessionState
|
|
startTimeShouldBeUpdated?: boolean
|
|
customEmbedBubble?: CustomEmbedBubble
|
|
} & Pick<ContinueChatResponse, 'clientSideActions' | 'logs'>
|
|
|
|
type WhatsAppMediaMessage = {
|
|
type: 'whatsapp media'
|
|
mediaId: string
|
|
workspaceId?: string
|
|
accessToken: string
|
|
}
|
|
|
|
export type Reply = string | WhatsAppMediaMessage | undefined
|
|
|
|
export type ParsedReply =
|
|
| { status: 'success'; reply: string }
|
|
| { status: 'fail' }
|
|
| { status: 'skip' }
|