mirror of
https://github.com/Dvorinka/Primora.git
synced 2026-10-28 15:51: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,40 @@
|
||||
import { OrganizationsService, PlatformService } from "@primora/api-client";
|
||||
|
||||
import { loadConfig } from "../config.js";
|
||||
import { configureClient, requireAuth } from "../http.js";
|
||||
import { isJson, printJson, printTable, success } from "../out.js";
|
||||
|
||||
export async function cmdOrgsList(options: { json?: boolean }): Promise<void> {
|
||||
const cfg = loadConfig();
|
||||
requireAuth(cfg);
|
||||
configureClient(cfg);
|
||||
|
||||
const me = await PlatformService.getMe();
|
||||
if (isJson(options)) {
|
||||
printJson(me.organizations);
|
||||
return;
|
||||
}
|
||||
printTable(
|
||||
["ID", "SLUG", "NAME", "ROLE"],
|
||||
me.organizations.map((o) => [o.id, o.slug, o.name, o.membershipRole]),
|
||||
);
|
||||
}
|
||||
|
||||
export async function cmdOrgsCreate(
|
||||
name: string,
|
||||
options: { slug?: string; json?: boolean },
|
||||
): Promise<void> {
|
||||
const cfg = loadConfig();
|
||||
requireAuth(cfg);
|
||||
configureClient(cfg);
|
||||
|
||||
const slug = options.slug ?? name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
||||
const org = await OrganizationsService.createOrganization({
|
||||
requestBody: { name, slug },
|
||||
});
|
||||
if (isJson(options)) {
|
||||
printJson(org);
|
||||
return;
|
||||
}
|
||||
success(`Organization "${org.name}" created (${org.slug})`);
|
||||
}
|
||||
Reference in new issue
Block a user