apps/gateway/src/routes/ops-actions.ts
Metadata
- Purpose: Gateway HTTP route handlers and request/response behavior.
- Domain:
applications - Language:
ts - Bytes: 11957
- Lines: 346
- Content hash (short):
c458a547 - Source (start): apps/gateway/src/routes/ops-actions.ts:1
- Source (end): apps/gateway/src/routes/ops-actions.ts:346
Indexed Symbols
toRecord(line 18, function) - Implements to record for HTTP request handling.nowIso(line 22, function) - Implements now iso for HTTP request handling.workspaceIdFromRequest(line 26, function) - Implements workspace id from request for HTTP request handling.parseIdempotency(line 30, function) - Implements parse idempotency for HTTP request handling.getContext(line 39, function) - Implements get context for HTTP request handling.
Markdown Headings (if applicable)
No markdown headings detected.
Source Preview
import { randomUUID } from "node:crypto";
import type { FastifyPluginAsync, FastifyReply, FastifyRequest } from "fastify";
import {
opsAlertLinkTicketRequestSchema,
opsEscalateTicketRequestSchema,
opsLinkAssetRequestSchema,
opsLinkRunbookRequestSchema,
opsResolveTicketRequestSchema
} from "@anchor/contracts";
import { enqueueOutboxEvent } from "../services/event-pipeline.js";
import { createResource, getResource, upsertResource } from "../services/resource-repository.js";
import { getIdempotencyKey, getIdempotencyRouteScope } from "../utils/idempotency.js";
import { ensureRoles } from "../utils/authorization.js";
import { getWorkspaceIdFromHeaders } from "../utils/workspace.js";
type AnyRecord = Record<string, unknown>;
function toRecord(input: unknown): AnyRecord {
return typeof input === "object" && input !== null ? (input as AnyRecord) : {};
}
function nowIso() {
return new Date().toISOString();
}