refactor: trim gateway runtime type exports

This commit is contained in:
Peter Steinberger
2026-05-01 22:54:57 +01:00
parent 5490704599
commit 663552630a
6 changed files with 8 additions and 10 deletions

View File

@@ -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;

View File

@@ -30,7 +30,7 @@ type PendingInvoke = {
timer: ReturnType<typeof setTimeout>;
};
export type NodeInvokeResult = {
type NodeInvokeResult = {
ok: boolean;
payload?: unknown;
payloadJSON?: string | null;

View File

@@ -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);

View File

@@ -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";

View File

@@ -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];

View File

@@ -1,6 +1,6 @@
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
export type SecurityPathCanonicalization = {
type SecurityPathCanonicalization = {
canonicalPath: string;
candidates: string[];
decodePasses: number;