Delete File
import { initializeMeshSDK, logResponse } from "./util";
import {
DeleteFileRequest,
DeleteFileResponse
} from "@instruxi-io/mesh-sdk-core";
async function main() {
try {
const mesh = await initializeMeshSDK();
const deleteFileRequest: DeleteFileRequest = {
file_id: '',
access_grant: '' // OPTIONAL if Admin
};
const deleteFileResponse: DeleteFileResponse = await mesh.os.deleteFile(deleteFileRequest);
await logResponse(`deleteFiles:`, deleteFileResponse);
} catch (error) {
console.error("An error occurred:", error);
}
}
main().catch((error) => {
console.error("Unhandled error in main function:", error);
process.exit(1);
});
Updated 2 months ago