Skip to content

Commit

Permalink
Merge pull request #660 from tannera926/master
Browse files Browse the repository at this point in the history
Adding typescript support for monitor and barge functions
  • Loading branch information
tannera926 authored Mar 31, 2023
2 parents 40a68ee + ed33a2c commit 1a64c8d
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amazon-connect-streams",
"version": "2.4.6",
"version": "2.4.7",
"description": "Amazon Connect Streams Library",
"engines": {
"node": ">=12.0.0"
Expand Down
47 changes: 46 additions & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,11 @@ declare namespace connect {
SEND_DATA_FAILED_EXCEPTION = "SendDataFailedException",
UNAUTHORIZED_EXCEPTION = "UnauthorizedException",
}

enum MonitoringMode {
SLIENT_MONITOR = "SILENT_MONITOR",
BARGE = "BARGE"
}

enum MasterTopics {
LOGIN_POPUP = 'loginPopup',
Expand Down Expand Up @@ -1501,6 +1506,17 @@ declare namespace connect {

/** Determine whether this contact is a softphone call and multiparty conference feature is turned on. */
isMultiPartyConferenceEnabled(): boolean;

/** Determines if the contact is under manager's supervision */
isUnderSupervision(): boolean;

/**
* Updates the monitor participant state to switch between different monitoring modes.
*
* @param targetState A MonitoringMode enum member
* @param callbacks Success and failure callbacks to determine whether the operation was successful
*/
updateMonitorParticipantState(targetState: MonitoringMode, callbacks?: SuccessFailOptions): void;
}

interface ContactState {
Expand Down Expand Up @@ -1704,7 +1720,36 @@ declare namespace connect {
* @param callbacks Success and failure callbacks to determine whether the operation was successful.
*/
unmuteParticipant(callbacks?: SuccessFailOptions): void;


/**
* Returns true if monitorStatus is MonitoringMode.SILENT_MONITOR. This means the supervisor connection is in silent monitoring state.
* Regular agent will not see supervisor's connection in the snapshot while it is in silent monitor state.
*/
isSilentMonitor(): boolean;

/**
* Returns true if monitorStatus is MonitoringMode.BARGE.
* This means the connection is in barge-in state. Regular agent will see the supervisor's connection in the list of connections in the snapshot.
*/
isBarge(): boolean;

/** Returns true if agent's monitoringCapabilities contain MonitoringMode.SILENT_MONITOR type. */
isSilentMonitorEnabled(): boolean;

/** Returns true if agent's monitoringCapabilities contain MonitoringMode.BARGE state type. */
isBargeEnabled(): boolean;

/** Returns the array of enabled monitor states of this connection. The array will consist of MonitoringMode enum values. */
getMonitorCapabilities(): MonitoringMode[];

/**
* Returns the current monitoring state of this connection.
* This value can be one of MonitoringMode enum values if the agent is supervisor, otherwise the monitorStatus will be undefined for the agent.
*/
getMonitorStatus(): MonitoringMode;

/** Returns true if the connection was forced muted by the manager. */
isForcedMute(): boolean;
}

/**
Expand Down

0 comments on commit 1a64c8d

Please sign in to comment.