Storage.constants.ts 2.2 KB

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