Create Pre-signed URL
import { initializeMeshSDK, logResponse } from "./util";
import {
GetPresignedUrlRequest,
GetPresignedUrlResponse
} from "@instruxi-io/mesh-sdk-core";
async function main() {
try {
const mesh = await initializeMeshSDK();
const preSignedURLRequest: GetPresignedUrlRequest = { file_id: file.id };
const preSignedURLResponse: GetPresignedUrlResponse = await mesh.os.getPresignedUrl(preSignedURLRequest);
await logResponse(`getPresignedUrl:`, preSignedURLResponse);
} catch (error) {
console.error("An error occurred:", error);
}
}
main().catch((error) => {
console.error("Unhandled error in main function:", error);
process.exit(1);
});
Updated 16 days ago