Skip to main content

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

Developer documentation

Bridge management

Read bridge records, status and retirement consequences.

Source 0.1.0 Private source package

How the calls fit together

Read the selected bridge and its current status. Pairing codes and device credential protocols remain in their protected setup workflow.

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

bridges.list

Lists bridges in an account.

const result = await client.bridges.list(
  "account 1",
  {}
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the bridges.

requestOptions · optional
RailDeckRequestControlOptions

Caller-owned cancellation signal and timeout; these controls never authorise an automatic mutation retry.

Returns Promise<RailDeckBridgeListResponse>.

Example evidence: Retained SDK transport fixture.

bridges.create

Creates a bridge record without redeeming hardware setup.

const result = await client.bridges.create(
  "account-1",
  {
    "displayName": "{{fixtureDisplayName}}"
  },
  {}
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that will own the bridge.

input · required
CreateRailDeckBridgeInput

Display name and optional assignments.

requestOptions · optional
RailDeckRequestControlOptions

Caller-owned cancellation signal and timeout; these controls never authorise an automatic mutation retry.

Returns Promise<RailDeckBridge>.

Example evidence: Retained SDK transport fixture.

bridges.get

Loads one bridge.

const result = await client.bridges.get(
  "account-1",
  "bridge-1",
  {}
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the bridge.

bridgeId · required
RailDeckIdentifier

Bridge to load.

requestOptions · optional
RailDeckRequestControlOptions

Caller-owned cancellation signal and timeout; these controls never authorise an automatic mutation retry.

Returns Promise<RailDeckBridge>.

Example evidence: Retained SDK transport fixture.

bridges.update

Updates one bridge.

const result = await client.bridges.update(
  "account-1",
  "bridge-1",
  {
    "displayName": "{{fixtureDisplayName}}"
  },
  {}
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the bridge.

bridgeId · required
RailDeckIdentifier

Bridge to update.

input · required
UpdateRailDeckBridgeInput

Partial bridge update.

requestOptions · optional
RailDeckRequestControlOptions

Caller-owned cancellation signal and timeout; these controls never authorise an automatic mutation retry.

Returns Promise<RailDeckBridge>.

Example evidence: Retained SDK transport fixture.

bridges.getRetirementPreview

Loads the exact current consequences of removing or completing a replacement.

const result = await client.bridges.getRetirementPreview(
  "account 1",
  "bridge 1",
  "bridge 2",
  {}
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Authorised account containing the selected railway records.

bridgeId · required
RailDeckIdentifier

Identifier of the explicitly selected record in your authorised development environment.

replacementBridgeId · required
RailDeckIdentifier | null

Selected replacement bridge, or null when no replacement is being proposed.

requestOptions · optional
RailDeckRequestControlOptions

Caller-owned cancellation signal and timeout; these controls never authorise an automatic mutation retry.

Returns Promise<RailDeckBridgeRetirementPreview>.

Example evidence: Retained SDK transport fixture.

bridges.delete

Retires one bridge against an exact reviewed preview.

const result = await client.bridges.delete(
  "account 1",
  "bridge 1",
  {
    "replacementBridgeId": "bridge 2",
    "previewFingerprint": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "confirmed": true
  },
  {}
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Authorised account containing the selected railway records.

bridgeId · required
RailDeckIdentifier

Identifier of the explicitly selected record in your authorised development environment.

input · required
DeleteRailDeckBridgeInput

The operation input. Use the complete typed shape shown in the example and retain reviewed versions for writes.

requestOptions · optional
RailDeckRequestControlOptions

Caller-owned cancellation signal and timeout; these controls never authorise an automatic mutation retry.

Returns Promise<RailDeckBridgeRetirementResult>.

Example evidence: Retained SDK transport fixture.

bridges.getStatus

Loads bridge lifecycle and assignment health status.

const result = await client.bridges.getStatus(
  "account-1",
  "bridge-1",
  {}
);
TypeScript parameters and return type
accountId · required
RailDeckIdentifier

Account that owns the bridge.

bridgeId · required
RailDeckIdentifier

Bridge to inspect.

requestOptions · optional
RailDeckRequestControlOptions

Caller-owned cancellation signal and timeout; these controls never authorise an automatic mutation retry.

Returns Promise<RailDeckBridgeStatus>.

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

/**
 * Read a bridge, current status and the consequences of retiring it without replacement.
 * @param client - Configured client; the caller owns current authority.
 * @param accountId - Authorised account for this workflow.
 * @param bridgeId - Explicitly selected bridge.
 * @param signal - Caller-owned cancellation signal.
 * @returns Management evidence only; no pairing code, credential or retirement command.
 */
export async function prepareBridgeReview(
  client: Client,
  accountId: string,
  bridgeId: string,
  signal: AbortSignal,
) {
  const options = { signal, timeoutMs: 15_000 };
  const bridge = await client.bridges.get(accountId, bridgeId, options);
  const status = await client.bridges.getStatus(accountId, bridgeId, options);
  const retirement = await client.bridges.getRetirementPreview(accountId, bridgeId, null, options);
  return { bridge, status, retirement };
}
Download TypeScript example

Information reviewed .