Command stations
Read and maintain command-station records for a layout.
Source 0.1.0 Private source package
How the calls fit together
Load the selected station and review its deletion consequences. A saved record is not evidence of a hardware connection.
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
controllers.list
Lists controllers in an account.
const result = await client.controllers.list(
"account 1",
{}
);TypeScript parameters and return type
accountId· requiredRailDeckIdentifierAccount that owns the controllers.
requestOptions· optionalRailDeckRequestControlOptionsCaller-owned cancellation signal and timeout; these controls never authorise an automatic mutation retry.
Returns Promise<RailDeckControllerListResponse>.
Example evidence: Retained SDK transport fixture.
controllers.create
Creates a controller inside an account.
const result = await client.controllers.create(
"account 1",
{
"name": "DCC-EX",
"type": "dcc-ex"
},
{}
);TypeScript parameters and return type
accountId· requiredRailDeckIdentifierAccount that will own the controller.
input· requiredCreateRailDeckControllerInputController name, type, connection mode, layout assignment, and metadata.
requestOptions· optionalRailDeckRequestControlOptionsCaller-owned cancellation signal and timeout; these controls never authorise an automatic mutation retry.
Returns Promise<RailDeckController>.
Example evidence: Retained SDK transport fixture.
controllers.get
Loads one controller.
const result = await client.controllers.get(
"account-1",
"controller-1",
{}
);TypeScript parameters and return type
accountId· requiredRailDeckIdentifierAccount that owns the controller.
controllerId· requiredRailDeckIdentifierController to load.
requestOptions· optionalRailDeckRequestControlOptionsCaller-owned cancellation signal and timeout; these controls never authorise an automatic mutation retry.
Returns Promise<RailDeckController>.
Example evidence: Retained SDK transport fixture.
controllers.update
Updates one controller.
const result = await client.controllers.update(
"account-1",
"controller-1",
{
"name": "Yard Controller"
},
{}
);TypeScript parameters and return type
accountId· requiredRailDeckIdentifierAccount that owns the controller.
controllerId· requiredRailDeckIdentifierController to update.
input· requiredUpdateRailDeckControllerInputPartial controller update.
requestOptions· optionalRailDeckRequestControlOptionsCaller-owned cancellation signal and timeout; these controls never authorise an automatic mutation retry.
Returns Promise<RailDeckController>.
Example evidence: Retained SDK transport fixture.
controllers.getDeletionPreview
Loads the current consequences and blockers which bind deliberate controller deletion.
const result = await client.controllers.getDeletionPreview(
"account-1",
"controller-1",
{}
);TypeScript parameters and return type
accountId· requiredRailDeckIdentifierAuthorised account containing the selected railway records.
controllerId· requiredRailDeckIdentifierIdentifier of the explicitly selected record in your authorised development environment.
requestOptions· optionalRailDeckRequestControlOptionsCaller-owned cancellation signal and timeout; these controls never authorise an automatic mutation retry.
Returns Promise<RailDeckControllerDeletionPreview>.
Example evidence: Retained SDK transport fixture.
controllers.delete
Deletes one controller.
const result = await client.controllers.delete(
"account-1",
"controller-1",
{
"previewFingerprint": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"confirmed": true
},
{}
);TypeScript parameters and return type
accountId· requiredRailDeckIdentifierAccount that owns the controller.
controllerId· requiredRailDeckIdentifierController to delete.
input· requiredDeleteRailDeckControllerInputThe operation input. Use the complete typed shape shown in the example and retain reviewed versions for writes.
requestOptions· optionalRailDeckRequestControlOptionsCaller-owned cancellation signal and timeout; these controls never authorise an automatic mutation retry.
Returns Promise<RailDeckSuccessResponse>.
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.
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';
/**
* Load a station and review the consequences before a separate confirmation.
* @param client - Configured client; the caller owns current authority.
* @param accountId - Authorised account for this workflow.
* @param controllerId - Explicitly selected command station.
* @param signal - Caller-owned cancellation signal.
* @returns The record and deletion preview, without removing or operating the station.
*/
export async function prepareControllerRemoval(
client: Client,
accountId: string,
controllerId: string,
signal: AbortSignal,
) {
const options = { signal, timeoutMs: 15_000 };
const controller = await client.controllers.get(accountId, controllerId, options);
const consequences = await client.controllers.getDeletionPreview(accountId, controllerId, options);
return { controller, consequences };
}
Download TypeScript example