flagon-io/g1t

public

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t/apps/sudo/app/lib/services.server.ts

21 lines972 bytesCodeBlame
1import { env } from "cloudflare:workers";
2
3import { accountsAdminClient, billingAdminClient, billingClient, eventsClient, identityAdminClient } from "@g1t/contracts";
4
5/** Staff-only billing, on the billing service. */
6export const admin = billingAdminClient(env.BILLING);
7
8/** The public price book, read-only, from the same service. */
9export const priceBook = () => billingClient(env.BILLING).prices();
10
11/** Staff-only identity: every workspace, its owners and members. */
12export const identity = identityAdminClient(env.IDENTITY);
13
14/** Staff-only accounts: a person's email addresses and security log. */
15export const accountsAdmin = accountsAdminClient(env.IDENTITY);
16
17/** The workspace's plan, caps and pause, as billing gives them to every service. */
18export const entitlements = (workspace: string) => billingClient(env.BILLING).entitlements(workspace);
19
20/** The event log, read-only: sudo lists `abuse.flagged`. */
21export const events = eventsClient(env.EVENTS);