Update Healer Man server
This commit is contained in:
1 parent
f8314e7de1
commit
1fedb9368d
76 files changed
+20556
-2523
No files matched your search
+91
-27
@@ -4,6 +4,28 @@ export type BalanceLabPartySource = "wow" | "coa" | "rom" | "all";
|
||||
export type BalanceLabBossCategory = "all" | "wow" | "rom";
|
||||
export type BalanceLabSpecSelection = "random" | "all" | "specific";
|
||||
export type BalanceLabJobStatus = "queued" | "running" | "complete" | "failed";
|
||||
export type BalanceLabExecutionTarget = "server" | "local";
|
||||
|
||||
function balanceLabApiPath(target: BalanceLabExecutionTarget, suffix: string): string {
|
||||
const root = target === "local" ? "/api/local/balance-lab" : "/api/gm/balance-lab";
|
||||
return `${root}${suffix}`;
|
||||
}
|
||||
|
||||
async function requestBalanceLabJson<T>(
|
||||
pathname: string,
|
||||
init: RequestInit,
|
||||
token: string,
|
||||
target: BalanceLabExecutionTarget,
|
||||
): Promise<T> {
|
||||
if (target === "server") return requestOnlineJson<T>(pathname, init, token);
|
||||
const headers = new Headers(init.headers);
|
||||
headers.set("Accept", "application/json");
|
||||
if (init.body !== undefined) headers.set("Content-Type", "application/json");
|
||||
const response = await fetch(pathname, { ...init, headers });
|
||||
const body = await response.json().catch(() => ({})) as T & { error?: string };
|
||||
if (!response.ok) throw new Error(body.error ?? `Local Balance Lab request failed (${response.status}).`);
|
||||
return body;
|
||||
}
|
||||
|
||||
export interface BalanceLabRuntimeStatus {
|
||||
readonly available: boolean;
|
||||
@@ -27,6 +49,8 @@ export interface BalanceLabJobSpec {
|
||||
readonly partySeed: number;
|
||||
readonly bossCategory: BalanceLabBossCategory;
|
||||
readonly bossKeys: readonly string[];
|
||||
readonly seatSweep?: boolean;
|
||||
readonly includeBetaSpecs?: boolean;
|
||||
}
|
||||
|
||||
export interface BalanceLabJob {
|
||||
@@ -56,6 +80,8 @@ export interface BalanceLabReportSummary {
|
||||
readonly runs: number;
|
||||
readonly classSpecs: number;
|
||||
readonly classAbilities: number;
|
||||
readonly npcClassSpecs?: number;
|
||||
readonly npcClassAbilities?: number;
|
||||
readonly bossPressureMedianDtps: number;
|
||||
}
|
||||
|
||||
@@ -82,6 +108,13 @@ export interface BalanceLabBossResult {
|
||||
export interface BalanceLabClassSpecResult {
|
||||
readonly source: string;
|
||||
readonly buildId: string;
|
||||
readonly characterName?: string | null;
|
||||
readonly talentBuildId?: string | null;
|
||||
readonly talentBuildName?: string | null;
|
||||
readonly talentBuildSource?: string | null;
|
||||
readonly talentBuildSourcePointCount?: number | null;
|
||||
readonly talentBuildSourcePointsRetained?: number | null;
|
||||
readonly talentBuildFallbackPointCount?: number | null;
|
||||
readonly classId: string;
|
||||
readonly className: string;
|
||||
readonly specialization: string;
|
||||
@@ -93,6 +126,7 @@ export interface BalanceLabClassSpecResult {
|
||||
readonly hps: number;
|
||||
readonly hpsReceived?: number;
|
||||
readonly dtps: number;
|
||||
readonly gcdUptimePercent?: number;
|
||||
readonly totalDamage: number;
|
||||
readonly totalDamageTaken: number;
|
||||
readonly totalHealing: number;
|
||||
@@ -128,6 +162,10 @@ export interface BalanceLabClassAbilityResult {
|
||||
readonly icon: string;
|
||||
readonly categories: string;
|
||||
readonly cooldownSeconds: number | null;
|
||||
readonly rotationProfileId?: string | null;
|
||||
readonly rotationPriority?: number | null;
|
||||
readonly expectedUsage?: "profile" | "conditional" | "available";
|
||||
readonly rotationDecisions?: number;
|
||||
readonly partyConfigurations: number;
|
||||
readonly bosses: number;
|
||||
readonly runs: number;
|
||||
@@ -147,7 +185,7 @@ export interface BalanceLabClassAbilityResult {
|
||||
readonly effectiveHealing: number;
|
||||
readonly overheal: number;
|
||||
readonly absorbs: number;
|
||||
readonly status: "unused" | "damage" | "support" | "used";
|
||||
readonly status: "unused" | "missing-profile-action" | "damage" | "support" | "used";
|
||||
readonly unusedAvailable: boolean;
|
||||
}
|
||||
|
||||
@@ -160,64 +198,90 @@ export interface BalanceLabSuiteReport {
|
||||
readonly bosses: readonly BalanceLabBossResult[];
|
||||
readonly classSpecs: readonly BalanceLabClassSpecResult[];
|
||||
readonly classAbilities?: readonly BalanceLabClassAbilityResult[];
|
||||
readonly npcClassSpecs?: readonly BalanceLabClassSpecResult[];
|
||||
readonly npcClassAbilities?: readonly BalanceLabClassAbilityResult[];
|
||||
readonly partyConfigurations: readonly BalanceLabPartyResult[];
|
||||
}
|
||||
|
||||
export async function listBalanceLabJobs(token: string): Promise<readonly BalanceLabJob[]> {
|
||||
return (await requestOnlineJson<{ jobs: BalanceLabJob[] }>(
|
||||
"/api/gm/balance-lab/jobs",
|
||||
export async function listBalanceLabJobs(
|
||||
token: string,
|
||||
target: BalanceLabExecutionTarget = "server",
|
||||
): Promise<readonly BalanceLabJob[]> {
|
||||
return (await requestBalanceLabJson<{ jobs: BalanceLabJob[] }>(
|
||||
balanceLabApiPath(target, "/jobs"),
|
||||
{},
|
||||
token,
|
||||
token, target,
|
||||
)).jobs;
|
||||
}
|
||||
|
||||
export async function getBalanceLabRuntime(token: string): Promise<BalanceLabRuntimeStatus> {
|
||||
return (await requestOnlineJson<{ runtime: BalanceLabRuntimeStatus }>(
|
||||
"/api/gm/balance-lab/runtime",
|
||||
export async function getBalanceLabRuntime(
|
||||
token: string,
|
||||
target: BalanceLabExecutionTarget = "server",
|
||||
): Promise<BalanceLabRuntimeStatus> {
|
||||
return (await requestBalanceLabJson<{ runtime: BalanceLabRuntimeStatus }>(
|
||||
balanceLabApiPath(target, "/runtime"),
|
||||
{},
|
||||
token,
|
||||
token, target,
|
||||
)).runtime;
|
||||
}
|
||||
|
||||
export async function startBalanceLabJob(spec: BalanceLabJobSpec, token: string): Promise<BalanceLabJob> {
|
||||
return (await requestOnlineJson<{ job: BalanceLabJob }>(
|
||||
"/api/gm/balance-lab/jobs",
|
||||
export async function startBalanceLabJob(
|
||||
spec: BalanceLabJobSpec,
|
||||
token: string,
|
||||
target: BalanceLabExecutionTarget = "server",
|
||||
): Promise<BalanceLabJob> {
|
||||
return (await requestBalanceLabJson<{ job: BalanceLabJob }>(
|
||||
balanceLabApiPath(target, "/jobs"),
|
||||
{ method: "POST", body: JSON.stringify(spec) },
|
||||
token,
|
||||
token, target,
|
||||
)).job;
|
||||
}
|
||||
|
||||
export async function startBalanceLabJobs(
|
||||
specs: readonly BalanceLabJobSpec[],
|
||||
token: string,
|
||||
target: BalanceLabExecutionTarget = "server",
|
||||
): Promise<readonly BalanceLabJob[]> {
|
||||
return (await requestOnlineJson<{ jobs: BalanceLabJob[] }>(
|
||||
"/api/gm/balance-lab/jobs/batch",
|
||||
return (await requestBalanceLabJson<{ jobs: BalanceLabJob[] }>(
|
||||
balanceLabApiPath(target, "/jobs/batch"),
|
||||
{ method: "POST", body: JSON.stringify({ specs }) },
|
||||
token,
|
||||
token, target,
|
||||
)).jobs;
|
||||
}
|
||||
|
||||
export async function getBalanceLabJob(id: string, token: string): Promise<BalanceLabJob> {
|
||||
return (await requestOnlineJson<{ job: BalanceLabJob }>(
|
||||
`/api/gm/balance-lab/jobs/${encodeURIComponent(id)}`,
|
||||
export async function getBalanceLabJob(
|
||||
id: string,
|
||||
token: string,
|
||||
target: BalanceLabExecutionTarget = "server",
|
||||
): Promise<BalanceLabJob> {
|
||||
return (await requestBalanceLabJson<{ job: BalanceLabJob }>(
|
||||
balanceLabApiPath(target, `/jobs/${encodeURIComponent(id)}`),
|
||||
{},
|
||||
token,
|
||||
token, target,
|
||||
)).job;
|
||||
}
|
||||
|
||||
export async function getBalanceLabReport(id: string, token: string): Promise<BalanceLabSuiteReport> {
|
||||
return requestOnlineJson<BalanceLabSuiteReport>(
|
||||
`/api/gm/balance-lab/jobs/${encodeURIComponent(id)}/artifacts/suite-report.json`,
|
||||
export async function getBalanceLabReport(
|
||||
id: string,
|
||||
token: string,
|
||||
target: BalanceLabExecutionTarget = "server",
|
||||
): Promise<BalanceLabSuiteReport> {
|
||||
return requestBalanceLabJson<BalanceLabSuiteReport>(
|
||||
balanceLabApiPath(target, `/jobs/${encodeURIComponent(id)}/artifacts/suite-report.json`),
|
||||
{},
|
||||
token,
|
||||
token, target,
|
||||
);
|
||||
}
|
||||
|
||||
export async function fetchBalanceLabArtifact(id: string, name: string, token: string): Promise<Blob> {
|
||||
export async function fetchBalanceLabArtifact(
|
||||
id: string,
|
||||
name: string,
|
||||
token: string,
|
||||
target: BalanceLabExecutionTarget = "server",
|
||||
): Promise<Blob> {
|
||||
const response = await fetch(
|
||||
`${onlineApiOrigin()}/api/gm/balance-lab/jobs/${encodeURIComponent(id)}/artifacts/${encodeURIComponent(name)}`,
|
||||
{ headers: { Authorization: `Bearer ${token}` } },
|
||||
`${target === "local" ? "" : onlineApiOrigin()}${balanceLabApiPath(target, `/jobs/${encodeURIComponent(id)}/artifacts/${encodeURIComponent(name)}`)}`,
|
||||
{ headers: token ? { Authorization: `Bearer ${token}` } : undefined },
|
||||
);
|
||||
if (!response.ok) {
|
||||
const body = await response.json().catch(() => ({})) as { error?: string };
|
||||
|
||||
@@ -28,6 +28,7 @@ export interface OnlineGroupActivity {
|
||||
readonly type: "dungeon" | "manastorm";
|
||||
readonly contentId: string;
|
||||
readonly fillWithAi: boolean;
|
||||
readonly includeBetaSpecs?: boolean;
|
||||
readonly partySize: number;
|
||||
readonly startingLevel: number | null;
|
||||
readonly startedAt: number;
|
||||
@@ -63,6 +64,7 @@ export interface StartOnlineGroupActivityInput {
|
||||
readonly type: OnlineGroupActivity["type"];
|
||||
readonly contentId: string;
|
||||
readonly fillWithAi: boolean;
|
||||
readonly includeBetaSpecs?: boolean;
|
||||
readonly partySize: number;
|
||||
readonly startingLevel?: number;
|
||||
}
|
||||
Reference in new issue
Block a user