Public & Private Access
Change object visibility with makePublic and makePrivate. Both methods return a short summary of the object after the change.
Function signatures
client.storage.makePublic(
filePath: string
): Promise<ObjectAccessSummary | BolticErrorResponse>;
client.storage.makePrivate(filePath: string): Promise<ObjectAccessSummary | BolticErrorResponse>;
Parameters
| Method | Argument | Description |
|---|---|---|
makePublic | filePath | Full object path in the bucket |
makePrivate | filePath | Full object path in the bucket |
Return Value — ObjectAccessSummary
| Field | Description |
|---|---|
message | Status text from the API |
name | Full path of the object |
size | Size string (or null) |
updated | Last update string (or null) |
public | true if public, false if private |
Make an object public
import { createClient, isErrorResponse } from "@boltic/sdk";
const client = createClient("your-api-key");
const result = await client.storage.makePublic("my-app/docs/readme.pdf");
if (isErrorResponse(result)) {
console.error(result.error.message);
} else {
console.log(result.public, result.name, result.size);
}
Make an object private
const result = await client.storage.makePrivate("my-app/public/old-banner.png");
if (!isErrorResponse(result)) {
console.log("Now private:", result.public === false);
}
Behavior
If the visibility change succeeds but the summary cannot be loaded, you may still receive an error. Retry list on the parent prefix to confirm the object state.