Isomorphic JavaScript client for Supabase providing authentication, database, real-time, storage, and edge functions capabilities.
89
Build a document management system that tracks file metadata for uploaded documents. The system should allow users to upload documents with custom metadata (such as document type, author, tags) and retrieve this metadata later.
Implement a function that uploads a document to storage with custom metadata including:
Implement a function that retrieves and returns the custom metadata for a specific document.
@generates
/**
* Uploads a document with custom metadata to the storage bucket
*
* @param {string} filePath - Local path to the file to upload
* @param {string} fileName - Name to store the file as
* @param {Object} metadata - Custom metadata object with document information
* @returns {Promise<{success: boolean, error?: string}>}
*/
async function uploadDocument(filePath, fileName, metadata) {
// IMPLEMENTATION HERE
}
/**
* Retrieves the custom metadata for a specific document
*
* @param {string} fileName - Name of the file to get metadata for
* @returns {Promise<{metadata: Object, error?: string}>}
*/
async function getDocumentMetadata(fileName) {
// IMPLEMENTATION HERE
}
module.exports = {
uploadDocument,
getDocumentMetadata
};Provides file storage with custom metadata support.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-supabase--supabase-jsevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10