List Files

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

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

        const listFilesRequest: ListFilesRequest = {
          page: 1,
          page_size: 10,
          bucket: "", // OPTIONAL for Admin
          path: ""
        };
        const listFilesResponse: ListFilesResponse = await mesh.os.listFiles(listFilesRequest);    
        await logResponse(`listFiles: ${bucket}`, listFilesResponse);

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

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