profile
viewpoint

marcogrcr/jquery-tableoverflow 8

jQuery plugin for dynamic table content overflowing.

marcogrcr/aws4fetch 1

A compact AWS client for modern JS environments

marcogrcr/dnx-watch 1

A watcher for dnx project development

marcogrcr/NET-SMS-Sender 1

A C# implementation of a SMS message sender using AT commands.

marcogrcr/amazon-connect-chatjs 0

Amazon Connect Chat JS - a browser-based contact center integration API for Chat on the Agent and Customer side.

marcogrcr/amazon-connect-streams 0

Amazon Connect Streams - a browser-based contact center integration API, typically with CRM systems.

marcogrcr/aws-sdk-java 0

The official AWS SDK for Java.

marcogrcr/cfn-response 0

NPM-hosted copy-paste job of AWS cfn-response.

marcogrcr/cfn-response-promise 0

Promise wrapped version of cfn-response.

marcogrcr/chai-exclude 0

Exclude keys to compare from a deep equal operation with chai expect or assert.

issue commentcryptomator/sanitizer

Add support to Vault version 7

Any advice on how to decrypt individual files in version 7?

juanmbraga

comment created time in 9 days

issue commentamazon-connect/amazon-connect-streams

I am not able to remove the logs from connect-streams.js

@Swethamr402:

connect.getLog().setEchoLevel(connect.LogLevel.CRITICAL); - What does it do exactly ?

It basically tells amazon-connect-streams what is the minimum level of message that will be taken into account when logging. For example:

connect.getLog().setEchoLevel(connect.LogLevel.WARN);

Will only log .warn(), .error(), .critical() messages.

connect.getLog().setEchoLevel(connect.LogLevel.ERROR);

Will only log .error(), .critical() messages.

So on and so forth.


You have to make sure you call this before your call to connect.core.initCCP().

Note that an important limitation of this method, is that this will only affect the logging performed by amazon-connect-streams in the hosting window (i.e. your web app), it will not affect the logging performed in the guest window (i.e. the CCP inside the <iframe>):

No logging config:

no-logging-config

With connect.getLog().setEchoLevel(connect.LogLevel.CRITICAL):

with-logging-config

Notice how the entries with red squares are gone after the configuration. As you can see, there are still entries from https://your-instance.awsapps.com/connect/ccp-naws/static/streams/connect-streams-min.95eec0b9.js which is a resource used by the CCP <iframe>.

Ideally, calling connect.getLog().setEchoLevel(connect.LogLevel.CRITICAL) should affect the CCP <iframe> too (by sending a message like it does for other methods), but as mentioned before, this method is currently not publicly documented. This could mean that it's not intended to be used by customers and there's currently no "official" way of removing the console logging.

Swethamr402

comment created time in 19 days

issue commentamazon-connect/amazon-connect-streams

Microphone does not work in Firefox when I popup the CCP in a separate window

Finally, for reference, here are the permissions that I had set on the browser for both origins:

CCP container origin:

ccp-container-permissions

CCP origin:

ccp-permissions


Allowing all permissions does not solve the issue.

marcogrcr

comment created time in 20 days

issue commentamazon-connect/amazon-connect-streams

Microphone does not work in Firefox when I popup the CCP in a separate window

Interestingly enough, if you click the "Accept call" button, and then focus the window where the CCP was initialized, then the call is connected and you can speak with the customer:

success-after-window-focus

marcogrcr

comment created time in 20 days

issue commentamazon-connect/amazon-connect-streams

Microphone does not work in Firefox when I popup the CCP in a separate window

Steps to reproduce:

  1. Load the example html on an https origin that is whitelisted in Amazon Connect. Wait for the CCP to load and the prompt for microphone permissions to show, click the "Allow" button.

initial-load

  1. Verify that the microphone show up on the URL bar:

url-bar

  1. Click the "Pop out!" button, wait for the popup to open an load:

pop-up-loaded

  1. On the popup, set yourself as "Available" and perform a phone call that would result in the call being routed to the agent:

set-as-available

  1. When the call comes in, click the "Accept call" button:

accept-call-button

Expected result

The call is connected and you can talk with the customer.

Actual result

Clicking the button one or multiple times "does nothing", and after a while (i.e. a timeout), you get a microphone permissions error:

microphone-permissions-error

Waiting a bit more (i.e. another timeout), results in a WebRTC error:

webrtc-error

marcogrcr

comment created time in 20 days

issue openedamazon-connect/amazon-connect-streams

Microphone does not work in Firefox when I popup the CCP in a separate window

Hi:

We have a use case that shows the built-in CCP inside our application and allows customers to "pop-out" the CCP into a separate window, as well as "pop-back" the CCP. A simplified version looks like this:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>microphone test</title>
    <script src="/node_modules/amazon-connect-streams/release/connect-streams.js"></script>
  </head>
  <body>
    <button id="pop-out">Pop out!</button>
    <button id="pop-in">Pop in!</button>
    <div id="ccp-container"></div>
    <script>
      const CCP_URL = "https://my-instance.awsapps.com/connect/ccp-v2";
      const LOGIN_URL = "https://my-login-url/";
      const CONTAINER = document.getElementById("ccp-container");
      let popup;

      document.getElementById("pop-out").addEventListener("click", () => {
        popup = window.open(
          CCP_URL,
          "CCP",
          "height=500,width=320,menubar=0,status=0,toolbar=0"
        );

        CONTAINER.style.display = "none";
      });

      document.getElementById("pop-in").addEventListener("click", () => {
        popup.close();

        CONTAINER.style.display = "";
      });

      connect.core.initCCP(CONTAINER, {
        ccpUrl: CCP_URL,
        region: "us-east-1",
        loginUrl: LOGIN_URL,
        loginPopup: true,
        loginPopupAutoClose: true,
        softphone: {
          allowFramedSoftphone: true,
        },
      });
    </script>
  </body>
</html>

Receiving calls work just fine in Chrome 83/Mac OS 10.14.6, however when I use Firefox ESR 68.8.0esr this doesn't work when attempting to receive calls on the popup.

created time in 20 days

issue commentamazon-connect/amazon-connect-streams

contact.onAccepted(...) - Contact param is null

This is a duplicate of #247

smearlaws

comment created time in 20 days

issue commentamazon-connect/amazon-connect-streams

Upgrading Streams API - Unable to Connect to Customer

Hi @amicming:

Keep in mind that amazon-connect-streams is now published as an npm package, so you should use the package if you're not doing it already.

Are you using import "amazon-connect-streams"; or <script src="amazon-connect-streams.js"></script>? If you're using the first method, consider revising your bundler configuration, there may be something in there that's breaking it. Keep in mind that amazon-connect-streams is not implemented as a module, it relies on this === window.

Try using a barebones app to verify that it works, and slowly start adding your customization to see what breaks it. Although not for angular, here's a barebones amazon-connect-chatjs + react example that you can adapt to amazon-connect-streams + angular, and slowly add your customizations: https://github.com/amazon-connect/amazon-connect-chatjs/issues/10#issuecomment-639945642

