Skip to main content

Rail Deck is being prepared for an invitation-only Alpha. Check current availability

Developer documentation

Guided signal setup

Start, inspect, try, cancel and save a signal setup.

Source 0.1.0 Private source package

How the calls fit together

A trial is a deliberate command. Recover its original outcome before another decision; a published trial does not prove the signal changed.

JavaScript examples

Supply your configured client. Each call awaits a decoded result; errors pass to your caller. These identifiers and values are fictional. Use selected development records and review every change before running it. Opening this page sends no API requests.

See the complete TypeScript workflow · Explore the Node starter

signalSetups.start

Starts a private fixed-lifetime setup, or explicitly recovers that original intent.

const result = await client.signalSetups.start(
  "1",
  "18",
  {
    "requestId": "11111111-1111-4111-8111-111111111111",
    "configuration": {
      "displayName": "{{fixtureDisplayName}}",
      "definition": {
        "design": "four-aspect",
        "quadrant": null
      },
      "controllerId": "21",
      "firstAddress": 86,
      "notes": "Platform end\nFaces the approach track."
    }
  },
  {}
);
TypeScript parameters and return type
accountId · required
string

Account owning the layout.

layoutId · required
string

Selected layout.

input · required
StartSignalSetupCommand

Original request ID and reviewed connection.

options · optional
RailDeckRequestControlOptions

Request lifetime controls, never automatic mutation replay.

Returns Promise<SignalSetupSnapshot>.

Example evidence: Retained SDK transport fixture.

signalSetups.get

Opens the initiating manager's setup without renewal, polling or a write.

const result = await client.signalSetups.get(
  "1",
  "18",
  "11111111-1111-4111-8111-111111111111",
  {}
);
TypeScript parameters and return type
accountId · required
string

Owning account.

layoutId · required
string

Selected layout.

setupId · required
string

Original setup ID.

options · optional
RailDeckRequestControlOptions

Request lifetime controls.

Returns Promise<SignalSetupSnapshot>.

Example evidence: Retained SDK transport fixture.

signalSetups.trySetting

Publishes one deliberate setting; uncertainty must use existing command recovery, not replay.

const result = await client.signalSetups.trySetting(
  "1",
  "18",
  {
    "requestId": "22222222-2222-4222-8222-222222222222",
    "setupId": "11111111-1111-4111-8111-111111111111",
    "expectedRevision": 1,
    "connection": {
      "address": 86,
      "output": 0
    }
  },
  {}
);
TypeScript parameters and return type
accountId · required
string

Owning account.

layoutId · required
string

Selected layout.

input · required
SignalSetupTrialCommand

Reviewed revision and original command identity.

options · optional
RailDeckRequestControlOptions

Request lifetime controls.

Returns Promise<SignalSetupTrialReceipt>.

Example evidence: Retained SDK transport fixture.

signalSetups.cancel

Cancels only the reviewed setup; it cannot undo a command already sent.

const result = await client.signalSetups.cancel(
  "1",
  "18",
  {
    "requestId": "33333333-3333-4333-8333-333333333333",
    "setupId": "11111111-1111-4111-8111-111111111111",
    "expectedRevision": 1
  },
  {}
);
TypeScript parameters and return type
accountId · required
string

Owning account.

layoutId · required
string

Selected layout.

input · required
CancelSignalSetupCommand

Original cancellation identity and reviewed revision.

options · optional
RailDeckRequestControlOptions

Request lifetime controls.

Returns Promise<SignalSetupSnapshot>.

Example evidence: Retained SDK transport fixture.

signalSetups.save

Saves only observed original trials through the atomic accessory owner.

const result = await client.signalSetups.save(
  "1",
  "18",
  {
    "requestId": "33333333-3333-4333-8333-333333333333",
    "setupId": "11111111-1111-4111-8111-111111111111",
    "expectedRevision": 1,
    "completion": "finish-later",
    "observations": []
  },
  {}
);
TypeScript parameters and return type
accountId · required
string

Owning account.

layoutId · required
string

Selected layout.

input · required
SaveSignalSetupCommand

Original save identity, reviewed version and unique visual answers.

options · optional
RailDeckRequestControlOptions

Request lifetime controls.

Returns Promise<SignalSetupSaveReceipt>.

Example evidence: Retained SDK transport fixture.

Download all TypeScript method examples

JavaScript calls and TypeScript downloads are checked through the real SDK using local response fixtures. This verifies the calls and decoding for those fixtures.

Handle errors and uncertain outcomes

Choose another feature

The complete TypeScript workflow

Follow how the calls fit together, including the review and recovery steps. Supply your configured client and explicitly selected development records. Importing the download performs no requests; mutations are never retried automatically.

import type { RailDeckDirectIntegrationClient as Client } from '@raildeck/frontend-sdk/direct-integration';

/**
 * Recover the original trial command before reading its signal setup again.
 * @param client - Configured client; the caller owns current authority.
 * @param accountId - Authorised account for this workflow.
 * @param layoutId - Explicitly selected layout within the account.
 * @param controllerId - Explicitly selected command station.
 * @param setupId - Original signal setup being reviewed.
 * @param commandId - Original command identity; never replace it to retry.
 * @param signal - Caller-owned cancellation signal.
 * @returns Original command evidence and setup; an unknown result never triggers another trial.
 */
export async function recoverSignalTrial(
  client: Client,
  accountId: string,
  layoutId: string,
  controllerId: string,
  setupId: string,
  commandId: string,
  signal: AbortSignal,
) {
  const options = { signal, timeoutMs: 15_000 };
  const outcome = await client.liveCommands.recoverAccessoryCommand(
    accountId, controllerId, commandId, { layoutId }, options,
  );
  const setup = await client.signalSetups.get(accountId, layoutId, setupId, options);
  return { outcome, setup };
}
Download TypeScript example

Information reviewed .