Add initial Portal version
This commit is contained in:
66
src/types/index.ts
Normal file
66
src/types/index.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
// ZITADEL JWT custom claims
|
||||
export interface ZitadelClaims {
|
||||
"urn:zitadel:iam:user:resourceowner:id": string;
|
||||
"urn:zitadel:iam:user:resourceowner:name": string;
|
||||
"urn:zitadel:iam:org:project:roles"?: Record<string, Record<string, string>>;
|
||||
}
|
||||
|
||||
export type PlatformRole =
|
||||
| "platform_admin"
|
||||
| "platform_operator"
|
||||
| "owner"
|
||||
| "user"
|
||||
| "viewer";
|
||||
|
||||
export interface SessionUser {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
orgId: string;
|
||||
orgName: string;
|
||||
roles: PlatformRole[];
|
||||
isPlatform: boolean;
|
||||
}
|
||||
|
||||
// PiecedTenant CR (pieced.ch/v1alpha1)
|
||||
export interface PiecedTenantSpec {
|
||||
displayName: string;
|
||||
agentName: string;
|
||||
plan?: string;
|
||||
packages?: string[];
|
||||
workspaceFiles?: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface PiecedTenantStatus {
|
||||
phase: "Pending" | "Provisioning" | "Running" | "Error" | "Deleting";
|
||||
message?: string;
|
||||
observedGeneration?: number;
|
||||
conditions?: Array<{
|
||||
type: string;
|
||||
status: string;
|
||||
reason?: string;
|
||||
message?: string;
|
||||
lastTransitionTime?: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface PiecedTenant {
|
||||
apiVersion: "pieced.ch/v1alpha1";
|
||||
kind: "PiecedTenant";
|
||||
metadata: {
|
||||
name: string;
|
||||
namespace?: string;
|
||||
creationTimestamp?: string;
|
||||
labels?: Record<string, string>;
|
||||
annotations?: Record<string, string>;
|
||||
};
|
||||
spec: PiecedTenantSpec;
|
||||
status?: PiecedTenantStatus;
|
||||
}
|
||||
|
||||
export interface UsageSummary {
|
||||
totalInputTokens: number;
|
||||
totalOutputTokens: number;
|
||||
totalSpendChf: number;
|
||||
period: string;
|
||||
}
|
||||
Reference in New Issue
Block a user