<!-- 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 -->
19 lines
464 B
TypeScript
19 lines
464 B
TypeScript
import { FileInputBlock } from './schema'
|
|
|
|
export const defaultFileInputOptions = {
|
|
isRequired: true,
|
|
isMultipleAllowed: false,
|
|
visibility: 'Auto',
|
|
labels: {
|
|
placeholder: `<strong>
|
|
Click to upload
|
|
</strong> or drag and drop<br>
|
|
(size limit: 10MB)`,
|
|
button: 'Upload',
|
|
clear: 'Clear',
|
|
skip: 'Skip',
|
|
},
|
|
} as const satisfies FileInputBlock['options']
|
|
|
|
export const fileVisibilityOptions = ['Auto', 'Public', 'Private'] as const
|