mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 18:12:22 +00:00
management labelpolicy
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
export * from "./server";
|
||||
export * from "./middleware";
|
||||
export * from "./management";
|
||||
|
||||
// export * as auth from "./auth";
|
||||
// export * as management from "./management";
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
export * from "./management";
|
||||
export * as management from "../proto/server/zitadel/management";
|
||||
export * from "../proto/server/zitadel/policy";
|
||||
|
||||
@@ -26,10 +26,19 @@ export function getServers(): ZitadelServer[] {
|
||||
return apps;
|
||||
}
|
||||
|
||||
export function getServer(name?: string): ZitadelServer | undefined {
|
||||
return name
|
||||
? apps.find((a) => a.name === name)
|
||||
: apps.length === 1
|
||||
? apps[0]
|
||||
: undefined;
|
||||
export function getServer(name?: string): ZitadelServer {
|
||||
if (name) {
|
||||
const found = apps.find((a) => a.name === name);
|
||||
if (found) {
|
||||
return found;
|
||||
} else {
|
||||
throw new Error("No server found");
|
||||
}
|
||||
} else {
|
||||
if (apps.length) {
|
||||
return apps[0];
|
||||
} else {
|
||||
throw new Error("No server found");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user