Terminal Entries
This section is about the entries of the Terminal; how to send an entry, receive the response of an entry, and the queues of entries.
Structures
We can differentiate between two different data structures for entries and responses.
Entry
({
cryptic: 'son/zdu7/gws',
id: 'd129327c-c523-47fe-8301-e4c1e6b37591',
});
Response
({
lineAddress: '49',
payload:
'SIGN-ON COMPLETE/ABCDE/AG/17APR/ DU7IA/0000000645-GALILEO\n(C)1989-2019 TRAVELPORT. ALL RIGHTS RESERVED\nLAST SIGN-ON AT 0905 ON 17APR19 FROM 4A23C4 MADOU\n---------------------------------------------------------- \nAD 2 TEST SIGN-ON MESSAGE. THIS IS SCHEDULED \nIN DC AND MIGRATED OVER TO OPEN AD STREAM >SV1· \n---------------------------------------------------------- \nAD 1 TEST SIGN-ON MESSAGE. THIS IS SCHEDULED \nIN DC AND MIGRATED OVER TO OPEN AD STREAM >SV2· \n \n \n \n \n)>',
entry: {
id: 'd129327c-c523-47fe-8301-e4c1e6b37591',
cryptic: 'son/zdu7/gws',
},
tast: [
'SIGN-ON COMPLETE/ABCDE/AG/17APR/ DU7IA/0000000645-GALILEO\n(C)1989-2019 TRAVELPORT. ALL RIGHTS RESERVED\nLAST SIGN-ON AT 0905 ON 17APR19 FROM 4A23C4 MADOU\n---------------------------------------------------------- \nAD 2 TEST SIGN-ON MESSAGE. THIS IS SCHEDULED \nIN DC AND MIGRATED OVER TO OPEN AD STREAM >SV1· \n---------------------------------------------------------- \nAD 1 TEST SIGN-ON MESSAGE. THIS IS SCHEDULED \nIN DC AND MIGRATED OVER TO OPEN AD STREAM >SV2· \n \n \n \n \n)>',
],
});
isTerminalBusy
Checks if the terminal is processing an entry.
isTerminalBusy(state: Object, { terminalId: String }): Boolean;
-
state Object
Required. The global state of the application.
-
terminalId String
Required. The ID of the terminal to be checked.
Returns
Boolean
Returns true if the terminal is processing an entry. False if not.
Example
const state = storeHelper.getState();
const isTerminalBusy = selectorsHelper.make('isTerminalBusy');
const isBusy = isTerminalBusy(state, { terminalId: 'terminal-1' });
receiveTerminalResponse
Receives an response, useful when responses from external services are retrieved.
Usage
dispatchersHelper.dispatch('receiveTerminalResponse', {
terminalId: String,
response: {
lineAddress: String,
payload: String,
entry: { id: String, cryptic: String },
tast: TAST,
},
});
-
terminalId String
Required. The ID of the terminal to receive the response.
-
response Object
Required. The response object.
-
payload String
Required. The payload of the response.
-
lineAddress String
Required. The lineAddress of the response.
-
entry Object
Required. The entry object.
-
**id** `String` _[REQUIRED]_
The ID of the response's entry.
-
**cryptic** `String` _[REQUIRED]_
The cryptic entry of the response.
-
-
tast TAST
Required. The response in TAST to receive in the terminal.
Example
dispatchersHelper.dispatch('receiveTerminalResponse', {
terminalId: 'terminal-1',
response: {
lineAddress: '49',
payload: 'RESPONSE-1',
entry: { id: 'entry-id', cryptic: 'ENTRY-1' },
tast,
},
});
queueTerminalEntry
Add an entry to the queue entries of the specified terminal.
Usage
dispatchersHelper.dispatch('queueTerminalEntry', {
terminalId: String,
entry: { id: String, cryptic: String },
});
-
terminalId String
Required. The terminal id to queue the entry.
-
entry Object
Required. The entry to be queued.
-
id String
Required. The entry to be queued.
-
cryptic String
Required. Cryptic entry to be queued.
Example
dispatchersHelper.dispatch('queueTerminalEntry', {
terminalId: 'terminal-1',
entry: { id: 'entry-id', cryptic: 'ENTRY-1' },
});
dequeueTerminalEntry
Remove an entry to the queue entries of the specified terminal.
Usage
dispatchersHelper.dispatch('dequeueTerminalEntry', {
terminalId: String,
entry: { id: String, cryptic: String },
});
-
terminalId String
Required. The terminal ID to dequeue the entry.
-
entry Object
Required. The entry to be dequeued.
-
id String
Required. The entry to be dequeued.
Example
dispatchersHelper.dispatch('dequeueTerminalEntry', {
terminalId: 'terminal-1',
entry: { id: 'entry-id' },
});
sendTerminalEntry
Send a terminal entry.
Usage
dispatchersHelper.dispatch('sendTerminalEntry', {
terminalId: String,
entry: { id: String, cryptic: String },
});
-
terminalId String
Required. The ID of the terminal to send the entry.
-
entry Object
Required. The entry to be sent.
-
id String
Optional. The ID of the entry.
-
cryptic String
Required. The cryptic entry to be send.
Example
dispatchersHelper.dispatch('sendTerminalEntry', {
terminalId: 'terminal-1',
entry: { cryptic: 'ENTRY-1' },
});
getTerminalEntriesQueues
Gets the entries queued of the specified terminal.
getTerminalEntriesQueues(state: Object, { terminalId: String }): Array;
-
state Object
Required. The global state of the application.
-
terminalId String
Required. The id of the terminal to get the queued entries.
Returns
-
Array
Returns an array of objects with the queued entries of the specified terminal.
Example
const state = storeHelper.getState();
const getTerminalEntriesQueues = selectorsHelper.make('getTerminalEntriesQueues');
const entries = getTerminalEntriesQueues(state, { terminalId: 'terminal-1' });