Create Access Grant

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

async function main() {
    try {
        const mesh = await initializeMeshSDK();
	
        const createAccessGrantRequest: CreateGrantRequest = {
            file_id: '',
            passphrase: '',
            permission: 'read' // one of 'read' | 'write' | 'admin';
        };
        const createAccessGrantResponse: CreateGrantResponse = await mesh.os.createAccessGrant(createAccessGrantRequest)
        await logResponse(`createAccessGrant:`, createAccessGrantResponse);

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

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