mirror of
https://github.com/Dvorinka/Primora.git
synced 2026-10-28 07:41:23 +00:00
feat: ship phase 1 surface area (v0.2.0)
- primora CLI + @primora/mcp server over generated client - auth users admin panel, mobile bottom nav - release workflow: GHCR images, compiled binaries, npm tarballs - fix gzip Content-Length truncation, nginx upstream re-resolution Authored By: TDvorak <[email protected]> Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
f77823ad90
commit
420502eec1
90 files changed
+9172
-9718
No files matched your search
@@ -0,0 +1,56 @@
|
||||
import { CreateBucketRequest, StorageService } from "@primora/api-client";
|
||||
|
||||
import { loadConfig } from "../config.js";
|
||||
import { configureClient, requireAuth, requireProject } from "../http.js";
|
||||
import { isJson, printJson, printTable, success } from "../out.js";
|
||||
|
||||
export async function cmdBucketsList(options: {
|
||||
project?: string;
|
||||
q?: string;
|
||||
json?: boolean;
|
||||
}): Promise<void> {
|
||||
const cfg = loadConfig();
|
||||
requireAuth(cfg);
|
||||
configureClient(cfg);
|
||||
|
||||
const projectId = requireProject(cfg, options.project);
|
||||
const { items } = await StorageService.listBuckets({
|
||||
projectId,
|
||||
q: options.q || undefined,
|
||||
});
|
||||
if (isJson(options)) {
|
||||
printJson(items);
|
||||
return;
|
||||
}
|
||||
printTable(
|
||||
["SLUG", "NAME", "VISIBILITY", "ID"],
|
||||
items.map((b) => [b.slug, b.name, b.visibility, b.id]),
|
||||
);
|
||||
}
|
||||
|
||||
export async function cmdBucketsCreate(
|
||||
name: string,
|
||||
options: { project?: string; slug?: string; public?: boolean; json?: boolean },
|
||||
): Promise<void> {
|
||||
const cfg = loadConfig();
|
||||
requireAuth(cfg);
|
||||
configureClient(cfg);
|
||||
|
||||
const projectId = requireProject(cfg, options.project);
|
||||
const slug = options.slug ?? name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
||||
const bucket = await StorageService.createBucket({
|
||||
projectId,
|
||||
requestBody: {
|
||||
name,
|
||||
slug,
|
||||
visibility: options.public
|
||||
? CreateBucketRequest.visibility.PUBLIC
|
||||
: CreateBucketRequest.visibility.PRIVATE,
|
||||
},
|
||||
});
|
||||
if (isJson(options)) {
|
||||
printJson(bucket);
|
||||
return;
|
||||
}
|
||||
success(`Bucket "${bucket.name}" created (${bucket.slug}, ${bucket.visibility})`);
|
||||
}
|
||||
Reference in new issue
Block a user