Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparing for beta.4 release #18417

Merged
merged 2 commits into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion sdk/web-pubsub/web-pubsub-express/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
# Release History

## 1.0.0-beta.4 (Unreleased)
## 1.0.0-beta.4 (2021-11-01)

### Features Added

### Breaking Changes

- Move `allowedEndpoints` settings into `WebPubSubEventHandlerOptions`. If not set, the default behavior is allowing all the incoming endpoints.

```js
const handler = new WebPubSubEventHandler("chat", {
handleConnect(req, res) {
// You can set the state for the connection, it lasts throughout the lifetime of the connection
res.setState("calledTime", 1);
res.success();
},
handleUserEvent(req, res) {
var calledTime = req.context.states.calledTime++;
console.log(calledTime);
// You can also set the state here
res.setState("calledTime", calledTime);
res.success();
},
allowedEndpoints: ["https://xxx.webpubsub.azure.com"]
});
```

- Remove `dumpRequest` flag and leverage @azure/logger instead.

### Bugs Fixed

### Other Changes
Expand Down
4 changes: 2 additions & 2 deletions sdk/web-pubsub/web-pubsub-express/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ const express = require("express");
const { WebPubSubEventHandler } = require("@azure/web-pubsub-express");
const handler = new WebPubSubEventHandler(
"chat",
["https://<yourAllowedService>.webpubsub.azure.com"],
{
handleConnect: (req, res) => {
// auth the connection and set the userId of the connection
res.success({
userId: "<userId>"
});
}
},
allowedEndpoints: ["https://<yourAllowedService>.webpubsub.azure.com"]
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
import { WebPubSubEventHandler } from "@azure/web-pubsub-express";
import express from "express";

const handler = new WebPubSubEventHandler("chat", ["https://xxx.webpubsub.azure.com"], {
dumpRequest: false,
const handler = new WebPubSubEventHandler("chat", {
handleConnect(req, res) {
console.log(req);
res.success();
Expand All @@ -22,7 +21,8 @@ const handler = new WebPubSubEventHandler("chat", ["https://xxx.webpubsub.azure.
handleUserEvent(req, res) {
console.log(req);
res.success("Hello", "text");
}
},
allowedEndpoints: ["https://xxx.webpubsub.azure.com"]
});

const app = express();
Expand Down
11 changes: 9 additions & 2 deletions sdk/web-pubsub/web-pubsub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
# Release History

## 1.0.0-beta.4 (Unreleased)
## 1.0.0-beta.4 (2021-11-01)

### Features Added

- Support for DefaultAzureCredential
- Added generateClientToken method to the `HubClient`.
- Added support for reverse proxies, enabling usage of Web Pubsub with Azure API Management.
- Added method to close all connections in a hub `serviceClient.closeAllConnections`,
- Added method to close all connections in a group `groupClient.closeAllConnections`
- Added method to close all connections for a user `serviceClient.closeUserConnections`.

### Breaking Changes

- Renamed method `getAuthenticationToken` to `getClientAccessToken`
- Renamed method `hasUser` to `userExists`
- Renamed method `hasGroup` to `groupExists`
- Renamed method `hasConnection` to `connnectionExists`

### Bugs Fixed

### Other Changes
Expand Down