@azure/web-pubsub-express 1.0.0-beta.4 → 1.0.1-alpha.20220118.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/index.js +22 -15
- package/dist/index.js.map +1 -1
- package/dist-esm/samples-dev/server.js +1 -1
- package/dist-esm/samples-dev/server.js.map +1 -1
- package/dist-esm/src/cloudEventsDispatcher.js +7 -11
- package/dist-esm/src/cloudEventsDispatcher.js.map +1 -1
- package/dist-esm/src/cloudEventsProtocols.js.map +1 -1
- package/dist-esm/src/utils.js +15 -3
- package/dist-esm/src/utils.js.map +1 -1
- package/dist-esm/test/connect.spec.js +8 -8
- package/dist-esm/test/connect.spec.js.map +1 -1
- package/dist-esm/test/connected.spec.js +1 -1
- package/dist-esm/test/connected.spec.js.map +1 -1
- package/dist-esm/test/ctor.spec.js +1 -1
- package/dist-esm/test/ctor.spec.js.map +1 -1
- package/dist-esm/test/disconnected.spec.js +1 -1
- package/dist-esm/test/disconnected.spec.js.map +1 -1
- package/dist-esm/test/user.spec.js +80 -9
- package/dist-esm/test/user.spec.js.map +1 -1
- package/dist-esm/test/validate.spec.js +2 -2
- package/dist-esm/test/validate.spec.js.map +1 -1
- package/package.json +10 -22
- package/types/web-pubsub-express.d.ts +15 -2
|
@@ -158,7 +158,20 @@ export declare type UserEventRequest = {
|
|
|
158
158
|
/**
|
|
159
159
|
* The type of the data.
|
|
160
160
|
*/
|
|
161
|
-
dataType: "text"
|
|
161
|
+
dataType: "text";
|
|
162
|
+
} | {
|
|
163
|
+
/**
|
|
164
|
+
* The context of current CloudEvents request.
|
|
165
|
+
*/
|
|
166
|
+
context: ConnectionContext;
|
|
167
|
+
/**
|
|
168
|
+
* The content data, when data type is `json`, the data is the result of JSON.parse, so the type of the data depends on user scenarios
|
|
169
|
+
*/
|
|
170
|
+
data: unknown;
|
|
171
|
+
/**
|
|
172
|
+
* The type of the data.
|
|
173
|
+
*/
|
|
174
|
+
dataType: "json";
|
|
162
175
|
} | {
|
|
163
176
|
/**
|
|
164
177
|
* The context of current CloudEvents request.
|
|
@@ -186,7 +199,7 @@ export declare interface UserEventResponseHandler {
|
|
|
186
199
|
setState(name: string, value: unknown): void;
|
|
187
200
|
/**
|
|
188
201
|
* Return success response with data to be delivered to the client WebSocket connection.
|
|
189
|
-
* @param data - The payload data to be returned to the client.
|
|
202
|
+
* @param data - The payload data to be returned to the client. Stringify the message if it is a JSON object.
|
|
190
203
|
* @param dataType - The type of the payload data.
|
|
191
204
|
*/
|
|
192
205
|
success(data?: string | ArrayBuffer, dataType?: "binary" | "text" | "json"): void;
|