Another thing you can do, is try to initialize the CCP version 2 rather than version 1, as I have seen some issues when using the old CCP (e.g. #263).

// instead of /connect/ccp
ccpUrl: "https://instance-name.awsapps.com/connect/ccp-v2"

Additionally, if you're using the chat functionality, keep in mind that you'll also need to include amazon-connect-chatjs.

amicming

comment created time in 20 days

issue commentamazon-connect/amazon-connect-streams

I am not able to remove the logs from connect-streams.js

Hi @Swethamr402:

What you're looking for is:

connect.getLog().setEchoLevel(connect.LogLevel.CRITICAL);

There is no connect.LogLevel.OFF level, but there's not a single entry so far in amazon-connect-streams@1.4.8 that uses that level, so for practical purposes it's the same thing.


Important: The Streams logger documentation does mention connect.LogLevel or connect.getLog().setEchoLevel(). It would be helpful if the amazon-connect-streams could clarify whether this is officially supported.


Ref:

https://github.com/amazon-connect/amazon-connect-streams/blob/996705f168c02c61693ef9b012a632231f056a8c/src/log.js#L21-L30

https://github.com/amazon-connect/amazon-connect-streams/blob/996705f168c02c61693ef9b012a632231f056a8c/src/log.js#L261-L267

https://github.com/amazon-connect/amazon-connect-streams/blob/996705f168c02c61693ef9b012a632231f056a8c/src/log.js#L283-L300

Swethamr402

comment created time in 20 days

issue commentamazon-connect/amazon-connect-streams

How to use SAML without loginPopup

It would be useful if the amazon-connect-streams team could clarify whether the previoulsy proposed method is the "official way" of achieving this, and whether it's safe to use the parameter: ccpAckTimeout

imankurpatel000

comment created time in 20 days

issue commentamazon-connect/amazon-connect-streams

How to use SAML without loginPopup

Hi @imankurpatel000:

The confusion stems from the fact that loginUrl is only used when loginPopup === true:

https://github.com/amazon-connect/amazon-connect-streams/blob/996705f168c02c61693ef9b012a632231f056a8c/src/core.js#L504-L515

https://github.com/amazon-connect/amazon-connect-streams/blob/996705f168c02c61693ef9b012a632231f056a8c/src/core.js#L42-L47


In theory, if you can craft a SAML url (e.g. <my-saml-url>) that:

  1. Can be loaded inside an <iframe> from your origin (i.e. no X-Frame-Options or Content-Security-Policy prevents it).
  2. Authenticates users against the Amazon Connect instance and redirects them to the CCP after (e.g. https://region.console.aws.amazon.com/connect/federate/instance-id?destination=%2Fconnect%2Fccp).

Then you should be able to initialize the CCP as follows:

connect.core.initCCP({
  ccpUrl: "<my-saml-url>",
  region: "<region>",
});

IMPORTANT: By default, your authentication will need to be completed in less than 8 seconds. This is because after 3 seconds, an ACK_TIMEOUT event triggers which causes amazon-connect-streams to refresh the <iframe> every 5 seconds until authentication succeeds:

https://github.com/amazon-connect/amazon-connect-streams/blob/996705f168c02c61693ef9b012a632231f056a8c/src/core.js#L21

https://github.com/amazon-connect/amazon-connect-streams/blob/996705f168c02c61693ef9b012a632231f056a8c/src/core.js#L23

https://github.com/amazon-connect/amazon-connect-streams/blob/996705f168c02c61693ef9b012a632231f056a8c/src/core.js#L505

https://github.com/amazon-connect/amazon-connect-streams/blob/996705f168c02c61693ef9b012a632231f056a8c/src/core.js#L523-L525

This can potentially interrupt the authentication going on at <my-saml-url>. To mitigate this, you can use the undocumented parameter ccpAckTimeout (specified in milliseconds):

https://github.com/amazon-connect/amazon-connect-streams/blob/996705f168c02c61693ef9b012a632231f056a8c/src/core.js#L465

So your init code becomes:

connect.core.initCCP({
  ccpAckTimeout: 5 * 1000, // use 5s instead of the default 3s
  ccpUrl: "<my-saml-url>",
  region: "<region>",
});
imankurpatel000

comment created time in 20 days

issue commentamazon-connect/amazon-connect-chatjs

agentChatSession.onEnded() does not trigger on contact transfers

Update: After examining the code, it looks like that happens because amazon-connect-chatjs triggers .onEnded() only when it encounters an application/vnd.amazonaws.connect.event.chat.ended event:

https://github.com/amazon-connect/amazon-connect-chatjs/blob/5d7455018bab60938d54ccd88510b4ca151e32ac/src/core/chatController.js#L177-L183

marcogrcr

comment created time in a month

issue openedamazon-connect/amazon-connect-chatjs

chatSession.onEnded() does not trigger on contact transfers

I have a need for allowing agents to access their chat transcripts immediately after finishing a chat session. Given that streaming CTRs is not a suitable solution for our use case due to its asynchronous nature, I have developed a solution around this by using a combination of chatSession.getTranscript() and chatSession.onMessage(). A simplification of the solution looks like this:

connect.contact(contact => {
  if (contact.getType() === connect.ContactType.CHAT) {
    contact.onAccepted(async () => {
      const session = await contact
        .getConnections()
        .find((c) => c.getType() === connect.ConnectionType.AGENT)
        .getMediaController();

      const transcript = new TranscriptCustomClass();

      // uses session.getTranscript()
      transcript.populatePreviousMessages(session);

      // dedupes message if present in session.getTranscript(), sorts messages
      session.onMessage(event => transcript.appendMessage(event));

      // waits for transcript.populatePreviousMessages() to completing
      session.onEnded(event => transcript.complete(event));
    });
  }
});

So far, I've used the chatSession.onEnded() event to detect when the chat transcript can be considered "complete" and be made available for consumption. However, I've realized that this method is not called when the agent uses /connect/ccp-v2's "quick connect" feature to perform a transfer.

For the purposes explaining the problem, I'm going to refer to the transferred contact (i.e. initial contact) chat session as initialSession and the current contact (i.e. transferred contact) as currentSession.

Currently, the following behaviors occur:

  1. When the contact is transferred and accepted by another agent, initialSession.onEnded() event is never triggered (I wonder whether this translates to a memory leak).
  2. When the contact is transferred and accepted by the initial agent (e.g. the queue has only one available agent), a new contact is created (as expected), however:
    1. When events/messages are sent to the current contact, both initialSession.onMessage() and currentSession.onMessage() trigger. I believe only currentSession.onMessage() should trigger.
    2. When the current contact session finishes, both initialSession.onEnded() and currentSession.onEnded() trigger. I believe initialSession.onEnded() should trigger when the transfer completes, and only currentSession.onEnded() should trigger.

I've worked around this problem by examining the received messages and stop capturing in initialSession when I receive the following sequence of events I've noticed always occur before a transfer:

// event 1
{
  ContentType: "application/vnd.amazonaws.connect.event.transfer.succeeded"
}

// event 2
{
  ContentType: "application/vnd.amazonaws.connect.event.participant.left",
  ParticipantRole: "AGENT",
}

Note: I've also noticed these messages can sometimes come in out-of-order, so I have to sort the events first by their AbsoluteTime before performing the detection.


Questions:

  1. Is this by design?
  2. If so, is the workaround guaranteed to always be true (i.e. the sequence of events before a transfer will not change)?

created time in a month

issue commentamazon-connect/amazon-connect-chatjs

Purpose of connect.ChatSession.connect args metadata property

I have created a pull request (#22) that aims to provide TypeScript support as well as improve the API documentation.

In order to create the types, I had examine the source code, and as a side-effect I figure out the purpose of the metadata field. You can see more details about it here.

I believe your options for setting contact attributes would be as you correctly pointed out: StartChatContact's Attributes param, or after the contact is created, UpdateContactAttributes.

That being said, I would defer to the amazon-connect-chatjs team for an official response though.

Christian-Sesta

comment created time in a month

Pull request review commentamazon-connect/amazon-connect-chatjs

TypeScript support.

 $ git clone https://github.com/amazon-connect/amazon-connect-chatjs  Find build artifacts in **dist** directory -  This will generate a file called `amazon-connect-chat.js` - this is the full Connect ChatJS API which you will want to include in your page. -### Initialization-Setup the globalConfig and logger for ChatJS to use. If no `globalConfig` object is supplied, no logger will work and the default values for fields like `region` will be used. +# API++## `connect.ChatSesion` API++This is the main entry point to `amazon-connect-chatjs`.+All your interactions with the library start here.++### `connect.ChatSession.setGlobalConfig()`+```js+connect.ChatSession.setGlobalConfig({+  loggerConfig: { // optional, the logging configuration. If omitted, no logging occurs+    logger: { // optional, a logger object implementation+      debug: (msg) => console.debug(msg), // REQUIRED, can be any function+      info: (msg) => console.info(msg), // REQUIRED, can be any function+      warn: (msg) => console.warn(msg), // REQUIRED, can be any function+      error: (msg) => console.error(msg) // REQUIRED, can be any function+    },+    level: connect.ChatSession.LogLevel.WARN, // optional, defaults to: `connect.ChatSession.LogLevel.INFO`+  },+  region: "us-east-1", // optional, defaults to: "us-west-2"+}); ```-var logger = {-  debug: (data) => {console.debug(data);},-  info: (data) => {console.info(data);},-  warn: (data) => {console.warn(data);},-  error: (data) => {console.error(data);}-} -var globalConfig = { //required: no. This object defines some config, but all of it is optional.-  loggerConfig: {-    logger: logger, //required: no. See above for an example client logger implementation.-    level: connect.ChatSession.LogLevel.INFO, // required: no. There are four levels available - DEBUG, INFO, WARN, ERROR. Default is INFO.+Setup the global configuration to use. If this method is not called, the defaults of `loggerConfig` and `region` are used.+This method should be called before `connect.ChatSession.create()`.++### `connect.ChatSession.create()`+```js+const customerChatSession = connect.ChatSession.create({+  chatDetails: { // REQUIRED+    contactId: "...", // REQUIRED+    participantId: "...", // REQUIRED+    participantToken: "...", // REQUIRED   },-  region: "us-west-2" // required: no. "us-west-2" is the default value.-};+  options: { // optional+    region: "us-east-1", // optional, defaults to `region` set in `connect.ChatSession.setGlobalConfig()`+  },+  type: connect.ChatSession.SessionTypes.CUSTOMER, // REQUIRED+});+```++Creates an instance of `AgentChatSession` or `CustomerChatSession`, depending on the specified `type`.++If you're creating a `CustomerChatSession`, the `chatDetails` field should be populated with the response of the [StartChatContact](https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html) API.++If you're creating an `AgentChatSession`, you must also include [`amazon-connect-streams`](https://github.com/amazon-connect/amazon-connect-streams). For example:+```js+// order is important, alternatively use <script> tags+import "amazon-connect-streams";+import "amazon-connect-chatjs";++connect.contact(contact => {+  if (contact.getType() !== connect.ContactType.CHAT) {+    // applies only to CHAT contacts+    return;+  }++  // recommended: calls `connect.ChatSession.setGlobalConfig()` and `connect.ChatSession.create()` internally+  contact.onAccepted(async () => {+    const cnn = contact.getConnections().find(cnn => cnn.getType() === connect.ConnectionType.AGENT); -connect.ChatSession.setGlobalConfig(globalConfig);+    const agentChatSession = await cnn.getMediaController();+  });++  // alternative: if you want control over the args of `connect.ChatSession.setGlobalConfig()` and `connect.ChatSession.create()`+  contact.onAccepted(() => {+    const cnn = contact.getConnections().find(cnn => cnn.getType() === connect.ConnectionType.AGENT);++    const agentChatSession = connect.ChatSession.create({+      chatDetails: cnn.getMediaInfo(), // REQUIRED+      options: { // REQUIRED+        region: "us-east-1", // REQUIRED, must match the value provided to `connect.core.initCCP()`+      },+      type: connect.ChatSession.SessionTypes.AGENT, // REQUIRED+      websocketManager: connect.core.getWebSocketManager() // REQUIRED+    });+  });+}); ``` -### `connect.ChatSession.create`-`Method param:` args+See the [`amazon-connect-streams` API documentation](https://github.com/amazon-connect/amazon-connect-streams/blob/master/Documentation.md) for more information on the methods not documented here.++**Note:** `AgentChatSession` and `CustomerChatSession` are logical concepts.+As a result, the `instanceof` operator will not work how you expect:+```js+if (connect.ChatSession.create(/* ... */) instanceof connect.ChatSession) {+  // this will never execute+} ```-args = {-    "chatDetails": chatDetails, //required: *yes*-    "type": sessionType,//required: *yes*. Two types of sessionType: -                        //connect.ChatSession.SessionTypes.CUSTOMER -                        //connect.ChatSession.SessionTypes.AGENT-    "options": options, //required: no. See below for example-    "websocketManager": WebSocketManager //required: no, only for AGENT type chat sessions. This comes from Streams -}; -//This is the object returned by a successful call to the StartChatContact API.-//From the agent-side, these fields should all be available via Streams.-chatDetails = {-  "ContactId": "string", //required: *yes*. The alphanumeric string id identifying this contact.-  "ParticipantId": "string", //required: *yes*. The alphanumeric string id identifying this participant.-  "ParticipantToken": "string" //required: *yes*. The alphanumeric token that allows us to fetch our auth token for AWS SDK Chat API calls+### `connect.ChatSession.LogLevel`+```js+connect.ChatSession.LogLevel = {+  DEBUG: /* ... */,+  INFO: /* ... */,+  WARN: /* ... */,+  ERROR: /* ... */ };- -options = {-    region: "string" //required: no. Represents the region (like "us-west-2", "eu-central-1", etc) for the AWS SDK client to use. +```++Enumerates the logging levels.++### `connect.ChatSession.SessionTypes`+```js+connect.ChatSession.SessionTypes = {+  AGENT: /* ... */,+  CUSTOMER: /* ... */ };+```++Enumerates the session types. +## ChatSession API++The `ChatSession` API divided into three sections: Amazon Connect Participant Service API wrappers, events, and other.++### Amazon Connect Participant Service API wrappers++Functions in this section:+- Wrap the APIs of the [Amazon Connect Participant Service](https://docs.aws.amazon.com/connect-participant/latest/APIReference/Welcome.html).+- Return a `Promise<Response>` (except for `chatSession.connect()`), where:+  - `Response` is an [`aws-sdk` Response object](https://github.com/aws/aws-sdk-js/blob/master/lib/response.d.ts).+  - If the `Promise` rejects, the error will still be a `Response` object. However, the `data` field will not be populated while the `error `field will.+- Can optionally specify a `metadata` arg field (except for `customerChatSession.disconnectParticipant()`). The `metadata` arg field is not used directly by `amazon-connect-chatjs`, rather it's merely copied to the response object for usage by developers.++For example:+```js+function handleResponse(response) {+  // `response` is an aws-sdk `Response` object+  // `data` contains the response data+  // `metadata` === "foo"+  const { data, metadata } = response;+  // ...+}++function handleError(response) {+  // `response` is an aws-sdk `Response` object+  // `error` contains the response error+  // `metadata` === "foo"+  const { error, metadata } = response;+  // ...+}++chatSession+  .getTranscript({ metadata: "foo" })+  .then(handleResponse, handleError);+``` -var chatSession = connect.ChatSession.create(args);+#### `chatSession.connect()`+```js+// connectCalled: indicates whether the Amazon Connect Participant Service was called+// connectSuccess: indicates whether the operation succeeded+const { connectCalled, connectSuccess } = await chatSession.connect(); ``` -Use the chatSession object to subscribe to the following callbacks. Example - The onMessage callback is used to handle any messages sent from one of the participants or the chat service.+Wraps the [CreateParticipantConnection](https://docs.aws.amazon.com/connect-participant/latest/APIReference/API_CreateParticipantConnection.html) API. +The arguments and response do not overlap with the API request or response.++**Note:** If the operation fails, the `Promise` will reject, but the error will have the same schema as a successful response.++#### `chatSession.getTranscript()`+```js+const awsSdkResponse = await chatSession.getTranscript({+  maxResults: 100,+  sortOrder: "ASCENDING"+});+const { InitialContactId, NextToken, Transcript } = awsSdkResponse.data; ```-chatSession.onConnectionBroken(data => {console.log("connection broken with server")});-chatSession.onTyping(data => {console.log("someone is typing! details:", data)});-chatSession.onMessage(data => {console.log("there  is message! details:", data)});-chatSession.onConnectionEstablished(data => {console.log("connection established with server")});-chatSession.onEnded(() => {console.log("chat has ended")})++Wraps the [GetTranscript](https://docs.aws.amazon.com/connect-participant/latest/APIReference/API_GetTranscript.html) API.++The arguments are based on the [API request body](https://docs.aws.amazon.com/connect-participant/latest/APIReference/API_GetTranscript.html#API_GetTranscript_RequestSyntax) with the following differences:++- Fields are in `camelCase`.+- `MaxResults` defaults to `15`.+- `ScanDirection` defaults to `BACKWARD` always.+- `SortOrder` defaults to `ASCENDING`.++The response `data` is the same as the [API response body](https://docs.aws.amazon.com/connect-participant/latest/APIReference/API_GetTranscript.html#API_GetTranscript_ResponseSyntax).++#### `chatSession.sendEvent()`+```js+const awsSdkResponse = await chatSession.sendEvent({+  contentType: "application/vnd.amazonaws.connect.event.typing"+});+const { AbsoluteTime, Id } = awsSdkResponse.data; ```-# Usage: -### `connect.ChatSession.connect`-`Method param:` args+Wraps the [SendEvent](https://docs.aws.amazon.com/connect-participant/latest/APIReference/API_SendEvent.html) API.++The arguments are based on the [API request body](https://docs.aws.amazon.com/connect-participant/latest/APIReference/API_SendEvent.html#API_SendEvent_RequestSyntax) with the following differences:++- Fields are in `camelCase`.+- `ClientToken` cannot be specified.+- `ContentType` allows the following values:+  - `"application/vnd.amazonaws.connect.event.chat.ended"`+  - `"application/vnd.amazonaws.connect.event.participant.joined"`+  - `"application/vnd.amazonaws.connect.event.participant.left"`+  - `"application/vnd.amazonaws.connect.event.transfer.succeeded"`

The previous documentation incorrectly referred to this event as application/vnd.amazonaws.connect.event.transfer.succeed (notice succeeded vs succeed).

marcogrcr

comment created time in a month

push eventmarcogrcr/amazon-connect-chatjs

Marco Gonzalez

commit sha c8c5e647199b943a9a6e5a1aa9a8dd97e44fbb6d

TypeScript support. WHAT? - Added `src/index.d.ts` typings for usage with TypeScript. - Reworded the API documentation to make it more clearer. WHY? Add TypeScript compatibility. I faced several issues trying to use `amazon-connect-chatjs` due to unclear documentation. I have reworded the API documentation to make it clearer for customers.

view details

push time in a month

push eventmarcogrcr/amazon-connect-chatjs

Marco Gonzalez

commit sha c9cec0bbb8147f30aa32361c91dc3856b4d6c976

TypeScript support. WHAT? - Added `src/index.d.ts` typings for usage with TypeScript. - Reworded the API documentation to make it more clearer. WHY? Add TypeScript compatibility. I faced several issues trying to use `amazon-connect-chatjs` due to unclear documentation. I have reworded the API documentation to make it clearer for customers.

view details

push time in a month

push eventmarcogrcr/amazon-connect-chatjs

Marco Gonzalez

commit sha 775eee2e289fe789d796ce70f04c396e7ab57aad

TypeScript support. WHAT? - Added `src/index.d.ts` typings for usage with TypeScript. - Reworded the API documentation to make it more clearer. WHY? Add TypeScript compatibility. I faced several issues trying to use `amazon-connect-chatjs` due to unclear documentation. I have reworded the API documentation to make it clearer for customers.

view details

push time in a month

push eventmarcogrcr/amazon-connect-chatjs

Marco Gonzalez

commit sha 794462c504bc715cacf29994d7e0146d059d7595

TypeScript support. WHAT? - Added `src/index.d.ts` typings for usage with TypeScript. - Reworded the API documentation to make it more clearer. WHY? Add TypeScript compatibility. I faced several issues trying to use `amazon-connect-chatjs` due to unclear documentation. I have reworded the API documentation to make it clearer for customers.

view details

push time in a month

push eventmarcogrcr/amazon-connect-chatjs

Marco Gonzalez

commit sha 0d7399fd6f67ce404c32eebb3dbe6a234607a15a

TypeScript support. WHAT? - Added `src/index.d.ts` typings for usage with TypeScript. - Reworded the API documentation to make it more clearer. WHY? Add TypeScript compatibility. I faced several issues trying to use `amazon-connect-chatjs` due to unclear documentation. I have reworded the API documentation to make it clearer for customers.

view details

push time in a month

PR opened amazon-connect/amazon-connect-streams

Document connect.core.getWebSocketManager()

Issue #, if available: (none)

Description of changes:

Note: The documentation changes assume that pull request #22 from amazon-connect-chatjs will be merged.

WHAT?

Document and add the typings for connect.core.getWebSocketManager().

WHY?

This method is required for creating an amazon-connect-chatjs's AgentChatSession object.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

+19 -1

0 comment

2 changed files

pr created time in a month

push eventmarcogrcr/amazon-connect-streams

Marco Gonzalez

commit sha fd73f9cca94b8866a8ee094c69afd0e458596d00

Fix incorrect attributes typing (#256) WHAT? The type of the `Contact.getAttributes()` method was incorrectly typed as `{ [key: string]: string }` when it should've been `{ [key: string]: { name: string; value: string } }`. Added fixes recommended by `dtslint`. Removed duplicated code in `core.js`. WHY? Without this change, TypeScript users will get the wrong type when they work with contact attributes in TypeScript, resulting in unexpected errors. Have the best practices of typings definitions. Have a smaller file size.

view details

Jeong Won Lee

commit sha 0ca0a2b40bb7cb669f15545437347fb1280be2c9

send iframe styling information to the embedded ccp **Motivation**: tracking custom ccp usage **Testing**: local embedded ccp

view details

Jeong Won Lee

commit sha 20341a641826e37f48ca8f8fdec7c8b7c27297b4

add iframe_style event **Motivation**: for custom ccp usage tracking **Testing**: local embedded ccp

view details

ctwomblyamzn

commit sha 996705f168c02c61693ef9b012a632231f056a8c

Merge from internal 5/29/2020 (#257) * merge from internal 5/29/2020

view details

Marco Gonzalez

commit sha c5d271fe221f8e7d6f70e8fa85db2423e17b2120

Document connect.core.getWebSocketManager() WHAT? Document and add the typings for `connect.core.getWebSocketManager()`. WHY? This method is required for creating an `amazon-connect-chatjs`'s `AgentChatSession` object.

view details

push time in a month

PR opened amazon-connect/amazon-connect-chatjs

TypeScript support.

WHAT?

  • Added src/index.d.ts typings for usage with TypeScript.
  • Reworded the API documentation to make it more clearer.

WHY?

Add TypeScript compatibility.

I faced several issues trying to use amazon-connect-chatjs due to unclear documentation. I have reworded the API documentation to make it clearer for customers.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

+887 -112

0 comment

5 changed files

pr created time in a month

push eventmarcogrcr/amazon-connect-chatjs

Marco Gonzalez

commit sha 977d0c2d31e3ca89adc423ec239c272c5f8d51ea

TypeScript support. WHAT? - Added `src/index.d.ts` typings for usage with TypeScript. - Reworded the API documentation to make it more clearer. WHY? Add TypeScript compatibility. I faced several issues trying to use `amazon-connect-chatjs` due to unclear documentation. I have reworded the API documentation to make it clearer for customers.

view details

push time in a month

push eventmarcogrcr/amazon-connect-chatjs

Marco Antonio Gonzalez Roesch

commit sha 374435c1dacea6230319cfd2f32d57f71d99610e

TypeScript support. WHAT? - Added `src/index.d.ts` typings for usage with TypeScript. - Reworded the API documentation to make it more clearer. WHY? Add TypeScript compatibility. I faced several issues trying to use `amazon-connect-chatjs` due to unclear documentation. I have reworded the API documentation to make it clearer for customers.

view details

push time in a month

fork marcogrcr/amazon-connect-chatjs

Amazon Connect Chat JS - a browser-based contact center integration API for Chat on the Agent and Customer side.

https://docs.aws.amazon.com/connect/latest/adminguide/what-is-amazon-connect.html

fork in a month

issue commentamazon-connect/amazon-connect-chatjs

Docs to built custom UI for agent chat?

@VaibhavKakadeHS: Gotcha, I missed the agent portion of your question. For the agent, you'll probably want to use chatConnection.getMediaController(). That being said, there are some caveats with that API. See amazon-connect-streams' #261 for more info.

VaibhavKakadeHS

comment created time in a month

issue openedamazon-connect/amazon-connect-streams

How to properly integrate with amazon-connect-chatjs

According to the documentation, in order to use the chat functionality, you'll need to include amazon-connect-chatjs. So far, here's how my code looks:

created time in a month

issue commentamazon-connect/amazon-connect-chatjs

Docs to built custom UI for agent chat?

@VaibhavKakadeHS:

You will need to invoke the StartChatContact API. Note that this operation is protected with SigV4. Here's two ideas of of how invoke it:

  1. Preferred: Create your own API (e.g. API Gateway + Lambda) that calls this API and returns the ParticipantId and ParticipantToken values.
  2. Use Cognito and aws-sdk's (Connect.startChatContact() + CognitoIdentityCredentials) to create the chat contact.

Here's an official example of option 1: amazon-connect/amazon-connect-chat-ui-examples/cloudformationTemplates/startChatContactAPI

VaibhavKakadeHS

comment created time in a month

issue commentamazon-connect/amazon-connect-chatjs

Using amazon-connect-chat.js in a React compoent

Note that amazon-connect-chatjs has been released to npm. The following minimal config works for me:

index.jsx:

import "amazon-connect-chatjs";
import React, { Fragment } from "react";
import { render } from "react-dom";

function App() {
  const isLoaded = window.connect && window.connect.ChatSession;

  return (
    <Fragment>
      <h1>react-amazon-connect-chatjs</h1>
      {isLoaded ? "loaded!" : "failed"}
    </Fragment>
  );
}

render(<App />, document.getElementById("app"));

index.html:

<!DOCTYPE html>
<html>
  <head>
    <title>react-amazon-connect-chatjs</title>
  </head>
  <body>
    <div id="app"></div>
  </body>
</html>

webpack.config.js:

const HtmlWebpackPlugin = require("html-webpack-plugin");

module.exports = {
  entry: "./index.jsx",
  devServer: {
    https: true
  },
  module: {
    rules: [
      { test: /\.jsx?$/, use: "babel-loader" }
    ],
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: "./index.html",
    }),
  ]
};

.babelrc:

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "useBuiltIns": "usage",
        "corejs": { "version": 3 }
      }
    ],
    "@babel/preset-react"
  ]
}

package.json:

{
  "name": "amazon-connect-chatjs-react-demo",
  "version": "1.0.0",
  "scripts": {
    "start": "webpack-dev-server -w"
  },
  "dependencies": {
    "amazon-connect-chatjs": "1.0.6",
    "react": "16.13.1",
    "react-dom": "16.13.1"
  },
  "devDependencies": {
    "@babel/core": "7.10.2",
    "@babel/preset-env": "7.10.2",
    "@babel/preset-react": "7.10.1",
    "babel-loader": "8.1.0",
    "core-js": "3.6.5",
    "html-webpack-plugin": "4.3.0",
    "regenerator-runtime": "0.13.5",
    "webpack": "4.43.0",
    "webpack-cli": "3.3.11",
    "webpack-dev-server": "3.11.0"
  }
}

I believe this can be closed.

indyfromoz

comment created time in a month

issue openedamazon-connect/amazon-connect-chatjs

chatSession.getTranscript fails when scanDirection === "FORWARD"

According to chatSession.getTranscript's documentation, this is a valid request:

await chatSession.getTranscript({
  scanDirection: "FORWARD"
});

However, I get the following error:

{
  type: "ValidationException",
  message: "Validation exception due to invalid parameter",
  stack: /* ... */,
  metadata: null
}

When I check the network request, here's what I see (headers omitted for simplification):

Request:

POST /participant/transcript HTTP/1.1
host: participant.connect.us-east-1.amazonaws.com
content-type: application/json

{
  "MaxResults": 15,
  "ScanDirection": "FORWARD",
  "SortOrder": "ASCENDING",
  "StartPosition": {}
}

