amazon-connect / amazon-connect-streams

Amazon Connect Streams - a browser-based contact center integration API, typically with CRM systems.
https://docs.aws.amazon.com/connect/latest/userguide/
Apache License 2.0
394 stars 315 forks source link

connect.AgentStateType missing "system" type #908

Closed ajspetner closed 2 months ago

ajspetner commented 3 months ago

The definition of connect.AgentStateType (in src/index.d.ts) is:

  /** This enumeration lists the different types of agent states. */
  enum AgentStateType {
    /** The agent state hasn't been initialized yet. */
    INIT = "init",

    /** The agent is in a state where they can be routed contacts. */
    ROUTABLE = "routable",

    /** The agent is in a state where they cannot be routed contacts. */
    NOT_ROUTABLE = "not_routable",

    /** The agent is offline. */
    OFFLINE = "offline",
  }

However, when initiating a call, during a call, and during after call work, the state returned has a type of "system", which is not in the interface definition. Example:

{
    "agentStateARN": "arn:aws:connect:us-east-1:XXXXXXXXXXXX:instance/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/agent-state/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "type": "system",
    "name": "AfterCallWork",
    "startTimestamp": "2024-08-05T08:50:14.191Z"
}
ajspetner commented 3 months ago

I just noticed that it is also missing the "error" state type so I added that to PR #909 as well