Skip to main content

apps/web/app/actions/operator-actions.ts

Metadata

Indexed Symbols

  • requiredString (line 9, function) - Implements required string for module behavior.
  • optionalString (line 17, function) - Implements optional string for module behavior.
  • requiredWorkspaceId (line 26, function) - Implements required workspace id for module behavior.
  • redirectBack (line 34, function) - Implements redirect back for module behavior.
  • parsePositiveNumber (line 39, function) - Implements parse positive number for module behavior.
  • requiredResourcePath (line 84, function) - Implements required resource path for module behavior.
  • parseJsonObject (line 92, function) - Implements parse json object for module behavior.
  • parseScalarValue (line 104, function) - Implements parse scalar value for module behavior.
  • collectStructuredFields (line 131, function) - Implements collect structured fields for module behavior.
  • createClientAction (line 153, function) - Implements create client action for module behavior.
  • createAssetAction (line 168, function) - Implements create asset action for module behavior.
  • createTicketAction (line 184, function) - Implements create ticket action for module behavior.
  • createAlertAction (line 200, function) - Implements create alert action for module behavior.
  • resourceCreateJsonAction (line 217, function) - Implements resource create json action for module behavior.
  • resourceCreateStructuredAction (line 231, function) - Implements resource create structured action for module behavior.
  • resourcePatchJsonAction (line 248, function) - Implements resource patch json action for module behavior.
  • resourceLifecyclePatchAction (line 263, function) - Implements resource lifecycle patch action for module behavior.
  • resourceDeleteAction (line 281, function) - Implements resource delete action for module behavior.
  • resourceArchiveAction (line 294, function) - Implements resource archive action for module behavior.
  • portalCreateTicketAction (line 320, function) - Implements portal create ticket action for module behavior.
  • createPortalInviteAction (line 338, function) - Implements create portal invite action for module behavior.
  • revokePortalInviteAction (line 393, function) - Implements revoke portal invite action for module behavior.
  • portalUpdateTicketAction (line 405, function) - Implements portal update ticket action for module behavior.
  • portalQuoteDecisionAction (line 422, function) - Implements portal quote decision action for module behavior.
  • portalInvoiceAcknowledgeAction (line 439, function) - Implements portal invoice acknowledge action for module behavior.
  • portalInvoicePaymentIntentAction (line 455, function) - Implements portal invoice payment intent action for module behavior.
  • portalTerminateSessionAction (line 473, function) - Implements portal terminate session action for module behavior.
  • opsAlertLinkTicketAction (line 479, function) - Implements ops alert link ticket action for module behavior.
  • opsTicketLinkAssetAction (line 495, function) - Implements ops ticket link asset action for module behavior.
  • opsTicketLinkRunbookAction (line 509, function) - Implements ops ticket link runbook action for module behavior.
  • opsTicketEscalateAction (line 523, function) - Implements ops ticket escalate action for module behavior.
  • opsTicketResolveAction (line 538, function) - Implements ops ticket resolve action for module behavior.
  • workflowRetryAction (line 553, function) - Implements workflow retry action for module behavior.
  • workflowCancelAction (line 567, function) - Implements workflow cancel action for module behavior.
  • retryOutboxFailureAction (line 581, function) - Implements retry outbox failure action for module behavior.
  • retryJobFailureAction (line 593, function) - Implements retry job failure action for module behavior.
  • triggerAgentSmokeAction (line 605, function) - Implements trigger agent smoke action for module behavior.
  • triggerAccountingSyncAction (line 625, function) - Implements trigger accounting sync action for module behavior.
  • triggerNotificationTestAction (line 659, function) - Implements trigger notification test action for module behavior.
  • setWorkspaceSecretAction (line 693, function) - Implements set workspace secret action for module behavior.
  • updateWorkspacePolicyAction (line 709, function) - Implements update workspace policy action for module behavior.
  • rotateEdgeEnrollmentTokenAction (line 745, function) - Implements rotate edge enrollment token action for module behavior.

Markdown Headings (if applicable)

No markdown headings detected.

Source Preview

"use server";

import { redirect } from "next/navigation";
import { cookies } from "next/headers";
import { gatewayJson } from "../../lib/gateway-server";
import { resolvePortalAuthToken, terminatePortalSession } from "../../lib/portal-session";
import { isWorkspaceId, withWorkspaceQuery } from "../../lib/workspace-context";

function requiredString(formData: FormData, key: string): string {
const value = formData.get(key);
if (typeof value !== "string" || value.trim().length === 0) {
throw new Error(`${key} is required`);
}
return value.trim();
}

function optionalString(formData: FormData, key: string): string | undefined {
const value = formData.get(key);
if (typeof value !== "string") {
return undefined;
}
const trimmed = value.trim();
return trimmed.length > 0 ? trimmed : undefined;
}