mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:30:57 +00:00
refactor: trim gateway runtime type exports
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { randomUUID } from "node:crypto";
|
||||
|
||||
export const NODE_PENDING_WORK_TYPES = ["status.request", "location.request"] as const;
|
||||
const NODE_PENDING_WORK_TYPES = ["status.request", "location.request"] as const;
|
||||
export type NodePendingWorkType = (typeof NODE_PENDING_WORK_TYPES)[number];
|
||||
|
||||
export const NODE_PENDING_WORK_PRIORITIES = ["default", "normal", "high"] as const;
|
||||
const NODE_PENDING_WORK_PRIORITIES = ["default", "normal", "high"] as const;
|
||||
export type NodePendingWorkPriority = (typeof NODE_PENDING_WORK_PRIORITIES)[number];
|
||||
|
||||
export type NodePendingWorkItem = {
|
||||
type NodePendingWorkItem = {
|
||||
id: string;
|
||||
type: NodePendingWorkType;
|
||||
priority: NodePendingWorkPriority;
|
||||
|
||||
@@ -30,7 +30,7 @@ type PendingInvoke = {
|
||||
timer: ReturnType<typeof setTimeout>;
|
||||
};
|
||||
|
||||
export type NodeInvokeResult = {
|
||||
type NodeInvokeResult = {
|
||||
ok: boolean;
|
||||
payload?: unknown;
|
||||
payloadJSON?: string | null;
|
||||
|
||||
@@ -22,9 +22,7 @@ const KNOWN_OPERATOR_SCOPE_VALUES: readonly OperatorScope[] = [
|
||||
TALK_SECRETS_SCOPE,
|
||||
];
|
||||
|
||||
export const KNOWN_OPERATOR_SCOPES: ReadonlySet<OperatorScope> = new Set(
|
||||
KNOWN_OPERATOR_SCOPE_VALUES,
|
||||
);
|
||||
const KNOWN_OPERATOR_SCOPES: ReadonlySet<OperatorScope> = new Set(KNOWN_OPERATOR_SCOPE_VALUES);
|
||||
|
||||
export function isOperatorScope(value: unknown): value is OperatorScope {
|
||||
return typeof value === "string" && KNOWN_OPERATOR_SCOPES.has(value as OperatorScope);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { resolveSecretRefValues } from "../secrets/resolve.js";
|
||||
import { normalizeOptionalString } from "../shared/string-coerce.js";
|
||||
|
||||
export type SecretInputUnresolvedReasonStyle = "generic" | "detailed"; // pragma: allowlist secret
|
||||
export type ConfiguredSecretInputSource =
|
||||
type ConfiguredSecretInputSource =
|
||||
| "config"
|
||||
| "secretRef" // pragma: allowlist secret
|
||||
| "fallback";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { isNodeRoleMethod } from "./method-scopes.js";
|
||||
|
||||
export const GATEWAY_ROLES = ["operator", "node"] as const;
|
||||
const GATEWAY_ROLES = ["operator", "node"] as const;
|
||||
|
||||
export type GatewayRole = (typeof GATEWAY_ROLES)[number];
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
|
||||
|
||||
export type SecurityPathCanonicalization = {
|
||||
type SecurityPathCanonicalization = {
|
||||
canonicalPath: string;
|
||||
candidates: string[];
|
||||
decodePasses: number;
|
||||
|
||||
Reference in New Issue
Block a user