Skip to content

Commit

Permalink
Basic implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <[email protected]>
  • Loading branch information
aaronchongth committed May 28, 2024
1 parent c4a76d8 commit f48bc5c
Show file tree
Hide file tree
Showing 11 changed files with 1,110 additions and 709 deletions.
13 changes: 8 additions & 5 deletions packages/api-client/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Debug from 'debug';
import { io, Socket } from 'socket.io-client';
import {
ApiServerModelsTortoiseModelsAlertsAlertLeaf,
AlertRequest,
AlertResponse,
ApiServerModelsTortoiseModelsBeaconsBeaconStateLeaf as BeaconState,
BuildingMap,
DeliveryAlert,
Expand All @@ -19,8 +20,6 @@ import {
TaskState,
} from './openapi';

type Alert = ApiServerModelsTortoiseModelsAlertsAlertLeaf;

const debug = Debug('rmf-client');

// https://stackoverflow.com/questions/52667959/what-is-the-purpose-of-bivariancehack-in-typescript-types
Expand Down Expand Up @@ -102,8 +101,12 @@ export class SioClient {
return this.subscribe<TaskEventLog>(`/tasks/${taskId}/log`, listener);
}

subscribeAlerts(listener: Listener<Alert>): Subscription {
return this.subscribe<Alert>(`/alerts`, listener);
subscribeAlertRequests(listener: Listener<AlertRequest>): Subscription {
return this.subscribe<AlertRequest>(`/alerts/requests`, listener);
}

subscribeAlertResponses(listener: Listener<AlertResponse>): Subscription {
return this.subscribe<AlertResponse>(`/alerts/responses`, listener);
}

subscribeDeliveryAlerts(listener: Listener<DeliveryAlert>): Subscription {
Expand Down
Loading

0 comments on commit f48bc5c

Please sign in to comment.