mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 03:24:32 +00:00
chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
@@ -9,12 +9,7 @@ import {
|
||||
|
||||
export type AuthProfileSource = "claude-cli" | "codex-cli" | "store";
|
||||
|
||||
export type AuthProfileHealthStatus =
|
||||
| "ok"
|
||||
| "expiring"
|
||||
| "expired"
|
||||
| "missing"
|
||||
| "static";
|
||||
export type AuthProfileHealthStatus = "ok" | "expiring" | "expired" | "missing" | "static";
|
||||
|
||||
export type AuthProfileHealth = {
|
||||
profileId: string;
|
||||
@@ -27,12 +22,7 @@ export type AuthProfileHealth = {
|
||||
label: string;
|
||||
};
|
||||
|
||||
export type AuthProviderHealthStatus =
|
||||
| "ok"
|
||||
| "expiring"
|
||||
| "expired"
|
||||
| "missing"
|
||||
| "static";
|
||||
export type AuthProviderHealthStatus = "ok" | "expiring" | "expired" | "missing" | "static";
|
||||
|
||||
export type AuthProviderHealth = {
|
||||
provider: string;
|
||||
@@ -111,8 +101,7 @@ function buildProfileHealth(params: {
|
||||
|
||||
if (credential.type === "token") {
|
||||
const expiresAt =
|
||||
typeof credential.expires === "number" &&
|
||||
Number.isFinite(credential.expires)
|
||||
typeof credential.expires === "number" && Number.isFinite(credential.expires)
|
||||
? credential.expires
|
||||
: undefined;
|
||||
if (!expiresAt || expiresAt <= 0) {
|
||||
@@ -125,11 +114,7 @@ function buildProfileHealth(params: {
|
||||
label,
|
||||
};
|
||||
}
|
||||
const { status, remainingMs } = resolveOAuthStatus(
|
||||
expiresAt,
|
||||
now,
|
||||
warnAfterMs,
|
||||
);
|
||||
const { status, remainingMs } = resolveOAuthStatus(expiresAt, now, warnAfterMs);
|
||||
return {
|
||||
profileId,
|
||||
provider: credential.provider,
|
||||
@@ -142,11 +127,7 @@ function buildProfileHealth(params: {
|
||||
};
|
||||
}
|
||||
|
||||
const { status, remainingMs } = resolveOAuthStatus(
|
||||
credential.expires,
|
||||
now,
|
||||
warnAfterMs,
|
||||
);
|
||||
const { status, remainingMs } = resolveOAuthStatus(credential.expires, now, warnAfterMs);
|
||||
return {
|
||||
profileId,
|
||||
provider: credential.provider,
|
||||
@@ -172,9 +153,7 @@ export function buildAuthHealthSummary(params: {
|
||||
: null;
|
||||
|
||||
const profiles = Object.entries(params.store.profiles)
|
||||
.filter(([_, cred]) =>
|
||||
providerFilter ? providerFilter.has(cred.provider) : true,
|
||||
)
|
||||
.filter(([_, cred]) => (providerFilter ? providerFilter.has(cred.provider) : true))
|
||||
.map(([profileId, credential]) =>
|
||||
buildProfileHealth({
|
||||
profileId,
|
||||
@@ -226,9 +205,7 @@ export function buildAuthHealthSummary(params: {
|
||||
|
||||
const oauthProfiles = provider.profiles.filter((p) => p.type === "oauth");
|
||||
const tokenProfiles = provider.profiles.filter((p) => p.type === "token");
|
||||
const apiKeyProfiles = provider.profiles.filter(
|
||||
(p) => p.type === "api_key",
|
||||
);
|
||||
const apiKeyProfiles = provider.profiles.filter((p) => p.type === "api_key");
|
||||
|
||||
const expirable = [...oauthProfiles, ...tokenProfiles];
|
||||
if (expirable.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user