Download File

import { initializeMeshSDK, logResponse } from "./util";
import {
    DownloadFileRequest
} from "@instruxi-io/mesh-sdk-core";

async function main() {
    try {
        const mesh = await initializeMeshSDK();

        const downloadFileRequest: DownloadFileRequest = { 
            file_id: "", 
            access_grant: "" // OPTIONAL if Admin
        }
        const downloadFileResponse = await mesh.os.downloadFile(downloadFileRequest)
        await logResponse(`downloadFile:`, downloadFileResponse);

    } catch (error) {
        console.error("An error occurred:", error);
    }
}

main().catch((error) => {
    console.error("Unhandled error in main function:", error);
    process.exit(1);
});