Create Account Bucket

Only user accounts with Role set to "Admin" are able to create custom named buckets

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

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

        const createEncryptedBucketRequest: CreateEncryptedBucketRequest = { passphrase: "secure-passphrase" }
        const createPrivateBucketResponse: CreateBucketResponse = await mesh.os.createEncryptedBucket(createEncryptedBucketRequest);
        await logResponse('createEncryptedBucket:', createPrivateBucketResponse);

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

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