Storage.constants.ts86 lines · main
| 1 | import { DOCS_URL } from '@/lib/constants' |
| 2 | |
| 3 | // Original storage constants |
| 4 | export enum URL_EXPIRY_DURATION { |
| 5 | WEEK = 60 * 60 * 24 * 7, |
| 6 | MONTH = 60 * 60 * 24 * 30, |
| 7 | YEAR = 60 * 60 * 24 * 365, |
| 8 | } |
| 9 | |
| 10 | export enum STORAGE_VIEWS { |
| 11 | COLUMNS = 'COLUMNS', |
| 12 | LIST = 'LIST', |
| 13 | } |
| 14 | |
| 15 | export enum STORAGE_SORT_BY { |
| 16 | NAME = 'name', |
| 17 | UPDATED_AT = 'updated_at', |
| 18 | CREATED_AT = 'created_at', |
| 19 | LAST_ACCESSED_AT = 'last_accessed_at', |
| 20 | } |
| 21 | |
| 22 | export enum STORAGE_BUCKET_SORT { |
| 23 | ALPHABETICAL = 'alphabetical', |
| 24 | CREATED_AT = 'created_at', |
| 25 | } |
| 26 | |
| 27 | export enum STORAGE_SORT_BY_ORDER { |
| 28 | ASC = 'asc', |
| 29 | DESC = 'desc', |
| 30 | } |
| 31 | |
| 32 | export enum STORAGE_ROW_TYPES { |
| 33 | BUCKET = 'BUCKET', |
| 34 | FILE = 'FILE', |
| 35 | FOLDER = 'FOLDER', |
| 36 | } |
| 37 | |
| 38 | export enum STORAGE_ROW_STATUS { |
| 39 | READY = 'READY', |
| 40 | LOADING = 'LOADING', |
| 41 | EDITING = 'EDITING', |
| 42 | } |
| 43 | |
| 44 | export const STORAGE_CLIENT_LIBRARY_MAPPINGS = { |
| 45 | upload: ['INSERT'], |
| 46 | download: ['SELECT'], |
| 47 | list: ['SELECT'], |
| 48 | update: ['SELECT', 'UPDATE'], |
| 49 | move: ['SELECT', 'UPDATE'], |
| 50 | copy: ['SELECT', 'INSERT'], |
| 51 | remove: ['SELECT', 'DELETE'], |
| 52 | createSignedUrl: ['SELECT'], |
| 53 | createSignedUrls: ['SELECT'], |
| 54 | getPublicUrl: [], |
| 55 | } |
| 56 | |
| 57 | export const BUCKET_TYPES = { |
| 58 | files: { |
| 59 | displayName: 'Files', |
| 60 | singularName: 'file', |
| 61 | article: 'a', |
| 62 | description: 'General file storage for most types of digital content', |
| 63 | valueProp: 'Store images, videos, documents, and any other file type.', |
| 64 | docsUrl: `${DOCS_URL}/guides/storage/buckets/fundamentals`, |
| 65 | }, |
| 66 | analytics: { |
| 67 | displayName: 'Analytics', |
| 68 | singularName: 'analytics', |
| 69 | article: 'an', |
| 70 | description: 'Purpose-built storage for analytical workloads', |
| 71 | valueProp: 'Store large datasets for analytics and reporting.', |
| 72 | docsUrl: `${DOCS_URL}/guides/storage/analytics/introduction`, |
| 73 | }, |
| 74 | vectors: { |
| 75 | displayName: 'Vectors', |
| 76 | singularName: 'vector', |
| 77 | article: 'a', |
| 78 | description: 'Purpose-built storage for vector data', |
| 79 | valueProp: 'Store, index, and query your vector embeddings at scale.', |
| 80 | docsUrl: `${DOCS_URL}/guides/storage/vector/introduction`, |
| 81 | }, |
| 82 | } |
| 83 | export const BUCKET_TYPE_KEYS = Object.keys(BUCKET_TYPES) as Array<keyof typeof BUCKET_TYPES> |
| 84 | export const DEFAULT_BUCKET_TYPE: keyof typeof BUCKET_TYPES = 'files' |
| 85 | |
| 86 | export const PUBLIC_BUCKET_TOOLTIP = 'Objects in this bucket are readable by anyone with the URL.' |