Response:

HTTP/1.1 400
content-type: application/json

{
  "message": "Validation exception due to invalid parameter"
}

Environment:

  • amazon-connect-chatjs: 1.0.6

created time in a month

issue commentwwayne/react-tooltip

Jest snapshots different classnames

This first started to occur with version 4.0.5 (see #562). The proposed solution was to add uuid as a dependency and have developers mock the module (see #566):

jest.mock("uuid", () => ({ v4: () => "00000000-0000-0000-0000-000000000000" }));

Initially uuid was bundled to dist/index.js by rollup so uuid could not be mocked. That got fixed with #582.

The current implementation has certain limitations. For example, if your package (or a dependency) depends on a non-compatible uuid version (as of react-tooltip@4.2.6 its ^7.0.3), uuid will be installed in node_modules/react-tooltip/node_modules/uuid. This requires to change the mocking to:

jest.mock("react-tooltip/node_modules/uuid", () => ({ v4: () => "00000000-0000-0000-0000-000000000000" }));

This could be fixed by making uuid a peerDependency. However that would result in a breaking change, since consumers with no dependency to uuid will get a Cannot find module 'uuid' error message. Instructions for installation would need to be updated as well.

Another alternative that does not depend on uuid's location is to mock crypto's randomBytes function like so:

jest.mock('crypto', () => ({ randomBytes: (num) => new Array(num).fill(0) }));

However, this approach can potentially break other testing that depend on the core crypto module.

As you can see, no solution is without its hiccups, and besides, none of these approaches are officially documented. I believe a more robust approach would be to expose a static method or property that could be executed so that generated uuids are static. For example:

// jest setup file
import ReactTooltip from "react-tooltip";

// alt names: .enableSnapshotMode(), .enableTestMode(), .testMode(), .snapshotMode()
ReactTooltip.useStaticUuids();
Ziker22

comment created time in a month

pull request commentDefinitelyTyped/DefinitelyTyped

fix(amazon-connect-streams) Sync types with official repo

Version 1.4.7 does not contain a types/typings entry in package.json so the types are not reachable. Additionally, the types contained in that package version were stale and do not represent the public API of version 1.4.7. Two pull requests (#243 and #256) updated the typings and configured the types field to fix these problems.

I created this pull request before 1.4.8 was released. So I guess the ideal solution IMHO would be:

  • Publish @types/amazon-connect-streams version 1.4.7.
  • Deprecate @types/amazon-connect-streams version 1.4.8.

Is it possible to publish both this change and the deprecation for 1.4.8+ in notNeededPackages.json with the same pull request?

marcogrcr

comment created time in a month

push eventmarcogrcr/DefinitelyTyped

Marco Gonzalez

commit sha 378020afdd662d8a40e9d566d34e181d12bf09e7

fix(amazon-connect-streams) Sync types with official repo Sync the typings here with the official types for version `1.4.7`. Starting with version `1.4.8`+, `@types/amazon-connect-streams` should be deprecated in favor of using the official typings. A note on the removal of `connect.core.initialized`: See https://github.com/amazon-connect/amazon-connect-streams/pull/256 BREAKING CHANGE: In order to match the typings with the official repo, some types may change names, resulting in compilation errors for users of previous versions.

view details

push time in a month

PR opened DefinitelyTyped/DefinitelyTyped

fix(amazon-connect-streams) Sync types with official repo

Sync the typings here with the official types for version 1.4.7. Starting with version 1.4.8+, @types/amazon-connect-streams should be deprecated in favor of using the official typings.

A note on the removal of connect.core.initialized: See https://github.com/amazon-connect/amazon-connect-streams/pull/256

BREAKING CHANGE: In order to match the typings with the official repo, some types may change names, resulting in compilation errors for users of previous versions.

Please fill in this template.

  • [x] Use a meaningful title for the pull request. Include the name of the package modified.
  • [x] Test the change in your own code. (Compile and run.)
  • [x] Add or edit tests to reflect the change. (Run with npm test.)
  • [x] Follow the advice from the readme.
  • [x] Avoid common mistakes.
  • [x] Run npm run lint package-name (or tsc if no tslint.json is present).

Select one of these and delete the others:

If changing an existing definition:

  • [x] Provide a URL to documentation or source code which provides context for the suggested changes: https://github.com/amazon-connect/amazon-connect-streams/blob/master/src/index.d.ts
  • [x] Include tests for your changes
  • [x] If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }. If for reason the any rule need to be disabled, disable it for that line using // tslint:disable-next-line [ruleName] and not for whole package so that the need for disabling can be reviewed.
+1519 -807

0 comment

3 changed files

pr created time in a month

push eventmarcogrcr/DefinitelyTyped

Hossein Hosni

commit sha 43022919d4a611a1cb2df1489dd5475242462f8b

Change FancytreeOptions.rtl type to boolean instead of false (#43725)

view details

Katie Soldau

commit sha 384e1dc562526e9e1c1801ddd5004e256039a295

Add missing types for react-calendar 3.0 (#43721)

view details

Victor Magalhães

commit sha f00facd841139a8aada72d5b27f0d47b8e62f378

[@types/react] Add missing charSet attr to the link tag type (#43730) * [@types/react] Add charSet attr for the link tag * Add my name to the contributors 🙈

view details

Cledson

commit sha 5dbf929af412900aa8eebac92c00e004df5910d5

[mongoose] Added connection options related to auto encryption using CSFLE (#43723) * added new connection options related to the new feature csfle * added basic test case for auto-encryption in mongoose client connection

view details

Michael Gates

commit sha 07e5a5902abbde90a8be6a4da942713c2fff360e

[aes-js] Counter allows for either a number or a ByteSource (#43719) * Counter allows for either a number or a ByteSource * Add unit test

view details

aleksey-rezvov

commit sha f5a2f3836152a439c70bce387a32e8ebd6ceaaf6

Fix: client.sessions() now able to accept pool parameter, e.g. client.sessions({ name: "demodb", username: "admin", password: "admin", pool: { max: 10}). (#43720) Docs: http://orientdb.com/docs/3.1.x/orientjs/Client.html#sessions

view details

Robert Wettstädt

commit sha 82b2c751f74789e4206f8422e5a5e06abfa155ee

[iv-viewer] Add iv viewer (#43728) * [iv-viewer] Add iv-viewer * [iv-viewer] Add missing class fields types * [iv-viewer] Add default options

view details

Pine

commit sha 413ad7aabf44eda23f0dfb607f088bbc270ebb08

VS Code 1.44.0 Extension API (#43745) * VS Code 1.44.0 Extension API * Update tslint Co-authored-by: VSCode <vscode@microsoft.com>

view details

Ethan Veres

commit sha 5fcd9e130060e2486ce323b548f1bb56e4853478

yup: add snake case to ObjectSchema (#43708) * yup: add snake case * remove auto formatting

view details

Vitor Jordão

commit sha ab7d2485757d495bcea48fa5652b86eb19c3b836

Fix callback return (#43703)

view details

heroboy

commit sha 56201fdc2d6e9b211478b42feb22c78b4c4965ec

🤖 Merge PR #43691 react-bootstrap: add umd global export by @heroboy * react-bootstrap: add umd global export * Update index.d.ts

view details

Rohit Garg

commit sha 50037f1669a4947bae52bf97e87fa346d9770687

[react-table] Add role key in props & remove unused key (#43762) * Removing un-used key initialRowStateKey * Add `role` key as acceptable * name update

view details

Konstantin

commit sha 96e6b6886cbf3eccc01515f3a024cb214bb3d9e3

MobileMessagingCordova (#43763) * MobileMessagingCordova: add CustomEvents support * MobileMessagingCordova: fix lint * MobileMessagingCordova: change version * MobileMessaging: fix header Co-authored-by: Konstantin Latypov <Konstantin.Latypov@infobip.com>

view details

Matthew Morrissette

commit sha 36720ed4eb8ccb511df14881142eb7705f781645

Add "fhir-kit-client" missing functions (#43757)

view details

Piotr Błażejewicz (Peter Blazejewicz)

commit sha 056df1a738b098f0d214d7d13c80ff9024ad3688

fix(plotly.js): nested property attributes fix (#43747) This changes the shape of the PlotlyRelayoutEvent to use string based property access as per-discussion here: https://github.com/plotly/plotly.js/issues/1877 See: https://plotly.com/javascript/plotlyjs-events/ https://plotly.com/javascript/zoom-events/#binding-to-zoom-events /cc @mmakrzem Thanks! Fixes: #43735

view details

Alex Jerabek

commit sha 874e5e47a04ae2f3da5f5c69648d7a20e9f867c9

[office-js, office-js-preview] Add note to Binding.onSelectionChanged about multi-cell selection (#43741) * Removing prompt verbage from selection binding options * Add note to Binding.onSelectionChanged about multi-cell selection * Fixing grammar * Fixing grammar

view details

Steve

commit sha 03713294edea69fda1c7f143c812ecfad30a9843

Updated index.d.ts for akumina-core project (#43690) Co-authored-by: Steve Grant <steven.grant@akumina.com>

view details

JongChan Choi

commit sha 82f5b794c1086b1b75a394c32d8d0ca3d1565ac3

[react] Add tangentialPressure, twist to PointerEvent (#43589) - https://github.com/facebook/react/pull/13374 - https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent

view details

Aaron Beall

commit sha 325b3e9b795d90a4249eb5e93f31976dc6a35fb7

Added stub definitions for react-bootstrap v1.0 (#43756) * Added missing $filter overload Added missing $filter overload that allows multiple strings to translate and returns an object * Added v1 dir with stub * Updated def header * Added v1/tsconfig.json to make publisher happy * Added index.d.ts to files * Added paths per build failure * Moved paths to the right tsconfig * Fixed path mapping

view details

omjadas

commit sha 8f19d2dd2e22cbe79b5e5695e5564d3b1d5937fb

update throwException types (#43626)

view details

push time in a month

push eventmarcogrcr/amazon-connect-streams

Marco Gonzalez

commit sha 629c38f0b058ce13eb3957ffb37b47e35567cb1c

Fix incorrect attributes typing WHAT? The type of the `Contact.getAttributes()` method was incorrectly typed as `{ [key: string]: string }` when it should've been `{ [key: string]: { name: string; value: string } }`. Added fixes recommended by `dtslint`. Removed duplicated code in `core.js`. WHY? Without this change, TypeScript users will get the wrong type when they work with contact attributes in TypeScript, resulting in unexpected errors. Have the best practices of typings definitions. Have a smaller file size.

view details

push time in a month

Pull request review commentamazon-connect/amazon-connect-streams

Fix Contact.getAttributes() and add connect.core.initialized typings

 this:  ## `connect.core` +### `connect.core.initialized`+```js+if (connect.core.initialized) { /* ... */ }

Customers are using this internal field without knowing that it's not what they think it is, and that it should not be used. I am fine with removing it from TypeScript to discourage its usage though.

That being said, I still see value in putting a warning against its usage, so customers don't walk into a trap if they use it. How about removing the documentation but putting the following at the end of the ## connect.core section:

Note about connect.core.initialized: This field is internally used by amazon-connect-streams and it's not part of the public API. Customers are discouraged to use it to determine whether the CCP has been initialized since it represents a different internal state. As an alternative, consider using connect.agent().

marcogrcr

comment created time in a month

Pull request review commentamazon-connect/amazon-connect-streams

Fix Contact.getAttributes() and add connect.core.initialized typings

 this:  ## `connect.core` +### `connect.core.initialized`+```js+if (connect.core.initialized) { /* ... */ }+```+Indicates whether the CCP has been initialized.

Make sense, since customers are still using it, I believe it should be documented to warn against its usage. I have update the commit with the following documentation:

Indicates whether amazon-connect-streams communicated successfully with the CCP. Important: This does not mean that the CCP has been fully initialized, and it's mostly used internally by amazon-connect-streams. It's not recommended that you use this field to detect whether the CCP has been initialized. As an alternative, consider using connect.agent().

marcogrcr

comment created time in a month

push eventmarcogrcr/amazon-connect-streams

Marco Gonzalez

commit sha 47d14daa148037f94a20a175621d1ad508f15c6e

Documented connect.core.initialized WHAT? Documented the useful property `connect.core.initialized` that library consumers use to determine whether the CCP has been initialized. Also removed some duplicated code in `core.js`. WHY? This property is used by customers (see [here](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/ea06812e397cdb50afee85e2f3b0861e42648170/types/amazon-connect-streams/index.d.ts#L69)). I believe it should be documented as a public property.

view details

Marco Gonzalez

commit sha ac72ed1b9cecd5090ef30d2fdea0ddb7bf1a9bed

Apply dstlint fixes WHAT? Applied the fixes suggested by `dtslint` while trying to contribute the typings to [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped). WHY? Follow the best practices of typings suggested by `DefinitelyTyped`.

view details

push time in a month

push eventmarcogrcr/amazon-connect-streams

Marco Gonzalez

commit sha 1741530c67f53c02aa2f28d5360d02b13b0932d3

Apply dstlint fixes WHAT? Applied the fixes suggested by `dtslint` while trying to contribute the typings to [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped). WHY? Follow the best practices of typings suggested by `DefinitelyTyped`.

view details

push time in a month

push eventmarcogrcr/amazon-connect-streams

Marco Gonzalez

commit sha c837648fab323f2c53704708826a34e5fe6067a5

Apply dstlint fixes WHAT? Applied the fixes suggested by `dtslint` while trying to contribute the typings to [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped). WHY? Follow the best practices of typings suggested by `DefinitelyTyped`.

view details

push time in a month

Pull request review commentamazon-connect/amazon-connect-streams

Fix Contact.getAttributes() and add connect.core.initialized typings

   };   connect.core.popupManager = new connect.PopupManager(); -  /**-----------------------------------------------------------------------*/-  connect.core.getPopupManager = function () {-    return connect.core.popupManager;-  };-  connect.core.popupManager = new connect.PopupManager();

This is duplicated from lines 1018-1021.

marcogrcr

comment created time in a month

PR opened amazon-connect/amazon-connect-streams

Fix Contact.getAttributes() and add connect.core.initialized typings

Issue #, if available: (none)

Description of changes:

  • Fixed an incorrect typing for Contact.getAttributes(). Updated documentation to make it clearer.
  • Documented and added typings for connect.core.initialized given that it's a field widely used by customers (it has even been added to the @types/amazon-connect-streams) package.
  • Removed some duplicated code in agent.js.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

+18 -12

0 comment

4 changed files

pr created time in a month

push eventmarcogrcr/amazon-connect-streams

Marco Gonzalez

commit sha b2c0c046acff897a6a177f09d635693513327868

Normalized `getState()` / `getStatus()` methods (#248) Addressed #37 and #86 by ensuring all three `Agent`, `Contact`, and `BaseConnection` have the following methods: - `getState()` - `getStateDuration()` - `getStatus()` - `getStatusDuration()` It seems that some inconsistencies in the documentation initially caused this confusion for customers. Given that `Agent` had already aliased the methods, aliasing the methods for the other two APIs seemed appropriate.

view details

Marco Gonzalez

commit sha 12cfd5954455328ef027abb2c72e620d893e85c3

Fix incorrect attributes typing WHAT? The type of the `Contact.getAttributes()` method was incorrectly typed as `{ [key: string]: string }` when it should've been `{ [key: string]: { name: string; value: string } }`. WHY? Without this change, TypeScript users will get the wrong type when they work with contact attributes in TypeScript, resulting in unexpected errors.

view details

Marco Gonzalez

commit sha 7efe1b1a21a96b94ac8add0f94721ce6281b6afc

Documented connect.core.initialized WHAT? Documented the useful property `connect.core.initialized` that library consumers use to determine whether the CCP has been initialized. Also removed some duplicated code in `core.js`. WHY? This property is used by customers (see [here](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/ea06812e397cdb50afee85e2f3b0861e42648170/types/amazon-connect-streams/index.d.ts#L69)). I believe it should be documented as a public property.

view details

push time in a month

pull request commentmhart/aws4fetch

Improve TypeScript definition

I'm happy to adjust my pull request to include the missing:

  • Declaration testing with dtslint for ensuring compatibility and non-breaking changes.
  • jsdoc.

Let me know if you see value in that.

marcogrcr

comment created time in 2 months

Pull request review commentmhart/aws4fetch

Improve TypeScript definition

+import { AwsClient, AwsRequestInit, AwsV4Signer } from "aws4fetch";++function AwsClientTest() {+  function constructor() {+    // $ExpectError+    new AwsClient({});++    const min = new AwsClient({+      accessKeyId: "value",+      secretAccessKey: "value",+    });++    const all = new AwsClient({+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      service: "value",+      region: "value",+      cache: new Map(),+      retries: 1,+      initRetryMs: 1,+    });+  }++  function fetch(client: AwsClient, init: AwsRequestInit) {+    // $ExpectError+    client.fetch();++    // $ExpectType Promise<Response>+    client.fetch("value");+    client.fetch("value", {});+    client.fetch("value", { aws: {} });+    client.fetch("value", init);+    client.fetch(new Request("value"));+    client.fetch(new Request("value"), {});+    client.fetch(new Request("value"), { aws: {} });+    client.fetch(new Request("value"), init);+  }++  function sign(client: AwsClient, init: AwsRequestInit) {+    // $ExpectError+    client.sign();++    // $ExpectType Promise<Request>+    client.sign("value");+    client.sign("value", {});+    client.sign("value", { aws: {} });+    client.sign("value", init);+    client.sign(new Request("value"));+    client.sign(new Request("value"), {});+    client.sign(new Request("value"), { aws: {} });+    client.sign(new Request("value"), init);+  }+}++function AwsRequestInitTest() {+  const min: AwsRequestInit = {};++  const all: AwsRequestInit = {+    method: "value",+    headers: {},+    body: "value",+    aws: {+      signQuery: true,+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      service: "value",+      region: "value",+      cache: new Map(),+      datetime: "value",+      appendSessionToken: true,+      allHeaders: true,+      singleEncode: true,+    },+    cache: "default",+    credentials: "same-origin",+    integrity: "value",+    keepalive: true,+    mode: "cors",+    redirect: "follow",+    referrer: "value",+    referrerPolicy: "same-origin",+    signal: new AbortSignal(),+    window: null,+  };+}++function AwsV4SignerTest() {+  function constructor() {+    // $ExpectError+    new AwsV4Signer();++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      retries: 1, // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      initRetryMs: 1, // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new Blob(), // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new FormData(), // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new URLSearchParams(), // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new ReadableStream(), // $ExpectError+    });++    const min = new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+    });++    const all = new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      method: "value",+      headers: {},+      body: "value",+      signQuery: true,+      service: "value",+      region: "value",+      cache: new Map(),+      datetime: "value",+      appendSessionToken: true,+      allHeaders: true,+      singleEncode: true,+    });+  }++  function authHeader(signer: AwsV4Signer) {+    // $ExpectType Promise<string>+    signer.authHeader();+  }++  function sign() {+    // $ExpectType Promise<AwsRequestInfo<undefined>>+    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+    }).sign();++    // $ExpectType Promise<AwsRequestInfo<"value">>+    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: "value",+    }).sign();++    // $ExpectType Promise<AwsRequestInfo<ArrayBuffer>>+    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new ArrayBuffer(1),+    }).sign();++    // $ExpectType Promise<AwsRequestInfo<Uint8Array>>+    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new Uint8Array(),+    }).sign();+  }++  function signature(signer: AwsV4Signer) {+    // $ExpectType Promise<string>+    signer.signature();

Previous types don't allow this method to be called.

marcogrcr

comment created time in 2 months

Pull request review commentmhart/aws4fetch

Improve TypeScript definition

+import { AwsClient, AwsRequestInit, AwsV4Signer } from "aws4fetch";++function AwsClientTest() {+  function constructor() {+    // $ExpectError+    new AwsClient({});++    const min = new AwsClient({+      accessKeyId: "value",+      secretAccessKey: "value",+    });++    const all = new AwsClient({+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      service: "value",+      region: "value",+      cache: new Map(),+      retries: 1,+      initRetryMs: 1,+    });+  }++  function fetch(client: AwsClient, init: AwsRequestInit) {+    // $ExpectError+    client.fetch();++    // $ExpectType Promise<Response>+    client.fetch("value");+    client.fetch("value", {});+    client.fetch("value", { aws: {} });+    client.fetch("value", init);+    client.fetch(new Request("value"));+    client.fetch(new Request("value"), {});+    client.fetch(new Request("value"), { aws: {} });+    client.fetch(new Request("value"), init);+  }++  function sign(client: AwsClient, init: AwsRequestInit) {+    // $ExpectError+    client.sign();++    // $ExpectType Promise<Request>+    client.sign("value");+    client.sign("value", {});+    client.sign("value", { aws: {} });+    client.sign("value", init);+    client.sign(new Request("value"));+    client.sign(new Request("value"), {});+    client.sign(new Request("value"), { aws: {} });+    client.sign(new Request("value"), init);+  }+}++function AwsRequestInitTest() {+  const min: AwsRequestInit = {};++  const all: AwsRequestInit = {+    method: "value",+    headers: {},+    body: "value",+    aws: {+      signQuery: true,+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      service: "value",+      region: "value",+      cache: new Map(),+      datetime: "value",+      appendSessionToken: true,+      allHeaders: true,+      singleEncode: true,+    },+    cache: "default",+    credentials: "same-origin",+    integrity: "value",+    keepalive: true,+    mode: "cors",+    redirect: "follow",+    referrer: "value",+    referrerPolicy: "same-origin",+    signal: new AbortSignal(),+    window: null,+  };+}++function AwsV4SignerTest() {+  function constructor() {+    // $ExpectError+    new AwsV4Signer();++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      retries: 1, // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      initRetryMs: 1, // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new Blob(), // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new FormData(), // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new URLSearchParams(), // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new ReadableStream(), // $ExpectError+    });++    const min = new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+    });++    const all = new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      method: "value",+      headers: {},+      body: "value",+      signQuery: true,+      service: "value",+      region: "value",+      cache: new Map(),+      datetime: "value",+      appendSessionToken: true,+      allHeaders: true,+      singleEncode: true,+    });+  }++  function authHeader(signer: AwsV4Signer) {+    // $ExpectType Promise<string>+    signer.authHeader();+  }++  function sign() {+    // $ExpectType Promise<AwsRequestInfo<undefined>>+    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+    }).sign();++    // $ExpectType Promise<AwsRequestInfo<"value">>+    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: "value",+    }).sign();++    // $ExpectType Promise<AwsRequestInfo<ArrayBuffer>>+    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new ArrayBuffer(1),+    }).sign();++    // $ExpectType Promise<AwsRequestInfo<Uint8Array>>+    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new Uint8Array(),+    }).sign();

Previous types don't provide generics support for getting a properly types body.

marcogrcr

comment created time in 2 months

Pull request review commentmhart/aws4fetch

Improve TypeScript definition

+import { AwsClient, AwsRequestInit, AwsV4Signer } from "aws4fetch";++function AwsClientTest() {+  function constructor() {+    // $ExpectError+    new AwsClient({});++    const min = new AwsClient({+      accessKeyId: "value",+      secretAccessKey: "value",+    });++    const all = new AwsClient({+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      service: "value",+      region: "value",+      cache: new Map(),+      retries: 1,+      initRetryMs: 1,+    });+  }++  function fetch(client: AwsClient, init: AwsRequestInit) {+    // $ExpectError+    client.fetch();++    // $ExpectType Promise<Response>+    client.fetch("value");+    client.fetch("value", {});+    client.fetch("value", { aws: {} });+    client.fetch("value", init);+    client.fetch(new Request("value"));+    client.fetch(new Request("value"), {});+    client.fetch(new Request("value"), { aws: {} });+    client.fetch(new Request("value"), init);+  }++  function sign(client: AwsClient, init: AwsRequestInit) {+    // $ExpectError+    client.sign();++    // $ExpectType Promise<Request>+    client.sign("value");+    client.sign("value", {});+    client.sign("value", { aws: {} });+    client.sign("value", init);+    client.sign(new Request("value"));+    client.sign(new Request("value"), {});+    client.sign(new Request("value"), { aws: {} });+    client.sign(new Request("value"), init);+  }+}++function AwsRequestInitTest() {+  const min: AwsRequestInit = {};++  const all: AwsRequestInit = {+    method: "value",+    headers: {},+    body: "value",+    aws: {+      signQuery: true,+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      service: "value",+      region: "value",+      cache: new Map(),+      datetime: "value",+      appendSessionToken: true,+      allHeaders: true,+      singleEncode: true,+    },+    cache: "default",+    credentials: "same-origin",+    integrity: "value",+    keepalive: true,+    mode: "cors",+    redirect: "follow",+    referrer: "value",+    referrerPolicy: "same-origin",+    signal: new AbortSignal(),+    window: null,+  };+}++function AwsV4SignerTest() {+  function constructor() {+    // $ExpectError+    new AwsV4Signer();++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      retries: 1, // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      initRetryMs: 1, // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new Blob(), // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new FormData(), // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new URLSearchParams(), // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new ReadableStream(), // $ExpectError+    });++    const min = new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+    });++    const all = new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      method: "value",+      headers: {},+      body: "value",+      signQuery: true,+      service: "value",+      region: "value",+      cache: new Map(),+      datetime: "value",+      appendSessionToken: true,+      allHeaders: true,+      singleEncode: true,+    });+  }++  function authHeader(signer: AwsV4Signer) {+    // $ExpectType Promise<string>+    signer.authHeader();

Previous types don't allow this method to be called.

marcogrcr

comment created time in 2 months

Pull request review commentmhart/aws4fetch

Improve TypeScript definition

+import { AwsClient, AwsRequestInit, AwsV4Signer } from "aws4fetch";++function AwsClientTest() {+  function constructor() {+    // $ExpectError+    new AwsClient({});++    const min = new AwsClient({+      accessKeyId: "value",+      secretAccessKey: "value",+    });++    const all = new AwsClient({+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      service: "value",+      region: "value",+      cache: new Map(),+      retries: 1,+      initRetryMs: 1,+    });+  }++  function fetch(client: AwsClient, init: AwsRequestInit) {+    // $ExpectError+    client.fetch();++    // $ExpectType Promise<Response>+    client.fetch("value");+    client.fetch("value", {});+    client.fetch("value", { aws: {} });+    client.fetch("value", init);+    client.fetch(new Request("value"));+    client.fetch(new Request("value"), {});+    client.fetch(new Request("value"), { aws: {} });+    client.fetch(new Request("value"), init);+  }++  function sign(client: AwsClient, init: AwsRequestInit) {+    // $ExpectError+    client.sign();++    // $ExpectType Promise<Request>+    client.sign("value");+    client.sign("value", {});+    client.sign("value", { aws: {} });+    client.sign("value", init);+    client.sign(new Request("value"));+    client.sign(new Request("value"), {});+    client.sign(new Request("value"), { aws: {} });+    client.sign(new Request("value"), init);+  }+}++function AwsRequestInitTest() {+  const min: AwsRequestInit = {};++  const all: AwsRequestInit = {+    method: "value",+    headers: {},+    body: "value",+    aws: {+      signQuery: true,+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      service: "value",+      region: "value",+      cache: new Map(),+      datetime: "value",+      appendSessionToken: true,+      allHeaders: true,+      singleEncode: true,+    },+    cache: "default",+    credentials: "same-origin",+    integrity: "value",+    keepalive: true,+    mode: "cors",+    redirect: "follow",+    referrer: "value",+    referrerPolicy: "same-origin",+    signal: new AbortSignal(),+    window: null,+  };+}++function AwsV4SignerTest() {+  function constructor() {+    // $ExpectError+    new AwsV4Signer();++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      retries: 1, // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      initRetryMs: 1, // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new Blob(), // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new FormData(), // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new URLSearchParams(), // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new ReadableStream(), // $ExpectError

Previous types fail this test.

marcogrcr

comment created time in 2 months

Pull request review commentmhart/aws4fetch

Improve TypeScript definition

+import { AwsClient, AwsRequestInit, AwsV4Signer } from "aws4fetch";++function AwsClientTest() {+  function constructor() {+    // $ExpectError+    new AwsClient({});++    const min = new AwsClient({+      accessKeyId: "value",+      secretAccessKey: "value",+    });++    const all = new AwsClient({+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      service: "value",+      region: "value",+      cache: new Map(),+      retries: 1,+      initRetryMs: 1,+    });+  }++  function fetch(client: AwsClient, init: AwsRequestInit) {+    // $ExpectError+    client.fetch();++    // $ExpectType Promise<Response>+    client.fetch("value");+    client.fetch("value", {});+    client.fetch("value", { aws: {} });+    client.fetch("value", init);+    client.fetch(new Request("value"));+    client.fetch(new Request("value"), {});+    client.fetch(new Request("value"), { aws: {} });+    client.fetch(new Request("value"), init);+  }++  function sign(client: AwsClient, init: AwsRequestInit) {+    // $ExpectError+    client.sign();++    // $ExpectType Promise<Request>+    client.sign("value");+    client.sign("value", {});+    client.sign("value", { aws: {} });+    client.sign("value", init);+    client.sign(new Request("value"));+    client.sign(new Request("value"), {});+    client.sign(new Request("value"), { aws: {} });+    client.sign(new Request("value"), init);+  }+}++function AwsRequestInitTest() {+  const min: AwsRequestInit = {};++  const all: AwsRequestInit = {+    method: "value",+    headers: {},+    body: "value",+    aws: {+      signQuery: true,+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      service: "value",+      region: "value",+      cache: new Map(),+      datetime: "value",+      appendSessionToken: true,+      allHeaders: true,+      singleEncode: true,+    },+    cache: "default",+    credentials: "same-origin",+    integrity: "value",+    keepalive: true,+    mode: "cors",+    redirect: "follow",+    referrer: "value",+    referrerPolicy: "same-origin",+    signal: new AbortSignal(),+    window: null,+  };+}++function AwsV4SignerTest() {+  function constructor() {+    // $ExpectError+    new AwsV4Signer();++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      retries: 1, // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      initRetryMs: 1, // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new Blob(), // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new FormData(), // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new URLSearchParams(), // $ExpectError

Previous types fail this test.

marcogrcr

comment created time in 2 months

Pull request review commentmhart/aws4fetch

Improve TypeScript definition

+import { AwsClient, AwsRequestInit, AwsV4Signer } from "aws4fetch";++function AwsClientTest() {+  function constructor() {+    // $ExpectError+    new AwsClient({});++    const min = new AwsClient({+      accessKeyId: "value",+      secretAccessKey: "value",+    });++    const all = new AwsClient({+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      service: "value",+      region: "value",+      cache: new Map(),+      retries: 1,+      initRetryMs: 1,+    });+  }++  function fetch(client: AwsClient, init: AwsRequestInit) {+    // $ExpectError+    client.fetch();++    // $ExpectType Promise<Response>+    client.fetch("value");+    client.fetch("value", {});+    client.fetch("value", { aws: {} });+    client.fetch("value", init);+    client.fetch(new Request("value"));+    client.fetch(new Request("value"), {});+    client.fetch(new Request("value"), { aws: {} });+    client.fetch(new Request("value"), init);+  }++  function sign(client: AwsClient, init: AwsRequestInit) {+    // $ExpectError+    client.sign();++    // $ExpectType Promise<Request>+    client.sign("value");+    client.sign("value", {});+    client.sign("value", { aws: {} });+    client.sign("value", init);+    client.sign(new Request("value"));+    client.sign(new Request("value"), {});+    client.sign(new Request("value"), { aws: {} });+    client.sign(new Request("value"), init);+  }+}++function AwsRequestInitTest() {+  const min: AwsRequestInit = {};++  const all: AwsRequestInit = {+    method: "value",+    headers: {},+    body: "value",+    aws: {+      signQuery: true,+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      service: "value",+      region: "value",+      cache: new Map(),+      datetime: "value",+      appendSessionToken: true,+      allHeaders: true,+      singleEncode: true,+    },+    cache: "default",+    credentials: "same-origin",+    integrity: "value",+    keepalive: true,+    mode: "cors",+    redirect: "follow",+    referrer: "value",+    referrerPolicy: "same-origin",+    signal: new AbortSignal(),+    window: null,+  };+}++function AwsV4SignerTest() {+  function constructor() {+    // $ExpectError+    new AwsV4Signer();++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      retries: 1, // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      initRetryMs: 1, // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new Blob(), // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new FormData(), // $ExpectError

Previous types fail this test.

marcogrcr

comment created time in 2 months

Pull request review commentmhart/aws4fetch

Improve TypeScript definition

+import { AwsClient, AwsRequestInit, AwsV4Signer } from "aws4fetch";++function AwsClientTest() {+  function constructor() {+    // $ExpectError+    new AwsClient({});++    const min = new AwsClient({+      accessKeyId: "value",+      secretAccessKey: "value",+    });++    const all = new AwsClient({+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      service: "value",+      region: "value",+      cache: new Map(),+      retries: 1,+      initRetryMs: 1,+    });+  }++  function fetch(client: AwsClient, init: AwsRequestInit) {+    // $ExpectError+    client.fetch();++    // $ExpectType Promise<Response>+    client.fetch("value");+    client.fetch("value", {});+    client.fetch("value", { aws: {} });+    client.fetch("value", init);+    client.fetch(new Request("value"));+    client.fetch(new Request("value"), {});+    client.fetch(new Request("value"), { aws: {} });+    client.fetch(new Request("value"), init);+  }++  function sign(client: AwsClient, init: AwsRequestInit) {+    // $ExpectError+    client.sign();++    // $ExpectType Promise<Request>+    client.sign("value");+    client.sign("value", {});+    client.sign("value", { aws: {} });+    client.sign("value", init);+    client.sign(new Request("value"));+    client.sign(new Request("value"), {});+    client.sign(new Request("value"), { aws: {} });+    client.sign(new Request("value"), init);+  }+}++function AwsRequestInitTest() {+  const min: AwsRequestInit = {};++  const all: AwsRequestInit = {+    method: "value",+    headers: {},+    body: "value",+    aws: {+      signQuery: true,+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      service: "value",+      region: "value",+      cache: new Map(),+      datetime: "value",+      appendSessionToken: true,+      allHeaders: true,+      singleEncode: true,+    },+    cache: "default",+    credentials: "same-origin",+    integrity: "value",+    keepalive: true,+    mode: "cors",+    redirect: "follow",+    referrer: "value",+    referrerPolicy: "same-origin",+    signal: new AbortSignal(),+    window: null,+  };+}++function AwsV4SignerTest() {+  function constructor() {+    // $ExpectError+    new AwsV4Signer();++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      retries: 1, // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      initRetryMs: 1, // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      body: new Blob(), // $ExpectError

Previous types fail this test.

marcogrcr

comment created time in 2 months

Pull request review commentmhart/aws4fetch

Improve TypeScript definition

+import { AwsClient, AwsRequestInit, AwsV4Signer } from "aws4fetch";++function AwsClientTest() {+  function constructor() {+    // $ExpectError+    new AwsClient({});++    const min = new AwsClient({+      accessKeyId: "value",+      secretAccessKey: "value",+    });++    const all = new AwsClient({+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      service: "value",+      region: "value",+      cache: new Map(),+      retries: 1,+      initRetryMs: 1,+    });+  }++  function fetch(client: AwsClient, init: AwsRequestInit) {+    // $ExpectError+    client.fetch();++    // $ExpectType Promise<Response>+    client.fetch("value");+    client.fetch("value", {});+    client.fetch("value", { aws: {} });+    client.fetch("value", init);+    client.fetch(new Request("value"));+    client.fetch(new Request("value"), {});+    client.fetch(new Request("value"), { aws: {} });+    client.fetch(new Request("value"), init);+  }++  function sign(client: AwsClient, init: AwsRequestInit) {+    // $ExpectError+    client.sign();++    // $ExpectType Promise<Request>+    client.sign("value");+    client.sign("value", {});+    client.sign("value", { aws: {} });+    client.sign("value", init);+    client.sign(new Request("value"));+    client.sign(new Request("value"), {});+    client.sign(new Request("value"), { aws: {} });+    client.sign(new Request("value"), init);+  }+}++function AwsRequestInitTest() {+  const min: AwsRequestInit = {};++  const all: AwsRequestInit = {+    method: "value",+    headers: {},+    body: "value",+    aws: {+      signQuery: true,+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      service: "value",+      region: "value",+      cache: new Map(),+      datetime: "value",+      appendSessionToken: true,+      allHeaders: true,+      singleEncode: true,+    },+    cache: "default",+    credentials: "same-origin",+    integrity: "value",+    keepalive: true,+    mode: "cors",+    redirect: "follow",+    referrer: "value",+    referrerPolicy: "same-origin",+    signal: new AbortSignal(),+    window: null,+  };+}++function AwsV4SignerTest() {+  function constructor() {+    // $ExpectError+    new AwsV4Signer();++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      retries: 1, // $ExpectError+    });++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      initRetryMs: 1, // $ExpectError

Previous types fail this test.

marcogrcr

comment created time in 2 months

Pull request review commentmhart/aws4fetch

Improve TypeScript definition

+import { AwsClient, AwsRequestInit, AwsV4Signer } from "aws4fetch";++function AwsClientTest() {+  function constructor() {+    // $ExpectError+    new AwsClient({});++    const min = new AwsClient({+      accessKeyId: "value",+      secretAccessKey: "value",+    });++    const all = new AwsClient({+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      service: "value",+      region: "value",+      cache: new Map(),+      retries: 1,+      initRetryMs: 1,+    });+  }++  function fetch(client: AwsClient, init: AwsRequestInit) {+    // $ExpectError+    client.fetch();++    // $ExpectType Promise<Response>+    client.fetch("value");+    client.fetch("value", {});+    client.fetch("value", { aws: {} });+    client.fetch("value", init);+    client.fetch(new Request("value"));+    client.fetch(new Request("value"), {});+    client.fetch(new Request("value"), { aws: {} });+    client.fetch(new Request("value"), init);+  }++  function sign(client: AwsClient, init: AwsRequestInit) {+    // $ExpectError+    client.sign();++    // $ExpectType Promise<Request>+    client.sign("value");+    client.sign("value", {});+    client.sign("value", { aws: {} });+    client.sign("value", init);+    client.sign(new Request("value"));+    client.sign(new Request("value"), {});+    client.sign(new Request("value"), { aws: {} });+    client.sign(new Request("value"), init);+  }+}++function AwsRequestInitTest() {+  const min: AwsRequestInit = {};++  const all: AwsRequestInit = {+    method: "value",+    headers: {},+    body: "value",+    aws: {+      signQuery: true,+      accessKeyId: "value",+      secretAccessKey: "value",+      sessionToken: "value",+      service: "value",+      region: "value",+      cache: new Map(),+      datetime: "value",+      appendSessionToken: true,+      allHeaders: true,+      singleEncode: true,+    },+    cache: "default",+    credentials: "same-origin",+    integrity: "value",+    keepalive: true,+    mode: "cors",+    redirect: "follow",+    referrer: "value",+    referrerPolicy: "same-origin",+    signal: new AbortSignal(),+    window: null,+  };+}++function AwsV4SignerTest() {+  function constructor() {+    // $ExpectError+    new AwsV4Signer();++    new AwsV4Signer({+      url: "value",+      accessKeyId: "value",+      secretAccessKey: "value",+      retries: 1, // $ExpectError

Previous types fail this test.

marcogrcr

comment created time in 2 months

Pull request review commentmhart/aws4fetch

Improve TypeScript definition

+import { AwsClient, AwsRequestInit, AwsV4Signer } from "aws4fetch";++function AwsClientTest() {+  function constructor() {+    // $ExpectError+    new AwsClient({});

Previous types fail this test.

marcogrcr

comment created time in 2 months

Pull request review commentmhart/aws4fetch

Improve TypeScript definition

+import { AwsClient, AwsRequestInit, AwsV4Signer } from "aws4fetch";

Previous types don't allow AwsV4Signer to be imported.

marcogrcr

comment created time in 2 months

issue commentmhart/aws4fetch

TypeScript interfaces (definition files)

@MickL I don't believe you did anything wrong. I have submitted a new pull request to address this (and other issues), as well as add types testing (#16).

MickL

comment created time in 2 months

PR opened mhart/aws4fetch

Improve TypeScript definition

WHAT?

  1. Fixed bugs in definitions:
    • Renamed AwsSigner to AwsV4Signer.
    • Removed retries and initRetryMs fields from: AwsSignerInit.
    • Removed body, headers, method, and url fields from: AwsRequestInit["aws"].
    • Made all fields optional in AwsRequestInit["aws"].
    • Removed invalid types (Blob, FormData, URLSearchParams, ReadableStream) from AwsSignerInit["body"].
    • Removed optional suffix (?) from required fields.
    • Removed redundant | null type in optional fields.
  2. Made all interface fields readonly.
  3. Added authHeader() and signature() to AwsV4Signer.
  4. Added jsdoc to the TypeScript definitions based on the README.md documentation.
  5. Added dtslint-based tests.

WHY?

  1. Allow the library to be used correctly with TypeScript.
  2. Make the interfaces immutable.
  3. Allow invocation of missing public methods.
  4. Make the library easier to use.
  5. Ensures types are correct and changes are backwards compatible.
+2131 -52

0 comment

6 changed files

pr created time in 2 months

push eventmarcogrcr/aws4fetch

Marco Gonzalez

commit sha bb00f85dd0efeb44d23696757777f0edbb857f38

Improve TypeScript definition WHAT? 1. Fixed bugs in definitions: - Renamed `AwsSigner` to `AwsV4Signer`. - Removed `retries` and `initRetryMs` fields from: `AwsSignerInit`. - Removed `body`, `headers`, `method`, and `url` fields from: `AwsRequestInit["aws"]`. - Made all fields optional in `AwsRequestInit["aws"]`. - Removed invalid types (`Blob`, `FormData`, `URLSearchParams`, `ReadableStream`) from `AwsSignerInit["body"]`. - Removed optional suffix (`?`) from required fields. - Removed redundant `| null` type in optional fields. 2. Made all `interface` fields `readonly`. 3. Added `authHeader()` and `signature()` to `AwsV4Signer`. 4. Added `jsdoc` to the TypeScript definitions based on the `README.md` documentation. 5. Added `dtslint`-based tests. WHY? 1. Allow the library to be used correctly with TypeScript. 2. Make the interfaces immutable. 3. Allow invocation of missing public methods. 4. Make the library easier to use. 5. Ensures types are correct and changes are backwards compatible.

view details

push time in 2 months

push eventmarcogrcr/aws4fetch

Marco Gonzalez

commit sha c78cf4f00955049efab6b61e2e39fcb14619dc73

Move typings file to types/ WHAT? Moved the typings file from `dist/aws4fetch.d.ts` to `types/index.d.ts`. WHY? Follow the recommendation from [dtslint](https://github.com/microsoft/dtslint).

view details

Marco Gonzalez

commit sha ccad57d1f972a0deaa07bb034eafacd9bcbe7257

Improve TypeScript definition WHAT? 1. Fixed bugs in definitions: - Renamed `AwsSigner` to `AwsV4Signer`. - Removed `retries` and `initRetryMs` fields from: `AwsSignerInit`. - Removed `body`, `headers`, `method`, and `url` fields from: `AwsRequestInit["aws"]`. - Made all fields optional in `AwsRequestInit["aws"]`. - Removed invalid types (`Blob`, `FormData`, `URLSearchParams`, `ReadableStream`) from `AwsSignerInit["body"]`. - Removed optional suffix (`?`) from required fields. - Removed redundant `| null` type in optional fields. 2. Added `authHeader()` and `signature()` to `AwsV4Signer`. 3. Added `jsdoc` to the TypeScript definitions based on the `README.md` documentation. 4. Added `dtslint`-based tests. WHY? 1. Allow the library to be used correctly with TypeScript. 2. Allow invocation of missing public methods. 3. Make the library easier to use. 4. Ensures types are correct and changes are backwards compatible.

view details

push time in 2 months

fork marcogrcr/aws4fetch

A compact AWS client for modern JS environments

fork in 2 months

issue closedaws/aws-cdk

RestApi construct does not automatically create new deployments when policy changes

The RestApi construct does not automatically create a new deployment when nothing but the policy changes.

Reproduction Steps

import { RestApi } from "@aws-cdk/aws-apigateway";
import { AnyPrincipal } from "@aws-cdk/aws-iam";
import { Token } from "@aws-cdk/core";

// if just this changes, RestApi does not trigger a new deployment automatically
const apiPolicy = new PolicyDocument({
  statements: [
    new PolicyStatement({
      actions: ["execute-api:Invoke"],
      resources: ["execute-api:/prod/*/public/*"],
      principals: [new AnyPrincipal()]
    })
  ]
});

const api = new RestApi(this, "Api", {
  // ...
  policy: apiPolicy
});

You can workaround the bug with the following:

api.latestDeployment?.addToLogicalId(Token.asAny(apiPolicy));

I believe this could be fixed by adding the following code to packages/@aws-cdk/aws-apigateway/lib/restapi.ts:341:

if (props.policy) {
  this._latestDeployment.addToLogicalId(Token.asAny(props.policy));
}

My plan was to actually submit a pull-request with the fix, but I'm unable to build aws-cdk locally (probably due to my local config) and the Docker build is currently broken (see #7785).

Environment

  • CLI Version: 1.38.0
  • Framework Version: 1.38.0
  • OS: Mac OS 10.14.6
  • Language: English

Other

This bug was indirectly mentioned in #2387.


This is :bug: Bug Report

closed time in 2 months

marcogrcr

issue commentaws/aws-cdk

RestApi construct does not automatically create new deployments when policy changes

Hi @nija-at:

Apologies for the misunderstanding. Turns out I was looking at the wrong project which was using version 1.32.0. I can confirm that this works after updating to 1.38.0.

marcogrcr

comment created time in 2 months

issue openedaws/aws-cdk

RestApi construct does not automatically create new deployments when policy changes

The RestApi construct does not automatically create a new deployment when nothing but the policy changes.

Reproduction Steps

import { RestApi } from "@aws-cdk/aws-apigateway";
import { AnyPrincipal } from "@aws-cdk/aws-iam";
import { Token } from "@aws-cdk/core";

// if just this changes, RestApi does not trigger a new deployment automatically
const apiPolicy = new PolicyDocument({
  statements: [
    new PolicyStatement({
      actions: ["execute-api:Invoke"],
      resources: ["execute-api:/prod/*/public/*"],
      principals: [new AnyPrincipal()]
    })
  ]
});

const api = new RestApi(this, "Api", {
  // ...
  policy: apiPolicy
});

You can workaround the bug with the following:

api.latestDeployment?.addToLogicalId(Token.asAny(apiPolicy));

I believe this could be fixed by adding the following code to packages/@aws-cdk/aws-apigateway/lib/restapi.ts:341:

if (props.policy) {
  this._latestDeployment.addToLogicalId(Token.asAny(props.policy));
}

My plan was to actually submit a pull-request with the fix, but I'm unable to build aws-cdk locally (probably due to my local config) and the Docker build is currently broken (see #7785).

Environment

  • CLI Version: 1.38.0
  • Framework Version: 1.38.0
  • OS: Mac OS 10.14.6
  • Language: English

Other

This bug was indirectly mentioned in #2387.


This is :bug: Bug Report

created time in 2 months

issue commentaws/aws-cdk

[apigateway] Unable to add accurate resource policy

This works just fine for me with npm's "@aws-cdk/aws-apigateway": "1.23.0":

import { RestApi } from "@aws-cdk/aws-apigateway";
import { AnyPrincipal } from "@aws-cdk/aws-iam";
import { Token } from "@aws-cdk/core";

const apiPolicy = new PolicyDocument({
  statements: [
    new PolicyStatement({
      actions: ["execute-api:Invoke"],
      // prod is `RestApi`'s default stage name, `*` means ANY method, `/public/*` means any path that starts with `/public`
      resources: ["execute-api:/prod/*/public/*"],
      principals: [new AnyPrincipal()]
    })
  ]
});

const api = new RestApi(this, "Api", {
  // ...
  policy: apiPolicy
});

// ensure a new API deployment occurs when the API policy changes
api.latestDeployment?.addToLogicalId(Token.asAny(apiPolicy));
brettswift

comment created time in 2 months

issue commentaws/aws-cdk

Make it easier to configure RestApi policy

I'm not sure I understand this feature request. What's wrong with:

new RestApi(this, "Api", {
  // ...
  policy: new PolicyDocument({
  statements: [
    new PolicyStatement({
      actions: ["execute-api:Invoke"],
      resources: ["execute-api:/{stage}/{method}/{path}"], // or "*"
      principals: [new AccountPrincipal("...")]
    })
  ]
});

The fact that you have to know the special execute-api:/* syntax?

nija-at

comment created time in 2 months

startedphilipwalton/rollup-native-modules-boilerplate

started time in 2 months

startedstrapi/strapi

started time in 2 months

startedhoanhan101/ultimate-go

started time in 2 months

startedTheAlgorithms/Java

started time in 2 months

startedMichalLytek/type-graphql

started time in 2 months

startedKyleAMathews/typography.js

started time in 2 months

startedevanw/esbuild

started time in 2 months

startedwojtekmaj/react-pdf

started time in 2 months

startedmholt/PapaParse

started time in 2 months

startedn64decomp/sm64

started time in 2 months

issue commentamazon-connect/amazon-connect-streams

Controlling the agent's active customer tab via JS?

#243 Officially documented onViewContact and viewContact, so this can be closed now.

winzig

comment created time in 2 months

issue commentamazon-connect/amazon-connect-streams

Check authentication failed while using SAML Authentication.

#243 officially documented the handlers, so this can be closed.

shreyasbhatia09

comment created time in 2 months

issue commentamazon-connect/amazon-connect-streams

AgentState documentation is inaccurate

This has been addressed in #243

aguecida

comment created time in 2 months

PR opened amazon-connect/amazon-connect-streams

Normalized `getState()` / `getStatus()` methods

Issue #, if available: #37, #86

Description of changes:

Addressed #37 and #86 by ensuring all three Agent, Contact, and BaseConnection have the following methods:

  • getState()
  • getStateDuration()
  • getStatus()
  • getStatusDuration()

It seems that some inconsistencies in the documentation initially caused this confusion for customers. Given that Agent had already aliased the methods, aliasing the methods for the other two APIs seemed appropriate.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

+34 -14

0 comment

3 changed files

pr created time in 2 months

push eventmarcogrcr/amazon-connect-streams

Marco Gonzalez

commit sha 51c5c40174548f375032fdcbe5217bbcd7f05e01

TypeScript support. (#243) * Updated documentation and fixed minor bugs - Updated documentation to fix typos, inconsistencies, indentation, etc. - Updated `api.js` to prevent errors when arguments documented as optional were not specified. - Updated `api.js` to remove redundant `VoiceConnection` methods that are inherited from `BaseConnection`. - Normalized `softphone.js`'s usage of `publishError()` to ensure `SoftphoneError`'s `endPointUrl` is never null. * Updated and exposed TypeScript definitions. - Updated `index.d.ts` to represent the shape of the API. - Updated documentation to indicate TypeScript support.

view details

Marco Gonzalez

commit sha 45530a17bc44f595f7a9ad462977724d9fb1a979

Normalized `getState()` / `getStatus()` methods Addressed #37 and #86 by ensuring all three `Agent`, `Contact`, and `BaseConnection` have the following methods: - `getState()` - `getStateDuration()` - `getStatus()` - `getStatusDuration()` It seems that some inconsistencies in the documentation initially caused this confusion for customers. Given that `Agent` had already aliased the methods, aliasing the methods for the other two APIs seemed appropriate.

view details

push time in 2 months

push eventmarcogrcr/amazon-connect-streams

Marco Gonzalez

commit sha 94a675f22cc9e7183db29e3b3955a08ddd98f02b

Updated documentation and fixed minor bugs - Updated documentation to fix typos, inconsistencies, indentation, etc. - Updated `api.js` to prevent errors when arguments documented as optional were not specified. - Updated `api.js` to remove redundant `VoiceConnection` methods that are inherited from `BaseConnection`. - Normalized `softphone.js`'s usage of `publishError()` to ensure `SoftphoneError`'s `endPointUrl` is never null.

view details

Marco Gonzalez

commit sha 81741f55fca2ee4cbbfad152fb0c92d5f1f0d40b

Updated and exposed TypeScript definitions. - Updated `index.d.ts` to represent the shape of the API. - Updated documentation to indicate TypeScript support.

view details

push time in 2 months

issue commentamazon-connect/amazon-connect-streams

CCP in React.js microphone not accessible

@Chu-CloudHesive I faced a similar issue, and I was able to fix it with the following:

connect.core.initCCP({
  // (...)
  softphone: {
    allowFramedSoftphone: true
  }
});

From the docs:

Normally, the softphone microphone and speaker components are not allowed to be hosted in an iframe. This is because the softphone must be hosted in a single window or tab. The window hosting the softphone session must not be closed during the course of a softphone call or the call will be disconnected. If allowFramedSoftphone is true, the softphone components will be allowed to be hosted in this window or tab.


You can also use the barebones React setup that I documented on #88 if you want to work backwards from there to see what things specifically on your app/configuration is causing it to break.

If this does not solve your problem, I recommend that you provide a bit more context about your problem (e.g. amazon-connect-streams version, browser, React version, args to connect.core.initCCP()).

Chu-CloudHesive

comment created time in 2 months

issue commentamazon-connect/amazon-connect-streams

Having trouble initializing the Streams API in a React app

Now that amazon-connect-streams is now distributed as an npm package in npmjs.com, the following setup with webpack works for me:

package.json

{
  "name": "my-app",
  "version": "1.0.0",
  "scripts": {
    "bundle": "webpack --mode production",
    "server": "webpack-dev-server -w --config webpack.server.config.js"
  },
  "dependencies": {
    "amazon-connect-streams": "1.4.7",
    "react": "16.13.1",
    "react-dom": "16.13.1"
  },
  "devDependencies": {
    "@babel/core": "7.9.6",
    "@babel/preset-env": "7.9.6",
    "@babel/preset-react": "7.9.4",
    "babel-loader": "8.1.0",
    "core-js": "3.6.5",
    "html-webpack-plugin": "4.3.0",
    "regenerator-runtime": "0.13.5",
    "webpack": "4.43.0",
    "webpack-cli": "3.3.11",
    "webpack-dev-server": "3.10.3"
  }
}

.babelrc

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "useBuiltIns": "usage",
        "corejs": { "version": 3 }
      }
    ],
    "@babel/preset-react"
  ]
}

webpack.config.js

const path = require("path");

module.exports = {
  entry: "./src/index.jsx",
  module: {
    rules: [{ test: /\.jsx?$/, use: "babel-loader" }]
  },
  output: {
    filename: "app.js",
    path: path.resolve("dist")
  }
};

webpack.server.config.js

const HtmlWebpackPlugin = require("html-webpack-plugin");

const config = require("./webpack.config");

module.exports = {
  ...config,
  devServer: {
    disableHostCheck: true,
    host: "0.0.0.0",
    https: true,
    overlay: true,
    port: 8000
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: "./src/index.html"
    })
  ]
};

src/index.jsx

import "amazon-connect-streams";

import React, { useEffect } from "react";
import { render } from "react-dom";

const CCP_URL = "https://<instance>.awsapps.com/connect/ccp-v2";
const LOGIN_URL = "https://<your-saml-login-url>";
const REGION = "<your-region>"; // e.g. us-west-2

function App() {
  useEffect(() => {
    const container = document.getElementById("ccp");
    connect.core.initCCP(container, {
      ccpUrl: CCP_URL,
      loginUrl: LOGIN_URL,
      loginPopup: true,
      loginPopupAutoClose: true,
      region: REGION,
      softphone: {
        allowFramedSoftphone: true
      }
    });
  }, []);

  return <div id="ccp" style={{ width: "320px", height: "500px" }}></div>;
}

render(<App />, document.getElementById("app"));

src/index.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>My App</title>
  </head>
  <body>
    <div id="app"></div>
  </body>
</html>
becklin-haston

comment created time in 2 months

push eventmarcogrcr/amazon-connect-streams

Marco Gonzalez

commit sha cb069f804e0e66c344a152594d0cced6e8d3bd21

Updated and exposed TypeScript definitions. - Updated `index.d.ts` to represent the shape of the API. - Updated documentation to indicate TypeScript support.

view details

push time in 2 months

issue commentamazon-connect/amazon-connect-streams

Check authentication failed while using SAML Authentication.

It seems that 7f104fc added two handlers:

  • connect.core.onAuthFail
  • connect.core.onAccessDenied

They seem to be hooked up on worker.js.

Are these methods supported?

shreyasbhatia09

comment created time in 2 months

issue commentamazon-connect/amazon-connect-streams

AgentState documentation is inaccurate

This is related to #108

aguecida

comment created time in 2 months

issue commentamazon-connect/amazon-connect-streams

Controlling the agent's active customer tab via JS?

@winzig

and lack of a fully open source chat client that can be configured for it

I'm curious what do you mean by that. Does amazon-connect-chatjs not satisfy your needs?

winzig

comment created time in 2 months

issue commentamazon-connect/amazon-connect-streams

agent.connect success handler

This is a duplicate of #216

andersonjohnf

comment created time in 2 months

issue commentamazon-connect/amazon-connect-streams

Controlling the agent's active customer tab via JS?

@winzig : it seems 7f104fc added two methods that precisely help with what you want:

  • connect.core.onViewContact: Allows you to subscribe to an event that fires whenever the currently selected contact changes (it passes a { contactId: string } arg).
  • connect.core.viewContact: Allows you to change the currently selected contact on the CCP. This will also trigger any subscriptions to connect.core.onViewContact.

Note: I have tested those methods myself, that's how I figure out their behavior.

It seems like these methods are intended to be a public API (at least for connect.core.viewContact according to cheat-sheet.md), though I would wait for official confirmation.

winzig

comment created time in 2 months

issue commentamazon-connect/amazon-connect-streams

Feature Request: contact.SetAttributes(key, value)

Keep in mind that in the meantime you can use the UpdateContactAttributes API.

camstuart

comment created time in 2 months

issue commentamazon-connect/amazon-connect-streams

Single logout in Connect

The closest thing to what you're looking for that I could find in the documentation is https://<instance>.awsapps.com/connect/logout

However, that may not work for you because of the following issues:

  1. You cannot call it from your APP using JavaScript due to CORS.
  2. Amazon Connect responds a GET https://<instance>.awsapps.com/connect/logout with a 302 > https://<instance>.awsapps.com/connect/login which you don't have control over.

I couldn't find any documentation that suggested you could put a returnUrl argument to /connect/logout so that you could potentially do something like:

  • GET https://myapp.com/logout: Performs logout of my app
    • 302 > https://<instance>.awsapps.com/connect/logout?returnUrl=https%3A%2F%2Fmyapp.com%2Flogin
  • GET https://<instance>.awsapps.com/connect/logout?returnUrl=https%3A%2F%2Fmyapp.com%2Flogin: Performs logout of Amazon Connect
    • 302 > https://myapp.com/login
  • GET http://myapp.com/login: Shows login page of my app
aguecida

comment created time in 2 months

push eventmarcogrcr/amazon-connect-streams

Marco Gonzalez

commit sha df8aad5578c5217fb8e8a67589f48f40e03574c8

Updated documentation and fixed minor bugs - Updated documentation to fix typos, inconsistencies, indentation, etc. - Updated `api.js` to prevent errors when arguments documented as optional were not specified. - Updated `api.js` to remove redundant `VoiceConnection` methods that are inherited from `BaseConnection`. - Normalized `softphone.js`'s usage of `publishError()` to ensure `SoftphoneError`'s `endPointUrl` is never null.

view details

Marco Gonzalez

commit sha ab857af16a9db3912cd843a60ffad03aa07d4a9d

Updated and exposed TypeScript definitions. - Updated `index.d.ts` to represent the shape of the API. - Updated documentation to indicate TypeScript support.

view details

push time in 2 months

issue commentamazon-connect/amazon-connect-streams

Native support to auto close login popup window

Now that #140 has been merged, this issue can be closed.

scyforce

comment created time in 2 months

issue commentamazon-connect/amazon-connect-streams

Expose agent ARN

This is a duplicate of #70

CiscoKidxx

comment created time in 2 months

pull request commentamazon-connect/amazon-connect-streams

TypeScript support.

marcogrcr force-pushed the marcogrcr:master branch from 2ebc4be to c74d870

This push addressed the updates for the media controllers comment.

marcogrcr force-pushed the marcogrcr:master branch from c74d870 to f35a702

This push fixed a bug I had in index.d.ts on interface AgentState

marcogrcr

comment created time in 2 months

push eventmarcogrcr/amazon-connect-streams

Marco Gonzalez

commit sha f35a702842213e967d87d873174eddff3f065774

Updated and exposed TypeScript definitions. - Updated `index.d.ts` to represent the shape of the API. - Updated documentation to indicate TypeScript support.

view details

push time in 2 months

Pull request review commentamazon-connect/amazon-connect-streams

TypeScript support.

 declare namespace connect {     DIALING = "Dialing",     JOINING = "Joining",     PENDING_AVAILABLE = "PendingAvailable",-    PENDING_BUSY = "PendingBusy"+    PENDING_BUSY = "PendingBusy",   }    enum AgentErrorStates {-    ERROR = 'Error',-    AGENT_HUNG_UP = 'AgentHungUp',-    BAD_ADDRESS_AGENT = 'BadAddressAgent',-    BAD_ADDRESS_CUSTOMER = 'BadAddressCustomer',-    DEFAULT = 'Default',-    FAILED_CONNECT_AGENT = 'FailedConnectAgent',-    FAILED_CONNECT_CUSTOMER = 'FailedConnectCustomer',-    LINE_ENGAGED_AGENT = 'LineEngagedAgent',-    LINE_ENGAGED_CUSTOMER = 'LineEngagedCustomer',-    MISSED_CALL_AGENT = 'MissedCallAgent',-    MISSED_CALL_CUSTOMER = 'MissedCallCustomer',-    MULTIPLE_CCP_WINDOWS = 'MultipleCcpWindows',-    REALTIME_COMMUNICATION_ERROR = 'RealtimeCommunicationError'+    ERROR = "Error",+    AGENT_HUNG_UP = "AgentHungUp",+    BAD_ADDRESS_AGENT = "BadAddressAgent",+    BAD_ADDRESS_CUSTOMER = "BadAddressCustomer",+    DEFAULT = "Default",+    FAILED_CONNECT_AGENT = "FailedConnectAgent",+    FAILED_CONNECT_CUSTOMER = "FailedConnectCustomer",+    LINE_ENGAGED_AGENT = "LineEngagedAgent",+    LINE_ENGAGED_CUSTOMER = "LineEngagedCustomer",+    MISSED_CALL_AGENT = "MissedCallAgent",+    MISSED_CALL_CUSTOMER = "MissedCallCustomer",+    MULTIPLE_CCP_WINDOWS = "MultipleCcpWindows",+    REALTIME_COMMUNICATION_ERROR = "RealtimeCommunicationError",   } +  /** This enumeration lists the different types of endpoints. */   enum EndpointType {-    PHONE_NUMBER = 'phone_number',-    AGENT = 'agent',-    QUEUE = 'queue'+    /** An endpoint pointing to a phone number. */+    PHONE_NUMBER = "phone_number",++    /** An endpoint pointing to an agent in the same instance. */+    AGENT = "agent",++    /** An endpoint pointing to a queue call flow in the same instance. */+    QUEUE = "queue",   } +  /** Lists the different types of connections. */   enum ConnectionType {-    AGENT = 'agent',-    INBOUND = 'inbound',-    OUTBOUND = 'outbound',-    MONITORING = 'monitoring'+    /** The agent connection. */+    AGENT = "agent",++    /** An inbound connection, usually representing an inbound call. */+    INBOUND = "inbound",++    /** An outbound connection, representing either an outbound call or additional connection added to the contact. */+    OUTBOUND = "outbound",++    /** A special connection type representing a manager listen-in session. */+    MONITORING = "monitoring",   } +  /** An enumeration listing the different states that a connection can have. */   enum ConnectionStateType {-    INIT = 'init',-    CONNECTING = 'connecting',-    CONNECTED = 'connected',-    HOLD = 'hold',-    DISCONNECTED = 'disconnected'+    /** The connection has not yet been initialized. */+    INIT = "init",++    /** The connection is being initialized. */+    CONNECTING = "connecting",++    /** The connection is connected to the contact. */+    CONNECTED = "connected",++    /** The connection is connected but on hold. */+    HOLD = "hold",++    /** The connection is no longer connected to the contact. */+    DISCONNECTED = "disconnected",   } -  interface CONNECTION_ACTIVE_STATES {-    [key: string]: number;+  enum ContactEvents {+    INIT = "init",+    REFRESH = "refresh",+    DESTROYED = "destroyed",+    INCOMING = "incoming",+    PENDING = "pending",+    CONNECTING = "connecting",+    CONNECTED = "connected",+    MISSED = "missed",+    ACW = "acw",+    VIEW = "view",+    ENDED = "ended",+    ERROR = "error",+    ACCEPTED = "accepted",   } +  /** An enumeration listing the different high-level states that a contact can have. */   enum ContactStateType {-    INIT = 'init',-    INCOMING = 'incoming',-    PENDING = 'pending',-    CONNECTING = 'connecting',-    CONNECTED = 'connected',-    MISSED = 'missed',-    ERROR = 'error',-    ENDED = 'ended'+    /** Indicates the contact is being initialized. */+    INIT = "init",++    /**+     * Indicates that the contact is incoming and is waiting for acceptance.+     * This state is skipped for `ContactType.VOICE` contacts but is essential for `ContactType.QUEUE_CALLBACK` contacts.+     */+    INCOMING = "incoming",++    /** Indicates the contact is pending. */+    PENDING = "pending",++    /**+     * Indicates that the contact is currently connecting.+     * For `ContactType.VOICE` contacts, this is when the user will accept the incoming call.+     * For all other types, the contact will be accepted during the `ContactStateType.INCOMING` state.+     */+    CONNECTING = "connecting",++    /** Indicates the contact is connected. */+    CONNECTED = "connected",++    /** Indicates the contact timed out before the agent could accept it. */+    MISSED = "missed",++    /** Indicates the contact is in an error state. */+    ERROR = "error",++    /** Indicates the contact has ended. */+    ENDED = "ended",   }    enum CONTACT_ACTIVE_STATES {-    INCOMING = 'incoming',-    CONNECTING = 'connecting',-    CONNECTED = 'connected'+    INCOMING = "incoming",+    PENDING = "pending",+    CONNECTING = "connecting",+    CONNECTED = "connected",   } +  /** This enumeration lists all of the contact types supported by Connect Streams. */   enum ContactType {-    VOICE = 'voice',-    QUEUE_CALLBACK = 'queue_callback',-    CHAT = 'chat'+    /** Normal incoming and outgoing voice calls. */+    VOICE = "voice",++    /**+     * Special outbound voice calls which are routed to agents before being placed.+     * For more information about how to setup and use queued callbacks, see the Amazon Connect user documentation.+     */+    QUEUE_CALLBACK = "queue_callback",++    /** Chat contact. */+    CHAT = "chat",   } +  /** This enumeration lists the different types of contact channels. */   enum ChannelType {-    VOICE = 'VOICE',-    CHAT = 'CHAT'+    /** A voice contact. */+    VOICE = "VOICE",++    /** A chat contact. */+    CHAT = "CHAT",   }    enum MediaType {-    SOFTPHONE = 'softphone',-    CHAT = 'chat'+    SOFTPHONE = "softphone",+    CHAT = "chat",   }    enum SoftphoneCallType {-    AUDIO_VIDEO = 'audio_video',-    VIDEO_ONLY = 'video_only',-    AUDIO_ONLY = 'audio_only',-    NONE = 'none'+    AUDIO_VIDEO = "audio_video",+    VIDEO_ONLY = "video_only",+    AUDIO_ONLY = "audio_only",+    NONE = "none",   }    enum SoftphoneErrorTypes {-    UNSUPPORTED_BROWSER = 'unsupported_browser',-    MICROPHONE_NOT_SHARED = 'microphone_not_shared',-    SIGNALLING_HANDSHAKE_FAILURE = 'signalling_handshake_failure',-    SIGNALLING_CONNECTION_FAILURE = 'signalling_connection_failure',-    ICE_COLLECTION_TIMEOUT = 'ice_collection_timeout',-    USER_BUSY_ERROR = 'user_busy_error',-    WEBRTC_ERROR = 'webrtc_error',-    REALTIME_COMMUNICATION_ERROR = 'realtime_communication_error',-    OTHER = 'other'+    UNSUPPORTED_BROWSER = "unsupported_browser",+    MICROPHONE_NOT_SHARED = "microphone_not_shared",+    SIGNALLING_HANDSHAKE_FAILURE = "signalling_handshake_failure",+    SIGNALLING_CONNECTION_FAILURE = "signalling_connection_failure",+    ICE_COLLECTION_TIMEOUT = "ice_collection_timeout",+    USER_BUSY_ERROR = "user_busy_error",+    WEBRTC_ERROR = "webrtc_error",+    REALTIME_COMMUNICATION_ERROR = "realtime_communication_error",+    OTHER = "other",   }    enum CTIExceptions {-    ACCESS_DENIED_EXCEPTION = 'AccessDeniedException',-    INVALID_STATE_EXCEPTION = 'InvalidStateException',-    BAD_ENDPOINT_EXCEPTION = 'BadEndpointException',-    INVALID_AGENT_ARNEXCEPTION = 'InvalidAgentARNException',-    INVALID_CONFIGURATION_EXCEPTION = 'InvalidConfigurationException',-    INVALID_CONTACT_TYPE_EXCEPTION = 'InvalidContactTypeException',-    PAGINATION_EXCEPTION = 'PaginationException',-    REFRESH_TOKEN_EXPIRED_EXCEPTION = 'RefreshTokenExpiredException',-    SEND_DATA_FAILED_EXCEPTION = 'SendDataFailedException',-    UNAUTHORIZED_EXCEPTION = 'UnauthorizedException'+    ACCESS_DENIED_EXCEPTION = "AccessDeniedException",+    INVALID_STATE_EXCEPTION = "InvalidStateException",+    BAD_ENDPOINT_EXCEPTION = "BadEndpointException",+    INVALID_AGENT_ARNEXCEPTION = "InvalidAgentARNException",+    INVALID_CONFIGURATION_EXCEPTION = "InvalidConfigurationException",+    INVALID_CONTACT_TYPE_EXCEPTION = "InvalidContactTypeException",+    PAGINATION_EXCEPTION = "PaginationException",+    REFRESH_TOKEN_EXPIRED_EXCEPTION = "RefreshTokenExpiredException",+    SEND_DATA_FAILED_EXCEPTION = "SendDataFailedException",+    UNAUTHORIZED_EXCEPTION = "UnauthorizedException",   }    /*-  * A callback to receive notifications of success or failure.-  */-  type SuccessFailCallback = () => void;+   * A callback to receive notifications of success or failure.+   */+  type SuccessFailCallback<T extends any[] = []> = (...args: T) => void;    interface SuccessFailOptions {-    /*-    * A {SuccessFailCallback} to receive a notification of success.-    */-    success?: SuccessFailCallback;-    /*-    * A {SuccessFailCallback} to receive a notification of failure.-    */-    failure?: SuccessFailCallback;+    /** A callback that executes when the operation completes successfully. */+    readonly success?: SuccessFailCallback;++    /** A callback that executes when the operation has an error. */+    readonly failure?: SuccessFailCallback<[string]>;   }+   interface ConnectOptions extends SuccessFailOptions {-    /*-    * A string containing a Connect Queue ARN.-    */-    queueARN?: string;+    /** The queue ARN to associate the contact with. */+    readonly queueARN?: string;   } -  interface Agent {+  /**+   * The Agent API provides event subscription methods and action methods which can be called on behalf of the agent.+   * There is only ever one agent per Streams instantiation and all contacts and actions are assumed to be taken on behalf of this one agent.+   */+  class Agent {     /**-     * Subscribe a method to be called whenever Contact information is about to be updated.+     * Subscribe a method to be called whenever a contact enters the pending state for this particular agent.      *-     * @param callback A callback to receive updated Agent information.+     * @param callback A callback to receive the `Agent` API object instance.      */     onContactPending(callback: AgentCallback): void;+     /**      * Subscribe a method to be called whenever new agent data is available.      *-     * @param callback A callback to receive updated Agent information.+     * @param callback A callback to receive the `Agent` API object instance.      */     onRefresh(callback: AgentCallback): void;+     /**      * Subscribe a method to be called when the agent's state changes.      *-     * @param callback A callback to receive updated Agent and state information.+     * @param callback A callback to receive the `AgentStateChange` API object instance.      */     onStateChange(callback: AgentStateChangeCallback): void;+     /**      * Subscribe a method to be called when the agent becomes routable, meaning that they can be routed incoming contacts.      *-     * @param callback A callback to receive updated Agent information.+     * @param callback A callback to receive the `Agent` API object instance.      */     onRoutable(callback: AgentCallback): void;+     /**      * Subscribe a method to be called when the agent becomes not-routable, meaning that they are online but cannot be routed incoming contacts.      *-     * @param callback A callback to receive updated Agent information.+     * @param callback A callback to receive the `Agent` API object instance.      */     onNotRoutable(callback: AgentCallback): void;+     /**      * Subscribe a method to be called when the agent goes offline.      *-     * @param callback A callback to receive updated Agent information.+     * @param callback A callback to receive the `Agent` API object instance.      */     onOffline(callback: AgentCallback): void;+     /**      * Subscribe a method to be called when the agent is put into an error state.+     * This can occur if Streams is unable to get new agent data, or if the agent fails to accept an incoming contact, or in other error cases.+     * It means that the agent is not routable, and may require that the agent switch to a routable state before being able to be routed contacts again.      *-     * @param callback A callback to receive updated Agent information.+     * @param callback A callback to receive the `Agent` API object instance.      */     onError(callback: AgentCallback): void;+     /**-     * Subscribe a method to be called when the agent enters the "After Call Work" (ACW) state.+     * Subscribe a method to be called when the agent is put into an error state specific to softphone funcionality.      *-     * @param callback A callback to receive updated Agent information.+     * @param callback A callback to receive the `SoftphoneError` error.      */-    onAfterCallWork(callback: AgentCallback): void;+    onSoftphoneError(callback: SoftphoneErrorCallback): void;+     /**-     * Subscribe a method to be called when the agent updates the mute status,-     * meaning that agents mute/unmute APIs are called and the local media stream-     * is succesfully updated with the new status.+     * Subscribe a method to be called when the agent enters the "After Call Work" (ACW) state.+     * This is a non-routable state which exists to allow agents some time to wrap up after handling a contact before they are routed additional contacts.      *-     * @param callback A callback to receive updates on agent mute state+     * @param callback A callback to receive the `Agent` API object instance.      */-    onMuteToggle(callback: AgentCallback): void;+    onAfterCallWork(callback: AgentCallback): void; -    /**-     * Get the agent's current AgentState object indicating their availability state type.-     */+    /** Get the agent's current `AgentState` object indicating their availability state type. */     getState(): AgentState;++    /** Alias for `getState()`. */+    getStatus(): AgentState;+     /**      * Get the duration of the agent's state in milliseconds relative to local time.+     * This takes into account time skew between the JS client and the Amazon Connect service.      */     getStateDuration(): number;-    // /**-    //  * For internal purposes only.-    //  */-    // getPermissions(): string[];+     /**-     * Gets a list of Contact API objects for each of the agent's current contacts.+     * Mostly for internal purposes only.+     * Contains strings which indicates actions that the agent can take in the CCP.      */-    getContacts(contactTypeFilter: string): Contact[];+    getPermissions(): string[];+     /**-     * Gets the full AgentConfiguration object for the agent.+     * Gets a list of `Contact` API objects for each of the agent's current contacts.+     *+     * @param contactTypeFilter If provided, only contacts of the given `ContactType` enum are returned.      */+    getContacts(contactTypeFilter?: ContactType): Contact[];++    /** Gets the full `AgentConfiguration` object for the agent. */     getConfiguration(): AgentConfiguration;+     /**-     * Gets the list of selectable AgentState API objects.+     * Gets the list of selectable `AgentState` API objects.+     * These are the agent states that can be selected when the agent is not handling a live contact.      */-    getAgentStates(): AgentState[];+    getAgentStates(): AgentStateDefinition[];++    /** Gets the agent's routing profile. */+    getRoutingProfile(): AgentRoutingProfile;+     /**-     * Gets the agent's routing profile.+     * Gets a map of channel type to 1 or 0.+     * 1 represents an enabled channel.+     * 0 represents a disabled channel.      */-    getRoutingProfile(): AgentRoutingProfile;+    getChannelConcurrency(): AgentChannelConcurrencyMap;+     /**-     * Gets the agent's user friendly display name from the AgentConfiguration object for the agent.+     * Gets a number indicating how many concurrent contacts can an agent have on a given channel.+     * 0 represents a disabled channel.+     *+     * @param channel The channel to get the configured concurrency.      */+    getChannelConcurrency(channel: ChannelType): number;++    /** Gets the agent's user friendly display name. */     getName(): string;+     /**-     * Gets the agent's phone number from the AgentConfiguration object for the agent.+     * Gets the agent's phone number.+     * This is the phone number that is dialed by Amazon Connect to connect calls to the agent for incoming and outgoing calls if softphone is not enabled.      */     getExtension(): string;-    /**-     * Determine if softphone is enabled for the agent.-     */++    /** Returns a list of eligible countries to be dialed / deskphone redirected. */+    getDialableCountries(): string[];++    /** Indicates whether the agent's phone calls should route to the agent's browser-based softphone or the telephone number configured as the agent's extension. */     isSoftphoneEnabled(): boolean;+     /**-     * Updates the agent's configuration with the given AgentConfiguration object.+     * Updates the agent's configuration with the given `AgentConfiguration` object.+     * The phone number specified must be in E.164 format or the update fails.      *-     * @param configuration The desired configuration-     * @param successFailOptions Optional success and failure callbacks can be provided to determine whether the operation was successful.+     * @param config The desired configuration.+     * @param callbacks Success and failure callbacks to determine whether the operation was successful.      */-    setConfiguration(configuration: AgentConfiguration, successFailOptions: SuccessFailOptions): void;+    setConfiguration(+      config: AgentConfiguration,+      callbacks?: SuccessFailOptions+    ): void;+     /**      * Set the agent's current availability state.+     * Can only be performed if the agent is not handling a live contact.      *      * @param state The new agent state.-     * @param successFailOptions Optional success and failure callbacks can be provided to determine whether the operation was successful.+     * @param callbacks Success and failure callbacks to determine whether the operation was successful.      */-    setState(state: AgentState, successFailOptions: SuccessFailOptions): void;+    setState(state: AgentStateDefinition, callbacks?: SuccessFailOptions): void;++    /** Alias for `setState()`. */+    setStatus(state: AgentStateType, callbacks?: SuccessFailOptions): void;+     /**      * Creates an outbound contact to the given endpoint.      *-     * @param endpoint An object describing the endpoint to which to connect.-     * @param successFailOptions Optional success and failure callbacks can be provided to determine whether the operation was successful.+     * @param endpoint An `Endpoint` API object to connect to.+     * @param connectOptions The connection options.      */-    connect(endpoint: Endpoint, successFailOptions: ConnectOptions): void;+    connect(endpoint: Endpoint, connectOptions?: ConnectOptions): void;++    /** Returns a list of the ARNs associated with this agent's routing profile's queues. */+    getAllQueueARNs(): string[];+     /**-     * Create a snapshot version of the current Agent state and save it for future use, such as adding to a log file or posting elsewhere.+     * Returns the endpoints associated with the queueARNs specified in `queueARNs`, along with any endpoints specified in `pageInfoIn.endpoints`.+     *+     * @param queueARNs A single Queue ARN or a list of Queue ARNs associated with the desired queues.+     * @param callbacks Success and failure callbacks to determine whether the operation was successful.+     * @param pageInfoIn A structure containing options for the call to the API getEndpoints.+     */+    getEndpoints(+      queueARNs: string | string[],+      callbacks: GetEndpointsCallbacks,+      pageInfoIn?: GetEndpointsInput+    ): void;++    /**+     * The data behind the `Agent` API object is ephemeral and changes whenever new data is provided.+     * This method provides an opportunity to create a snapshot version of the `Agent` API object and save it for future use, such as adding to a log file or posting elsewhere.      */     toSnapshot(): Agent; -    /*-     * Sets the agent local media to mute mode.-     */+    /** Sets the agent local media to mute mode. */     mute(): void; -    /*-     * Sets the agent localmedia to unmute mode.-     */+    /** Sets the agent localmedia to unmute mode. */     unmute(): void;++    /**+     * Subscribe a method to be called when the agent updates the mute status, meaning that agents mute/unmute APIs are called and the local media stream is succesfully updated with the new status.+     *+     * @param callback A callback to receive updates on agent mute state+     */+    onMuteToggle(callback: AgentMutedStatusCallback): void;+  }++  interface AgentMutedStatus {+    /** A value indicating whether the agent local media is muted. */+    readonly muted: boolean;   }    interface AgentStateChange {-    /*-     * The Agent object.-     */-    agent: Agent;+    /** The `Agent` API object. */+    readonly agent: Agent; -    /*-     * The name of the agent's new state.-     */-    newState: string;+    /** The name of the agent's previous state. */+    readonly oldState: string; -    /*-     * The name of the agent's previous state.-     */-    oldState: string;+    /** The name of the agent's new state. */+    readonly newState: string;   } -  /**-   * An object containing the current Agent state-   */-  interface AgentState {-    /**-     * The name of the agent's current availability state.-     */-    name: string;+  interface AgentStateDefinition {+    /** The agent state ARN. */+    readonly agentStateARN: string; -    /**-     * The agent's current availability state type, as per the AgentStateType enumeration.-     */-    type: AgentStateType;+    /** The agent state type. */+    readonly type: AgentStateType; -    /**-     * A relative local state duration. To get the actual duration of the state relative-     * to the current time, use agent.getStateDuration().-     */-    duration?: number;+    /** The name of the agent state to be displayed in the UI. */+    readonly name: string;+  } -    /**-     * Indicates whether the agent is currently muted.-     */-    muted?: boolean;+  /** An object containing the current Agent state. */+  interface AgentState {+    /** The agent's current state ARN. */+    readonly agentStateARN: string; -    /**-     * Resource ARN of the Agent State.-     */-    agentStateARN: string;+    /** The name of the agent's current availability state. */+    readonly name: string;++    /** Indicates when the state was set. */+    readonly startTimestamp?: Date;++    /** The agent's current availability state type, as per the `AgentStateType` enumeration. */+    readonly type: AgentStateType;   }    interface AgentConfiguration {-    /**-     * The agent's user friendly display name.-     */-    name: string;+    /** See `agent.getAgentStates()` for more info. */+    readonly agentStates: AgentStateDefinition[]; -    /**-     * Indicates whether the agent's phone calls should route to the agent's browser-based softphone or the telephone number configured as the agent's extension.-     */-    softphoneEnabled: boolean;+    /** See `agent.getDialableCountries()` for more info. */+    readonly dialableCountries: string[]; -    /**-     * Indicates the phone number that should be dialed to connect the agent to their inbound or outbound calls when softphone is not enabled.-     */+    /** See `agent.getExtension()` for more info. */     extension: string; -    /**-     * Describes the agent's current routing profile and list of queues therein. See agent.getRoutingProfile() for more info.-     */-    routingProfile: AgentRoutingProfile;+    /** See `agent.getName()` for more info. */+    readonly name: string; -    /**-     * The username for the agent as entered in their Amazon Connect user account.-     */-    username: string;+    /** See `agent.getPermissions()` for more info. */+    readonly permissions: string[];++    /** See `agent.getRoutingProfile()` for more info. */+    readonly routingProfile: AgentRoutingProfile;++    /** Indicates whether auto accept soft phone calls is enabled. */+    readonly softphoneAutoAccept: boolean;++    /** See `agent.isSoftphoneEnabled()` for more info. */+    softphoneEnabled: boolean;++    /** The username for the agent as entered in their Amazon Connect user account. */+    readonly username: string;   }    interface AgentRoutingProfile {-    /**-     * The name of the routing profile.-     */-    name: string;+    /** See `agent.getChannelConcurrency()` for more info. */+    readonly channelConcurrencyMap: AgentChannelConcurrencyMap; -    /**-     * The queues contained in the routing profile.-     */-    queues: string;+    /** The default queue which should be associated with outbound contacts. */+    readonly defaultOutboundQueue: Queue; -    /**-     * The default queue which should be associated with outbound contacts.-     */-    defaultOutboundQueue: string;+    /** The name of the routing profile. */+    readonly name: string;++    /** The queues contained in the routing profile. */+    readonly queues: Queue[];++    /** The routing profile ARN. */+    readonly routingProfileARN: string;++    /** Alias for `routingProfileARN`. */+    readonly routingProfileId: string;+  }++  type AgentChannelConcurrencyMap = {+    readonly [channel in ChannelType]: number;+  };++  interface GetEndpointsResult {+    endpoints: Endpoint[];+    addresses: Endpoint[];+  }++  interface GetEndpointsCallbacks {+    readonly success: SuccessFailCallback<[GetEndpointsResult]>;+    readonly failure?: SuccessFailCallback<[string]>;   }    interface AttributeDictionary {-    [key: string]: string;+    readonly [key: string]: string;   } -  interface Contact {-    onPending(cb: ContactCallback);+  /**+   * The Contact API provides event subscription methods and action methods which can be called on behalf of a specific contact.+   * Contacts come and go and so should these API objects.+   * It is good practice not to persist these objects or keep them as internal state.+   * If you need to, store the `contactId` of the contact and make sure that the contact still exists by fetching it from the `Agent` API object before calling methods on it.+   */+  class Contact {+    /** The unique contactId of this contact. */+    readonly contactId: string;      /**      * Subscribe a method to be invoked whenever the contact is updated.+     *+     * @param callback A callback to receive the `Contact` API object instance.      */     onRefresh(callback: ContactCallback): void;+     /**-     * Subscribe a method to be invoked when the contact is incoming.+     * Subscribe a method to be invoked when a queue callback contact is incoming.+     * In this state, the contact is waiting to be accepted if it is a softphone call or is waiting for the agent to answer if it is not a softphone call.+     *+     * @param callback A callback to receive the `Contact` API object instance.      */     onIncoming(callback: ContactCallback): void;++    /**+     * Subscribe a method to be invoked when the contact is pending.+     * This event is expected to occur before the connecting event.+     *+     * @param callback A callback to receive the `Contact` API object instance.+     */+    onPending(callback: ContactCallback): void;++    /**+     * Subscribe a method to be invoked when the contact is connecting.+     * This works with chat and softphone contacts.+     * This event happens when a call or chat comes in, before accepting (there is an exception for queue callbacks, in which onConnecting's handler is executed after the callback is accepted).+     * Note that once the contact has been accepted, the `onAccepted` handler will be triggered.+     *+     * @param callback A callback to receive the `Contact` API object instance.+     */+    onConnecting(callback: ContactCallback): void;+     /**      * Subscribe a method to be invoked whenever the contact is accepted.+     *+     * @param callback A callback to receive the `Contact` API object instance.      */     onAccepted(callback: ContactCallback): void;++    /**+     * Subscribe a method to be invoked whenever the contact is missed.+     * This is an event which is fired when a contact is put in state "missed" by the backend, which happens when the agent does not answer for a certain amount of time, when the agent rejects the call, or when the other participant hangs up before the agent can accept.+     *+     * @param callback A callback to receive the `Contact` API object instance.+     */+    onMissed(callback: ContactCallback): void;+     /**      * Subscribe a method to be invoked whenever the contact is ended or destroyed.+     * This could be due to the conversation being ended by the agent, or due to the contact being missed.+     * Call `contact.getState()` to determine the state of the contact and take appropriate action.+     *+     * @param callback A callback to receive the `Contact` API object instance.      */     onEnded(callback: ContactCallback): void;++    /**+     * Subscribe a method to be invoked whenever the contact is destroyed.+     *+     * @param callback A callback to receive the `Contact` API object instance.+     */+    onDestroy(callback: ContactCallback): void;++    /**+     * Subscribe a method to be invoked whenever the contact enters the ACW state.+     * This is after the connection has been closed, but before the contact is destroyed.+     *+     * @param callback A callback to receive the `Contact` API object instance.+     */+    onACW(callback: ContactCallback): void;+     /**      * Subscribe a method to be invoked when the contact is connected.+     *+     * @param callback A callback to receive the `Contact` API object instance.      */     onConnected(callback: ContactCallback): void;      /**-     * Get the unique contactId of this contact.+     * Returns a formatted string with the contact event and ID.+     *+     * @param event The event to format.      */+    getEventName(event: ContactEvents): string;++    /** Get the unique contactId of this contact. */     getContactId(): string;+     /**-     * Get the original contact id from which this contact was transferred,-     * or none if this is not an internal Connect transfer.+     * Get the original (initial) contact id from which this contact was transferred, or none if this is not an internal Connect transfer.+     * This is typically a contact owned by another agent, thus this agent will not be able to manipulate it.+     * It is for reference and association purposes only, and can be used to share data between transferred contacts externally if it is linked by originalContactId.      */     getOriginalContactId(): string;++    /** Alias for `getOriginalContactId()`. */+    getInitialContactId(): string;+     /**-     * Get the type of the contact. This indicates what type of media is-     * carried over the connections of the contact.-     */-    getType(): string;-    /**-     * Get a ContactState object representing the state of the contact.+     * Get the type of the contact.+     * This indicates what type of media is carried over the connections of the contact.      */+    getType(): ContactType;++    /** Get a ContactState object representing the state of the contact. */     getStatus(): ContactState;+     /**      * Get the duration of the contact state in milliseconds relative to local time.+     * This takes into account time skew between the JS client and the Amazon Connect backend servers.      */     getStatusDuration(): number;-    /**-     * Get the queue associated with the contact.-     */++    /** Get the queue associated with the contact. */     getQueue(): Queue;-    /**-     * Get a list containing Connection API objects for each connection in the contact.-     */-    getConnections(): Connection[];-    /**-     * Get the initial connection of the contact.-     */-    getInitialConnection(): Connection;-    /**-     * Get the inital connection of the contact, or null if the initial connection-     * is no longer active.-     */-    getActiveInitialConnection(): Connection;-    /**-     * Get a list of all of the third-party connections, i.e. the list of all-     * connections except for the initial connection, or an empty list if there-     * are no third-party connections.-     */-    getThirdPartyConnections(): Connection;++    /** Gets the timestamp associated with when the contact was placed in the queue. */+    getQueueTimestamp(): Date;++    /** Get a list containing `Connection` API objects for each connection in the contact. */+    getConnections(): BaseConnection[];++    /** Get the initial connection of the contact. */+    getInitialConnection(): BaseConnection;++    /** Get the inital connection of the contact, or null if the initial connection is no longer active. */+    getActiveInitialConnection(): BaseConnection | null;++    /** Get a list of all of the third-party connections, i.e. the list of all connections except for the initial connection, or an empty list if there are no third-party connections. */+    getThirdPartyConnections(): BaseConnection[];+     /**      * In Voice contacts, there can only be one active third-party connection.-     * This method returns the single active third-party connection, or null if-     * there are no currently active third-party connections.-     */-    getSingleActiveThirdPartyConnection(): Connection;-    /**-     * Gets the agent connection. This is the connection that represents the agent's-     * participation in the contact.+     * This method returns the single active third-party connection, or null if there are no currently active third-party connections.      */-    getAgentConnection(): Connection;+    getSingleActiveThirdPartyConnection(): BaseConnection | null;+     /**-     * Get a map from attribute name to value for each attribute associated with the contact.-     */-    getAttributes(): { [key: string]: { name: string, value: string } };-    /*-     * Determine whether this contact is a softphone call.+     * Gets the agent connection.+     * This is the connection that represents the agent's participation in the contact.      */+    getAgentConnection(): BaseConnection;++    /** Get a map from attribute name to value for each attribute associated with the contact. */+    getAttributes(): AttributeDictionary;++    /** Determine whether this contact is a softphone call.  */     isSoftphoneCall(): boolean;-    /**-     * Determine whether this is an inbound or outbound contact.-     */++    /** Determine whether this is an inbound or outbound contact. */     isInbound(): boolean;+     /**      * Determine whether the contact is in a connected state.+     * Note that contacts no longer exist once they have been removed.+     * To detect these instances, subscribe to the `contact.onEnded()` event for the contact.      */     isConnected(): boolean;+     /**      * Accept an incoming contact.      *-     * @param successFailOptions Optional success and failure callbacks can be provided to determine whether the operation was successful.+     * @param callbacks Success and failure callbacks to determine whether the operation was successful.      */-    accept(successFailOptions: SuccessFailOptions): void;+    accept(callbacks?: SuccessFailOptions): void;+     /**      * Close the contact and all of its associated connections.+     * If the contact is a voice contact, and there is a third-party, the customer remains bridged with the third party and will not be disconnected from the call.+     * Otherwise, the agent and customer are disconnected.      *-     * @param successFailOptions Optional success and failure callbacks can be provided to determine whether the operation was successful.+     * @param callbacks Success and failure callbacks to determine whether the operation was successful.      */-    destroy(successFailOptions: SuccessFailOptions): void;+    destroy(callbacks?: SuccessFailOptions): void;+     /**-     * Provide diagnostic information for the contact in the case-     * something exceptional happens on the front end.+     * This is an API that completes this contact entirely.+     * That means that this should only be used for non-monitoring agent connections.      *-     * @param successFailOptions Optional success and failure callbacks can be provided to determine whether the operation was successful.+     * @param callbacks Success and failure callbacks to determine whether the operation was successful.      */-    notifyIssue(successFailOptions: SuccessFailOptions): void;+    complete(callbacks?: SuccessFailOptions): void;+     /**-     * Add a new outbound third-party connection to this contact and connect-     * it to the specified endpoint.+     * Provide diagnostic information for the contact in the case something exceptional happens on the front end.+     * The Streams logs will be published along with the issue code and description provided here.+     *+     * @param issueCode An arbitrary issue code to associate with the diagnostic report.+     * @param description A description to associate with the diagnostic report.+     * @param callbacks Success and failure callbacks to determine whether the operation was successful.+     */+    notifyIssue(+      issueCode: string,+      description: string,+      callbacks?: SuccessFailOptions+    ): void;++    /**+     * Add a new outbound third-party connection to this contact and connect it to the specified endpoint.      *      * @param endpoint The endpoint to add.-     * @param successFailOptions Optional success and failure callbacks can be provided to determine whether the operation was successful.+     * @param callbacks Success and failure callbacks to determine whether the operation was successful.      */-    addConnection(endpoint: Endpoint, successFailOptions: SuccessFailOptions): void;+    addConnection(endpoint: Endpoint, callbacks?: SuccessFailOptions): void;+     /**      * Rotate through the connected and on hold connections of the contact.-     * @param successFailOptions Optional success and failure callbacks can be provided to determine whether the operation was successful.+     * This operation is only valid if there is at least one third-party connection and the initial connection is still connected.+     *+     * @param callbacks Success and failure callbacks to determine whether the operation was successful.      */-    toggleActiveConnections(successFailOptions: SuccessFailOptions): void;+    toggleActiveConnections(callbacks?: SuccessFailOptions): void;+     /**      * Conference together the active connections of the conversation.+     * This operation is only valid if there is at least one third-party connection and the initial connection is still connected.      *-     * @param successFailOptions Optional success and failure callbacks can be provided to determine whether the operation was successful.+     * @param callbacks Success and failure callbacks to determine whether the operation was successful.      */-    conferenceConnections(successFailOptions: SuccessFailOptions): void;-  }+    conferenceConnections(callbacks?: SuccessFailOptions): void; -  interface ContactState {     /**-     * The contact state type, as per the ContactStateType enumeration.+     * The data behind the `Contact` API object is ephemeral and changes whenever new data is provided.+     * This method provides an opportunity to create a snapshot version of the `Contact` API object and save it for future use, such as adding to a log file or posting elsewhere.      */-    type: string;+    toSnapshot(): Contact;+  } -    /**-     * A relative local state duration. To get the actual duration of the state-     * relative to the current time, use contact.getStateDuration().-     */-    timestamp: Date;+  interface ContactState {+    /** The contact state type, as per the ContactStateType enumeration. */+    readonly type: ContactStateType;++    /** Indicates when the the contact was put in that state. */+    readonly timestamp: Date;   }    interface Queue {-    /**-     * The queueARN of the queue.-     */-    queueARN: string;+    /** The name of the queue. */+    readonly name: string; -    /**-     * The name of the queue.-     */-    name: string;+    /** The ARN of the queue. */+    readonly queueARN: string;++    /** Alias for `queueARN`. */+    readonly queueId: string;   } -  class Endpoint {-    endpointARN: string;-    endpointId: string;-    type: connect.EndpointType;-    name: string;-    phoneNumber: string;-    agentLogin: string;-    queue: string;-    static byPhoneNumber(phoneNumber: string): Endpoint;+  interface GetEndpointsInput {+    /** The maximum number of endpoints returned from this API. */+    readonly maxResults?: number;++    /** A list of endpoints to add to the final list of endpoints returned by this API. */+    readonly endpoints?: EndpointOptions[];   } -  interface BaseConnection {+  interface EndpointOptions {+    readonly endpointARN: string;+    readonly endpointId: string;+    readonly type: connect.EndpointType;+    readonly name: string;+    readonly phoneNumber: string;+    readonly agentLogin: string;+    readonly queue: string;+  }++  class Endpoint implements EndpointOptions {+    readonly endpointARN: string;+    readonly endpointId: string;+    readonly type: connect.EndpointType;+    readonly name: string;+    readonly phoneNumber: string;+    readonly agentLogin: string;+    readonly queue: string;++    constructor(options: EndpointOptions);+     /**-     * Gets the unique contactId of the contact to which this connection belongs.+     * Creates an endpoint from a E.164 phone number.+     *+     * @param phoneNumber The E.164 endpoint phone number.      */+    static byPhoneNumber(phoneNumber: string): Endpoint;+  }++  class SoftphoneError {+    readonly errorType: string;+    readonly errorMessage: string;+    readonly endPointUrl: string;++    constructor(errorType: string, errorMessage: string, endPointUrl: string);++    getErrorType(): string;++    getErrorMessage(): string;++    getEndPointUrl(): string;+  }++  /**+   * The Connection API provides action methods (no event subscriptions) which can be called to manipulate the state of a particular connection within a contact.+   * Like contacts, connections come and go.+   * It is good practice not to persist these object or keep them as internal state.+   * If you need to, store the contactId and connectionId of the connection and make sure that the contact and connection still exist by fetching them in order from the Agent API object before calling methods on them.+   */+  class BaseConnection {+    /** The unique contactId of the contact to which this connection belongs. */+    readonly contactId: string;++    /** The unique connectionId for this connection. */+    readonly connectionId: string;++    /** Gets the unique contactId of the contact to which this connection belongs. */     getContactId(): string;-    /**-     * Gets the unique connectionId for this connection.-     */++    /** Gets the unique connectionId for this connection. */     getConnectionId(): string;-    /**-     * Gets the endpoint to which this connection is connected.-     */++    /** Gets the endpoint to which this connection is connected. */     getEndpoint(): Endpoint;-    /**-     * Gets the ConnectionState object for this connection.-     */-    getState(): ConnectionState;++    /** Alias for `getEndpoint()`. */+    getAddress(): Endpoint;++    /** Gets the `ConnectionState` object for this connection. */+    getStatus(): ConnectionState;+     /**      * Get the duration of the connection state, in milliseconds, relative to local time.+     * This takes into account time skew between the JS client and the Amazon Connect service.      */-    getStateDuration(): number;-    /**-     * Get the type of connection.-     */-    getType(): "inbound" | "outbound" | "monitoring";-    /**-     * Determine if the connection is the contact's initial connection.-     */+    getStatusDuration(): number;++    /** Get the type of connection. */+    getType(): ConnectionType;++    /** Get the currently monitored contact info, or null if that does not exist. */+    getMonitorInfo(): MonitorInfo | null;++    /** Determine if the connection is the contact's initial connection. */     isInitialConnection(): boolean;+     /**      * Determine if the contact is active.+     * The connection is active it is incoming, connecting, connected, or on hold.      */     isActive(): boolean;-    /**-     * Determine if the connection is connected, meaning that the agent is live in a-     * conversation through this connection.-     */++    /** Determine if the connection is connected, meaning that the agent is live in a conversation through this connection. */     isConnected(): boolean;-    /**-     * Determine whether the connection is in the process of connecting.-     */++    /** Determine whether the connection is in the process of connecting. */     isConnecting(): boolean;-    /**-     * Determine whether the connection is on hold.-     */++    /** Determine whether the connection is on hold. */     isOnHold(): boolean;+     /**      * Ends the connection.-     * @param successFailOptions Optional success and failure callbacks can be provided to determine whether the operation was successful.+     *+     * @param callbacks Success and failure callbacks to determine whether the operation was successful.      */-    destroy(successFailOptions: SuccessFailOptions): void;+    destroy(callbacks?: SuccessFailOptions): void;+     /**      * Send a digit or string of digits through this connection.+     * This is only valid for contact types that can accept digits, currently this is limited to softphone-enabled voice contacts.+     *      * @param digits The digits to dial.-     * @param successFailOptions Optional success and failure callbacks can be provided to determine whether the operation was successful.+     * @param callbacks Success and failure callbacks to determine whether the operation was successful.      */-    sendDigits(digits: string, options: SuccessFailOptions): void;+    sendDigits(digits: string, callbacks?: SuccessFailOptions): void;      /**      * Put this connection on hold.-     * @param successFailOptions Optional success and failure callbacks can be provided to determine whether the operation was successful.+     *+     * @param callbacks Success and failure callbacks to determine whether the operation was successful.      */-    hold(successFailOptions: SuccessFailOptions): void;+    hold(callbacks?: SuccessFailOptions): void;      /**      * Resume this connection if it was on hold.-     * @param successFailOptions Optional success and failure callbacks can be provided to determine whether the operation was successful.+     *+     * @param callbacks Success and failure callbacks to determine whether the operation was successful.      */-    resume(successFailOptions: SuccessFailOptions): void;-    getMonitorInfo(): MonitorInfo;+    resume(callbacks?: SuccessFailOptions): void;   } -  interface VoiceConnection extends BaseConnection {-    getMediaType(): MediaType;-    getMediaInfo(): any;-    getMediaController(): any;-    sendDigits(digits: string, options: SuccessFailOptions);-    hold(options: SuccessFailOptions);-    resume(options: SuccessFailOptions);-    isOnHold(): boolean;-  }+  /**+   * The VoiceConnection API provides action methods (no event subscriptions) which can be called to manipulate the state of a particular voice connection within a contact.+   * Like contacts, connections come and go.+   * It is good practice not to persist these object or keep them as internal state.+   * If you need to, store the `contactId` and `connectionId` of the connection and make sure that the contact and connection still exist by fetching them in order from the `Agent` API object before calling methods on them.+   */+  class VoiceConnection extends BaseConnection {+    /** Returns the media info object associated with this connection. */+    getMediaInfo(): VoiceMediaInfo;++    /** Returns the `MediaType` enum value: `"softphone"`. */+    getMediaType(): MediaType.SOFTPHONE; -  interface ChatConnection extends BaseConnection {-    getMediaType(): MediaType;-    getMediaInfo(): any;-    getMediaController(): any;-    getConnectionToken(): Promise<{ chatTokenTransport: { participantToken: string } }>+    /** Get the media controller associated with this connection. */+    getMediaController(): Promise<VoiceMediaInfo>;   } -  type Connection = ChatConnection | VoiceConnection;+  /**+   * The ChatConnection API provides action methods (no event subscriptions) which can be called to manipulate the state of a particular chat connection within a contact.+   * Like contacts, connections come and go.+   * It is good practice not to persist these object or keep them as internal state.+   * If you need to, store the `contactId` and `connectionId` of the connection and make sure that the contact and connection still exist by fetching them in order from the `Agent` API object before calling methods on them.+   */+  class ChatConnection extends BaseConnection {+    /** Get the media info object associated with this connection. */+    getMediaInfo(): ChatMediaInfo;++    /** Provides a promise which resolves with the API response from createTransport transportType chat_token for this connection. */+    getConnectionToken(): Promise<ConnectionToken>;++    /** Returns the `MediaType` enum value: `"chat"`.  */+    getMediaType(): MediaType.CHAT;++    /** Get the media controller associated with this connection. */+    getMediaController(): Promise<any>;

Given this information, I have opted for:

  • Update the documentation.
  • Have both VoiceConnection.getMediaController() and ChatConnection.getMediaController() return a Promise<any>.
marcogrcr

comment created time in 2 months

push eventmarcogrcr/amazon-connect-streams

Marco Gonzalez

commit sha a60a97b29980496d5cb1898188c725076db12b1d

Updated documentation and fixed minor bugs - Updated documentation to fix typos, inconsistencies, indentation, etc. - Updated `api.js` to prevent errors when arguments documented as optional were not specified. - Updated `api.js` to remove redundant `VoiceConnection` methods that are inherited from `BaseConnection`. - Normalized `softphone.js`'s usage of `publishError()` to ensure `SoftphoneError`'s `endPointUrl` is never null.

view details

Marco Gonzalez

commit sha c74d8704bb7dafad2eceebdf0e772d5b0eb827fd

Updated and exposed TypeScript definitions. - Updated `index.d.ts` to represent the shape of the API. - Updated documentation to indicate TypeScript support.

view details

push time in 2 months

more