Terminal History

This section is about the Terminal History, entries and responses. The terminal History is an array of entries or responses where the last entries and responses (max 50 of each one by default), are stored in order.

Structures

We can differentiate between two different data structures for entries and responses at the History.

Entry

This is the structure of an entry:

Copy
{
cryptic: String,
id: String,
terminalId: String,
}
  • cryptic String

    The message that is being sent as an entry.

  • id String

    The id of the entry.

  • terminalId String

    The ID of the terminal that is sending the entry.

Response

This is the structure of a response:

Copy
{
lineAddress: String,
payload: String,
entry: Object,
tast: String,
terminalId: String,
}
  • lineAddress String

    The lineAddress of the response, this is a number that is used to know how to render the response.

  • payload String

    The server response.

  • entry String

    The entry associated to this response.

  • tast [String]

    The content that will be rendered.

  • terminalId String

    The ID of the terminal that receives the response.

getTerminalsEntriesHistoryList

Returns an array with the last entries that have been sent to all the terminals. The list is limited by the limit, that by default is 50 entries.

Copy
getTerminalsEntriesHistoryList(state: Object): Array;
  • state Object

    Required. The global state of the application.

Returns
  • Array

    Array with the last entries sent.

Example
Copy
const state = storeHelper.getState();
const getTerminalsEntriesHistoryList = selectorsHelper.make('getTerminalsEntriesHistoryList');
const entriesHistoryList = getTerminalsEntriesHistoryList(state);

getTerminalsResponsesHistoryList

Returns an array with the last responses that have been received in all the terminals. The list is limited by the limit, that by default is 50 entries.

Copy
getTerminalsResponsesHistoryList(state: Object): Array;
  • state Object

    Required. The global state of the application.

Returns
  • Array

    Array with the last responses received.

Example
Copy
const state = storeHelper.getState();
const getTerminalsResponsesHistoryList = selectorsHelper.make('getTerminalsResponsesHistoryList');
const responsesHistoryList = getTerminalsResponsesHistoryList(state);

getTerminalEntriesHistoryList

Returns an array with the last entries that have been sent to an specific terminal.

Copy
getTerminalEntriesHistoryList(state: Object, {terminalId: String}): Array;
  • state Object

    Required. The global state of the application.

  • terminalId String

    Required. ID of the terminal from which we want to retrieve the entries.

Returns
  • Array

    Array with all the entries of the specified terminal.

Example
Copy
const state = storeHelper.getState();
const getTerminalEntriesHistoryList = selectorsHelper.make('getTerminalEntriesHistoryList');
const entriesHistoryList = getTerminalEntriesHistoryList(state, {
terminalId: 'terminal-1',
});

getTerminalResponsesHistoryList

Returns an array with the last responses that have been received in an specific terminal.

Copy
getTerminalResponsesHistoryList(state: Object, {terminalId: String}): Array;
  • state Object

    Required. The global state of the application.

  • terminalId String

    Required. ID of the terminal from which we want to retrieve the responses.

Returns
  • Array

    Array with all the responses of the specified terminal.

Example
Copy
const state = storeHelper.getState();
const getTerminalResponsesHistoryList = selectorsHelper.make('getTerminalResponsesHistoryList');
const responsesHistoryList = getTerminalResponsesHistoryList(state, {
terminalId: 'terminal-1',
});